diff options
author | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2002-09-10 09:11:20 +0000 |
---|---|---|
committer | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2002-09-10 09:11:20 +0000 |
commit | ab99ddb3dddb97a6241dfa4ff0d7d7131b482b45 (patch) | |
tree | 4cc00a44a50049a875f3c52fef13f8b0b391c09e | |
parent | 4dc00a6afd64bd26c538772f995b0378bbfbf669 (diff) | |
download | libapr-ab99ddb3dddb97a6241dfa4ff0d7d7131b482b45.tar.gz |
Make it a little easier to drop get-version.sh into apr-util by removing
the hardcoded APR prefix to the version defines and taking that as a
parameter.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63855 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | build/get-version.sh | 19 | ||||
-rw-r--r-- | configure.in | 6 |
2 files changed, 15 insertions, 10 deletions
diff --git a/build/get-version.sh b/build/get-version.sh index f85b29798..c29bceb01 100755 --- a/build/get-version.sh +++ b/build/get-version.sh @@ -2,31 +2,36 @@ # # extract version numbers from a header file # -# USAGE: get-version.sh CMD VERSION_HEADER +# USAGE: get-version.sh CMD VERSION_HEADER PREFIX # where CMD is one of: all, major, libtool +# where PREFIX is the prefix to {MAJOR|MINOR|PATCH}_VERSION defines # # get-version.sh all returns a dotted version number # get-version.sh major returns just the major version number # get-version.sh libtool returns a version "libtool -version-info" format # -if test $# != 2; then - echo "USAGE: $0 CMD INCLUDEDIR" +if test $# != 3; then + echo "USAGE: $0 CMD INCLUDEDIR PREFIX" echo " where CMD is one of: all, major" exit 1 fi -major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $2`" -minor="`sed -n '/#define.*APR_MINOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $2`" -patch="`sed -n '/#define.*APR_PATCH_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $2`" +major_sed="/#define.*$3_MAJOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p" +minor_sed="/#define.*$3_MINOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p" +patch_sed="/#define.*$3_PATCH_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p" +major="`sed -n $major_sed $2`" +minor="`sed -n $minor_sed $2`" +patch="`sed -n $patch_sed $2`" if test "$1" = "all"; then echo ${major}.${minor}.${patch} elif test "$1" = "major"; then echo ${major} elif test "$1" = "libtool"; then + # Yes, ${minor}:${patch}:${minor} is correct due to libtool idiocy. echo ${minor}:${patch}:${minor} else - echo "ERROR: unknown version CMD" + echo "ERROR: unknown version CMD ($1)" exit 1 fi diff --git a/configure.in b/configure.in index 7edba41a3..08b88bf41 100644 --- a/configure.in +++ b/configure.in @@ -69,8 +69,8 @@ APR_MKDIR_P_CHECK($apr_builders/mkdir.sh) dnl get our version information get_version="$apr_builders/get-version.sh" version_hdr="$apr_srcdir/include/apr_version.h" -APR_MAJOR_VERSION="`$get_version major $version_hdr`" -APR_DOTTED_VERSION="`$get_version all $version_hdr`" +APR_MAJOR_VERSION="`$get_version major $version_hdr APR`" +APR_DOTTED_VERSION="`$get_version all $version_hdr APR`" AC_SUBST(APR_DOTTED_VERSION) AC_SUBST(APR_MAJOR_VERSION) @@ -158,7 +158,7 @@ AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@' - LT_VERSION="-version-info `$get_version libtool $version_hdr`" + LT_VERSION="-version-info `$get_version libtool $version_hdr APR`" link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) ${LT_VERSION} \$(ALL_LDFLAGS) -o \$@" so_ext='lo' lib_target='-rpath $(libdir) $$objects' |