Is it possible to specify include paths for C and C++ in a pkg-config file (mylib.pc.in)?
I know I have Cflags field where I can pass any compiler flags, but it is generic and autoconf resolves it by placing all my options, as long as the include paths in X_CFLAGS but not X_CXXFLAGS.
So if I have a project that contains both C and C++ files and specify in Makefile.am:
mybin_CPPFLAGS = $(X_CPPFLAGS)
mybin_CFLAGS = $(X_CFLAGS)
mybin_CXXFLAGS = $(X_CXXFLAGS)
My C++ files can’t see the include path!
In the example bellow, mylib.pc.in contains Cflags: -I/my/iclude/path/.
Output compiling a C file:
libtool: compile: ppc-linux-gcc -DHAVE_CONFIG_H -I. -I./include -I/opt/ELDK/ppc_8xx/usr/include/ -I/my/iclude/path/ -Wall -std=gnu99 -MT libAW3C_IDU_la-aw3c_utility.lo -MD -MP -MF .deps/libAW3C_IDU_la-aw3c_utility.Tpo -c src/aw3c_utility.c -fPIC -DPIC -o .libs/libAW3C_IDU_la-aw3c_utility.o
Output compiling a C++ file (notice the missing -I/my/iclude/path/):
libtool: compile: ppc-linux-g++ -DHAVE_CONFIG_H -I. -I./include -I/opt/ELDK/ppc_8xx/usr/include/ -Wall -MT libAW3C_IDU_la-aw3c_stream.lo -MD -MP -MF .deps/libAW3C_IDU_la-aw3c_stream.Tpo -c src/aw3c_stream.cpp -fPIC -DPIC -o .libs/libAW3C_IDU_la-aw3c_stream.o
Any help will be appreciated.
Thanks!
pkg-confighas the option--cflags-only-Ithat only yields the include paths inCflags. So you can add something like:to
configure.ac. Q: Are you using thePKG_CHECK_MODULESmacro inconfigure.ac?