Remove useless directive
[manu/libnss-mysql-bg.git] / configure.in
1 dnl Copyright (C) 2002 Ben Goodwin
2 dnl This file is part of the nss-mysql library.
3 dnl
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.
8 dnl
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.
13 dnl
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
17 dnl
18 dnl $Id: configure.in,v 1.56 2005/09/04 03:34:00 cinergi Exp $ */
19
20 dnl Autoconf 2.53 is REQUIRED
21
22 AC_REVISION($Revision: 1.56 $)dnl
23 AC_INIT
24 AC_CONFIG_AUX_DIR(aux)
25 AC_PREREQ(2.53)
26 AC_CONFIG_SRCDIR([src/nss_main.c])
27 AC_CANONICAL_TARGET([])
28 AC_PREFIX_DEFAULT()
29 AM_INIT_AUTOMAKE(libnss-mysql, 1.5)
30 AM_CONFIG_HEADER(config.h)
31 AM_MAINTAINER_MODE
32
33 AC_PROG_CC
34
35 AC_DISABLE_STATIC
36 AC_PROG_LIBTOOL
37
38 AC_ARG_WITH(mysql,
39             [  --with-mysql=DIR        Location of your MySQL installation])
40 AC_ARG_ENABLE(debug,
41             [  --enable-debug          Enable debug (see DEBUGGING)],
42             [AC_DEFINE([DEBUG], 1, [Enable debug])])
43
44 case "$target_os" in
45 linux*)
46     CPPFLAGS="$CPPFLAGS -D_REENTRANT"
47     LIBVER=2
48     OS=linux
49     RENAME=false
50     test "$prefix" = "NONE" && prefix=
51     ;;
52 solaris*)
53     CPPFLAGS="$CPPFLAGS -D_REENTRANT"
54     LIBVER=1
55     OS=solaris
56     RENAME=true
57     test "$prefix" = "NONE" && prefix= && libdir=/usr/lib
58     ;;
59 freebsd*)
60     CPPFLAGS="$CPPFLAGS -DPIC -D_REENTRANT"
61     LIBVER=1
62     OS=freebsd
63     RENAME=true
64     test "$prefix" = "NONE" && prefix= && libdir=/usr/lib
65     ;;
66 *)  OS=unknown
67     ;;
68 esac
69
70 AM_CONDITIONAL(RENAME, test "$RENAME" = "true")
71
72 AC_CACHE_CHECK([whether the linker accepts -znodelete],
73                [nss_mysql_cv_cc_znodelete], [
74     SAVELIBS=$LIBS
75     LIBS="-Wl,-znodelete $SAVELIBS"
76     AC_TRY_LINK([], [], nss_mysql_cv_cc_znodelete=yes,
77                         nss_mysql_cv_cc_znodelete=no)
78     LIBS=$SAVELIBS])
79 if test $nss_mysql_cv_cc_znodelete = "yes"; then
80     LIBS="-Wl,-znodelete $SAVELIBS"
81 fi
82
83 AC_SUBST(LIBVER)
84 AC_SUBST(OS)
85
86 FIND_MYSQL()
87
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)
93
94 AC_CHECK_LIB(mysqlclient, main, ,
95              [AC_MSG_ERROR([Unable find a functioning MySQL library])])
96
97 AC_HEADER_STDC
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)
100
101 AC_C_CONST
102 AC_TYPE_UID_T
103 AC_TYPE_SIZE_T
104 AC_CHECK_TYPES([socklen_t], , , [
105 #include <unistd.h>
106 #include <sys/socket.h>
107 ])
108
109 EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
110 AC_DEFINE_UNQUOTED([MAINCFG], "$EXPANDED_SYSCONFDIR/libnss-mysql.cfg",
111                    [Main config file])
112 AC_DEFINE_UNQUOTED([ROOTCFG],"$EXPANDED_SYSCONFDIR/libnss-mysql-root.cfg",
113                    [Root config file])
114
115 AC_CONFIG_FILES([Makefile src/Makefile src/version.c])
116 AC_OUTPUT