[PATCH 08/11] libtool: add -os2dllname option

KO Myung-Hun <[email protected]>
Newsgroups gmane.comp.gnu.libtool.patches
Message-ID <[email protected]>
OS/2 limits a length of a DLL base name up to 8 characters. Because of
this, if there are many DLLs whose prefix is same and very long, the
result DLLs are overwritten. So to avoid this, the option to specify a
OS/2 DLL name is needed.

* NEWS: Add news for -os2dllname.
* build-aux/ltmain.in (func_mode_help): Add a description for -os2dllname.
(fund_mode_link): Add -os2dllname.
* doc/libtool.texi: Add -os2dllname item.
---
 NEWS                |    2 ++
 build-aux/ltmain.in |   12 ++++++++++++
 doc/libtool.texi    |    4 ++++
 m4/libtool.m4       |    2 +-
 4 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/NEWS b/NEWS
index 79f4942..883bfed 100644
--- a/NEWS
+++ b/NEWS
@@ -59,6 +59,8 @@ NEWS - list of user-visible changes between releases of GNU Libtool
 
         make check-local TESTSUITEFLAGS='-k "!expensive"'
 
+  - Added -os2dllname option to specify a OS/2 DLL name (OS/2 only)
+
 ** Bug fixes:
 
   - Fix a long-standing latent bug in autom4te include path for autotests
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index 7a53d19..0d90df9 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -1819,6 +1819,7 @@ The following components of LINK-COMMAND are treated specially:
   -no-undefined     declare that a library does not refer to external symbols
   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
   -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -os2dllname NAME  specify a OS/2 DLL name(effect on OS/2 only)
   -precious-files-regex REGEX
                     don't remove output files matching REGEX
   -release RELEASE  specify package release information
@@ -4606,6 +4607,7 @@ func_mode_link ()
     module=no
     no_install=no
     objs=
+    os2dllname=
     non_pic_objects=
     precious_files_regex=
     prefer_static_libs=no
@@ -4863,6 +4865,11 @@ func_mode_link ()
 	  prev=
 	  continue
 	  ;;
+	os2dllname)
+	  os2dllname="$arg"
+	  prev=
+	  continue
+	  ;;
 	precious_regex)
 	  precious_files_regex=$arg
 	  prev=
@@ -5172,6 +5179,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -os2dllname)
+	prev=os2dllname
+	continue
+	;;
+
       -o) prev=output ;;
 
       -precious-files-regex)
diff --git a/doc/libtool.texi b/doc/libtool.texi
index 89c5d1a..65d63a3 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -1531,6 +1531,10 @@ Create @var{output-file} from the specified objects and libraries.
 @item -objectlist @var{file}
 Use a list of object files found in @var{file} to specify objects.
 
+@item -os2dllname @var{name}
+If @var{name} is specified, replace a name for a DLL with @var{suffix} (effect
+on OS/2 only)
+
 @item -precious-files-regex @var{regex}
 Prevents removal of files from the temporary output directory whose
 names match this regular expression.  You might specify @samp{\.bbg?$}
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 9fc700e..7d58420 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -2813,7 +2813,7 @@ os2*)
   # OS/2 limits a length of a DLL basename up to 8 characters.
   # So there is need to use a short name instead of a original name
   # longer than 8 characters. And replace '.' with '_'.
-  soname_spec='`eval $ECHO $libname | cut -b -8 | tr . _`${shared_ext}'
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; $ECHO $libname | cut -b -8 | tr . _`${shared_ext}'
   library_names_spec='${libname}_dll.$libext'
   dynamic_linker='OS/2 ld.exe'
   shlibpath_var=BEGINLIBPATH
-- 
1.7.3.2
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.