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.
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
.
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.
精彩评论