[CDRIVER-123] pkg-config needed Created: 02/Apr/12  Updated: 11/Nov/13  Resolved: 11/Nov/13

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 0.5
Fix Version/s: 0.90.0

Type: Improvement Priority: Trivial - P5
Reporter: Mansour Assignee: Gary Murakami
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

gentoo



 Description   

since the c driver doesn't have pkg-config, compiling and linking agianst is done by hard coding paths to files (ie, mongo.h and libmonogc.so) in a makefile.

Using makefile (that we all know) is easier that introducing another new build system.



 Comments   
Comment by Christian Hergert [ 11/Nov/13 ]

The new C driver[1] installs and uses pkg-config for managing build dependencies for libraries.

You can use it in a Makefile like:

program: program.c
        $(CC) -o $@ program.c $(shell pkg-config --cflags --libs libmongoc-1.0)

If you use autoconf and automake, you can use the PKG_CHECK_MODULES() macro in your configure.ac

PKG_CHECK_MODULES(MONGOC, [libmongoc-1.0])

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