[CDRIVER-2037] Distribute pkg-config files for dynamic and static linking Created: 06/Feb/17  Updated: 19/Jun/17  Resolved: 27/Mar/17

Status: Closed
Project: C Driver
Component/s: packaging
Affects Version/s: None
Fix Version/s: 1.7.0

Type: New Feature Priority: Minor - P4
Reporter: Andrew Morrow (Inactive) Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CXX-1257 Revise static library naming and link... Closed
Related
is related to CDRIVER-2054 Windows static build is broken in 1.5.0 Closed
Epic Link: convenient-static

 Description   

To compile and link against the static libraries for libbson and libmongoc, it is necessary to set certain preprocesor definitions, and link to differently named libraries. Distribute separate pkg-config files that provide these flags.

(Note: the pkg-config --static option sounds like it should do this, but it serves a different purpose.)

Distribute:

  • libbson-1.0.pc
  • libbson-static-1.0.pc
  • libmongoc-1.0.pc
  • libmongoc-static-1.0.pc
  • libmongoc-ssl-1.0.pc


 Comments   
Comment by Githook User [ 19/Jun/17 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: Merge branch 'evergreen-fix' into CDRIVER-2037-static-pkg

Comment by Githook User [ 19/Jun/17 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-2037 Fix static linking when compression is enabled
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/80c91b9d4bd7a6d87707179aefa523e8bc9ff40b

Comment by Githook User [ 27/Mar/17 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-2037, CDRIVER-2083 convenient linking

Whether built with CMake or the Autotools, libmongoc now installs CMake
config-file packages for libmongoc-1.0 and libmongoc-static-1.0, and pkg-config
files for the same.

Compile and link an example program with all combinations: libmongoc built with
CMake or the Autotools, using static or dynamic linking, and finding libmongoc
with the CMake find_package command or with pkg-config.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/3a522396807209076e1cbee96da6a604112a4243

Comment by Githook User [ 24/Mar/17 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-2037 install libbson-static-1.0.pc iff --enable-static
Branch: master
https://github.com/mongodb/libbson/commit/15863795e35c4fb425cdf3d73e39d95804f09294

Comment by Githook User [ 20/Mar/17 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-2037, CDRIVER-2083 easy linking pt 2

Add and test config-version.cmake files, update example CMake style,
more cleanly test in Autotools install-exec-hook whether static linking
is enabled, clearer test matrix.
Branch: master
https://github.com/mongodb/libbson/commit/e50bfae13a7ca2042be03fabf577c76815800773

Comment by Githook User [ 20/Mar/17 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-2037 handle soname properly with CMake
Branch: master
https://github.com/mongodb/libbson/commit/2660548efbffd45efa524d23d43494aefb0dc528

Comment by A. Jesse Jiryu Davis [ 15/Mar/17 ]

Done for libbson. Still must do for libmongoc.

Also required:

  • Like libcurl does, check during build time if pkg-config is available, and if so use it to determine list of libs needed by each dependency, catenate them in libmongoc-static-1.0.pc's Libs.private field. Do this both with the Autotools and CMake builds of libmongoc. Include libbson-static.1.0.pc's CPP flags definition.
  • Test using the CMake config-file packages with MSVC on Windows.
  • Add instructions for manual linking with Clang, GCC, and the Visual Studio IDE, for libbson and libmongoc.
Comment by Githook User [ 15/Mar/17 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-2037 convenient static linking

Whether built with CMake or the Autotools, libbson now installs CMake
config-file packages for bson-1.0 and bson-static-1.0, and pkg-config
files for the same.

Compile and link an example program with all combinations: libbson built
with CMake or the Autotools, using static or dynamic linking, and
finding libbson with the CMake find_package command or with pkg-config.
Branch: master
https://github.com/mongodb/libbson/commit/c9af85d2786825a8ee3b9787d8aa4d9b4300fda0

Comment by Githook User [ 15/Mar/17 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-2037, CDRIVER-2083 easy static linking

Distribute separate pkg-config files and CMake config packages for
programs that want to statically link to libbson.
Branch: master
https://github.com/mongodb/libbson/commit/66baac8c6cb228a3a5e2af3d90442c868a2bb54e

Generated at Wed Feb 07 21:13:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.