Will the os2 patches posted by KO Myung-Hun back in november 2011 (links below) be merged mainline?
http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00004.html http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00005.html http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00006.html http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00007.html http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00008.html http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00009.html http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00010.html http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00011.html http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00012.html http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00013.html -- O.S.
http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00004.html From: KO Myung-Hun <kom...@gmail.com> Subject: [PATCH] OS/2 patches Date: Sun, 4 Nov 2012 21:13:25 +0900 Hi/2. These are the patches for OS/2. Review, please. -- http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00005.html From: KO Myung-Hun Subject: [PATCH 1/9] libtool: add -shortname option Date: Sun, 4 Nov 2012 21:13:26 +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: Add news for -shortname. * build-aux/ltmain.in(func_mode_help): Add a description for -shortname. (fund_mode_link): Add -shortname. * doc/libtool.texi: Add -shortname item. * m4/libtool.m4: Introduce shortname_cmds for -shortname. -- http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00006.html From: KO Myung-Hun Subject: [PATCH 2/9] libtool: don't eliminate duplications in $postdeps and $predeps on OS/2 Date: Sun, 4 Nov 2012 21:13:27 +0900 * build-aux/ltmain.h(libtool_validate_options): Add *os2* to the list. -- http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00007.html From: KO Myung-Hun Subject: [PATCH 3/9] libtool: set lt_prog_compiler_static to -Bstatic on OS/2 Date: Sun, 4 Nov 2012 21:13:28 +0900 * m4/libtool.m4(_LT_COMPILER_PIC): Same as the title. -- http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00008.html From: KO Myung-Hun Subject: [PATCH 4/9] ltdl: OS/2 uses other APIs to load a DLL than LoadLibrary() on Windows Date: Sun, 4 Nov 2012 21:13:29 +0900 *m4/ltdl.m4: Remove os2* from a list for loadlibrary.la. -- http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00009.html From: KO Myung-Hun Subject: [PATCH 5/9] libtool: there is no need to relink DLLs on OS/2 Date: Sun, 4 Nov 2012 21:13:30 +0900 *build-aux/ltmain.in(func_mode_link): Set need_relink to no on OS/2. -- http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00010.html From: KO Myung-Hun Subject: [PATCH 6/9] libtool: set lt_cv_deplibs_check_method to pass_all on OS/2 Date: Sun, 4 Nov 2012 21:13:31 +0900 *m4/libtool.m4(_LT_CHECK_MAGIC_METHOD): Same as the title. -- http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00011.html From: KO Myung-Hun Subject: [PATCH 7/9] libtool: support -Zxxx options used on OS/2 Date: Sun, 4 Nov 2012 21:13:32 +0900 *build-aux/ltmain.in(fund_mode_link): Add -Z* case. -- http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00012.html From: KO Myung-Hun Subject: [PATCH 8/9] libtool: create an import libraries instead of links to the real library on OS/2 Date: Sun, 4 Nov 2012 21:13:33 +0900 Link is not supported on OS/2. *build-aux/ltmain.in(fund_mode_install): Create an import library. (fund_mode_link): Likewise. -- http://lists.gnu.org/archive/html/libtool-patches/2012-11/msg00013.html From: KO Myung-Hun Subject: [PATCH 9/9] libtool: fix a problem that it fails to find proper libraries if .la is a dependency on OS/2 Date: Sun, 4 Nov 2012 21:13:34 +0900 *build-aux/ltmain.in(func_mode_link): Same as the title. diff --git a/NEWS b/NEWS index c8730c7..a372a77 100644 --- a/NEWS +++ b/NEWS @@ -107,6 +107,8 @@ NEWS - list of user-visible changes between releases of GNU Libtool ** Changes in supported systems or compilers: + - Added -shortname option to specify a short name for a DLL (OS/2 only) + - Support for bitrig (*-*-bitrig*). - Solaris 7 and earlier requires ECHO=/usr/ucb/echo in the build diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index f452e54..d768af3 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -497,7 +497,7 @@ libtool_validate_options () test : = "$debug_cmd" || 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=: ;; @@ -1815,6 +1815,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 @@ -2402,8 +2403,17 @@ func_mode_install () # so we also need to try rm && ln -s. for linkname do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + if test "$linkname" != "$realname"; then + case $host_os in + os2*) + # Create import libraries instead of links on OS/2 + func_show_eval "(emximp -o $destdir/$linkname $dir/${linkname%%_dll.$libext}.def)" + ;; + *) + func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + ;; + esac + fi done fi @@ -4873,6 +4883,11 @@ func_mode_link () prev= continue ;; + shortname) + shortname_cmds="$ECHO $arg | cut -b -8" + prev= + continue + ;; shrext) shrext_cmds=$arg prev= @@ -5198,6 +5213,11 @@ func_mode_link () continue ;; + -shortname) + prev=shortname + continue + ;; + -shrext) prev=shrext continue @@ -5312,6 +5332,17 @@ func_mode_link () continue ;; + # OS/2 uses -Zxxx to specify OS/2-specific options + -Z*) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) prev=xcompiler;; + esac + continue + ;; + # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" @@ -5657,33 +5688,66 @@ func_mode_link () # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll=$l - done - if test "X$ll" = "X$old_library"; then # only static version available - found=false - func_dirname "$lib" "" "." - ladir=$func_dirname_result - lib=$ladir/$old_library - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + case $host_os in + os2*) + case " $predeps $postdeps " in + *" $deplib "*) ;; + *) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=false + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue fi - continue fi - fi + ;; + esac ;; - *) ;; - esac + *) + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=false + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + ;; + esac # case $host_os in fi else # deplib doesn't seem to be a libtool library @@ -6138,7 +6202,7 @@ func_mode_link () if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in - *cygwin* | *mingw* | *cegcc*) + *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no @@ -6521,6 +6585,28 @@ func_mode_link () fi fi ;; + *-*-os2*) + depdepl= + deplibrary_names= + if test "$build_old_libs" != yes && test "$link_static" != yes ; then + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + fi + if test -z "$deplibrary_names" ; then + # fall back to static library + eval deplibrary_names=`${SED} -n -e 's/^old_library=\(.*\)$/\1/p' $deplib` + fi + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + compiler_flags="$compiler_flags $depdepl" + linker_flags="$linker_flags $depdepl" + fi + fi + path= + ;; *) path=-L$absdir/$objdir ;; @@ -8030,7 +8116,15 @@ EOF # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + case $host_os in + os2*) + # Create import libraries instead of links on OS/2 + func_show_eval '(emximp -o $output_objdir/$linkname $output_objdir/$libname.def)' 'exit $?' + ;; + *) + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + ;; + esac fi done diff --git a/doc/libtool.texi b/doc/libtool.texi index 05fec92..af031e4 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. +@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/m4/libtool.m4 b/m4/libtool.m4 index ce58f31..da956ed 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2285,6 +2285,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= @@ -2809,9 +2810,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*) @@ -2957,6 +2964,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]]) @@ -3414,6 +3422,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) @@ -4017,6 +4028,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 @@ -4336,6 +4352,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*) @@ -4433,6 +4454,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*) @@ -4899,6 +4925,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 @@ -5517,8 +5553,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*) @@ -6311,6 +6349,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++*) diff --git a/m4/ltdl.m4 b/m4/ltdl.m4 index 7f30925..04729bf 100644 --- a/m4/ltdl.m4 +++ b/m4/ltdl.m4 @@ -706,7 +706,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 <sys/cygwin.h>]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;;
_______________________________________________ https://lists.gnu.org/mailman/listinfo/libtool