pkg-config libdivecomputer / subsurface makefile / confusion

Jef Driesen jefdriesen at telenet.be
Tue Jul 10 12:00:50 PDT 2012


On 07/10/2012 08:02 PM, Linus Torvalds wrote:
> On Tue, Jul 10, 2012 at 7:23 AM, Grischa Toedt <toedt at embl.de> wrote:
>>
>> b) the subsurface makefile uses pkg-config to identify the include path:
>> --- line 43 ---
>> else ifeq ($(UNAME), darwin)
>>          LIBDIVECOMPUTERINCLUDES = $(shell $(PKGCONFIG) --cflags libdivecomputer)
>
> Does it work if you replace "--cflags" with "--cflags-only-I"?

The problem is that the libdivecomputer pkg-config file used to contain:

-I${includedir}/libdivecomputer

and applications can then include the header files like this:

#include <header.h>

But I changed the pkg-config file some time ago to contain only:

-I${includedir}

and applications now have to include the header files like this:

#include <libdivecomputer/header.h>

I did this because I believe the second style is better. It does avoid trouble 
if an application uses two independent libraries that both have a header file 
installed with the same header.h name.

Maybe I should keep both variants in the pkg-config file. Then it's up to the 
application to decide which #include style to use.

Jef


More information about the subsurface mailing list