diff options
author | Nick Kew <niq@apache.org> | 2011-03-25 12:42:53 +0000 |
---|---|---|
committer | Nick Kew <niq@apache.org> | 2011-03-25 12:42:53 +0000 |
commit | 886b9083bab5e915aa7f2f357bcc40229fc1ac58 (patch) | |
tree | d843108f6cba039c69ccaa7068f3e86e4787c053 /build/apu-conf.m4 | |
parent | c958f1b7c7ba0516227047e0fde0888dc31842c3 (diff) | |
download | apr-886b9083bab5e915aa7f2f357bcc40229fc1ac58.tar.gz |
Support selection of libxml2 vs expat in autoconf build.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085350 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/apu-conf.m4')
-rw-r--r-- | build/apu-conf.m4 | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/build/apu-conf.m4 b/build/apu-conf.m4 index a727e5870..a4078226d 100644 --- a/build/apu-conf.m4 +++ b/build/apu-conf.m4 @@ -46,117 +46,6 @@ AC_DEFUN([APU_FIND_APR], [ AC_SUBST(APR_BUILD_DIR) ]) -dnl -dnl APU_TRY_EXPAT_LINK( -dnl test-message, cache-var-name, hdrs, libs, -dnl [actions-on-success], [actions-on-failure]) -dnl -dnl Tests linking against expat with libraries 'libs' and includes -dnl 'hdrs', passing message + cache-var-name to AC_CACHE_CHECK. -dnl On success, sets $expat_libs to libs, sets $apu_have_expat to 1, -dnl and runs actions-on-success; on failure runs actions-on-failure. -dnl -AC_DEFUN([APU_TRY_EXPAT_LINK], [ -AC_CACHE_CHECK([$1], [$2], [ - apu_expat_LIBS=$LIBS - apu_expat_CPPFLAGS=$CPPFLAGS - LIBS="$LIBS $4" - CPPFLAGS="$CPPFLAGS $INCLUDES" - AC_TRY_LINK([#include <stdlib.h> -#include <$3>], [XML_ParserCreate(NULL);], - [$2=yes], [$2=no]) - LIBS=$apu_expat_LIBS - CPPFLAGS=$apu_expat_CPPFLAGS -]) - -if test $[$2] = yes; then - AC_DEFINE([HAVE_]translit([$3], [a-z./], [A-Z__]), 1, - [Define if $3 is available]) - apu_expat_libs="$4" - apu_has_expat=1 - $5 -else - apu_has_expat=0 - $6 -fi -]) - -dnl -dnl APU_SYSTEM_EXPAT: tests for a system expat installation -dnl If present, sets $apu_has_expat to 1 and adjusts LDFLAGS/CPPFLAGS -dnl appropriately. This is mostly for compatibility with existing -dnl expat releases; all but the first APU_TRY_EXPAT_LINK call could -dnl be dropped later. -dnl -AC_DEFUN([APU_SYSTEM_EXPAT], [ - - APU_TRY_EXPAT_LINK([Expat 1.95.x], apu_cv_expat_system, - [expat.h], [-lexpat]) - - if test $apu_has_expat = 0; then - APU_TRY_EXPAT_LINK([old Debian-packaged expat], apu_cv_expat_debian, - [xmltok/xmlparse.h], [-lxmlparse -lxmltok]) - fi - - if test $apu_has_expat = 0; then - APU_TRY_EXPAT_LINK([old FreeBSD-packaged expat], apu_cv_expat_freebsd, - [xml/xmlparse.h], [-lexpat]) - fi - - if test $apu_has_expat = 0; then - APU_TRY_EXPAT_LINK([Expat 1.0/1.1], apu_cv_expat_1011, - [xmlparse/xmlparse.h], [-lexpat]) - fi - - if test $apu_has_expat = 0; then - APR_ADDTO(LDFLAGS, [-L/usr/local/lib]) - APR_ADDTO(INCLUDES, [-I/usr/local/include]) - - APU_TRY_EXPAT_LINK([Expat 1.95.x in /usr/local], - apu_cv_expat_usrlocal, [expat.h], [-lexpat], [], [ - APR_REMOVEFROM(LDFLAGS, [-L/usr/local/lib]) - APR_REMOVEFROM(INCLUDES, [-I/usr/local/include]) - ]) - fi -]) - - -dnl -dnl APU_FIND_EXPAT: figure out where EXPAT is located (or use bundled) -dnl -AC_DEFUN([APU_FIND_EXPAT], [ - -save_cppflags="$CPPFLAGS" - -apu_has_expat=0 - -AC_ARG_WITH([expat], -[ --with-expat=DIR specify Expat location], [ - if test "$withval" = "yes"; then - AC_MSG_ERROR([a directory must be specified for --with-expat]) - elif test "$withval" = "no"; then - AC_MSG_ERROR([Expat cannot be disabled (at this time)]) - else - # Add given path to standard search paths if appropriate: - if test "$withval" != "/usr"; then - APR_ADDTO(INCLUDES, [-I$withval/include]) - APR_ADDTO(LDFLAGS, [-L$withval/lib]) - fi - fi -]) - -APU_SYSTEM_EXPAT -test ${apu_has_expat} != "1" && AC_MSG_ERROR(could not find Expat) - -APR_ADDTO(APRUTIL_EXPORT_LIBS, [$apu_expat_libs]) -APR_ADDTO(LIBS, [$apu_expat_libs]) - -APR_XML_DIR=$bundled_subdir -AC_SUBST(APR_XML_DIR) - -CPPFLAGS=$save_cppflags -]) - dnl dnl Find a particular LDAP library |