📄 configure.in
字号:
dnl /* ==================================================================== dnl * The Kannel Software License, Version 1.0 dnl * dnl * Copyright (c) 2001-2004 Kannel Group dnl * Copyright (c) 1998-2001 WapIT Ltd. dnl * All rights reserved. dnl * dnl * Redistribution and use in source and binary forms, with or without dnl * modification, are permitted provided that the following conditions dnl * are met: dnl * dnl * 1. Redistributions of source code must retain the above copyright dnl * notice, this list of conditions and the following disclaimer. dnl * dnl * 2. Redistributions in binary form must reproduce the above copyright dnl * notice, this list of conditions and the following disclaimer in dnl * the documentation and/or other materials provided with the dnl * distribution. dnl * dnl * 3. The end-user documentation included with the redistribution, dnl * if any, must include the following acknowledgment: dnl * "This product includes software developed by the dnl * Kannel Group (http://www.kannel.org/)." dnl * Alternately, this acknowledgment may appear in the software itself, dnl * if and wherever such third-party acknowledgments normally appear. dnl * dnl * 4. The names "Kannel" and "Kannel Group" must not be used to dnl * endorse or promote products derived from this software without dnl * prior written permission. For written permission, please dnl * contact org@kannel.org. dnl * dnl * 5. Products derived from this software may not be called "Kannel", dnl * nor may "Kannel" appear in their name, without prior written dnl * permission of the Kannel Group. dnl * dnl * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED dnl * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES dnl * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE dnl * DISCLAIMED. IN NO EVENT SHALL THE KANNEL GROUP OR ITS CONTRIBUTORS dnl * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, dnl * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT dnl * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR dnl * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, dnl * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE dnl * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, dnl * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. dnl * ==================================================================== dnl * dnl * This software consists of voluntary contributions made by many dnl * individuals on behalf of the Kannel Group. For more information on dnl * the Kannel Group, please see <http://www.kannel.org/>. dnl * dnl * Portions of this software are based upon software originally written at dnl * WapIT Ltd., Helsinki, Finland for the Kannel project. dnl */ dnldnl configure.in -- main autoconf macro definition filednldnl Process this file with autoconf to produce a configure script.dnldnl initializationAC_PREREQ(2.13)AC_INIT(gw/alt_charsets.h)AC_CONFIG_HEADER(gw-config.h)AC_SUBST(SHELL)AC_CONFIG_AUX_DIR(.)AC_SET_TERMINAL_SEQUENCES()dnl Check gateway version number.VERSION=`head -n 1 VERSION`if test "x$VERSION" = "xcvs"; then AC_MSG_CHECKING([cvs checkout date]) AC_CVS_DATE(CVS_DATE) AC_MSG_RESULT([$CVS_DATE]) VERSION="$VERSION-$CVS_DATE"fiAC_DEFINE_UNQUOTED(GW_NAME, "Kannel")AC_DEFINE_UNQUOTED(GW_VERSION, "$VERSION")AC_DEFINE_UNQUOTED(VERSION, "$VERSION")AC_SUBST(GW_VERSION)AC_SUBST(VERSION)AC_CONFIG_SECTION([Configuring for Kannel gateway version $VERSION])dnl Solaris pkgadd support definitionsPKGADD_PKG="KANNELgateway"PKGADD_NAME="Kannel - WAP and SMS gateway"PKGADD_VENDOR="www.kannel.org"AC_SUBST(PKGADD_PKG)AC_SUBST(PKGADD_NAME)AC_SUBST(PKGADD_VENDOR)dnl Target installation directory for documentationAC_SUBST(docdir)docdir='${prefix}/share/doc/kannel'dnl Checks system type.AC_CONFIG_SECTION([Running system checks])AC_CANONICAL_HOSTdnl Apply system specific rules.dnl Executable extension for systems that need one, i.e. Cygwindnl Set the LIBTOOL to be used to create libsEXE_EXT=""LIBTOOL="ar rc"case "$host" in *-sun-solaris*) CFLAGS="$CFLAGS -DSunOS=1" ;; *-cygwin*) EXE_EXT=".exe" ;; *apple-darwin*) CFLAGS="$CFLAGS -DDARWIN=1" LIBTOOL="libtool -static -o" ;; *-linux-*) CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE" LDFLAGS="$LDFLAGS -rdynamic" ;; *-*-openbsd* | *-*-freebsd*) CFLAGS="$CFLAGS -pthread" AC_CHECK_LIB(c_r, pthread_exit, [LIBS="$LIBS -lc_r -lkse"; pthread="yes"]) ;;esacAC_SUBST(EXE_EXT)AC_SUBST(LIBTOOL)AC_ARG_WITH(cflags,[ --with-cflags=FLAGS use FLAGS for CFLAGS],CFLAGS="$CFLAGS $withval")AC_ARG_WITH(libs,[ --with-libs=FLAGS use FLAGS for extra libraries],LIBS="$LIBS $withval")dnl Checks for programs.AC_PROG_CCAC_PROG_INSTALLAC_PROG_RANLIBAC_PROG_YACCAC_PROG_LEXAC_PATH_PROG(CONVERT, convert)AC_PATH_PROG(PERL, perl)dnl Check for word sizes.AC_CHECK_SIZEOF(short, 2)AC_CHECK_SIZEOF(int, 4)AC_CHECK_SIZEOF(long, 4)AC_CHECK_SIZEOF(long long, 8)SIZEOF_SHORT=$ac_cv_sizeof_shortSIZEOF_INT=$ac_cv_sizeof_intSIZEOF_LONG=$ac_cv_sizeof_longSIZEOF_LONG_LONG=$ac_cv_sizeof_long_longAC_SUBST(SIZEOF_SHORT)AC_SUBST(SIZEOF_INT)AC_SUBST(SIZEOF_LONG)AC_SUBST(SIZEOF_LONG_LONG)dnl Checks for libraries.AC_CHECK_LIB(m, log)AC_CHECK_LIB(socket, accept)AC_CHECK_LIB(nsl, inet_ntoa)AC_CHECK_LIB(resolv, inet_ntop)AC_CHECK_LIB(bind, inet_ntop)if test -z "$pthread"; then AC_CHECK_LIB(pthread, pthread_exit, [LIBS="$LIBS -lpthread"])fiAC_CHECK_LIB(iconv, libiconv, [LIBS="$LIBS -liconv"]) dnl Checks for header files.AC_HEADER_STDCAC_CHECK_HEADERS(sys/ioctl.h sys/time.h sys/types.h unistd.h sys/poll.h)AC_CHECK_HEADERS(pthread.h getopt.h syslog.h iconv.h zlib.h execinfo.h stdlib.h)AC_CHECK_HEADERS(sys/socket.h sys/sockio.h net/if.h netinet/in.h)dnl Checks for typedefs, structures, and compiler characteristics.AC_TRY_COMPILE(, [char *func = __FUNCTION__;], AC_DEFINE(HAVE___FUNCTION__))AC_TRY_COMPILE(, [char *func = __func__;], AC_DEFINE(HAVE___FUNC__))dnl Checks for library functions.AC_CHECK_FUNCS(gettimeofday select socket strdup getopt_long localtime_r gmtime_r backtrace srandom)AC_CHECK_FUNC(getopt, , LIBOBJS="$LIBOBJS utils/attgetopt.o")AC_SUBST(LIBOBJS)dnl Check if we have reentrant gethostbyname and which oneAC_CHECK_FUNC(gethostbyname_r, [ AC_FUNC_WHICH_GETHOSTBYNAME_R ], [ AC_CHECK_FUNC(gethostbyname,[], [ AC_MSG_ERROR([Couldnot find gethostbyname_r nor gethostbyname functions])])])dnl Extra feature checksdnl GW_HAVE_TYPE_FROM(HDRNAME, TYPE, HAVENAME, DESCRIPTION)AC_DEFUN(GW_HAVE_TYPE_FROM, [ AC_CACHE_CHECK([for $2 in <$1>], gw_cv_type_$3, AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H#include <sys/types.h>#endif#include <$1>], [$2 foo;], gw_cv_type_$3=yes, gw_cv_type_$3=no)) if test $gw_cv_type_$3 = yes; then AC_DEFINE($3, 1, $4) fi])dnl GW_HAVE_FUNC_FROM(HDRNAME, FUNC, HAVENAME, DESCRIPTION)AC_DEFUN(GW_HAVE_FUNC_FROM, [ AC_CACHE_CHECK([for $2 in <$1>], gw_cv_func_$3, AC_TRY_COMPILE([#include <$1>], [void *foo = $2;], gw_cv_func_$3=yes, gw_cv_func_$3=no)) if test $gw_cv_func_$3 = yes; then AC_DEFINE($3, 1, $4) fi])GW_HAVE_TYPE_FROM(sys/socket.h, socklen_t, HAVE_SOCKLEN_T, [Defined if there is a socklen_t in <sys/socket.h>])GW_HAVE_FUNC_FROM(stdio.h, getopt, HAVE_GETOPT_IN_STDIO_H, [Does <stdio.h> declare getopt()?])GW_HAVE_FUNC_FROM(unistd.h, getopt, HAVE_GETOPT_IN_UNISTD_H, [Does <unistd.h> declare getopt()?])dnl POSIX regular expression checkAC_CHECK_HEADERS(regex.h, [ AC_CHECK_FUNC(regcomp, [ AC_DEFINE(HAVE_REGEX) has_posix_regex=1 ])])dnl Misfeature checksAC_CONFIG_SECTION([Checking for POSIX threads support])AC_MSG_CHECKING(for working pthreads)AC_TRY_RUN([#include <pthread.h>#include <unistd.h>int pid;void testpid(void* foo);int main(void){ pthread_t child; pid=getpid(); pthread_create(&child,NULL,(void*)testpid,NULL); pthread_join(child,NULL); return 0;}void testpid(void* foo){ int mypid=getpid(); if(mypid!=pid){ /* Pthreads states that all threads should have the same PID * we dont! */ exit(1); }else{ exit(0); }}],echo yes , echo no ;CFLAGS="$CFLAGS -DBROKEN_PTHREADS=1", echo Cross compiling - assuming they work)dnldnl Checking pthread_spin supportdnlAC_MSG_CHECKING([for pthread_spinlock support])AC_TRY_COMPILE([#include <pthread.h>], [pthread_spinlock_t lock;pthread_spin_init(&lock, 0);pthread_spin_lock(&lock);pthread_spin_unlock(&lock);pthread_spin_destroy(&lock);], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PTHREAD_SPINLOCK_T)], AC_MSG_RESULT(no))dnl checking pthread_rwlock supportAC_MSG_CHECKING([for pthread_rwlock support])AC_TRY_COMPILE([#include <pthread.h>], [pthread_rwlock_t lock;pthread_rwlock_init(&lock, NULL);pthread_rwlock_rdlock(&lock);pthread_rwlock_unlock(&lock);pthread_rwlock_wrlock(&lock);pthread_rwlock_unlock(&lock);pthread_rwlock_destroy(&lock);], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PTHREAD_RWLOCK)], AC_MSG_RESULT(no), [AC_MSG_RESULT(Cross compiling - assuming suuported) ; AC_DEFINE(HAVE_PTHREAD_RWLOCK)])dnl checking for native semaphore supportdnl Solaris & HP-UX needs librt.AC_CHECK_LIB(rt, sem_init)AC_MSG_CHECKING([for semaphore support])AC_TRY_RUN([#include <semaphore.h>int main(void) { sem_t s; int val; /* DARWNIN doesn't implement native sem_init */ if (sem_init(&s, 0, 1) != 0) return 1; sem_wait(&s); sem_post(&s); sem_getvalue(&s, &val); sem_destroy(&s); return 0;}], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SEMAPHORE)], AC_MSG_RESULT(no), [AC_MSG_RESULT(Cross compiling - assuming suuported) ; AC_DEFINE(HAVE_SEMAPHORE)])dnl Check if we have libxml2 installed and which version it is.dnl Kannel requires currently at least version 2.2.5 of libxml2.AC_CONFIG_SECTION([Checking for libxml2 support])xml_ver_required="2.2.5"AC_PATH_PROGS(XML_CONFIG, xml2-config xml-config, no)if test "$XML_CONFIG" = "no"; then AC_MSG_ERROR([You MUST have the libxml2 (aka gnome-xml) library installed])else AC_MSG_CHECKING([libxml version]) xml_version=`$XML_CONFIG --version` AC_MSG_RESULT([$xml_version]) AC_CHECK_VERSION($xml_version, $xml_ver_required, [ LIBS="$LIBS `$XML_CONFIG --libs`" CFLAGS="$CFLAGS `$XML_CONFIG --cflags`" ],[ AC_MSG_ERROR([libxml2 version $xml_version is too old. You need at least $xml_ver_required]) ])fidnl Implement the --enable-pcre option. This will set HAVE_PCRE in gw-config.hdnl accordingly and enable the usage of Perl compatible regular expressions.AC_CONFIG_SECTION([Configuring for PCRE support])AC_MSG_CHECKING([whether to compile with PCRE support])AC_ARG_ENABLE(pcre,[ --enable-pcre enable PCRE regex support [disabled]], [ if test "$enableval" != yes; then AC_MSG_RESULT(disabled) else AC_MSG_RESULT(searching) AC_PATH_PROGS(PCRE_CONFIG, pcre-config, no) if test "$PCRE_CONFIG" = "no"; then AC_MSG_ERROR(Unable to find pcre-config in path for PCRE support) else AC_MSG_CHECKING([PCRE version]) pcre_version=`$PCRE_CONFIG --version` AC_MSG_RESULT([$pcre_version]) AC_MSG_CHECKING([for POSIX regex provider]) if test "x$has_posix_regex" != "x" ; then LIBS="$LIBS `$PCRE_CONFIG --libs`" CFLAGS="$CFLAGS `$PCRE_CONFIG --cflags`" AC_MSG_RESULT([system regex]) else LIBS="$LIBS `$PCRE_CONFIG --libs-posix`" CFLAGS="$CFLAGS `$PCRE_CONFIG --cflags-posix`" AC_MSG_RESULT([PCRE library]) AC_CHECK_HEADERS(pcreposix.h) AC_CHECK_LIB(pcreposix, regcomp) fi AC_CHECK_HEADERS(pcre.h) AC_CHECK_FUNCS(pcre_compile) AC_DEFINE(HAVE_PCRE) AC_DEFINE_UNQUOTED(LIBPCRE_VERSION, "$pcre_version")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -