Index: library/xml/TclExpat-1.1/configure =================================================================== diff -u -r78e6c23b4195221aba2a75be9e813382d74f20fb -ra16cfab111738c0792b602340bb9f86263206a74 --- library/xml/TclExpat-1.1/configure (.../configure) (revision 78e6c23b4195221aba2a75be9e813382d74f20fb) +++ library/xml/TclExpat-1.1/configure (.../configure) (revision a16cfab111738c0792b602340bb9f86263206a74) @@ -1313,6 +1313,9 @@ --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH absolute path to xotclConfig.sh, --without-xotcl disables, but this is pointless + --with-expat=sys assumes a system-wide expat installation, + --with-expat= point to a custom expat installation, + --without-expat falls back to the bundled expat installation --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tclinclude directory containing the public Tcl header files @@ -1921,6 +1924,46 @@ fi + +# Check whether --with-expat was given. +if test "${with_expat+set}" = set; then + withval=$with_expat; with_expat=$withval +else + with_expat=bundle +fi + + +case $with_expat in + bundle) ;; + sys) + { echo "$as_me:$LINENO: result: search for expat in ${prefix} /usr/local /usr" >&5 +echo "${ECHO_T}search for expat in ${prefix} /usr/local /usr" >&6; } + for f in $prefix /usr/local /usr; do + if test -f "$f/include/expat.h" ; then + expat_dir=$f + EXPAT_INC_SPEC="-I`(cd $inc_dir; pwd)`" + break + fi + done + ;; + *) + inc_dir="`echo $with_expat |cut -f1 -d,`" + lib_dir="`echo $with_expat |cut -f2 -d, -s`" + if test -f "$inc_dir/expat.h"; then + EXPAT_INC_SPEC="-I`(cd $inc_dir; pwd)`" + else + { { echo "$as_me:$LINENO: error: ${inc_dir} directory does not contain expat.h" >&5 +echo "$as_me: error: ${inc_dir} directory does not contain expat.h" >&2;} + { (exit 1); exit 1; }; } + fi + expat_dir="`(cd $inc_dir/..; pwd)`" + if test -z "${lib_dir}"; then + EXPAT_LIB_SPEC="" + else + EXPAT_LIB_SPEC="-L`(cd $lib_dir; pwd)`" + fi +esac + #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- @@ -6659,8 +6702,17 @@ #----------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then + filemap="win32filemap.c" +else + filemap="unixfilemap.c" +fi - vars="xmltok.c win32filemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c" +if test "${with_expat}" = bundle ; then + # 1) the bundled case + { echo "$as_me:$LINENO: result: using bundled expat distribution" >&5 +echo "${ECHO_T}using bundled expat distribution" >&6; } + + vars="xmltok.c ${filemap} xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c" for i in $vars; do case $i in \$*) @@ -6696,8 +6748,11 @@ else + # 2) the shared case + { echo "$as_me:$LINENO: result: using shared expat found in ${expat_dir}" >&5 +echo "${ECHO_T}using shared expat found in ${expat_dir}" >&6; } - vars="xmltok.c unixfilemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c" + vars="tclexpat.c" for i in $vars; do case $i in \$*) @@ -6732,6 +6787,24 @@ + + vars="${EXPAT_INC_SPEC}" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + + + + vars="${EXPAT_LIB_SPEC} -lexpat" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + fi