diff options
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | configure.in | 27 | ||||
-rwxr-xr-x | conftools/get-version.sh | 46 | ||||
-rw-r--r-- | lib/expat.h | 2 | ||||
-rwxr-xr-x | make-release.sh | 6 |
5 files changed, 71 insertions, 12 deletions
diff --git a/Makefile.in b/Makefile.in index fca3044..2fad3d2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -110,7 +110,7 @@ LTFLAGS = --silent COMPILE = $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@ +LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@ LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@ LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo diff --git a/configure.in b/configure.in index 1cd9e7a..9613bad 100644 --- a/configure.in +++ b/configure.in @@ -10,10 +10,26 @@ dnl under the terms of the License (based on the MIT/X license) contained dnl in the file COPYING that comes with this distribution. dnl -dnl Ensure that subversion is configured with autoconf 2.50 or newer -AC_PREREQ(2.50) - -AC_INIT(Makefile.in) +dnl Ensure that subversion is configured with autoconf 2.52 or newer +AC_PREREQ(2.52) + +dnl Get the version number of Expat, using m4's esyscmd() command to run +dnl the command at m4-generation time. This allows us to create an m4 +dnl symbol holding the correct version number. AC_INIT() requires the +dnl version number at m4-time, rather than when ./configure is run, so +dnl all this must happen as part of m4, not as part of the shell code +dnl contained in ./configure. +dnl +dnl NOTE: esyscmd() is a GNU M4 extension. Thus, we wrap it in an appropriate +dnl test. I believe this test will work, but I don't have a place with non- +dnl GNU M4 to test it right now. +define([expat_version], ifdef([__gnu__], + [esyscmd(conftools/get-version.sh lib/expat.h)], + [1.95.x])) +AC_INIT(expat, expat_version, expat-bugs@lists.sourceforge.net) +undefine([expat_version]) + +AC_CONFIG_SRCDIR(Makefile.in) AC_CONFIG_AUX_DIR(conftools) @@ -98,7 +114,8 @@ AC_DEFINE([XML_DTD], 1, AC_DEFINE([XML_CONTEXT_BYTES], 1024, [Define to specify how much context to retain around the current parse point.]) -AC_OUTPUT(Makefile) +AC_CONFIG_FILES(Makefile) +AC_OUTPUT abs_srcdir="`cd $srcdir && pwd`" abs_builddir="`pwd`" diff --git a/conftools/get-version.sh b/conftools/get-version.sh new file mode 100755 index 0000000..a70e0fb --- /dev/null +++ b/conftools/get-version.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# +# USAGE: get-version.sh path/to/expat.h +# +# This script will print Expat's version number on stdout. For example: +# +# $ ./conftools/get-version.sh ./lib/expat.h +# 1.95.3 +# $ +# + +if test $# = 0; then + echo "ERROR: pathname for expat.h was not provided." + echo "" + echo "USAGE: $0 path/to/expat.h" + exit 1 +fi +if test $# != 1; then + echo "ERROR: too many arguments were provided." + echo "" + echo "USAGE: $0 path/to/expat.h" + exit 1 +fi + +hdr="$1" +if test ! -r "$hdr"; then + echo "ERROR: '$hdr' does not exist, or is not readable." + exit 1 +fi + +MAJOR_VERSION="`sed -n -e '/MAJOR_VERSION/s/[^0-9]*//gp' $hdr`" +MINOR_VERSION="`sed -n -e '/MINOR_VERSION/s/[^0-9]*//gp' $hdr`" +MICRO_VERSION="`sed -n -e '/MICRO_VERSION/s/[^0-9]*//gp' $hdr`" + +# Determine how to tell echo not to print the trailing \n. This is +# similar to Autoconf's @ECHO_C@ and @ECHO_N@; however, we don't +# generate this file via autoconf (in fact, get-version.sh is used +# to *create* ./configure), so we just do something similar inline. +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ;; + *c*,* ) ECHO_N=-n ECHO_C= ;; + *) ECHO_N= ECHO_C='\c' ;; +esac + +echo $ECHO_N "$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$ECHO_C" diff --git a/lib/expat.h b/lib/expat.h index a952230..bf263ca 100644 --- a/lib/expat.h +++ b/lib/expat.h @@ -8,7 +8,7 @@ #include <stdlib.h> #ifndef XMLPARSEAPI -# if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) +# if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) # define XMLPARSEAPI(type) __declspec(dllimport) type __cdecl # else # define XMLPARSEAPI(type) type diff --git a/make-release.sh b/make-release.sh index 86990f3..3ec043c 100755 --- a/make-release.sh +++ b/make-release.sh @@ -27,11 +27,7 @@ echo "Preparing $tmpdir for release (running buildconf.sh)" (cd $tmpdir && ./buildconf.sh) || exit 1 # figure out the release version -hdr="$tmpdir/lib/expat.h" -MAJOR_VERSION="`sed -n -e '/MAJOR_VERSION/s/[^0-9]*//gp' $hdr`" -MINOR_VERSION="`sed -n -e '/MINOR_VERSION/s/[^0-9]*//gp' $hdr`" -MICRO_VERSION="`sed -n -e '/MICRO_VERSION/s/[^0-9]*//gp' $hdr`" -vsn=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION +vsn="`$tmpdir/conftools/get-version.sh $tmpdir/lib/expat.h`" echo "" echo "Release version: $vsn" |