📄 configure.in
字号:
fifidnl Checks for inet libraries:AC_SEARCH_LIBS(gethostent, [nsl])AC_SEARCH_LIBS(setsockopt, [socket net])AC_SEARCH_LIBS(connect, [inet])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/types.h> #include <sys/socket.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 dnl platforms. However, we should only do this if ss_family is not dnl present. dnl ******************************************************************** AC_MSG_CHECKING([struct sockaddr::ss_family]) AC_TRY_COMPILE([ #include <sys/types.h> #include <sys/socket.h> ], [ struct sockaddr_storage ss ; ss.ss_family = 0 ; ], have_ss_family=yes, have_ss_family=no ) AC_MSG_RESULT($have_ss_family) if test x$have_ss_family = xno ; then AC_MSG_CHECKING([broken struct sockaddr::ss_family]) AC_TRY_COMPILE([ #include <sys/types.h> #include <sys/socket.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]) else AC_MSG_WARN(ss_family and __ss_family not found) fi 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 hppa*-*-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 ;; *-*-mingw* | *-*-cygwin* | *-*-msvc* ) # If the host is Windows, and shared libraries are disabled, we # need to add -DLIBXML_STATIC to CFLAGS in order for linking to # work properly (without it, xmlexports.h would force the use of # DLL imports, which obviously aren't present in a static # library). if test "x$enable_shared" = "xno"; then XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC" CFLAGS="$CFLAGS -DLIBXML_STATIC" fi ;;esacdnldnl check for pythondnlPYTHON_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 if test -x "$PYTHON" then echo Found python in environment PYTHON=$PYTHON with_python=`$PYTHON -c "import sys; print sys.exec_prefix"` else AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) fi 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=$libdir/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' fielse PYTHON=fiAM_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=0TEST_MODULES=if test "$with_modules" != "no" ; then case "$host" in *-*-cygwin*) MODULE_EXTENSION=".dll" AC_CHECK_LIB(cygwin, dlopen, [ WITH_MODULES=1 MODULE_PLATFORM_LIBS= AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) ]) ;; *) AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [ AC_CHECK_LIB(dld, shl_load, [ MODULE_PLATFORM_LIBS="-ldld" libxml_have_shl_load=yes], [ AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [ AC_CHECK_LIB(dl, dlopen, [ MODULE_PLATFORM_LIBS="-ldl" libxml_have_dlopen=yes])])])]) if test "${libxml_have_shl_load}" = "yes"; then MODULE_EXTENSION=".sl" WITH_MODULES=1 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso]) fi if test "${libxml_have_dlopen}" = "yes"; then case "${host}" in *-*-hpux* ) MODULE_EXTENSION=".sl" ;; * ) MODULE_EXTENSION=".so" ;; esac WITH_MODULES=1 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) fi ;; esacfiif 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/gnomesvn/libxml2" ]] then if test "$with_minimum" != "yes" then if test "${with_mem_debug}" = "" ; then echo Activating memory debugging with_mem_debug="yes" with_run_debug="yes" fi if test "${with_docbook}" = "" ; then with_docbook="yes" fi fi if test "${GCC}" = "yes" ; 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=""BASE_THREAD_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" ;; *linux*) if test "${GCC}" = "yes" ; then GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'` GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'` GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'` if test "${THREAD_LIBS}" = "-lpthread" ; then if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null then THREAD_LIBS="" BASE_THREAD_LIBS="-lpthread" else if expr ${GCC_MAJOR} \> 3 > /dev/null then THREAD_LIBS="" BASE_THREAD_LIBS="-lpthread" else echo old GCC disabling weak symbols for pthread fi fi fi fi ;; 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(BASE_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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -