[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_CHECK_LIB: Library is found on build host but is not on a target
From: |
Luke Mewburn |
Subject: |
Re: AC_CHECK_LIB: Library is found on build host but is not on a target host |
Date: |
Tue, 28 Sep 2010 16:53:44 +1000 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Mon, Sep 27, 2010 at 10:30:49AM -0300, Sergio Belkin wrote:
| Hi, I've added
|
| LDFLAGS="-L/usr/lib/mysql $LDFLAGS"
|
| and it worked. I wonder if the proper way to do it.
I've used the following:
----
# Look for mysql via the presence of 'mysql_config' or 'mysql_config5'
#
AC_PATH_PROGS([TOOL_MYSQL_CONFIG], [mysql_config mysql_config5], [],
[$PATH:/opt/local/bin])AS_IF([test -n "$TOOL_MYSQL_CONFIG"],
[MYSQL_CFLAGS=`$TOOL_MYSQL_CONFIG --cflags`
MYSQL_LIBS=`$TOOL_MYSQL_CONFIG --libs_r`],
[AC_MSG_ERROR([missing program 'mysql_config'; is 'mysql' or 'MySQL-devel'
installed?])])
AC_SUBST([MYSQL_CFLAGS])
AC_SUBST([MYSQL_LIBS])
AC_PATH_PROGS([TOOL_MYSQL], [mysql mysql5], [],
[$PATH:/opt/local/bin])
----
Use @MYSQL_LIBS@ and @MYSQL_CFLAGS@ in Makefile.am as appropriate.
It works on CentOS and Fedora with the MySQL packages provided by
either the distribution or from mysql.com, and also for Macports
on Mac OS X (mysql5_config in /opt/local/bin).
Luke.
pgp4TKFlb6Bor.pgp
Description: PGP signature