📄 configure.in
字号:
dnl dnl Autoconf configuration file for APRdnl dnl Process this file with autoconf to produce a configure script.dnl Use ./buildconf to prepare build files and run autoconf for APR.AC_INIT(build/apr_common.m4)AC_CONFIG_HEADER(include/arch/unix/apr_private.h)AC_CONFIG_AUX_DIR(build)dnl dnl Include our own M4 macros along with those for libtooldnl sinclude(build/apr_common.m4)sinclude(build/apr_network.m4)sinclude(build/apr_threads.m4)sinclude(build/apr_hints.m4)sinclude(build/libtool.m4)dnl Save user-defined environment settings for later restorationdnlAPR_SAVE_THE_ENVIRONMENT(CPPFLAGS)APR_SAVE_THE_ENVIRONMENT(CFLAGS)APR_SAVE_THE_ENVIRONMENT(LDFLAGS)APR_SAVE_THE_ENVIRONMENT(LIBS)APR_SAVE_THE_ENVIRONMENT(INCLUDES)dnl Generate ./config.nice for reproducing runs of configurednlAPR_CONFIG_NICE(config.nice)AC_CANONICAL_SYSTEMecho "Configuring APR library"echo "Platform: $host"dnl Some initial steps for configuration. We setup the default directorydnl and which files are to be configured.dnl Setup the directory macros now# Absolute source/build directoryapr_srcdir=`(cd $srcdir && pwd)`apr_builddir=`pwd`AC_SUBST(apr_srcdir)AC_SUBST(apr_builddir)if test "$apr_builddir" != "$apr_srcdir"; then USE_VPATH=1 APR_CONFIG_LOCATION=buildelse APR_CONFIG_LOCATION=sourcefiAC_SUBST(APR_CONFIG_LOCATION)# Libtool might need this symbol -- it must point to the location of# the generated libtool script (not necessarily the "top" build dir).#top_builddir="$apr_builddir"AC_SUBST(top_builddir)# Directory containing apr build macros, helpers, and make rules# NOTE: make rules (apr_rules.mk) will be in the builddir for vpath#apr_buildout=$apr_builddir/buildapr_builders=$apr_srcdir/buildAC_SUBST(apr_builders)MKDIR=$apr_builders/mkdir.shdnl Initialize mkdir -p functionality.APR_MKDIR_P_CHECK($apr_builders/mkdir.sh)# get our version informationget_version="$apr_builders/get-version.sh"version_hdr="$apr_srcdir/include/apr_version.h"APR_MAJOR_VERSION="`$get_version major $version_hdr APR`"APR_DOTTED_VERSION="`$get_version all $version_hdr APR`"AC_SUBST(APR_DOTTED_VERSION)AC_SUBST(APR_MAJOR_VERSION)echo "APR Version: ${APR_DOTTED_VERSION}"dnl Enable the layout handling code, then reparse the prefix-stylednl arguments due to autoconf being a PITA.APR_ENABLE_LAYOUT(apr)APR_PARSE_ARGUMENTSdnl Set optional CC hints here in case autoconf makes an inappropriate choice.dnl This allows us to suggest what the compiler should be, but stilldnl allows the user to override CC externally.APR_CC_HINTSdnl Do the various CC checks *before* preloading values. The preload codednl may need to use compiler characteristics to make decisions. This macrodnl can only be used once within a configure script, so this prevents adnl preload section from invoking the macro to get compiler info.AC_PROG_CCdnl PreloadAPR_PRELOADdnl These added to allow default directories to be used...DEFAULT_OSDIR="unix"echo "(Default will be ${DEFAULT_OSDIR})"apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support"dnl Checks for programs.AC_PROG_MAKE_SETAC_PROG_CPPAC_PROG_AWKAC_PROG_LN_SAC_PROG_RANLIBAC_PROG_INSTALLAC_CHECK_PROG(RM, rm, rm)AC_CHECK_PROG(AS, as, as)AC_CHECK_PROG(ASCPP, cpp, cpp)AC_CHECK_TOOL(AR, ar, ar)dnl Various OS checks that apparently set required flagsAC_AIXAC_ISC_POSIXAC_MINIXAPR_EBCDICdnl this is our library nameAPR_LIBNAME="apr${libsuffix}"AC_SUBST(APR_LIBNAME)dnl prep libtooldnlecho "performing libtool configuration..."AC_ARG_ENABLE(experimental-libtool,[ --experimental-libtool Use experimental custom libtool (not included in source distribution)], [experimental_libtool=$enableval],[experimental_libtool=no])case $host in*os2*) # Use a custom-made libtool replacement echo "using aplibtool" LIBTOOL="$srcdir/build/aplibtool" gcc $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL.c ;;*) if test "x$LTFLAGS" = "x"; then LTFLAGS='--silent' fi if test "$experimental_libtool" = "yes"; then # Use a custom-made libtool replacement echo "using jlibtool" LIBTOOL="$apr_builddir/libtool" LIBTOOL_SRC="$apr_srcdir/build/jlibtool.c" if test ! -f $LIBTOOL_SRC; then AC_MSG_ERROR([Experimental libtool source not found. It is not included with APR by default.]) fi $CC $CFLAGS $CPPFLAGS -o $LIBTOOL $LIBTOOL_SRC else dnl libtoolize requires that the following not be indentedAC_PROG_LIBTOOL # get libtool's setting of shlibpath_var eval `grep "^shlibpath_var=[[A-Z_]]*$" $apr_builddir/libtool` if test "x$shlibpath_var" = "x"; then shlibpath_var=REPLACE_WITH_YOUR_SHLIBPATH_VAR fi fi ;;esacAC_ARG_WITH(installbuilddir, [ --with-installbuilddir=DIR location to store APR build files (defaults to '${datadir}/build')], [ installbuilddir=$withval ], [ installbuilddir="${datadir}/build" ] )AC_SUBST(installbuilddir)AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the library], [ use_libtool=$withval ], [ use_libtool="yes" ] )if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@' LT_VERSION="-version-info `$get_version libtool $version_hdr APR`" link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) ${LT_VERSION} \$(ALL_LDFLAGS) -o \$@" so_ext='lo' lib_target='-rpath $(libdir) $$objects' export_lib_target='-rpath \$(libdir) \$\$objects'else lt_compile='$(COMPILE) -c $<' link='$(AR) cr $(TARGET_LIB) $$objects; $(RANLIB) $(TARGET_LIB)' so_ext='o' lib_target='' export_lib_target=''ficase $host in *-solaris2*) apr_platform_runtime_link_flag="-R" ;; *) ;;esacAC_SUBST(lt_compile)AC_SUBST(link)AC_SUBST(so_ext)AC_SUBST(lib_target)AC_SUBST(export_lib_target)AC_SUBST(shlibpath_var)AC_SUBST(LTFLAGS)AC_SUBST(LT_LDFLAGS)dnl ----------------------------- Checks for compiler flagsnl=''echo "${nl}Check for compiler flags..."dnl AC_PROG_CC sets -g in CFLAGS (and -O2 for gcc) by default.dnl On OS/390 this causes the compiler to insert extra debuggerdnl hook instructions. That's fine for debug/maintainer builds, not finednl otherwise.case $host in *os390) if test "$ac_test_CFLAGS" != set; then APR_REMOVEFROM(CFLAGS,-g) fi ;;esacAC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings], [APR_ADDTO(CFLAGS,-g) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,-Wall) elif test "$AIX_XLC" = "yes"; then APR_ADDTO(CFLAGS,-qfullpath) fi])dnlAC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and compile time warnings], [APR_ADDTO(CFLAGS,-g) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) elif test "$AIX_XLC" = "yes"; then APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qcheck=all -qinfo=pro) fi])dnlAC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)], if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS, -pg) APR_REMOVEFROM(CFLAGS, -g) if test "$host" = "i586-pc-beos"; then APR_REMOVEFROM(CFLAGS, -O2) APR_ADDTO(CFLAGS, -O1) APR_ADDTO(LDFLAGS, -p) fi fi)dnlAC_ARG_ENABLE(pool-debug, [ --enable-pool-debug[[=yes|no|verbose|verbose-alloc|lifetime|owner|all]] Turn on pools debugging], [ if test -z "$enableval"; then APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG=1) elif test ! "$enableval" = "no"; then apr_pool_debug=1 for i in $enableval do flag=0 case $i in yes) flag=1 ;; verbose) flag=2 ;; lifetime) flag=4 ;; owner) flag=8 ;; verbose-alloc) flag=16 ;; all) apr_pool_debug=31 ;; *) ;; esac if test $flag -gt 0; then apr_pool_debug=`expr '(' $apr_pool_debug - $apr_pool_debug % \ '(' $flag '*' 2 ')' ')' + $flag + $apr_pool_debug % $flag` fi done APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG=$apr_pool_debug) fi ])dnl Electric Fence malloc checker.dnl --with-efence specifies the path to Electric FenceAC_ARG_WITH(efence, [ --with-efence[[=DIR]] path to Electric Fence installation], [ apr_efence_dir="$withval" if test "$apr_efence_dir" != "yes"; then APR_ADDTO(LDFLAGS,[-L$apr_efence_dir/lib]) if test "x$apr_platform_runtime_link_flag" != "x"; then APR_ADDTO(LDFLAGS, [$apr_platform_runtime_link_flag$apr_efence_dir/lib]) fi fi AC_CHECK_LIB(efence, malloc, [ APR_ADDTO(LIBS,-lefence) ], [ AC_MSG_ERROR(Electric Fence requested but not detected) ]) ])if test "$host" = "i586-pc-beos"; then AC_ARG_ENABLE(malloc-debug,[ --enable-malloc-debug Switch on malloc_debug for BeOS], APR_REMOVEFROM(CFLAGS, -O2) APR_ADDTO(CPPFLAGS, -fcheck-memory-usage -D_KERNEL_MODE) ) dnlfi# this is the place to put specific options for platform/compiler# combinationscase "$host:$CC" in *-hp-hpux*:cc ) APR_ADDTO(CFLAGS,[-Ae +Z]) case $host in ia64-* ) ;; * ) if echo "$CFLAGS " | grep '+DA' >/dev/null; then : else APR_ADDTO(CFLAGS,[+DAportable]) fi ;; esac ;; powerpc-*-beos:mwcc* ) APR_SETVAR(CPP,[mwcc -E]) APR_SETVAR(CC,mwcc) APR_SETVAR(AR,ar) ;;esacdnl Check the depend program we can useAPR_CHECK_DEPEND# force_atomic_generic flag # this will be set we find a cpu/OS combo# which is historical and doesn't work with the method# we are using for the more up to date cpu/OS# (ie.. old sparcs)apr_force_atomic_generic=0proc_mutex_is_global=0nonportable_atomics_enabled=0AC_ARG_ENABLE(nonportable-atomics,[ --enable-nonportable-atomics Turn on optimized atomic code which may produce nonportable binaries],[ if test "$enableval" = "yes"; then nonportable_atomics_enabled=1 fi])config_subdirs="none"INSTALL_SUBDIRS="none"case $host in i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*) OSDIR="aix" APR_ADDTO(LDFLAGS,-lld) eolstr="\\n" ;; *-os2*) APR_ADDTO(CPPFLAGS,-DOS2) APR_ADDTO(CFLAGS,-Zmt) AC_CHECK_LIB(bsd, random) OSDIR="os2" enable_threads="system_threads" eolstr="\\r\\n" file_as_socket="0" proc_mutex_is_global=1 ;; *beos*) OSDIR="beos" APR_ADDTO(CPPFLAGS,-DBEOS) enable_threads="system_threads" native_mmap_emul="1" APR_CHECK_DEFINE(BONE_VERSION, sys/socket.h) eolstr="\\n" osver=`uname -r` proc_mutex_is_global=1 case $osver in 5.0.4) file_as_socket="1" ;; *) file_as_socket="0" ;; esac ;; *os390) OSDIR="os390" eolstr="\\n" ;; *os400) OSDIR="as400" eolstr="\\n" ;; *cygwin*) OSDIR="unix" APR_ADDTO(CPPFLAGS,-DCYGWIN) enable_threads="no" eolstr="\\n" ;; *linux*) apr_force_atomic_generic=1 case $host_cpu in i486|i586|i686) if test "$nonportable_atomics_enabled" = 1; then apr_force_atomic_generic=0 fi ;; esac OSDIR="unix" eolstr="\\n" ;; *hpux10* ) enable_threads="no" OSDIR="unix" eolstr="\\n" ;; *) OSDIR="unix" eolstr="\\n" ;;esacAC_SUBST(apr_force_atomic_generic)AC_SUBST(proc_mutex_is_global)AC_SUBST(eolstr)AC_SUBST(INSTALL_SUBDIRS)# For some platforms we need a version string which allows easy numeric# comparisons.case $host in *freebsd*) # 3.4-RELEASE: 340 4.1.1-RELEASE: 411 os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/' | sed -e 's/\(.\)\.\(.\)\-.*/\1\20/'` ;; *linux*) os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'` ;; *darwin*) os_version=`uname -r | sed -e 's/\(.\)\.\(.\).*/\1\2/'` ;; *) os_version=OS_VERSION_IS_NOT_SET ;;esacdnl ----------------------------- Checks for Any required Librariesdnl Note: Autoconf will always append LIBS with an extra " " in AC_CHECK_LIB.dnl It should check for LIBS being empty and set LIBS equal to the new value dnl without the extra " " in that case, but they didn't do that. So, wednl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance.AC_CHECK_LIB(resolv, res_init)AC_CHECK_LIB(nsl, gethostbyname)AC_SEARCH_LIBS(gethostname, nsl)AC_CHECK_LIB(socket, socket)AC_SEARCH_LIBS(crypt, crypt ufc)AC_CHECK_LIB(truerand, main)AC_SEARCH_LIBS(modf, m)AC_SEARCH_LIBS(sqrt, m)dnl ----------------------------- Checking for Threadsecho "${nl}Checking for Threads..."if test -z "$enable_threads"; then AC_ARG_ENABLE(threads, [ --enable-threads Enable threading support in APR.], [ enable_threads=$enableval] , [ APR_CHECK_PTHREADS_H([ enable_threads="pthread" ] , [ enable_threads="no" ] ) ] )fiif test "$enable_threads" = "no"; then threads="0" pthreadh="0" pthreadser="0"else if test "$enable_threads" = "pthread"; then# We have specified pthreads for our threading library, just make sure# that we have everything we need APR_PTHREADS_CHECK_SAVE APR_PTHREADS_CHECK
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -