📄 configure.in
字号:
dnl configure.in -- main autoconf macro definition filednldnl Process this file with autoconf to produce a configure script.dnl This file is part of the Kannel WAP and SMS gateway project.dnl initializationAC_PREREQ(2.13)AC_INIT(gw/alt_charsets.h)AC_CONFIG_HEADER(config.h)AC_SUBST(SHELL)AC_CONFIG_AUX_DIR(.)AC_SET_TERMINAL_SEQUENCES()dnl Check gateway version number.VERSION=`head -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(VERSION, "$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" 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 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)AC_CHECK_LIB(pthread, pthread_exit)AC_CHECK_LIB(iconv, libiconv)if test -z "$pthread"; then AC_CHECK_LIB(c_r, pthread_exit, [LIBS="$LIBS -lc_r"])fidnl 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)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)AC_CHECK_FUNC(getopt, , LIBOBJS="$LIBOBJS utils/attgetopt.o")AC_SUBST(LIBOBJS)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 Misfeature checksAC_CONFIG_SECTION([Checking 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)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]) ])fi dnl DocBook stuffAC_CONFIG_SECTION([Configuring DocBook support])AC_CHECK_PROG(JADE, jade, jade, no)AC_CHECK_PROG(JADETEX, jadetex, jadetex, no)AC_CHECK_PROG(PDFJADETEX, pdfjadetex, pdfjadetex, no)AC_CHECK_PROG(DVIPS, dvips, dvips, no)AC_CHECK_PROG(FIG2DEV, fig2dev, fig2dev, no)AC_CHECK_PROG(CONVERT, convert, convert, no)AC_SUBST(HTML_DSL)found=""for loc in /usr /usr/local; do if test "x$found" = "x" ; then for file in ${loc}/lib/sgml/stylesheet/dsssl/docbook/nwalsh/html/docbook.dsl \ ${loc}/lib/sgml/stylesheets/nwalsh-modular/html/docbook.dsl \ ${loc}/share/sgml/docbook/dsssl-stylesheets-1.59/html/docbook.dsl \ ${loc}/share/sgml/docbook/dsssl-stylesheets/html/docbook.dsl \ ${loc}/share/sgml/docbook/dsssl/modular/html/docbook.dsl ; do if test "x$found" = "x" ; then AC_CHECK_FILE($file,HTML_DSL=$file; found=1) fi done fidoneAC_SUBST(TEX_DSL)found=""for loc in /usr /usr/local; do if test "x$found" = "x" ; then for file in ${loc}/lib/sgml/stylesheet/dsssl/docbook/nwalsh/print/docbook.dsl \ ${loc}/lib/sgml/stylesheets/nwalsh-modular/print/docbook.dsl \ ${loc}/share/sgml/docbook/dsssl-stylesheets-1.59/print/docbook.dsl \ ${loc}/share/sgml/docbook/dsssl-stylesheets/print/docbook.dsl \ ${loc}/share/sgml/docbook/dsssl/modular/print/docbook.dsl ; do if test "x$found" = "x" ; then AC_CHECK_FILE($file,TEX_DSL=$file; found=1) fi done fi donednl Implement --enable-warnings option.AC_ARG_ENABLE(warnings,[ --enable-warnings enable compilation warnings (default: disabled)], [ echo enabling compilation warnings if test -n "$GCC"; then CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Wmissing-prototypes" CFLAGS="$CFLAGS -Wmissing-declarations" CFLAGS="$CFLAGS -Wnested-externs" CFLAGS="$CFLAGS -Winline" #CFLAGS="$CFLAGS -Wstrict-prototypes" #CFLAGS="$CFLAGS -Wredundant-decls" #CFLAGS="$CFLAGS -Wconversion" fi])dnl Implement --enable-docs option.AC_SUBST(DOCSTARGET)AC_ARG_ENABLE(docs,[ --enable-docs enable building of documentation (default: enabled)], [ if test "$enableval" = "yes" then DOCSTARGET="docs" else DOCSTARGET="no-docs" fi])if test "x$HTML_DSL" = "x" -o "x$TEX_DSL" = "x" \ || test "$JADE" = "no" \ || test "$JADETEX" = "no" \ || test "$PDFJADETEX" = "no" \ || test "$DVIPS" = "no" \ || test "$FIG2DEV" = "no" \ || test "$CONVERT" = "no"then DOCSTARGET="no-docs"else DOCSTARGET="docs"ficase "$DOCSTARGET" inno-docs) AC_MSG_RESULT(Not building documentation.) ;;docs) AC_MSG_RESULT(Documentation will be built as well.) ;;esacdnl Implement --enable-drafts option.AC_SUBST(DOCDRAFTS)DOCDRAFTS="IGNORE"AC_ARG_ENABLE(drafts,[ --enable-drafts enable building of documentation drafts (default: disabled)], [ if test "$enableval" = "yes" then DOCDRAFTS="INCLUDE" else DOCDRAFTS="IGNORE" fi])if test "x$DOCSTARGET" = "xdocs"then case "$DOCDRAFTS" in INCLUDE) AC_MSG_RESULT(Documentation will include drafts.) ;; esacfiAC_CONFIG_SECTION([Configuring parameters])dnl Implement --with-suffix=version option.SUFFIX=""AC_ARG_WITH(suffix,[ --with-suffix set suffix for binaries (default: -\$VERSION)], [ if test "x$withval" != "x" ; then SUFFIX=$withval fi])dnl Implement --enable-suffix option.AC_ARG_ENABLE(suffix,[ --enable-suffix enable suffix for binaries (default: disabled)], [ if test "$enableval" = "yes" ; then SUFFIX="-$VERSION" else SUFFIX="" fi])if test "x$SUFFIX" != "x" ; then AC_MSG_CHECKING(whether to append suffix to binary) AC_MSG_RESULT($SUFFIX)fiAC_DEFINE_UNQUOTED(SUFFIX, "$SUFFIX")AC_SUBST(SUFFIX)dnl Implement --with-defaults=speed/debug option.AC_ARG_WITH(defaults,[ --with-defaults set default configure options: speed/debug (default: native malloc + assertions) this will set assertion checking and malloc wrapper accordingly speed = native malloc + no assertions debug = checking malloc + assertions], [ case "$withval" in speed) assertiondefault=no mallocdefault=native ;; debug) assertiondefault=yes mallocdefault=check ;; *) echo "unknown --with-defaults parameter $withval" exit 1 ;; esac], [ dnl defaults to native malloc but with assertions assertiondefault=yes mallocdefault=native])dnl Implement --with-malloc=[native|check|slow] option.AC_MSG_CHECKING(which malloc to use)AC_ARG_WITH(malloc,[ --with-malloc select malloc wrapper to use: native/check/slow (default: native)], [ case "$withval" in native) AC_DEFINE(USE_GWMEM_NATIVE) AC_MSG_RESULT(native malloc) ;; check) AC_DEFINE(USE_GWMEM_CHECK) AC_MSG_RESULT(checking malloc) ;; slow) AC_DEFINE(USE_GWMEM_SLOW) AC_MSG_RESULT(slow malloc) ;; *) echo "Unknown malloc wrapper $withval. Oops."; exit 1 ;; esac], [ case "$mallocdefault" in
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -