[PATCH] Add -shortname option

2011-01-15 Thread KO Myung-Hun
Hi/2.

This patch adds -shortname option for OS/2.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.0.11
Under OS/2 Warp 4 for Korean with FixPak #15
On Intel Core2Duo T5500 1.66 GHz with 2 GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr

From c620c5dd4af864f8d70bbf78eaf0cb4743ca5594 Mon Sep 17 00:00:00 2001
From: KO Myung-Hun 
Date: Fri, 14 Jan 2011 00:43:38 +0900
Subject: [PATCH 01/10] Add -shortname option.

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 +
 doc/libtool.texi   |4 
 libltdl/config/ltmain.m4sh |   11 +++
 libltdl/m4/libtool.m4  |   38 ++
 4 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 39eb771..895b77f 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ New in 2.4.2 2011-??-??: 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/doc/libtool.texi b/doc/libtool.texi
index 727a03d..6fcd210 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -1583,6 +1583,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.
 
+@item -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/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 7baa6aa..73efab0 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -1638,6 +1638,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 SUFFIXoverride the standard shared library file extension
   -static   do not do any dynamic linking of uninstalled libtool 
libraries
   -static-libtool-libs
@@ -4636,6 +4637,11 @@ func_mode_link ()
  prev=
  continue
  ;;
+   shortname)
+ shortname_cmds="$ECHO $arg | cut -b -8"
+ prev=
+ continue
+ ;;
shrext)
  shrext_cmds="$arg"
  prev=
@@ -4955,6 +4961,11 @@ func_mode_link ()
continue
;;
 
+  -shortname)
+   prev=shortname
+   continue
+   ;;
+
   -shrext)
prev=shrext
continue
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index fd79dcf..39dd006 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -2202,6 +2202,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=
@@ -2731,9 +2732,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
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
 osf3* | osf4* | osf5*)
@@ -2879,6 +2886,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]])
@@ -4752,6 +4760,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

[PATCH] Don't eliminate duplication in $postdeps and $predeps on OS/2

2011-01-15 Thread KO Myung-Hun
Hi/2.

Subject says all.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.0.11
Under OS/2 Warp 4 for Korean with FixPak #15
On Intel Core2Duo T5500 1.66 GHz with 2 GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr

From dafc620b7684e0847d40c0e97479a521a74f7eb6 Mon Sep 17 00:00:00 2001
From: KO Myung-Hun 
Date: Sat, 15 Jan 2011 17:50:36 +0900
Subject: [PATCH 02/10] Don't eliminate duplications in $postdeps and $predeps 
on OS/2

---
 libltdl/config/ltmain.m4sh |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 73efab0..2aa0980 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -395,7 +395,7 @@ M4SH_GETOPTS(
   test "$opt_debug" = : || func_append preserve_args " --debug"
 
   case $host in
-*cygwin* | *mingw* | *pw32* | *cegcc*)
+*cygwin* | *mingw* | *pw32* | *cegcc* | *os2*)
   # don't eliminate duplications in $postdeps and $predeps
   opt_duplicate_compiler_generated_deps=:
   ;;
-- 
1.7.3.2

___
http://lists.gnu.org/mailman/listinfo/libtool


[PATCH] Set lt_prog_compiler_static to -Bstatic on OS/2

2011-01-15 Thread KO Myung-Hun
Hi/2.

Subject says all.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.0.11
Under OS/2 Warp 4 for Korean with FixPak #15
On Intel Core2Duo T5500 1.66 GHz with 2 GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr

From ea574c972441d6c834924016cecdaa03a4a3c52a Mon Sep 17 00:00:00 2001
From: KO Myung-Hun 
Date: Sat, 15 Jan 2011 17:54:24 +0900
Subject: [PATCH 03/10] Set lt_prog_compiler_static to -Bstatic on OS/2

---
 libltdl/m4/libtool.m4 |   15 +++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 39dd006..3e5ca75 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -3899,6 +3899,11 @@ m4_if([$1], [CXX], [
   # (--disable-auto-import) libraries
   m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+  case $host_os in
+  os2*)
+_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+;;
+  esac
   ;;
 darwin* | rhapsody*)
   # PIC is the default on this platform
@@ -4217,6 +4222,11 @@ m4_if([$1], [CXX], [
   # (--disable-auto-import) libraries
   m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+  case $host_os in
+  os2*)
+_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+;;
+  esac
   ;;
 
 darwin* | rhapsody*)
@@ -4300,6 +4310,11 @@ m4_if([$1], [CXX], [
   # built for inclusion in a dll (and should export symbols for example).
   m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+  case $host_os in
+  os2*)
+_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+;;
+  esac
   ;;
 
 hpux9* | hpux10* | hpux11*)
-- 
1.7.3.2

___
http://lists.gnu.org/mailman/listinfo/libtool


[PATCH] OS/2 uses other APIs than Win32

2011-01-15 Thread KO Myung-Hun
Hi/2.

OS/2 uses other APIs to load a DLL than LoadLibrary() of Win32.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.0.11
Under OS/2 Warp 4 for Korean with FixPak #15
On Intel Core2Duo T5500 1.66 GHz with 2 GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr

From 24f31852bc439ba78a1d4b127ce0d002eb919fe2 Mon Sep 17 00:00:00 2001
From: KO Myung-Hun 
Date: Sat, 15 Jan 2011 17:59:03 +0900
Subject: [PATCH 04/10] OS/2 uses other APIs to load a DLL than LoadLibrary() on 
Windows.

---
 libltdl/m4/ltdl.m4 |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libltdl/m4/ltdl.m4 b/libltdl/m4/ltdl.m4
index 42e07e9..8ed1f22 100644
--- a/libltdl/m4/ltdl.m4
+++ b/libltdl/m4/ltdl.m4
@@ -696,7 +696,7 @@ darwin[[1567]].*)
 beos*)
   LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
   ;;
-cygwin* | mingw* | os2* | pw32*)
+cygwin* | mingw* | pw32*)
   AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]])
   LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la"
   ;;
-- 
1.7.3.2

___
http://lists.gnu.org/mailman/listinfo/libtool


[PATCH] OS/2 uses ld inherited from GNU ld

2011-01-15 Thread KO Myung-Hun
Hi/2.

I think, it's fine to set with_gnu_ld to yes because OS/2 ld was
modified frome GNU ld.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.0.11
Under OS/2 Warp 4 for Korean with FixPak #15
On Intel Core2Duo T5500 1.66 GHz with 2 GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr

From 5fc395618b414295b0af97fab75e7772f16561ad Mon Sep 17 00:00:00 2001
From: KO Myung-Hun 
Date: Sat, 15 Jan 2011 18:05:13 +0900
Subject: [PATCH 05/10] OS/2 uses ld inherited from GNU ld

---
 libltdl/m4/libtool.m4 |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 3e5ca75..dd3febf 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -4636,6 +4636,9 @@ dnl Note also adjust exclude_expsyms for C++ above.
   with_gnu_ld=no
 fi
 ;;
+  os2*)
+with_gnu_ld=yes
+;;
   interix*)
 # we just hope/assume this is gcc and not c89 (= MSVC++)
 with_gnu_ld=yes
-- 
1.7.3.2

___
http://lists.gnu.org/mailman/listinfo/libtool


Sorry for using a wrong mailing list

2011-01-15 Thread KO Myung-Hun
Hi/2.

I'm sorry that I sent patches to a wrong mailing list.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.0.11
Under OS/2 Warp 4 for Korean with FixPak #15
On Intel Core2Duo T5500 1.66 GHz with 2 GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr


___
http://lists.gnu.org/mailman/listinfo/libtool