1 dnl Copyright (C) 2002 Ben Goodwin
2 dnl This file is part of the nss-mysql library.
4 dnl The nss-mysql library is free software; you can redistribute it and/or
5 dnl modify it under the terms of the GNU General Public License as published
6 dnl by the Free Software Foundation; either version 2 of the License, or
7 dnl (at your option) any later version.
9 dnl The nss-mysql library is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with the nss-mysql library; if not, write to the Free Software
16 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 dnl $Id: configure.in,v 1.56 2005/09/04 03:34:00 cinergi Exp $ */
20 dnl Autoconf 2.53 is REQUIRED
22 AC_REVISION($Revision: 1.56 $)dnl
24 AC_CONFIG_AUX_DIR(aux)
26 AC_CONFIG_SRCDIR([src/nss_main.c])
27 AC_CANONICAL_TARGET([])
29 AM_INIT_AUTOMAKE(libnss-mysql, 1.5)
30 AM_CONFIG_HEADER(config.h)
39 [ --with-mysql=DIR Location of your MySQL installation])
41 [ --enable-debug Enable debug (see DEBUGGING)],
42 [AC_DEFINE([DEBUG], 1, [Enable debug])])
46 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
50 test "$prefix" = "NONE" && prefix=
53 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
57 test "$prefix" = "NONE" && prefix= && libdir=/usr/lib
60 CPPFLAGS="$CPPFLAGS -DPIC -D_REENTRANT"
64 test "$prefix" = "NONE" && prefix= && libdir=/usr/lib
70 AM_CONDITIONAL(RENAME, test "$RENAME" = "true")
72 AC_CACHE_CHECK([whether the linker accepts -znodelete],
73 [nss_mysql_cv_cc_znodelete], [
75 LIBS="-Wl,-znodelete $SAVELIBS"
76 AC_TRY_LINK([], [], nss_mysql_cv_cc_znodelete=yes,
77 nss_mysql_cv_cc_znodelete=no)
79 if test $nss_mysql_cv_cc_znodelete = "yes"; then
80 LIBS="-Wl,-znodelete $SAVELIBS"
88 AC_CHECK_LIB(socket, getsockname)
89 AC_CHECK_LIB(nsl, gethostbyname)
90 AC_CHECK_LIB(m, floor)
91 AC_CHECK_LIB(dl, dlsym)
92 AC_CHECK_LIB(z, compress)
94 AC_CHECK_LIB(mysqlclient, main, ,
95 [AC_MSG_ERROR([Unable find a functioning MySQL library])])
98 AC_CHECK_HEADER(mysql.h, , [AC_MSG_ERROR([Unable to find mysql.h])])
99 AC_CHECK_HEADERS(syslog.h stdint.h nss.h nss_common.h shadow.h)
104 AC_CHECK_TYPES([socklen_t], , , [
106 #include <sys/socket.h>
109 EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
110 AC_DEFINE_UNQUOTED([MAINCFG], "$EXPANDED_SYSCONFDIR/libnss-mysql.cfg",
112 AC_DEFINE_UNQUOTED([ROOTCFG],"$EXPANDED_SYSCONFDIR/libnss-mysql-root.cfg",
115 AC_CONFIG_FILES([Makefile src/Makefile src/version.c])