Hi Vaclav,
I had the same problem with MySQL and other external packages, and I
couldn't find anything really appropriate. The smartest thing I could do
was to hack configure.in in this way:
<snip>
dnl
dnl MySQL include directory
dnl
AC_ARG_WITH(mysqlinc,
[ --with-mysqlinc=DIR DIR=path of MySQL include
dir[$ac_default_prefix/mysql/include]],
if test [ x$withval != x ] -a [ -d $withval ]; then
mysqlincdir=$withval
else
echo "Please specify a suitable MySQL include directory:
--with-mysqlinc=DIR"; exit 1
fi ,
mysqlincdir=$ac_default_prefix/mysql/include)
AC_CHECK_FILE($mysqlincdir/mysql.h, ,
echo "MySQL include directory does not contain mysql.h !";
echo "Please specify a suitable MySQL include directory:
--with-mysqlinc=DIR"; exit 1)
AC_SUBST(mysqlincdir)
</snip>
And the same for "mysqllib" (but there I
AC_CHECK_FILE($mysqlincdir/libmysqlclient.a)).
This way you need to specify "configure --with-mysqlinc=...
--with-mysqllib=..." (it's better to wrap it in a script).
If you are pretty sure that MySQL will be installed as
$something/include/mysql and $something/lib/mysql, then you might only
need one of these to look for $something and say "configure
--with-mysql=...". But I have a host where the installation is
/usr/local/mysql/include and /usr/local/mysql/lib, so out of luck there...
Anyway, I don't consider myself very smart, nor very experienced with
autoconf, so if anyone else out there has solved the problem in a more
elegant way, please let me(us!) know...
Cheers,
Daniele.
On Mon, 8 Jan 2001, Vaclav Haisman wrote:
>
> Hi,
>
> I need to write autoconf test that would search for mysql.h in some
> directories and then put that directory into INCLUDES, I also want
> similar thing for libmysqlclient, but I didn't find any suitable macro in
> documentation. Could you please give me some hints how to do that?
>
> Vaclav Haisman
>
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GCS/IT d- s+:(+) a-- c++ UB+(++) P++(+++) L+ E W++ N+ o? K? w+ O? M-(--)
> V? PS(+) PE++ Y PGP t(+) 5? X R+@ tv+ b++ DI+ D+ G e h! r-(--) !z+
> ------END GEEK CODE BLOCK------
>
>