[CDRIVER-2070] Can not build static library on macOS Created: 24/Feb/17 Updated: 27/Oct/23 Resolved: 27/Feb/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | Build |
| Affects Version/s: | 1.6.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Hongcai Deng | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
OS: macOS 10.12.3 |
||
| Description |
|
When build for static library
it says
and no .a file is generated. |
| Comments |
| Comment by A. Jesse Jiryu Davis [ 27/Feb/17 ] | |||||||
|
Conclusion: I had been confused, as you were, that the ".a" file isn't built on Mac OS X until "make install". I saw the AC_DISABLE_STATIC macro in SetupLibtool.m4 and I thought it was to blame. It turns out that the macro correctly disables the static build by default, but if you pass --enable-static then the build system correctly generates a static archive. | |||||||
| Comment by A. Jesse Jiryu Davis [ 27/Feb/17 ] | |||||||
|
Great, thanks for letting us know. | |||||||
| Comment by Hongcai Deng [ 27/Feb/17 ] | |||||||
|
sorry, I forgot that .a file is generated by libtool...I missed the `make install` step, and now everything is fine. Thanks for your support. | |||||||
| Comment by A. Jesse Jiryu Davis [ 24/Feb/17 ] | |||||||
|
Actually I can't reproduce this, when I compile:
The static archive libbson-1.0.a is installed.
| |||||||
| Comment by A. Jesse Jiryu Davis [ 24/Feb/17 ] | |||||||
|
The warnings are nothing to worry about - if "bson-atomic.o" has no symbols, that's because libbson is using your compiler's builtin support for atomic operations, so none of libbson's custom atomic operations are compiled. However, there does seem to be a bug in build/autotools/SetupLibtool.m4, it shouldn't have AC_DISABLE_STATIC. |