[PATCH 07/12] Declare enable/disable aix-soname options.

Michael Haubenwallner <[email protected]>
Newsgroups gmane.comp.gnu.libtool.patches
Message-ID <1349192093-24173-8-git-send-email-michael.haubenwallner@salomon.at>
Declare filename based shared library versioning on AIX.
* m4/ltoptions.m4: (_LT_ENABLE_AIX_SONAME) New. Provides
--enable-aix-soname commandline option. Declares the
'shared_archive_member_spec' libtool variable.
(_LT_SET_OPTIONS) Add LT_INIT options "aix-soname",
"disable-aix-soname". Default is disabled.
* m4/ltdl.m4: (LT_SHARED_LIB_MEMBER) Define, based on the value of
the shared_archive_member_spec libtool variable.
---
 m4/ltdl.m4      |    5 +++++
 m4/ltoptions.m4 |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/m4/ltdl.m4 b/m4/ltdl.m4
index 28c39a9..c4a3171 100644
--- a/m4/ltdl.m4
+++ b/m4/ltdl.m4
@@ -566,6 +566,11 @@ if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then
   AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"],
     [Define to the shared library suffix, say, ".dylib".])
 fi
+if test -n "$shared_archive_member_spec"; then
+  m4_pattern_allow([LT_SHARED_LIB_MEMBER])dnl
+  AC_DEFINE_UNQUOTED([LT_SHARED_LIB_MEMBER], ["($shared_archive_member_spec.o)"],
+    [Define to the shared archive member specification, say "(shr.o)".])
+fi
 ])# LT_SYS_MODULE_EXT
 
 # Old name:
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
index 13da361..6f53562 100644
--- a/m4/ltoptions.m4
+++ b/m4/ltoptions.m4
@@ -82,6 +82,8 @@ m4_if([$1],[LT_INIT],[
   _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
 		   [_LT_ENABLE_FAST_INSTALL])
+  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname disable-aix-soname],
+		   [_LT_ENABLE_AIX_SONAME(no)])
   ])
 ])# _LT_SET_OPTIONS
 
@@ -319,6 +321,36 @@ dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 
 
+# _LT_ENABLE_AIX_SONAME([DEFAULT])
+# ----------------------------------
+# implement the --enable-aix-soname flag, and support the `aix-soname'
+# and `disable-aix-soname' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `no'.
+m4_define([_LT_ENABLE_AIX_SONAME],
+[m4_define([_LT_ENABLE_AIX_SONAME_DEFAULT], [m4_if($1, yes, yes, no)])dnl
+AC_ARG_ENABLE([aix-soname],
+    [AS_HELP_STRING([--enable-aix-soname],
+    [On AIX, do filename based shared library versioning (using Import Files),
+      for use with runtime linking only. @<:@default=]_LT_ENABLE_AIX_SONAME_DEFAULT[@:>@.])],
+    [case $enableval in
+      yes) enable_aix_soname=yes ;;
+      no) enable_aix_soname=no ;;
+      *) AC_MSG_ERROR([invalid value for 'aix-soname']) ;;
+    esac],
+    [enable_aix_soname=]_LT_ENABLE_AIX_SONAME_DEFAULT)
+    case $host_cpu-$host_os in
+      powerpc*-aix*) ;;
+      *) enable_aix_soname=no ;;
+    esac
+
+_LT_DECL([], [shared_archive_member_spec], [0],
+    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
+])# _LT_ENABLE_AIX_SONAME
+
+LT_OPTION_DEFINE([LT_INIT], [aix-soname], [_LT_ENABLE_AIX_SONAME([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-aix-soname], [_LT_ENABLE_AIX_SONAME([no])])
+
+
 # _LT_WITH_PIC([MODE])
 # --------------------
 # implement the --with-pic flag, and support the `pic-only' and `no-pic'
-- 
1.7.3.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.