]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in: New flag -version-number to be used for maintaining
authorKeith Packard <keithp@keithp.com>
Mon, 31 Mar 2003 17:36:01 +0000 (17:36 +0000)
committerRobert Boehne <rboehne@gnu.org>
Mon, 31 Mar 2003 17:36:01 +0000 (17:36 +0000)
compatability with a previously non-Libtool versioning scheme.
* doc/libtool.texi: Document it.

ChangeLog
doc/libtool.texi
ltmain.in

index b8f4a21ed6aa199ddcb415030d525fa6284e670a..4eba58128bc8275f91a6ce35280a42749602600b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-03-31  Keith Packard  <keithp@keithp.com>
+
+       * ltmain.in: New flag -version-number to be used for maintaining
+       compatability with a previously non-Libtool versioning scheme.
+       * doc/libtool.texi: Document it.
+
 2003-03-31  Naofumi Yasufuku  <naofumi@yasufuku.net>
 
        * ltmain.in (win32_libid): Fixed sed expression error in
index 2cd0fa39d0e5fd00b7343f413da7753a431f497e..760346949506917d622ad3f03c9a2ad293eeab10 100644 (file)
@@ -1307,6 +1307,14 @@ information @var{current}, @var{revision}, and @var{age} to build it
 (@pxref{Versioning}).  Do @strong{not} use this flag to specify package
 release information, rather see the @samp{-release} flag.
 
+@item -version-number @var{major}[:@var{minor}[:@var{revision}]]
+If @var{output-file} is a libtool library, compute interface version
+information so that the resulting library uses the specified major, minor and
+revision numbers.  This is designed to permit libtool to be used with
+existing projects where identical version numbers are already used across
+operating systems.  New projects should use the @samp{-version-info} flag
+instead.
+
 @item -Wl,@var{flag}
 @itemx -Xlinker @var{flag}
 Pass a linker specific flag directly to the linker.
index f4aa90d5287eb0c25b48bd820eff78976db1741a..5ac8f8a8eb5b139698cfca5c797f917249f682f9 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -878,6 +878,7 @@ EOF
     temp_rpath=
     thread_safe=no
     vinfo=
+    vinfo_number=no
 
     # We need to know -static, to get the right output filenames.
     for arg
@@ -1400,6 +1401,11 @@ EOF
        prev=vinfo
        continue
        ;;
+      -version-number)
+       prev=vinfo
+       vinfo_number=yes
+       continue
+       ;;
 
       -Wc,*)
        args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
@@ -2715,7 +2721,7 @@ EOF
       fi
 
       if test -n "$vinfo"; then
-       $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
+       $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
       fi
 
       if test -n "$release"; then
@@ -2792,7 +2798,7 @@ EOF
        fi
 
        if test -n "$vinfo"; then
-         $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
+         $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
        fi
 
        if test -n "$release"; then
@@ -2811,9 +2817,46 @@ EOF
          exit 1
        fi
 
-       current="$2"
-       revision="$3"
-       age="$4"
+       # convert absolute version numbers to libtool ages
+       # this retains compatibility with .la files and attempts
+       # to make the code below a bit more comprehensible
+       
+       case $vinfo_number in
+       yes)
+         number_major="$2"
+         number_minor="$3"
+         number_revision="$4"
+         #
+         # There are really only two kinds -- those that
+         # use the current revision as the major version
+         # and those that subtract age and use age as
+         # a minor version.  But, then there is irix
+         # which has an extra 1 added just for fun
+         #
+         case $version_type in
+         darwin|linux|osf|windows)
+           current=`expr $number_major + $number_minor`
+           age="$number_minor"
+           revision="$number_revision"
+           ;;
+         freebsd-aout|freebsd-elf|sunos)
+           current="$number_major"
+           revision="$number_minor"
+           age="0"
+           ;;
+         irix|nonstopux)
+           current=`expr $number_major + $number_minor - 1`
+           age="$number_minor"
+           revision="$number_minor"
+           ;;
+         esac
+         ;;
+       no)
+         current="$2"
+         revision="$3"
+         age="$4"
+         ;;
+       esac
 
        # Check that each of the things are valid numbers.
        case $current in