You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Joe Schaefer <jo...@sunstarsys.com> on 2004/06/21 19:02:58 UTC
libtool & pattern match fixes for build/get-version.sh
We've been using the build/get-version.sh script in
httpd-apreq-2. The following patch corrects the
libtool version string miscalculation (we let libtool
generate the shared library version for libapreq2, so
it's pretty well-tested).
The patch also includes a patch to correctly handle
multi-digit numbers (the original regexp will drop
all but the final digit due to the greediness of the
opening .* pattern.
% diff -u apr/build/get-version.sh httpd-apreq-2/build/get-version.sh
--- apr/build/get-version.sh 2002-09-10 09:11:20.000000000 +0000
+++ httpd-apreq-2/build/get-version.sh 2004-06-21 16:50:43.816189354 +0000
@@ -13,24 +13,24 @@
if test $# != 3; then
echo "USAGE: $0 CMD INCLUDEDIR PREFIX"
- echo " where CMD is one of: all, major"
+ echo " where CMD is one of: all, major, libtool"
exit 1
fi
-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="/#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`"
+ltmaj="`expr $major + $minor`"
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}
+ echo ${ltmaj}:${patch}:${minor}
else
echo "ERROR: unknown version CMD ($1)"
exit 1
--
Joe Schaefer
Re: libtool & pattern match fixes for build/get-version.sh
Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Wednesday, June 30, 2004 5:02 PM +0100 Joe Orton <jo...@redhat.com>
wrote:
> I'm a little hesitant about gratuitously changing the soname just before
> a major release, and after 1.0 it will be too late. Is there a reason
> why you need the get-version.sh script included in APR to behave like
> this, rather than just using a local modification in the copy in the
> libapreq2 tree?
+1. Now is *not* the time to make goofy changes like this. -- justin
Re: libtool & pattern match fixes for build/get-version.sh
Posted by Joe Schaefer <jo...@sunstarsys.com>.
Joe Orton <jo...@redhat.com> writes:
[...]
> The ltmaj fix is not necessary for APR, since APR embeds the major
> version in the library name to allow parallel installs of different
> major versions, so always passing CURRENT == AGE as the libtool
> interface versions is OK.
>
> I'm a little hesitant about gratuitously changing the soname just
> before a major release, and after 1.0 it will be too late.
No worries, it's a minor polish issue that allows the
APR_DOTTED_VERSION to match the generated soname. I
brought it up now because it wasn't an issue in the 0.9.X
releases. If binary compatibility has been stable since
apr started generating libapr-1.so.0.0.0, then changing the
soname would be a bad idea. OTOH if it has broken recently,
then bumping the number might be worth consideration.
> Is there a reason why you need the get-version.sh script included in
> APR to behave like this, rather than just using a local modification
> in the copy in the libapreq2 tree?
No- libapreq2's dependency on apr is solely through apr-config.
Whatever decision is made on the soname will not impact libapreq2.
However, adjusting its name to apr-1-config will likely us
avoid problems in the future (since we're tied to httpd-2.0's ABI).
--
Joe Schaefer
Re: libtool & pattern match fixes for build/get-version.sh
Posted by Joe Orton <jo...@redhat.com>.
On Mon, Jun 21, 2004 at 01:02:58PM -0400, Joe Schaefer wrote:
> We've been using the build/get-version.sh script in
> httpd-apreq-2. The following patch corrects the
> libtool version string miscalculation (we let libtool
> generate the shared library version for libapreq2, so
> it's pretty well-tested).
>
> The patch also includes a patch to correctly handle
> multi-digit numbers (the original regexp will drop
> all but the final digit due to the greediness of the
> opening .* pattern.
The sed fix is clearly good, thanks.
The ltmaj fix is not necessary for APR, since APR embeds the major
version in the library name to allow parallel installs of different
major versions, so always passing CURRENT == AGE as the libtool
interface versions is OK.
I'm a little hesitant about gratuitously changing the soname just before
a major release, and after 1.0 it will be too late. Is there a reason
why you need the get-version.sh script included in APR to behave like
this, rather than just using a local modification in the copy in the
libapreq2 tree?
Regards,
joe
Re: libtool & pattern match fixes for build/get-version.sh
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
hi all...
Joe Schaefer wrote:
> We've been using the build/get-version.sh script in
> httpd-apreq-2. The following patch corrects the
> libtool version string miscalculation (we let libtool
> generate the shared library version for libapreq2, so
> it's pretty well-tested).
>
> The patch also includes a patch to correctly handle
> multi-digit numbers (the original regexp will drop
> all but the final digit due to the greediness of the
> opening .* pattern.
did this slip through the cracks? I'm not good at reviewing this kind of
build thing, but it would help the httpd-apreq project out a bit if someone
who is could give it a glance and provide some feedback.
--Geoff
>
> % diff -u apr/build/get-version.sh httpd-apreq-2/build/get-version.sh
> --- apr/build/get-version.sh 2002-09-10 09:11:20.000000000 +0000
> +++ httpd-apreq-2/build/get-version.sh 2004-06-21 16:50:43.816189354 +0000
> @@ -13,24 +13,24 @@
>
> if test $# != 3; then
> echo "USAGE: $0 CMD INCLUDEDIR PREFIX"
> - echo " where CMD is one of: all, major"
> + echo " where CMD is one of: all, major, libtool"
> exit 1
> fi
>
> -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="/#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`"
> +ltmaj="`expr $major + $minor`"
>
> 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}
> + echo ${ltmaj}:${patch}:${minor}
> else
> echo "ERROR: unknown version CMD ($1)"
> exit 1
>
>