instigator
instigator

Reputation: 1677

configure.in and adding options

I am trying to add an option to my ./configure script. I need to add the location to mysql.h but a few methods I have tried and keep getting the error: configure: error: unrecognized option: --mysql=/usr/local/mysql/include/mysql/

How do I add the option to my configure script aswell as to add the header file which is specified.

Upvotes: 2

Views: 2406

Answers (2)

vanza
vanza

Reputation: 9903

You're probably looking for AC_ARG_WITH. Something like this:

AC_ARG_WITH([mysql],
        [AS_HELP_STRING([--with-mysql=path : path to mysql headers])],
        [MYSQL_INCLUDE=$withval],
        [])

Then run ./configure --with-mysql=/foo .

Upvotes: 4

Von
Von

Reputation: 4525

Sounds like what you are trying to get your compiler to include a specific include path when it builds. The easiest way to do that is with the CPPFLAGS environment variable, e.g.

% setenv CPPLAGS -I/usr/local/mysql/include/mysql/
% ./configure
% make
% etc...

If you actually need to add a new option to configure you'll need to learn about autoconf and editing configure.in to generate a new configure script.

Upvotes: 0

Related Questions