user1231232141214124
user1231232141214124

Reputation: 1349

Passing Parameters into ./configure

For whatever reason, the third party drivers I'm using need to have -I/usr/include added as a compiler flag in the Makefile or else make fails because it can't find certain header files.

I don't want to have to edit the supplied Makefile, but rather pass in the -I/usr/include to ./configure in my own bash script which builds several other drivers..

I've tried both of the following with ./configure

--includedir=DIR       C header files [PREFIX/include]
--oldincludedir=DIR    C header files for non-gcc [/usr/include]

DIR replaced with /usr/include

Both times the build fails, but if I add -I/usr/include to EXTRA_CFLAGS in the makefile, then the make runs successfully.

Is it possible to supply make or configure with the include directory so I don't have to edit the third party makefile? Or am I just missing something somewhere?

Upvotes: 1

Views: 1823

Answers (1)

MadScientist
MadScientist

Reputation: 100916

If it's a standard autoconf package then the user (you) owns the CFLAGS, CXXFLAGS, and CPPFLAGS (the CPP here stands for C preprocessor, not C++) variables so you can modify them as you like. For example, either of these should do what you want:

./configure CPPFLAGS='-I/usr/include'

or:

make CPPFLAGS='-I/usr/include'

Upvotes: 4

Related Questions