[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/10] Add -shortname option.
From: |
KO Myung-Hun |
Subject: |
[PATCH 01/10] Add -shortname option. |
Date: |
Thu, 23 Feb 2012 00:01:54 +0900 |
OS/2 limits a length of a DLL base name up to 8 characters. If a name of
a shared library is longer than 8 characters, OS/2 cannot load it. So the
option to specify a short name is needed.
---
NEWS | 1 +
build-aux/ltmain.m4sh | 11 +++++++++++
doc/libtool.texi | 4 ++++
m4/libtool.m4 | 38 ++++++++++++++++++++++++++++++++++----
4 files changed, 50 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
index ecd4fa1..32a0bdb 100644
--- a/NEWS
+++ b/NEWS
@@ -73,6 +73,7 @@ New in 2.4.2 2011-10-17: git version 2.4.1a, Libtool team:
- The --with-pic configure option now supports a list of comma-separated
package names. This can be used to build some static libraries with PIC
objects while building others with non-PIC objects.
+ - Added -shortname option to specify a short name for a DLL (OS/2 only)
- Initial support for Go, using the gccgo compiler.
diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 30f99f4..7017dc6 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -1652,6 +1652,7 @@ The following components of LINK-COMMAND are treated
specially:
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
-shared only do dynamic linking of libtool libraries
+ -shortname NAME specify a short name for a DLL(effect on OS/2 only)
-shrext SUFFIX override the standard shared library file extension
-static do not do any dynamic linking of uninstalled libtool
libraries
-static-libtool-libs
@@ -4669,6 +4670,11 @@ func_mode_link ()
prev=
continue
;;
+ shortname)
+ shortname_cmds="$ECHO $arg | cut -b -8"
+ prev=
+ continue
+ ;;
shrext)
shrext_cmds=$arg
prev=
@@ -4989,6 +4995,11 @@ func_mode_link ()
continue
;;
+ -shortname)
+ prev=shortname
+ continue
+ ;;
+
-shrext)
prev=shrext
continue
diff --git a/doc/libtool.texi b/doc/libtool.texi
index da5497e..8a040bd 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -1567,6 +1567,10 @@ In the later case, libtool will signal an error if it
was configured
with @option{--disable-shared}, or if the host does not support shared
libraries.
address@hidden -shortname @var{name}
+If @var{name} is specified, replace a name for a DLL with @var{suffix} (effect
+on OS/2 only)
+
@item -shrext @var{suffix}
If @var{output-file} is a libtool library, replace the system's standard
file name extension for shared libraries with @var{suffix} (most systems
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index ac4381c..a8c43c0 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -2229,6 +2229,7 @@ BEGIN {RS = " "; FS = "/|\n";} {
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi])
+shortname_cmds=
library_names_spec=
libname_spec='lib$name'
soname_spec=
@@ -2755,9 +2756,15 @@ os2*)
libname_spec='$name'
shrext_cmds=.dll
need_lib_prefix=no
- library_names_spec='$libname$shared_ext $libname.a'
+ # 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.
+ shortname_cmds='$ECHO $libname | cut -b -8'
+ library_names_spec='`eval $shortname_cmds`${shared_ext}
${libname}_dll.$libext'
dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
+ shlibpath_var=BEGINLIBPATH
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
osf3* | osf4* | osf5*)
@@ -2903,6 +2910,7 @@ _LT_DECL([], [shlibpath_var], [0],[Shared library path
variable])
_LT_DECL([], [shlibpath_overrides_runpath], [0],
[Is shlibpath searched before the hard-coded library search path?])
_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [shortname_cmds], [2], [Command to make a short name])
_LT_DECL([], [library_names_spec], [1],
[[List of archive names. First name is the real one, the rest are links.
The last name is the one that the linker finds with -lNAME]])
@@ -4790,6 +4798,16 @@ _LT_EOF
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=".dll"
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY `eval $shortname_cmds`
INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION
\"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >>
$output_objdir/$libname.def~$ECHO " MULTIPLE NONSHARED" >>
$output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp
$libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~$CC -Zdll
-Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o
$output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
interix[[3-9]]*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -5415,8 +5433,10 @@ _LT_EOF
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" >
$output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >>
$output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo "
SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >>
$output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC
-Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags
$output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o
$output_objdir/$libname.a $output_objdir/$libname.def'
+ shrext_cmds=".dll"
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY `eval $shortname_cmds`
INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION
\"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >>
$output_objdir/$libname.def~$ECHO " MULTIPLE NONSHARED" >>
$output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp
$libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~$CC -Zdll
-Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o
$output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
;;
osf3*)
@@ -6208,6 +6228,16 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_DARWIN_LINKER_FEATURES($1)
;;
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=".dll"
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY `eval $shortname_cmds`
INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION
\"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >>
$output_objdir/$libname.def~$ECHO " MULTIPLE NONSHARED" >>
$output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp
$libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~$CC -Zdll
-Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o
$output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
dgux*)
case $cc_basename in
ec++*)
--
1.7.3.2
- [PATCH] OS/2 supports, KO Myung-Hun, 2012/02/22
- [PATCH 01/10] Add -shortname option.,
KO Myung-Hun <=
- [PATCH 02/10] Don't eliminate duplications in $postdeps and $predeps on OS/2, KO Myung-Hun, 2012/02/22
- [PATCH 03/10] Set lt_prog_compiler_static to -Bstatic on OS/2, KO Myung-Hun, 2012/02/22
- [PATCH 05/10] OS/2 uses ld inherited from GNU ld, KO Myung-Hun, 2012/02/22
- [PATCH 04/10] OS/2 uses other APIs to load a DLL than LoadLibrary() on Windows., KO Myung-Hun, 2012/02/22
- [PATCH 06/10] There is no need to relink DLLs on OS/2, KO Myung-Hun, 2012/02/22
- [PATCH 07/10] Set lt_cv_deplibs_check_method to pass_all on OS/2, KO Myung-Hun, 2012/02/22
- [PATCH 08/10] Support -Zxxx options used on OS/2, KO Myung-Hun, 2012/02/22
- [PATCH 09/10] Create import libraries instead of links to the real library on OS/2, KO Myung-Hun, 2012/02/22
- [PATCH 10/10] Fix a problem that it fails to find proper libraries if .la is a dependency on OS/2, KO Myung-Hun, 2012/02/22