[Opalvoip-svn] SF.net SVN: opalvoip:[20771] ptlib/trunk
Brought to you by:
csoutheren,
rjongbloed
From: <ms3...@us...> - 2008-08-30 08:18:34
|
Revision: 20771 http://opalvoip.svn.sourceforge.net/opalvoip/?rev=20771&view=rev Author: ms30002000 Date: 2008-08-30 08:18:44 +0000 (Sat, 30 Aug 2008) Log Message: ----------- Switch expat detection to new implementation. Modified Paths: -------------- ptlib/trunk/configure ptlib/trunk/configure.ac ptlib/trunk/ptlib.m4 Modified: ptlib/trunk/configure =================================================================== --- ptlib/trunk/configure 2008-08-30 08:03:35 UTC (rev 20770) +++ ptlib/trunk/configure 2008-08-30 08:18:44 UTC (rev 20771) @@ -1363,7 +1363,7 @@ --disable-sasl disable SASL support --disable-openldap disable OpenLDAP support --disable-openssl disable OpenSSL support - --disable-expat disable XML support + --disable-expat disable expat XML support --disable-ipv6 disable IPV6 support --disable-sdl disable SDL support --enable-configfile enable config file support @@ -1409,6 +1409,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-expat-dir=PFX Location of expat XML parser --with-directx-includedir=DIR Location of DirectX include files @@ -4022,9 +4023,6 @@ OS_MINOR=`uname -r | sed -e 's/[0-9][0-9]*\.//' -e 's/\..*$//'` OSRELEASE=`expr $OS_MAJOR + $OS_MINOR` SHAREDLIBEXT="dylib"; - if test -e /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include/expat.h ; then - EXPATDIR=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6 - fi cat >>confdefs.h <<\_ACEOF #define P_PTHREADS 1 @@ -10215,169 +10213,42 @@ - # Check whether --enable-expat was given. if test "${enable_expat+set}" = set; then - enableval=$enable_expat; + enableval=$enable_expat; enable_expat=$enableval +else + enable_expat=$default_expat + fi -if test "${enable_expat}z" = "z" ; then - enable_expat=$default_expat -fi -HAS_EXPAT= if test "$enable_expat" = "no" ; then { echo "$as_me:$LINENO: Expat disabled" >&5 echo "$as_me: Expat disabled" >&6;} else - if test "${EXPATDIR}z" != "z" ; then -for ac_header in ${EXPATDIR}/lib/expat.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +# Check whether --with-expat-dir was given. +if test "${with_expat_dir+set}" = set; then + withval=$with_expat_dir; with_expat_dir="$withval" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ptlib_expat=no - ac_header_preproc=no -fi + if test "x${with_expat_dir}" != "x"; then + ptlib_expat_cflags="-I${with_expat_dir}/include" + ptlib_expat_libs="-L${with_expat_dir}/lib" + fi -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } + old_LIBS="$LIBS" + old_CFLAGS="$CFLAGS" + LIBS="$LIBS ${ptlib_expat_libs}" + CFLAGS="$CFLAGS ${ptlib_expat_cflags}" -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - HAS_EXPAT=1 -fi - -done - - if test "${HAS_EXPAT:-unset}" != "unset" ; then - STDCCFLAGS="$STDCCFLAGS -I${EXPATDIR}/lib" - LDFLAGS="$LDFLAGS -L${EXPATDIR}/.libs" - else - -for ac_header in ${EXPATDIR}/include/expat.h +for ac_header in expat.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -10511,159 +10382,15 @@ cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - HAS_EXPAT=1 -fi - -done - - if test "${HAS_EXPAT:-unset}" != "unset" ; then - STDCCFLAGS="$STDCCFLAGS -I${EXPATDIR}/include" - LDFLAGS="$LDFLAGS -L${EXPATDIR}/lib" - fi - fi - else - -for ac_header in expat.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } + ptlib_expat=yes else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no + ptlib_expat=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - HAS_EXPAT=1 -fi - done - if test "${HAS_EXPAT:-unset}" != "unset" ; then - { echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 + if test "x${ptlib_expat}" = "xyes" ; then + { echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6; } if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10725,27 +10452,41 @@ { echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6; } if test $ac_cv_lib_expat_XML_ParserCreate = yes; then + ptlib_expat=yes +else + ptlib_expat=no +fi + + fi + + LIBS="$old_LIBS" + CFLAGS="$old_CFLAGS" + + if test "x${ptlib_expat}" = "xyes" ; then + EXPAT_LIBS="-lexpat ${ptlib_expat_libs}" + EXPAT_CFLAGS="${ptlib_expat_cflags}" + fi + if test $ptlib_expat = yes; then HAS_EXPAT=1 else HAS_EXPAT= fi - fi - fi - if test "${HAS_EXPAT:-unset}" != "unset" ; then + if test "x${HAS_EXPAT}" = "x1" ; then + cat >>confdefs.h <<\_ACEOF #define P_OEXPAT 1 _ACEOF - ENDLDLIBS="$ENDLDLIBS -lexpat" + STDCCFLAGS="$STDCCFLAGS $EXPAT_CFLAGS" + ENDLDLIBS="$ENDLDLIBS $EXPAT_LIBS" fi fi - # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then enableval=$enable_ipv6; Modified: ptlib/trunk/configure.ac =================================================================== --- ptlib/trunk/configure.ac 2008-08-30 08:03:35 UTC (rev 20770) +++ ptlib/trunk/configure.ac 2008-08-30 08:18:44 UTC (rev 20771) @@ -132,9 +132,6 @@ OS_MINOR=[`uname -r | sed -e 's/[0-9][0-9]*\.//' -e 's/\..*$//'`] OSRELEASE=`expr $OS_MAJOR + $OS_MINOR` SHAREDLIBEXT="dylib"; - if test -e /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include/expat.h ; then - EXPATDIR=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6 - fi AC_DEFINE(P_PTHREADS, 1, "PThreads found") AC_CHECK_FUNC([swab], [AC_DEFINE([USE_SYSTEM_SWAB], [], [Use system swab()] )] ) ;; @@ -1169,43 +1166,24 @@ dnl MSWIN_CHECK_DIR expat,\libs\expat\ dnl MSWIN_CHECK_DIR expat,\Program Files\Expat 2.* +AC_ARG_ENABLE([expat], + AS_HELP_STRING([--disable-expat],[disable expat XML support]), + [enable_expat=$enableval], + [enable_expat=$default_expat] + ) -AC_ARG_ENABLE(expat, - [ --disable-expat disable XML support]) -if test "${enable_expat}z" = "z" ; then - enable_expat=$default_expat -fi - -HAS_EXPAT= if test "$enable_expat" = "no" ; then AC_MSG_NOTICE(Expat disabled) else - if test "${EXPATDIR}z" != "z" ; then - AC_CHECK_HEADERS(${EXPATDIR}/lib/expat.h, HAS_EXPAT=1) - if test "${HAS_EXPAT:-unset}" != "unset" ; then - STDCCFLAGS="$STDCCFLAGS -I${EXPATDIR}/lib" - LDFLAGS="$LDFLAGS -L${EXPATDIR}/.libs" - else - AC_CHECK_HEADERS(${EXPATDIR}/include/expat.h, HAS_EXPAT=1) - if test "${HAS_EXPAT:-unset}" != "unset" ; then - STDCCFLAGS="$STDCCFLAGS -I${EXPATDIR}/include" - LDFLAGS="$LDFLAGS -L${EXPATDIR}/lib" - fi - fi - else - AC_CHECK_HEADERS(expat.h, HAS_EXPAT=1) - if test "${HAS_EXPAT:-unset}" != "unset" ; then - AC_CHECK_LIB(expat, XML_ParserCreate, HAS_EXPAT=1, HAS_EXPAT=) - fi - fi + PTLIB_FIND_EXPAT([HAS_EXPAT=1], [HAS_EXPAT=]) - if test "${HAS_EXPAT:-unset}" != "unset" ; then + if test "x${HAS_EXPAT}" = "x1" ; then AC_DEFINE(P_OEXPAT, 1, "expat found") - ENDLDLIBS="$ENDLDLIBS -lexpat" + STDCCFLAGS="$STDCCFLAGS $EXPAT_CFLAGS" + ENDLDLIBS="$ENDLDLIBS $EXPAT_LIBS" fi fi -AC_SUBST(HAS_EXPAT) dnl ######################################################################## dnl look for IPV6 functions Modified: ptlib/trunk/ptlib.m4 =================================================================== --- ptlib/trunk/ptlib.m4 2008-08-30 08:03:35 UTC (rev 20770) +++ ptlib/trunk/ptlib.m4 2008-08-30 08:18:44 UTC (rev 20771) @@ -445,7 +445,7 @@ LIBS="$LIBS ${ptlib_expat_libs}" CFLAGS="$CFLAGS ${ptlib_expat_cflags}" - AC_CHECK_HEADERS([expat.h], [ptlib_expat=yes]) + AC_CHECK_HEADERS([expat.h], [ptlib_expat=yes], [ptlib_expat=no]) if test "x${ptlib_expat}" = "xyes" ; then AC_CHECK_LIB([expat], [XML_ParserCreate], [ptlib_expat=yes], [ptlib_expat=no]) fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |