[CDRIVER-3339] Hardcoded libdir in src/libmongoc/CMakeLists.txt Created: 26/Aug/19  Updated: 28/Oct/23  Resolved: 27/Aug/19

Status: Closed
Project: C Driver
Component/s: Build, cmake, packaging
Affects Version/s: None
Fix Version/s: 1.16.0

Type: Bug Priority: Major - P3
Reporter: Vasil Velichkov Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Fedora 29



 Description   

The libdir variable is hardcoded in src/libmongoc/CMakeLists.txt and cannot be change using cmake parameter, it is used in the *.pc.in files and as a result on distributions that have different libdir for 64bit like Redhat/Fedora/... pkg-config add a wrong library directory to LDFLAGS.

$ rpm -q mongo-c-driver-devel
mongo-c-driver-devel-1.13.1-1.fc29.x86_64

$ rpm -ql mongo-c-driver-develĀ  | grep libmongoc-1.0.so
/usr/lib64/libmongoc-1.0.so

$ pkg-config --libs libmongoc-1.0
-L/usr/lib -lmongoc-1.0 -lbson-1.0

$ pkg-config --libs libmongoc-ssl-1.0
-L/usr/lib -lmongoc-1.0 -lbson-1.0



 Comments   
Comment by Githook User [ 27/Aug/19 ]

Author:

{'name': 'Vasil Velichkov', 'email': 'vvvelichkov@gmail.com', 'username': 'velichkov'}

Message: CDRIVER-3339 Use CMAKE_INSTALL_LIBDIR

The libdir was hardcoded to ${prefix}/lib and as a result on
distributions that have different libdir for 64bit architectures
pkg-config --libs adds wrong directory to the LDFLAGS
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/0acb4a539a62248c2a7f1e0b4a866340c463359c

Comment by Vasil Velichkov [ 26/Aug/19 ]

Just pushed a patch to https://github.com/mongodb/mongo-c-driver/pull/585

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