📄 configure.in
字号:
dnl Checks for inet libraries:AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(net, setsockopt))AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))dnl Determine what socket length (socklen_t) data type isAC_MSG_CHECKING([for type of socket length (socklen_t)])AC_TRY_COMPILE2([#include <stddef.h>#include <sys/types.h>#include <sys/socket.h>],[(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[ AC_MSG_RESULT(socklen_t *) XML_SOCKLEN_T=socklen_t],[ AC_TRY_COMPILE2([#include <stddef.h>#include <sys/types.h>#include <sys/socket.h>],[(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[ AC_MSG_RESULT(size_t *) XML_SOCKLEN_T=size_t],[ AC_TRY_COMPILE2([#include <stddef.h>#include <sys/types.h>#include <sys/socket.h>],[(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[ AC_MSG_RESULT(int *) XML_SOCKLEN_T=int],[ AC_MSG_WARN(could not determine) XML_SOCKLEN_T="int"])])])AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])dnl ***********************Checking for availability of IPv6*******************AC_MSG_CHECKING([whether to enable IPv6])AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)if test "$with_minimum" = "yes"then enable_ipv6=nofiif test $enable_ipv6 = yes; then have_ipv6=no AC_TRY_COMPILE([ #include <sys/socket.h> #include <sys/types.h>], [ struct sockaddr_storage ss; socket(AF_INET6, SOCK_STREAM, 0) ], have_ipv6=yes, have_ipv6=no ) AC_MSG_RESULT($have_ipv6) if test $have_ipv6 = yes; then AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6]) have_broken_ss_family=no dnl ********************************************************************* dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have dnl a ss_family member, but rather __ss_family. Let's detect that dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these platforms. dnl ******************************************************************** AC_MSG_CHECKING([broken struct sockaddr::ss_family]) AC_TRY_COMPILE([ #include <sys/socket.h> #include <sys/types.h>], [ struct sockaddr_storage ss ; ss.__ss_family = 0 ; ], have_broken_ss_family=yes, have_broken_ss_family=no ) AC_MSG_RESULT($have_broken_ss_family) if test x$have_broken_ss_family = xyes ; then AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [], [Whether struct sockaddr::__ss_family exists]) AC_DEFINE(ss_family, __ss_family, [ss_family is not defined here, use __ss_family instead]) fi have_getaddrinfo=no AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes) if test $have_getaddrinfo != yes; then for lib in bsd socket inet; do AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break]) done fi if test $have_getaddrinfo = yes; then AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there]) fi fifi dnl ******************************End IPv6 checks******************************dnl Checks for isnan in libm if not in libcAC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan, [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf, [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))XML_LIBDIR='-L${libdir}'XML_INCLUDEDIR='-I${includedir}/libxml2'dnldnl Extra flagsdnlXML_CFLAGS=""RDL_LIBS=""dnldnl Workaround for native compilersdnl HP : http://bugs.gnome.org/db/31/3163.htmldnl DEC : Enable NaN/Infdnlif test "${GCC}" != "yes" ; then case "${host}" in *-*-hpux* ) CFLAGS="${CFLAGS} -Wp,-H30000" ;; *-dec-osf* ) CFLAGS="${CFLAGS} -ieee" ;; alpha*-*-linux* ) CFLAGS="${CFLAGS} -ieee" ;; esacelse if test "$with_fexceptions" = "yes" then # # Not activated by default because this inflates the code size # Used to allow propagation of C++ exceptions through the library # CFLAGS="${CFLAGS} -fexceptions" fi CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls" case "${host}" in alpha*-*-linux* ) CFLAGS="${CFLAGS} -mieee" ;; alpha*-*-osf* ) CFLAGS="${CFLAGS} -mieee" ;; esacficase ${host} in *-*-solaris*) XML_LIBDIR="${XML_LIBDIR} -R${libdir}" ;; hppa*-hp-mpeix) NEED_TRIO=1 ;;esacdnldnl check for pythondnlPYTHON=PYTHON_VERSION=PYTHON_INCLUDES=PYTHON_SITE_PACKAGES=PYTHON_TESTS=pythondir=if test "$with_python" != "no" ; then if test -x "$with_python/bin/python" then echo Found python in $with_python/bin/python PYTHON="$with_python/bin/python" else if test -x "$with_python" then echo Found python in $with_python PYTHON="$with_python" else AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) fi fi if test "$PYTHON" != "" then PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` echo Found Python version $PYTHON_VERSION fi if test "$PYTHON_VERSION" != "" then if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ -d $with_python/lib/python$PYTHON_VERSION/site-packages then PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages else if test -r $prefix/include/python$PYTHON_VERSION/Python.h then PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)' PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' else if test -r /usr/include/python$PYTHON_VERSION/Python.h then PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' else echo could not find python$PYTHON_VERSION/Python.h fi fi if test ! -d "$PYTHON_SITE_PACKAGES" then PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` fi fi fi if test "$with_python" != "" then pythondir='$(PYTHON_SITE_PACKAGES)' else pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages' fifiAM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")if test "$PYTHON_INCLUDES" != ""then PYTHON_SUBDIR=pythonelse PYTHON_SUBDIR=fiAC_SUBST(pythondir)AC_SUBST(PYTHON_SUBDIR)dnl check for dso supportWITH_MODULES=0MODULE_EXTENSION=".so"TEST_MODULES=if test "$with_modules" != "no" ; thenAC_CHECK_LIB(dld, shl_load, [ WITH_MODULES=1 MODULE_PLATFORM_LIBS="-ldld" AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])])AC_CHECK_LIB(dl, dlopen, [ WITH_MODULES=1 MODULE_PLATFORM_LIBS="-ldl" AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])])fiif test "${WITH_MODULES}" = "1"; then TEST_MODULES="ModuleTests"fi AC_SUBST(WITH_MODULES)AC_SUBST(MODULE_PLATFORM_LIBS)AC_SUBST(MODULE_EXTENSION)AC_SUBST(TEST_MODULES)dnldnl Tester makes use of readline if presentdnldnldnl specific tests to setup DV and Bill's devel environments with debug etc ...dnl (-Wunreachable-code)dnlif [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \ [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \ [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \ [[ "${LOGNAME}" = "wbrack" -a "`pwd`" = "/Users/wbrack/gnomecvs/xmltest" ]] then if test "$with_minimum" != "yes" then if test "${with_mem_debug}" = "" ; then with_mem_debug="yes" with_run_debug="yes" fi if test "${with_docbook}" = "" ; then with_docbook="yes" fi fi if test "${CC}" = "gcc" ; then CFLAGS="-g -O -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall" fi STATIC_BINARIES="-static"dnl -Wcast-qual -ansielse STATIC_BINARIES=fiAC_SUBST(STATIC_BINARIES)dnldnl Check for trio string functionsdnlif test "${NEED_TRIO}" = "1" ; then echo Adding trio library for string functions WITH_TRIO=1else WITH_TRIO=0fiAM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")AC_SUBST(WITH_TRIO)dnldnl Allow to enable/disable various piecesdnlecho Checking configuration requirementsdnldnl Thread-related stuffdnlTHREAD_LIBS=""WITH_THREADS=0THREAD_CFLAGS=""TEST_THREADS=""THREADS_W32=""if test "$with_threads" = "no" ; then echo Disabling multithreaded supportelse echo Enabling multithreaded support AC_CHECK_HEADER(pthread.h, AC_CHECK_LIB(pthread, pthread_join,[ THREAD_LIBS="-lpthread" AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)]) AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there]) WITH_THREADS="1"])) case $host_os in *mingw32*) WITH_THREADS="1" THREADS_W32="Win32" THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" ;; *cygwin*) THREAD_LIBS="" ;; *beos*) WITH_THREADS="1" THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS" ;; esac if test "$WITH_THREADS" = "1" ; then THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT" TEST_THREADS="Threadtests" fifiif test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"fiAC_SUBST(THREAD_LIBS)AC_SUBST(WITH_THREADS)AC_SUBST(THREAD_CFLAGS)AC_SUBST(TEST_THREADS)AC_SUBST(THREADS_W32)dnldnl xmllint shell historydnlif test "$with_history" = "yes" ; then echo Enabling xmllint shell history dnl check for terminal library. this is a very cool solution dnl from octave's configure.in unset tcap for termlib in ncurses curses termcap terminfo termlib; do AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"]) test -n "$tcap" && break done AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(history, append_history,[ RDL_LIBS="-lhistory" AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])])) AC_CHECK_HEADER(readline/readline.h, AC_CHECK_LIB(readline, readline,[ RDL_LIBS="-lreadline $RDL_LIBS $tcap" AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap)) if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" fifidnldnl Tree functionsdnlif test "$with_tree" = "no" ; then echo Disabling DOM like tree manipulation APIs WITH_TREE=0else WITH_TREE=1fiAC_SUBST(WITH_TREE)if test "$with_ftp" = "no" ; then echo Disabling FTP support WITH_FTP=0 FTP_OBJ=else WITH_FTP=1 FTP_OBJ=nanoftp.ofiAC_SUBST(WITH_FTP)AC_SUBST(FTP_OBJ)if test "$with_http" = "no" ; then echo Disabling HTTP support
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -