configure.in
上传用户:tany51
上传日期:2013-06-12
资源大小:1397k
文件大小:10k
- #
- # Copyright (C) 1999 Rob Crittenden (rcrit@greyoak.com)
- # Copyright (C) 1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License
- # as published by the Free Software Foundation; either version 2
- # of the License, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- #
- # Process this file with autoconf to produce a configure script.
- AC_INIT(bnetd/handle_bnet.c)
- AC_CONFIG_HEADER(config.h)
- AUTOCONF_CONFIG_DIR="autoconf"
- AC_CONFIG_AUX_DIR(${AUTOCONF_CONFIG_DIR})
- builtin(include,autoconf/ccstdc.m4)
- builtin(include,autoconf/mkdir.m4)
- AC_CANONICAL_SYSTEM
- # Checks for programs.
- AC_PROG_CC
- AC_PROG_INSTALL
- # Checks compiler.
- AC_PROG_CPP
- # Checks for systems.
- AC_AIX
- AC_ISC_POSIX
- AC_MINIX
- # Custom checks.
- zwarnflags=""
- AC_ARG_WITH(warn, [ --with-warn enable compiler warnings], [zwarnflags="-pedantic -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wunreachable-code -Winline -Wpacked -Wno-sign-compare"])
- zlangflags=""
- AC_ARG_WITH(ansi, [ --with-ansi use ANSI C mode], [zlangflags="-ansi -pedantic"])
- extra_include=""
- AC_ARG_WITH(includes, [ --with-includes=DIR search include DIR for header files], [
- case "x$withval" in
- x/*|x.*)
- AC_MSG_RESULT([adding ${withval} to include search path])
- if test ! -d ${withval}; then
- AC_MSG_RESULT([Warning: directory ${withval} does not exist])
- fi
- extra_include="${extra_include} -I${withval}"
- ;;
- *)
- AC_MSG_RESULT([not adding any includes])
- ;;
- esac])
- extra_lib_dir=""
- AC_ARG_WITH(libraries, [ --with-libraries=DIR search library DIR for libraries], [
- case "x${withval}" in
- x/*|x.*)
- AC_MSG_RESULT([adding ${withval} to library search path])
- if test ! -d ${withval}; then
- AC_MSG_RESULT([Warning: directory ${withval} does not exist])
- fi
- extra_lib_dir="${extra_lib_dir} -L${withval}"
- ;;
- *)
- AC_MSG_RESULT([not adding any libs])
- ;;
- esac])
- extra_lib=""
- AC_ARG_WITH(efence, [ --with-efence link with Electric Fence to find memory problems], [extra_lib="${extra_lib} -lefence"])
- AC_ARG_WITH(mysql, [ --with-mysql include MySQL user accounts support], [ac_with_mysql='yes'])
- AC_ARG_WITH(pgsql, [ --with-pgsql include PostgreSQL user accounts support], [ac_with_pgsql='yes'])
- extra_define=""
- dnl Enable poll()
- AC_ARG_ENABLE(poll,
- [ --enable-poll Enable poll() instead of select(). Normally poll
- is preferred over select, but configure knows poll
- is broken on some platforms. If you think you are
- smarter than the configure script, you may enable
- poll with this option.
- --disable-poll Disable the use of poll().],
- [
- case "$enableval" in
- yes)
- echo "Forcing poll() to be enabled"
- ac_cv_func_poll='yes'
- ;;
- no)
- echo "Forcing poll() to be disabled"
- ac_cv_func_poll='no'
- ;;
- esac
- ])
- dnl Shamesly stolen from squid 2.3 configure.in
- dnl This has to be before AC_CHECK_FUNCS
- # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
- # when running configure.
- if test -z "$ac_cv_func_poll"; then
- case "$host" in
- [alpha-dec-osf3.*])
- # John Kay (jkay@nlanr.net) 19970818
- echo "disabling poll for $host..."
- ac_cv_func_poll='no'
- ;;
- [*-hp-hpux*.*])
- # Duane Wessels
- echo "disabling poll for $host..."
- ac_cv_func_poll='no'
- ;;
- [*-linux-*])
- # Henrik Nordstrom (hno@hem.passagen.se) 19980817
- # poll is problematic on Linux. We disable it
- # by default until Linux gets it right.
- rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
- if test $rev -lt 002002; then
- echo "disabling poll for $host < 2.2..."
- ac_cv_func_poll='no'
- fi
- ;;
- [powerpc-ibm-aix4.1.*])
- # Mike Laster (mlaster@metavillage.com) 19981021
- echo "disabling poll for $host..."
- ac_cv_func_poll='no'
- ;;
- [*-pc-sco3.2*])
- # Robert Side <rside@aiinc.bc.ca>
- # Mon, 18 Jan 1999 17:48:00 GMT
- echo "disabling poll for $host..."
- ac_cv_func_poll='no'
- ;;
- esac
- fi
- LDFLAGS="${LDFLAGS} ${extra_lib_dir}"
- LIBS="${LIBS} ${extra_lib}"
- CFLAGS="${CFLAGS} ${zlangflags} ${zwarnflags}"
- DEFINES="${DEFINES} ${extra_define}"
- CPPFLAGS="${CPPFLAGS} ${extra_include}"
- # This is our invention so we have to substitute it ourselves
- # autoconf uses DEFS
- AC_SUBST(DEFINES)
- # Checks for compiler quirks.
- AC_PROG_GCC_TRADITIONAL
- AM_PROG_CC_STDC
- AC_C_CONST
- #AC_EXEEXT
- # Checks for libraries.
- AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"])
- AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])
- AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"])
- AC_CHECK_LIB(resolv, inet_aton, [LIBS="$LIBS -lresolv"])
- AC_CHECK_LIB(z, compress, [LIBS="$LIBS -lz"])
- mysql_include_path=""
- dnl Detecting mysql paths
- if test "$ac_with_mysql" = "yes" ; then
- echo -n "checking for mysql include path ... "
- mysql_try_includes="/usr/include /usr/include/mysql /usr/local/include /usr/local/include/mysql /usr/local/mysql/include /usr/local/mysql/include/mysql"
- for i in `echo ${mysql_try_includes}`; do
- if test -f "${i}/mysql.h" ; then
- echo ${i}
- CPPFLAGS="${CPPFLAGS} -I${i}"
- mysql_include_path=${i}
- break
- fi
- done
- fi
- mysql_lib_path=""
- if test "$ac_with_mysql" = "yes" ; then
- AC_CHECK_LIB(mysqlclient, mysql_init , [DEFINES="${DEFINES} -DWITH_SQL -DWITH_SQL_MYSQL" ; LIBS="${LIBS} -lmysqlclient"], [
- echo -n "checking for mysql lib path ... "
- mysql_try_libs="/usr/lib /usr/lib/mysql /usr/local/lib /usr/local/lib/mysql /usr/local/mysql/lib /usr/local/mysql/lib/mysql"
- for i in `echo ${mysql_try_libs}`; do
- if test -f "${i}/libmysqlclient.so" -o -f "${i}/libmysqlclient.a" ; then
- echo ${i}
- save_ldflags="${LDFLAGS}"
- LDFLAGS="${LDFLAGS} -L${i}"
- AC_CHECK_LIB(mysqlclient, mysql_close , [DEFINES="${DEFINES} -DWITH_SQL -DWITH_SQL_MYSQL" ; LIBS="${LIBS} -lmysqlclient" ; mysql_lib_path="${i}"], [LDFLAGS="${save_ldflags}"])
- break
- fi
- done
- ])
- fi
- pgsql_include_path=""
- dnl Detecting pgsql paths
- if test "$ac_with_pgsql" = "yes" ; then
- echo -n "checking for pgsql include path ... "
- pgsql_try_includes="/usr/include /usr/include/pgsql /usr/local/include /usr/local/include/pgsql /usr/local/pgsql/include"
- for i in `echo ${pgsql_try_includes}`; do
- if test -f "${i}/libpq-fe.h" ; then
- echo ${i}
- CPPFLAGS="${CPPFLAGS} -I${i}"
- pgsql_include_path=${i}
- break
- fi
- done
- fi
- pgsql_lib_path=""
- if test "$ac_with_pgsql" = "yes" ; then
- AC_CHECK_LIB(pq, PQsetdbLogin , [DEFINES="${DEFINES} -DWITH_SQL -DWITH_SQL_PGSQL" ; LIBS="${LIBS} -lpq"], [
- echo -n "checking for pgsql lib path ... "
- pgsql_try_libs="/usr/lib /usr/lib/pgsql /usr/local/lib /usr/local/lib/pgsql /usr/local/pgsql/lib"
- for i in `echo ${pgsql_try_libs}`; do
- if test -f "${i}/libpq.so" -o -f "${i}/libpq.a" ; then
- echo ${i}
- save_ldflags="${LDFLAGS}"
- LDFLAGS="${LDFLAGS} -L${i}"
- AC_CHECK_LIB(pq, PQfinish , [DEFINES="${DEFINES} -DWITH_SQL -DWITH_SQL_PGSQL" ; LIBS="${LIBS} -lpq" ; pgsql_lib_path="${i}"], [LDFLAGS="${save_ldflags}"])
- break
- fi
- done
- ])
- fi
- # Checks for header files.
- AC_HEADER_DIRENT
- AC_HEADER_STDC
- AC_HEADER_TIME
- AC_HEADER_STAT
- AC_CHECK_HEADERS(fcntl.h sys/time.h sys/select.h string.h strings.h unistd.h stdarg.h varargs.h malloc.h sys/utsname.h sys/timeb.h sys/socket.h sys/param.h netinet/in.h arpa/inet.h netdb.h termios.h stddef.h memory.h sys/types.h sys/wait.h sys/ioctl.h stdint.h sys/file.h limits.h poll.h sys/poll.h stropts.h sys/stropts.h sys/stat.h pwd.h grp.h dir.h direct.h sys/mman.h sys/event.h sys/epoll.h sys/resource.h)
- # Checks for typedefs and structures
- AC_STRUCT_TM
- AC_TYPE_PID_T
- AC_TYPE_SIGNAL
- AC_TYPE_OFF_T
- AC_TYPE_SIZE_T
- AC_CHECK_SIZEOF(unsigned char, 1)
- AC_CHECK_SIZEOF(unsigned short, 2)
- AC_CHECK_SIZEOF(unsigned int, 4)
- AC_CHECK_SIZEOF(unsigned long, 4)
- AC_CHECK_SIZEOF(unsigned long long, 0)
- # Checks for library functions.
- AC_FUNC_MMAP
- AC_FUNC_STRFTIME
- AC_FUNC_VPRINTF
- AC_FUNC_SETPGRP
- AC_FUNC_CLOSEDIR_VOID
- AC_FUNC_MKDIR_ARGS
- AC_CHECK_FUNCS(gethostname gettimeofday select socket strdup strtoul strerror inet_aton inet_ntoa uname recv send recvfrom sendto uname fork getpid sigaction sigprocmask sigaddset setpgid setpgrp ftime strcasecmp strncasecmp stricmp strnicmp chdir difftime strchr strrchr index rindex memcpy memset memmove bcopy wait waitpid pipe getenv ioctl setsid mktime poll gethostbyname getservbyname getlogin pow getpwnam getgrnam getuid getgid setuid setgid mkdir _mkdir strsep getopt kqueue setitimer epoll_create getrlimit)
- if test X"${am_cv_prog_cc_stdc}" = X"no"; then
- COMPILEANSI1='${PREPROCESS} $< | sed '"'"'s/^# *([0-9][0-9]*) *([^ ]*[a-z][^ ]*) *.*$$/#line 1 2/'"'"' | ${SRC_ACDIR}/ansi2knr > ${SRC_SRCDIR}/.ansi2knr_tmp.c'
- COMPILEANSI2='${COMPILE} ${SRC_SRCDIR}/.ansi2knr_tmp.c -o $@'
- COMPILEANSI3='@${RMF} ${SRC_SRCDIR}/.ansi2knr_tmp.c'
- ANSI2KNR_TMP='${SRC_SRCDIR}/.ansi2knr_tmp.c'
- ANSI2KNR_DEP='${SRC_ACDIR}/ansi2knr'
- else
- COMPILEANSI1='${COMPILE} $< -o $@'
- COMPILEANSI2='@:'
- COMPILEANSI3='@:'
- ANSI2KNR_TMP=''
- ANSI2KNR_DEP=''
- fi
- AC_SUBST(COMPILEANSI1)
- AC_SUBST(COMPILEANSI2)
- AC_SUBST(COMPILEANSI3)
- AC_SUBST(ANSI2KNR_TMP)
- AC_SUBST(ANSI2KNR_DEP)
- AC_OUTPUT(Makefile)