📄 configure.ac
字号:
dnl configure.in -- Automatically configure Intercomdnl Copyright (C) 2001-2003 Shane Wegnerdnl This file is part of Intercom.dnldnl Intercom is free software; you can redistribute it and/or modify itdnl under the terms of version 2 of the GNU General Public License asdnl published by the Free Software Foundation.dnldnl Intercom is distributed in the hope that it will be useful, butdnl WITHOUT ANY WARRANTY; without even the implied warranty ofdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUdnl General Public License for more details.dnldnl You should have received a copy of version 2 of the GNU General Publicdnl License along with Intercom; if not, write to the Free Softwarednl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USAdnldnl To contact the author, please send email to shane@cm.nu.dnl $Id: configure.ac,v 1.9 2003/02/13 20:25:30 shane Exp $AC_INITAC_CONFIG_SRCDIR([intercom.c])AC_PREREQ(2.54)AM_CONFIG_HEADER(config.h)AM_INIT_AUTOMAKE(intercom, 0.15)AC_CANONICAL_HOST# optionsAC_ARG_WITH([included-getopt],AC_HELP_STRING([--with-included-getopt],[Always use included getopt library.]),ic_cv_included_getopt=$withval,ic_cv_included_getopt=no)AC_ARG_WITH([included-gsm],AC_HELP_STRING([--with-included-gsm],[Always use included GSM library.]),ic_cv_included_gsm=$withval,ic_cv_included_gsm=no)IC_ARG_WITH(readline, [--without-readline], [Disable readline support], yes)IC_ARG_WITH(history, [--without-history], [Disable use of the GNU history library], yes)dnl IC_ARG_WITH(gettext, [--with-gettext], [Build with gettext support], no)IC_ARG_ENABLE(debug, [--enable-debug=level], [Set debugging level (0 = off)], 0)IC_ARG_ENABLE(cpu, [--with-cpu=type], [Optimize for specified cpu type], none)IC_ARG_ENABLE(optimize, [--enable-optimize], [Use compiler optimizations (makes debugging difficult)], no)IC_ARG_ENABLE(g72x, [--disable-g72x], [Do not build G.721 and G.723 codecs], yes)IC_ARG_ENABLE(gsm, [--disable-gsm], [Build without GSM support.], yes)IC_ARG_ENABLE(crypto, [--disable-crypto], [Do not include support for encrypted audio], yes)AM_MAINTAINER_MODEif test "$USE_MAINTAINER_MODE" = yes; thenic_cv_included_getopt=yesic_cv_included_gsm=yesdnl kludge to force old openssl des_ routines offAC_DEFINE(OPENSSL_DISABLE_OLD_DES_SUPPORT, 1, disable old openssl des_ routines)fi# DefinesAC_DEFINE(_GNU_SOURCE, 1, Enable some GNU extensions)AC_DEFINE_UNQUOTED(DEBUG, $ic_cv_debug, Intercom debugging level)if test "$ic_cv_g72x" = yes; thenAC_DEFINE(HAVE_G72X, 1, Define to use the G.721 and G.723 codecs)fi# Checks for programs.AC_PROG_CCAC_PROG_GCC_TRADITIONALAM_SANITY_CHECKAC_PROG_INSTALLAC_PROG_LN_SAC_PROG_MAKE_SETAC_PROG_RANLIBAC_SUBST(IC_SUBDIRS)AC_SUBST(IC_LIBS)AC_CONFIG_LIBOBJ_DIR(subst)dnl Checks for gettextALL_LINGUAS=""dnl if test "$ic_cv_gettext" = yes; thendnl AM_GNU_GETTEXTdnl AC_DEFINE(USE_GETTEXT, 1, Define if using the gettext library.)dnl AC_CONFIG_FILES([intl/Makefile po/Makefile.in])dnl IC_SUBDIRS="$IC_SUBDIRS intl \po"dnl fidnl Cpu-specific optimizationsif test $ic_cv_cpu != "none"; thenAC_MSG_CHECKING(Whether $CC accepts -march=$ic_cv_cpu)old_cflags=${CFLAGS}CFLAGS="${CFLAGS} -march=$ic_cv_cpu"AC_TRY_COMPILE([], [], [cpu_is_ok=yes], [cpu_is_ok=no])AC_MSG_RESULT($cpu_is_ok)if test $cpu_is_ok = no; thenAC_MSG_WARN(--with-cpu has no effect as $CC does not accept -march=$ic_cv_cpu)CFLAGS=${old_cflags}fifidnl General compiler optimizationsif test $ic_cv_optimize = "yes"; thenif test $GCC = "yes"; thenoptim="-pipe -O3 -fomit-frame-pointer -ffast-math -funroll-loops"gcc_version=`${CC} --version`case $gcc_version in3.*)optim="${optim} -maccumulate-outgoing-args";;esaccase $gcc_version in2.9*|3.*)case $ic_cv_cpu ini486|i586|pentium|i686|pentiumpro)optim="${optim} -mfancy-math-387";;esac;;esacAC_MSG_CHECKING(Whether $CC accepts ${optim})old_cflags=${CFLAGS}CFLAGS="${CFLAGS} ${optim}"AC_TRY_COMPILE([], [], [opt_is_ok=yes], [opt_is_ok=no])AC_MSG_RESULT($opt_is_ok)if test $opt_is_ok = "no"; thenCFLAGS=${old_cflags}fifiif test "$ic_cv_gsm" = yes; thenic_cv_included_gsm=yesfifi# Checks for libraries.AC_CHECK_LIB([m], [pow])# Needed for some BSD systemsAC_CHECK_LIB([ossaudio], [_oss_ioctl])if test "$ic_cv_gsm" = yes; thenif test "$ic_cv_included_gsm" = no; thenic_cv_included_gsm=yesAC_CHECK_LIB(gsm, gsm_decode,[AC_CHECK_HEADERS([gsm/gsm.h gsm.h],[ic_cv_included_gsm=noLIBS="${LIBS} -lgsm"break])])if test "$ic_cv_included_gsm" = yes; thenAC_MSG_WARN(GSM library found but no gsm.h.)AC_MSG_WARN(Will continue with included GSM library.)fifiif test "$ic_cv_included_gsm" = yes; thenIC_SUBDIRS="$IC_SUBDIRS gsm"IC_LIBS="$IC_LIBS gsm/libgsm.a"AC_DEFINE(HAVE_LIBGSM, 1, Define if you have the gsm library)AC_DEFINE(HAVE_GSM_GSM_H, 1, Define if you have gsm/gsm.h)fifiif test "$ic_cv_readline" = yes; thenic_cv_readline=noAC_CHECK_HEADERS([readline.h readline/readline.h],[ic_cv_readline=yesbreak])if test "$ic_cv_readline" = yes; thenAC_CHECK_LIB([curses], [tgetstr])AC_CHECK_LIB([readline], [rl_callback_handler_install])fifiif test "$ic_cv_history" = yes; thenic_cv_history=noAC_CHECK_HEADERS([history.h readline/history.h],[AC_CHECK_LIB([history], [add_history])ic_cv_history=yesbreak])fiif test $ic_cv_crypto = "yes"; thenic_cv_crypto=noAC_CHECK_LIB([crypto], [DES_ncbc_encrypt],[AC_CHECK_HEADERS([openssl/des.h],[AC_DEFINE(USE_CRYPTO, 1, Define if crypto support is enabled.)LIBS="${LIBS} -lcrypto"ic_cv_crypto=yes])])if test $ic_cv_crypto = "no"; thendnl check for old des_ openssl routinesAC_CHECK_LIB([crypto], [des_ncbc_encrypt],[AC_CHECK_HEADERS([openssl/des.h],[AC_DEFINE(USE_CRYPTO, 1, Define if crypto support is enabled.)AC_DEFINE(CRYPTO_OLD_DES, 1, Define if using old des_ crypto routines)LIBS="${LIBS} -lcrypto"ic_cv_crypto=yes])])fiif test "$USE_MAINTAINER_MODE" = yes; thendnl force crypto on as if the checks fail over here,dnl I want to know about it.ic_cv_crypto=yesfifiif test $ic_cv_included_getopt = "no"; thenic_cv_included_getopt=yesAC_CHECK_FUNC(getopt_long,[AC_CHECK_HEADERS([getopt.h],[ic_cv_included_getopt=nobreak])])fiif test $ic_cv_included_getopt = "yes"; thenAC_LIBOBJ(getopt)AC_LIBOBJ(getopt1)fiAC_FUNC_STRNLENAC_FUNC_STRTODAC_FUNC_MEMCMPAC_FUNC_SELECT_ARGTYPESAC_TYPE_SIGNALAC_FUNC_STRFTIMEAC_FUNC_STRNLENAC_FUNC_STRTODAC_REPLACE_FUNCS([mempcpy])AC_REPLACE_FNMATCH# Checks for header files.AC_HEADER_SYS_WAITAC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h netdb.h netinet/in.h \netinet/ip.h netinet/in_systm.h stdlib.h string.h malloc.h sys/ioctl.h \sys/socket.h sys/time.h unistd.h sys/soundcard.h \machine/soundcard.h soundcard.h stdint.h inttypes.h features.h float.h \paths.h stddef.h sys/param.h wchar.h])# Checks for typedefs, structures, and compiler characteristics.AC_C_CONSTAC_C_INLINEAC_TYPE_PID_TAC_TYPE_SIZE_TAC_TYPE_UID_TAC_CHECK_TYPE(socklen_t, break,AC_DEFINE(socklen_t, int, Define if the socklen_t type is not defined))AC_HEADER_TIMEAC_CHECK_SIZEOF(void *)AC_CHECK_SIZEOF(size_t)AC_STRUCT_TM# Checks for library functions.AC_FUNC_ALLOCAAC_HEADER_STDCAC_TYPE_SIGNALAC_CHECK_FUNCS([gethostbyname gethostbyaddr gettimeofday pow socket dup2 \getpass inet_ntoa inet_aton select setenv \memset strcasecmp strchr strcspn strdup strerror strspn strtol atexit])AM_CONDITIONAL(ic_cv_g72x, test "$ic_cv_g72x" = yes)AM_CONDITIONAL(ic_cv_crypto, test "$ic_cv_crypto" = yes)test "x$prefix" = xNONE && prefix=$ac_default_prefixAC_DEFINE_UNQUOTED(SYSCONFDIR,"`eval echo "${sysconfdir}" | sed "s/\/\$//"`",Where config files are located)AC_DEFINE_UNQUOTED(LOCALEDIR,"`eval echo "${datadir}/locale" | sed "s/\/\//\//g"`",Where locale files are located)IC_SUBDIRS="$IC_SUBDIRS subst"IC_LIBS="$IC_LIBS subst/libsubst.a"AC_CONFIG_FILES([Makefile doc/Makefile doc/sgml/Makefile gsm/Makefile \subst/Makefile])AC_OUTPUT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -