Re: [PATCH 1/2] libtool: replace : with $PATH_SEPARATOR
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi/2. Mike Frysinger wrote: > On 17 Jan 2024 22:44, KO Myung-Hun wrote: >> Mike Frysinger wrote: >>> On 16 Jan 2024 23:44, KO Myung-Hun wrote: >>>> Some OSes such as OS/2, uses ';' as a path separator. So >>>> using $PATH_SEPARATOR instead of hard-coded ':' is more >>>> proper. >>> >>> so we're on the same page, we're talking about the separator >>> that is used in the $PATH environment variable. it doesn't >>> show up in other places -- it is not used to separate e.g. >>> rpath entries right ? what about LD_LIBRARY_PATH and similar >>> vars ? i guess we assume the separator used by PATH is also >>> used with that var ? >> >> This is applied to all the variables containing a list of paths >> and/or dirs separated by ':' including PATH and LD_LIBRARY_PATH. >> >> If rpath entries is separated by ':', it's also true. > > i'm not familiar with the diff (non-glibc) runtime loaders, so will > take your word for this. afaict, libtool has behaved this way for > a long time, so i'm a bit inclined to wait for 2.4.8 release and > then merge it. This is true for `libtool: Limit a length of DLL name to 8.3 correctly' patch ? - -- KO Myung-Hun Korean OS/2 User Community : https://www.os2.kr/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (OS/2) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFlrlAqE9YstvghgroRAu9lAJ9PNW+i6302JaHF1EJdwflkAaqXCwCfQkBX TD0X3lZjcbypyNfW27XR800= =j071 -END PGP SIGNATURE-
Re: [PATCH 1/2] libtool: replace : with $PATH_SEPARATOR
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike Frysinger wrote: > On 16 Jan 2024 23:44, KO Myung-Hun wrote: >> Some OSes such as OS/2, uses ';' as a path separator. So using >> $PATH_SEPARATOR instead of hard-coded ':' is more proper. > > so we're on the same page, we're talking about the separator that > is used in the $PATH environment variable. it doesn't show up in > other places -- it is not used to separate e.g. rpath entries right > ? what about LD_LIBRARY_PATH and similar vars ? i guess we assume > the separator used by PATH is also used with that var ? This is applied to all the variables containing a list of paths and/or dirs separated by ':' including PATH and LD_LIBRARY_PATH. If rpath entries is separated by ':', it's also true. - -- KO Myung-Hun Korean OS/2 User Community : https://www.os2.kr/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (OS/2) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFlp9m6E9YstvghgroRAqRsAKCpMU2R0Ci96WrlxC4v3MeDSnJBlACgtwJo sb+xmV5nLYLHccbW8uJl4W8= =FtDX -END PGP SIGNATURE-
Re: [PATCH 1/2] libtool: replace : with $PATH_SEPARATOR
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi/2. Mike Frysinger wrote: > On 15 Jan 2024 21:15, KO Myung-Hun wrote: >> Mike Frysinger wrote: >>> On 15 Oct 2023 02:04, KO Myung-Hun wrote: >>>> Some OSes such as OS/2, uses ';' as a path separator. So >>>> using $PATH_SEPARATOR instead of hard-coded ':' is more >>>> proper. >>>> >>>> * build-aux-ltmain.in: replace : with $PATH_SEPARATOR. * >>>> m4/libtool.m4: Likewise. >>> >>> this doesn't work for me >>> >>> 544675d6b538 2024-01-14 18:06:03 -0500 gnulib: update submodule >>> to current versions >>> >>> $ ./bootstrap $ ./configure ... checking for mt... no checking >>> if : is a manifest tool... no ./configure: 1: Syntax error: >>> Unterminated quoted string $ -mike >> >> How about this? > > it passes configure, but fails `make check` & `make syntax-check`. > -mike Another try. - -- KO Myung-Hun Korean OS/2 User Community : https://www.os2.kr/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (OS/2) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFlppZFE9YstvghgroRAjFKAJ0fQTTh4qTJtgRvd/pI2TSeFIf4xgCeNEWF mWoDIYiA2aMRvGaFs3ES9cE= =fXIc -END PGP SIGNATURE- From 11d5ba83c5211ec7e149f3170bbaf7d49e6448da Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Thu, 3 Nov 2022 23:32:37 +0900 Subject: [PATCH v3 1/2] libtool: replace : with $PATH_SEPARATOR Some OSes such as OS/2, uses ';' as a path separator. So using $PATH_SEPARATOR instead of hard-coded ':' is more proper. * Makefile.am (TESTS_ENVIRONMENT): Pass $PATH_SEPARATOR. * build-aux-ltmain.in: Replace : with $PATH_SEPARATOR. * m4/libtool.m4: Likewise. --- Makefile.am | 1 + build-aux/ltmain.in | 76 ++--- m4/libtool.m4 | 16 +- 3 files changed, 47 insertions(+), 46 deletions(-) diff --git a/Makefile.am b/Makefile.am index 904f3d73..d2838ad2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -745,6 +745,7 @@ TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \ F77="$(F77)" FFLAGS="$(FFLAGS)" \ FC="$(FC)" FCFLAGS="$(FCFLAGS)" \ GCJ="$(GCJ)" GCJFLAGS="$(GCJFLAGS)" \ + PATH_SEPARATOR="$(PATH_SEPARATOR)" \ lt_cv_with_aix_soname="$(with_aix_soname)" \ lt_cv_to_host_file_cmd="$(to_host_file_cmd)" \ lt_cv_to_tool_file_cmd="$(to_tool_file_cmd)" diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index d5157a8d..8e596847 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -733,8 +733,8 @@ func_resolve_sysroot () # store the result into func_replace_sysroot_result. func_replace_sysroot () { - case $lt_sysroot:$1 in - ?*:"$lt_sysroot"*) + case $lt_sysroot$PATH_SEPARATOR$1 in + ?*$PATH_SEPARATOR$lt_sysroot*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; @@ -2007,7 +2007,7 @@ func_mode_execute () if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + eval "$shlibpath_var=\"\$dir\$PATH_SEPARATOR\$$shlibpath_var\"" fi done @@ -3579,7 +3579,7 @@ func_exec_program () if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH -PATH=$dllsearchpath:\$PATH +PATH=\"$dllsearchpath$PATH_SEPARATOR\$PATH\" " fi @@ -3591,7 +3591,7 @@ func_exec_program () # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed -$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` +$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/$PATH_SEPARATOR$PATH_SEPARATOR*\$//'\` export $shlibpath_var " @@ -3802,7 +3802,7 @@ EOF fi if test -n "$dllsearchpath"; then - func_to_host_path "$dllsearchpath:" + func_to_host_path "$dllsearchpath$PATH_SEPARATOR" cat <From 59498d6c77255404205aa107d4a907f5068db4d0 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Thu, 12 Oct 2023 15:11:18 +0900 Subject: [PATCH v3 2/2] libtool: Limit a length of DLL name to 8.3 correctly If a length of $release and/or $versionsuffix is more than 8 bytes, a length of DLL name may be more than 8. Then, this corrupts a generated DLL on OS/2. * m4/libtool.m4 (soname_spec) [os2*]: Limit a length of DLL name to 8.3 correctly. --- m4/libtool.m4 |
Re: [PATCH 1/2] libtool: replace : with $PATH_SEPARATOR
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike Frysinger wrote: > On 15 Oct 2023 02:04, KO Myung-Hun wrote: >> Some OSes such as OS/2, uses ';' as a path separator. So using >> $PATH_SEPARATOR instead of hard-coded ':' is more proper. >> >> * build-aux-ltmain.in: replace : with $PATH_SEPARATOR. * >> m4/libtool.m4: Likewise. > > this doesn't work for me > > 544675d6b538 2024-01-14 18:06:03 -0500 gnulib: update submodule to > current versions > > $ ./bootstrap $ ./configure ... checking for mt... no checking if : > is a manifest tool... no ./configure: 1: Syntax error: Unterminated > quoted string $ -mike How about this? - -- KO Myung-Hun Korean OS/2 User Community : https://www.os2.kr/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (OS/2) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFlpSHTE9YstvghgroRAhS0AJoDOLC7CqgIxDOIjauhO3TW0TGvbACghk6m pHAtNYl5XnpC4Pptph8j3sE= =kxUR -END PGP SIGNATURE- From 23812414244882e7a7dbe790de648318643e66e6 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Thu, 3 Nov 2022 23:32:37 +0900 Subject: [PATCH v2] libtool: replace : with $PATH_SEPARATOR Some OSes such as OS/2, uses ';' as a path separator. So using $PATH_SEPARATOR instead of hard-coded ':' is more proper. * build-aux-ltmain.in: replace : with $PATH_SEPARATOR. * m4/libtool.m4: Likewise. --- build-aux/ltmain.in | 76 ++--- m4/libtool.m4 | 16 +- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index d5157a8d..4ad97c40 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -733,8 +733,8 @@ func_resolve_sysroot () # store the result into func_replace_sysroot_result. func_replace_sysroot () { - case $lt_sysroot:$1 in - ?*:"$lt_sysroot"*) + case "$lt_sysroot$PATH_SEPARATOR$1" in + ?*"$PATH_SEPARATOR$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; @@ -2007,7 +2007,7 @@ func_mode_execute () if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + eval "$shlibpath_var=\"\$dir\$PATH_SEPARATOR\$$shlibpath_var\"" fi done @@ -3579,7 +3579,7 @@ func_exec_program () if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH -PATH=$dllsearchpath:\$PATH +PATH=\"$dllsearchpath$PATH_SEPARATOR\$PATH\" " fi @@ -3591,7 +3591,7 @@ func_exec_program () # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed -$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` +$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/$PATH_SEPARATOR$PATH_SEPARATOR*\$//'\` export $shlibpath_var " @@ -3802,7 +3802,7 @@ EOF fi if test -n "$dllsearchpath"; then - func_to_host_path "$dllsearchpath:" + func_to_host_path "$dllsearchpath$PATH_SEPARATOR" cat <
Re: [PATCH 1/2] libtool: replace : with $PATH_SEPARATOR
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi/2. Mike Frysinger wrote: > On 15 Oct 2023 02:04, KO Myung-Hun wrote: >> Some OSes such as OS/2, uses ';' as a path separator. So using >> $PATH_SEPARATOR instead of hard-coded ':' is more proper. >> >> * build-aux-ltmain.in: replace : with $PATH_SEPARATOR. * >> m4/libtool.m4: Likewise. --- build-aux/ltmain.in | 76 >> ++--- m4/libtool.m4 >> | 16 +- 2 files changed, 46 insertions(+), 46 >> deletions(-) > > this seems reasonable, but the size of the patch seems like it > should require copyright papers. have you done those for the > libtool project before ? -mike Sure. I've done already. - -- KO Myung-Hun Korean OS/2 User Community : https://www.os2.kr/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (OS/2) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFlo/ZgE9YstvghgroRAhOPAJ48Ztp2AygDR3trkqpncq2HxFPNBQCfcF4I TRp9xcZ4jlBuvNIfJFZP83s= =E2z2 -END PGP SIGNATURE-
[PATCH 1/2] libtool: replace : with $PATH_SEPARATOR
Some OSes such as OS/2, uses ';' as a path separator. So using $PATH_SEPARATOR instead of hard-coded ':' is more proper. * build-aux-ltmain.in: replace : with $PATH_SEPARATOR. * m4/libtool.m4: Likewise. --- build-aux/ltmain.in | 76 ++--- m4/libtool.m4 | 16 +- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 3b76bd08..cd38be04 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -733,8 +733,8 @@ func_resolve_sysroot () # store the result into func_replace_sysroot_result. func_replace_sysroot () { - case $lt_sysroot:$1 in - ?*:"$lt_sysroot"*) + case "$lt_sysroot$PATH_SEPARATOR$1" in + ?*"$PATH_SEPARATOR$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; @@ -2006,7 +2006,7 @@ func_mode_execute () if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + eval "$shlibpath_var=\"\$dir\$PATH_SEPARATOR\$$shlibpath_var\"" fi done @@ -3578,7 +3578,7 @@ func_exec_program () if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH -PATH=$dllsearchpath:\$PATH +PATH=\"$dllsearchpath$PATH_SEPARATOR\$PATH\" " fi @@ -3590,7 +3590,7 @@ func_exec_program () # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed -$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` +$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/$PATH_SEPARATOR$PATH_SEPARATOR*\$//'\` export $shlibpath_var " @@ -3801,7 +3801,7 @@ EOF fi if test -n "$dllsearchpath"; then - func_to_host_path "$dllsearchpath:" + func_to_host_path "$dllsearchpath$PATH_SEPARATOR" cat <
[PATCH 2/2] libtool: Limit a length of DLL name to 8.3 correctly
If a length of $release and/or $versionsuffix is more than 8 bytes, a length of DLL name may be more than 8. Then, this corrupts a generated DLL on OS/2. * m4/libtool.m4 (soname_spec) [os2*]: Limit a length of DLL name to 8.3 correctly. --- m4/libtool.m4 | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index f63b8406..c2eb0481 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2967,9 +2967,14 @@ os2*) need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; -v=$($ECHO $release$versuffix | tr -d .-); -n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); -$ECHO $n$v`$shared_ext' +n=$($ECHO $libname | tr -d .-); +l=${#n}; test $l -gt 3 && l=3; mr=$((8 - $l)); +r=$($ECHO $release | tr -d .-); +l=${#r}; test $l -gt 2 && l=2; mv=$(($mr - $l)); +v=$($ECHO $versuffix | tr -d .- | cut -b -$mv); +r=$($ECHO $r | cut -b -$(($mr - ${#v}))); +n=$($ECHO $n | cut -b -$((8 - ${#r} - ${#v}))); +$ECHO $n$r$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH -- 2.42.0
[PATCH 0/2] OS/2 patches
Hi/2. These are patches for OS/2. Review, please... [PATCH 1/2] libtool: replace : with $PATH_SEPARATOR [PATCH 2/2] libtool: Limit a length of DLL name to 8.3 correctly
[PATCH] libtool: use $PATH_SEPARATOR instead ':'
On OS/2, a path separator is ';' not ':'. So use $PATH_SEPARATOR. * build-aux/ltmain.in (func_exec_program) [shlibpath_var]: Replace ':' with $PATH_SEPARATOR. (func_mode_link) [shlib_search_path]: Likewise. * m4/libtool.m4 (func_munge_path_list): Likewise. --- build-aux/ltmain.in | 4 ++-- m4/libtool.m4 | 16 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 96b37003..46ddb6d1 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -3587,7 +3587,7 @@ func_exec_program () # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed -$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` +$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/'$PATH_SEPARATOR$PATH_SEPARATOR'*\$//'\` export $shlibpath_var " @@ -5563,7 +5563,7 @@ func_mode_link () if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/$PATH_SEPARATOR/ /g\'\` else shlib_search_path= fi diff --git a/m4/libtool.m4 b/m4/libtool.m4 index f2d1f398..684c2256 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2278,18 +2278,18 @@ func_munge_path_list () case x@S|@2 in x) ;; -*:) -eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" +*$PATH_SEPARATOR) +eval @S|@1=\"`$ECHO @S|@2 | $SED 's/'$PATH_SEPARATOR'/ /g'` \@S|@@S|@1\" ;; -x:*) -eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" +x$PATH_SEPARATOR*) +eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/'$PATH_SEPARATOR'/ /g'`\" ;; -*::*) -eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" -eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" +*$PATH_SEPARATOR$PATH_SEPARATOR*) +eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*'$PATH_SEPARATOR$PATH_SEPARATOR'//' -e 's/'$PATH_SEPARATOR'/ /g'`\" +eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/'$PATH_SEPARATOR$PATH_SEPARATOR'.*//' -e 's/'$PATH_SEPARATOR'/ /g'`\ \@S|@@S|@1\" ;; *) -eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" +eval @S|@1=\"`$ECHO @S|@2 | $SED 's/'$PATH_SEPARATOR'/ /g'`\" ;; esac } -- 2.22.0
Re: [PATCH 2/2] libtool: set file_list_spec to '@' on OS/2
Hi/2. Peter Rosin wrote: > Hi! > > On 2016-02-22 12:21, Pavel Raiskup wrote: >> KO Myung-Hun, thanks for this patch but I need to see a bit deeper >> reasoning for this change as I do not understand the code properly. >> >> As the $file_list_spec is used in libtool under special circumstances, can >> you describe what are the values of important variables (or could you post >> a full libtool output with shell debugging output)? >> >> Maybe other committers can help with the review? > > Stepping up to the plate... > > The first hunk is for gnu ld on os2, and I believe '@' is correct there. > > The second hunk is for the system linker on os2, whatever that is but I > would guess link.exe or something such. If that's true and this link.exe is > compatible with microsoft link.exe, '@' is also correct. Two big ifs though. > I'm not even sure if it is sensible to talk about a system linker on os2, > but it is not gnu ld (it would have been handled by the first hunk in that > case). > All the linker on OS/2 accept '@'. > The third hunk is for everything C++, and maybe libtool only works for > g++ anyway on os2? I don't know, but if that is the case, '@' is ok. > C++ as well. > I don't know if anything but gnu tools ever worked with libtool on os2? > emx tools. ^^ > Cheers, > Peter > >> On Wednesday 16 of December 2015 12:59:17 KO Myung-Hun wrote: >>> Creating and linking reloadable objects sometimes fail. >>> >>> * m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) : >>> Set file_list_spec to '@'. >>> --- >>> m4/libtool.m4 | 3 +++ >>> 1 file changed, 3 insertions(+) >>> >>> diff --git a/m4/libtool.m4 b/m4/libtool.m4 >>> index 2e8c3cf..c01f8fb 100644 >>> --- a/m4/libtool.m4 >>> +++ b/m4/libtool.m4 >>> @@ -5169,6 +5169,7 @@ _LT_EOF >>> emximp -o $lib $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 >>> + _LT_TAGVAR(file_list_spec, $1)='@' >>>;; >>> >>> interix[[3-9]]*) >>> @@ -5874,6 +5875,7 @@ _LT_EOF >>> emximp -o $lib $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 >>> + _LT_TAGVAR(file_list_spec, $1)='@' >>>;; >>> >>> osf3*) >>> @@ -6743,6 +6745,7 @@ if test yes != "$_lt_caught_CXX_error"; then >>> emximp -o $lib $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 >>> + _LT_TAGVAR(file_list_spec, $1)='@' >>> ;; >>> >>>dgux*) >>> >> >> -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
Re: [PATCH 2/2] libtool: set file_list_spec to '@' on OS/2
Hi/2. Pavel Raiskup wrote: > KO Myung-Hun, thanks for this patch but I need to see a bit deeper > reasoning for this change as I do not understand the code properly. > Thanks a lot for your replying. > As the $file_list_spec is used in libtool under special circumstances, can > you describe what are the values of important variables (or could you post > a full libtool output with shell debugging output)? > Hmm... My commit message seems not to be enough. Sorry. $file_list_spec is used if arguments being passed to a linker are too many. That is, the total length of arguments is longer than $max_cmd_len, which is set by LT_CMD_MAX_LEN($lt_cv_sys_max_cmd_len). Without this patch, libtool tries to generate a re-loadable object. However, such a object sometimes fails to being compiled on OS/2. Whereas passing a list of objects to a linker via a response file has no problem. Still not enough ? -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
Re: [PATCH 1/2] edit-readme-alpha: do not edit again a file already edited
Pavel Raiskup wrote: > On Friday 19 of February 2016 15:56:15 KO Myung-Hun wrote: >> Pavel Raiskup wrote: >>> On Tuesday 29 of December 2015 23:55:08 KO Myung-Hun wrote: >>>> Ping ? >>> >>> Thanks, and sorry for the delay. Fixed by 40bc0628d5c8c979 as a part of >>> fix for bug#20196, this double-edit issue is fixed by reverting the order >>> of checks. Please check and comment if there is an issue. >>> >> >> README shipped with libtool 2.4.6 contains only >> >> - >> This is an alpha testing release of [GNU Libtool][libtool], a generic >> library support script. [Libtool][] hides the complexity of using shared >> libraries behind a consistent, portable interface. >> - >> >> However, newly generated README contains all the original contents with >> modified to the above paragraph. >> >> This is expected behavior ? > > That was my intention; and I believe it was the original idea of > edit-readme-alpha (de-duplicate two similar READMEs). > Ok. Then no problem. BTW, if time is permitted, would you mind reviewing this remaining patch as well ? http://lists.gnu.org/archive/html/libtool-patches/2016-01/msg0.html Thanks. -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
Re: [PATCH 1/2] edit-readme-alpha: do not edit again a file already edited
Hi/2. Pavel Raiskup wrote: > On Tuesday 29 of December 2015 23:55:08 KO Myung-Hun wrote: >> Ping ? > > Thanks, and sorry for the delay. Fixed by 40bc0628d5c8c979 as a part of > fix for bug#20196, this double-edit issue is fixed by reverting the order > of checks. Please check and comment if there is an issue. > README shipped with libtool 2.4.6 contains only - This is an alpha testing release of [GNU Libtool][libtool], a generic library support script. [Libtool][] hides the complexity of using shared libraries behind a consistent, portable interface. - However, newly generated README contains all the original contents with modified to the above paragraph. This is expected behavior ? -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
Re: [PATCH 2/2] libtool: set file_list_spec to '@' on OS/2
Ping ? KO Myung-Hun wrote: > Creating and linking reloadable objects sometimes fail. > > * m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) : > Set file_list_spec to '@'. > --- > m4/libtool.m4 | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/m4/libtool.m4 b/m4/libtool.m4 > index 2e8c3cf..c01f8fb 100644 > --- a/m4/libtool.m4 > +++ b/m4/libtool.m4 > @@ -5169,6 +5169,7 @@ _LT_EOF > emximp -o $lib $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 > + _LT_TAGVAR(file_list_spec, $1)='@' >;; > > interix[[3-9]]*) > @@ -5874,6 +5875,7 @@ _LT_EOF > emximp -o $lib $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 > + _LT_TAGVAR(file_list_spec, $1)='@' >;; > > osf3*) > @@ -6743,6 +6745,7 @@ if test yes != "$_lt_caught_CXX_error"; then > emximp -o $lib $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 > + _LT_TAGVAR(file_list_spec, $1)='@' > ;; > >dgux*) -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
Re: [PATCH 1/2] edit-readme-alpha: do not edit again a file already edited
Ping ? KO Myung-Hun wrote: > No need to edit again a file already edited. In addition, if editing > the file, a zero-length file is generated. > > * build-aux-edit-readme-alpha: Skip a file already edited. > --- > build-aux/edit-readme-alpha | 15 +-- > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/build-aux/edit-readme-alpha b/build-aux/edit-readme-alpha > index 4b4d395..4f7c214 100755 > --- a/build-aux/edit-readme-alpha > +++ b/build-aux/edit-readme-alpha > @@ -68,12 +68,15 @@ for file in "$@"; do > |wc -l |sed 's|^ *||'` > ># Unless, of course, it was edited by this script already. > - test 3 = "$matched" \ > - || matched=`sed -n -e '/^This is an alpha testing release/,/a > consistent, portable interface\.$/p' $file \ > - |wc -l |sed 's|^ *||'` > - > - test 3 = "$matched" \ > - || func_fatal_error "$file format has changed, please fix '$0'" > + test 3 = "$matched" || { > +matched=`sed -n -e '/^This is an alpha testing release/,/a consistent, > portable interface\.$/p' $file \ > + |wc -l |sed 's|^ *||'` > + > +# if already edited, no need to edit again. > +test 3 = "$matched" \ > +&& continue \ > +|| func_fatal_error "$file format has changed, please fix '$0'" > + } > ># Don't leave file droppings. >trap 'x=$?; rm $file.T; exit $x' 1 2 13 15 -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
[PATCH 1/2] edit-readme-alpha: do not edit again a file already edited
No need to edit again a file already edited. In addition, if editing the file, a zero-length file is generated. * build-aux-edit-readme-alpha: Skip a file already edited. --- build-aux/edit-readme-alpha | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/build-aux/edit-readme-alpha b/build-aux/edit-readme-alpha index 4b4d395..4f7c214 100755 --- a/build-aux/edit-readme-alpha +++ b/build-aux/edit-readme-alpha @@ -68,12 +68,15 @@ for file in "$@"; do |wc -l |sed 's|^ *||'` # Unless, of course, it was edited by this script already. - test 3 = "$matched" \ - || matched=`sed -n -e '/^This is an alpha testing release/,/a consistent, portable interface\.$/p' $file \ - |wc -l |sed 's|^ *||'` - - test 3 = "$matched" \ - || func_fatal_error "$file format has changed, please fix '$0'" + test 3 = "$matched" || { +matched=`sed -n -e '/^This is an alpha testing release/,/a consistent, portable interface\.$/p' $file \ + |wc -l |sed 's|^ *||'` + +# if already edited, no need to edit again. +test 3 = "$matched" \ +&& continue \ +|| func_fatal_error "$file format has changed, please fix '$0'" + } # Don't leave file droppings. trap 'x=$?; rm $file.T; exit $x' 1 2 13 15 -- 2.6.0
[PATCH 2/2] libtool: set file_list_spec to '@' on OS/2
Creating and linking reloadable objects sometimes fail. * m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) : Set file_list_spec to '@'. --- m4/libtool.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 2e8c3cf..c01f8fb 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -5169,6 +5169,7 @@ _LT_EOF emximp -o $lib $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 + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5874,6 +5875,7 @@ _LT_EOF emximp -o $lib $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 + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6743,6 +6745,7 @@ if test yes != "$_lt_caught_CXX_error"; then emximp -o $lib $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 + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) -- 2.6.0
Re: [PATCH] bootstrap: use $PATH_SEPARATOR instead of :
Hi/2. Gary V. Vaughan wrote: > Hi, > > On Jan 20, 2015, at 5:22 AM, KO Myung-Hun wrote: >> >> On OS/2, a path separator is ';' not ':'. >> >> * bootstrap (func_find_tool, func_check_tool): Use PATH_SEPARATOR. >> * gl/build-aux/bootstrap.in (func_check_tool): Likewise. >> * gl/build-aux/extract-trace (fund_find_tool): Likewise. > > These files do not belong to Libtool itself, but rather to > https://github.com/gvvaughan/bootstrap. Then should I send patches for it to different places ? > We already fixed one of the > PATH_SEPARATOR omissions on your last round of patches (thanks!), but > I ported the other one upstream, and then updated libtool with the > result, including a couple of other unrelated improvements. Thanks. -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
[PATCH] edit-readme-alpha: do not edit again a file already edited
No need to edit again a file already edited. In addition, if editing the file, a zero-length file is generated. * build-aux-edit-readme-alpha: Skip a file already edited. --- build-aux/edit-readme-alpha | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/build-aux/edit-readme-alpha b/build-aux/edit-readme-alpha index 4b4d395..4f7c214 100755 --- a/build-aux/edit-readme-alpha +++ b/build-aux/edit-readme-alpha @@ -68,12 +68,15 @@ for file in "$@"; do |wc -l |sed 's|^ *||'` # Unless, of course, it was edited by this script already. - test 3 = "$matched" \ - || matched=`sed -n -e '/^This is an alpha testing release/,/a consistent, portable interface\.$/p' $file \ - |wc -l |sed 's|^ *||'` - - test 3 = "$matched" \ - || func_fatal_error "$file format has changed, please fix '$0'" + test 3 = "$matched" || { +matched=`sed -n -e '/^This is an alpha testing release/,/a consistent, portable interface\.$/p' $file \ + |wc -l |sed 's|^ *||'` + +# if already edited, no need to edit again. +test 3 = "$matched" \ +&& continue \ +|| func_fatal_error "$file format has changed, please fix '$0'" + } # Don't leave file droppings. trap 'x=$?; rm $file.T; exit $x' 1 2 13 15 -- 1.8.5.2
[PATCH] bootstrap: use $PATH_SEPARATOR instead of :
On OS/2, a path separator is ';' not ':'. * bootstrap (func_find_tool, func_check_tool): Use PATH_SEPARATOR. * gl/build-aux/bootstrap.in (func_check_tool): Likewise. * gl/build-aux/extract-trace (fund_find_tool): Likewise. --- bootstrap | 4 ++-- gl/build-aux/bootstrap.in | 2 +- gl/build-aux/extract-trace | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bootstrap b/bootstrap index f55bedc..83f55cf 100755 --- a/bootstrap +++ b/bootstrap @@ -2308,7 +2308,7 @@ func_find_tool () for _G_prog do _G_find_tool_save_IFS=$IFS - IFS=: + IFS=$PATH_SEPARATOR for _G_dir in $PATH; do IFS=$_G_find_tool_save_IFS _G_progpath=$_G_dir/$_G_prog @@ -4812,7 +4812,7 @@ func_check_tool () ;; *) save_IFS=$IFS - IFS=: + IFS=$PATH_SEPARATOR for _G_check_tool_path in $PATH; do IFS=$save_IFS if test -x "$_G_check_tool_path/$1"; then diff --git a/gl/build-aux/bootstrap.in b/gl/build-aux/bootstrap.in index c6e6dfb..00568a6 100755 --- a/gl/build-aux/bootstrap.in +++ b/gl/build-aux/bootstrap.in @@ -2424,7 +2424,7 @@ func_check_tool () ;; *) save_IFS=$IFS - IFS=: + IFS=$PATH_SEPARATOR for _G_check_tool_path in $PATH; do IFS=$save_IFS if test -x "$_G_check_tool_path/$1"; then diff --git a/gl/build-aux/extract-trace b/gl/build-aux/extract-trace index 2371824..440148b 100755 --- a/gl/build-aux/extract-trace +++ b/gl/build-aux/extract-trace @@ -165,7 +165,7 @@ func_find_tool () for _G_prog do _G_find_tool_save_IFS=$IFS - IFS=: + IFS=$PATH_SEPARATOR for _G_dir in $PATH; do IFS=$_G_find_tool_save_IFS _G_progpath=$_G_dir/$_G_prog -- 1.8.5.2
Re: [PATCH] ltdl: set libltdl_cv_need_uscore to yes on OS/2
Hi/2. Gary V. Vaughan wrote: > Hi, > >> On Nov 27, 2014, at 4:53 AM, KO Myung-Hun wrote: >> Gary V. Vaughan wrote: >>> >>>> On 27 Nov 2014, at 02:47, KO Myung-Hun wrote: >>>> I agree. >>>> >>>> Gary V. Vaughan wrote: >>>>> I pushed the core of a new macro that does exactly that to M4 master just >>>>> now. >>>>> >>>>> Would you let me know whether this works correctly on OS2 for you please? >>>> >>>> Of course. Unfortunately, however, it does not work. dlopen() in >>>> configure fails due to 'file not found'. >>> >>> Thanks for checking. Can you tell me why it fails (module is not compiled >>> correctly; >>> path argument to dlopen() is wrong), and maybe suggest what would fix it, >>> please? >>> >> >> I've look into this problem. Module is not built. To build it, some >> additional variables are required. They are soname, libname, >> output_objdir. And archive_cmds on OS/2 consists of multi lines >> separated by ~. So when using it, quotation is needed. And to eval it >> the function such as func_execute_cmds is needed. In addition, make sure >> .libs exist before building a module. >> >> Finally, please remember that OS/2 does not support DLLs whose base name >> is longer than 8 characters. > > Thanks for the swift and helpful feedback. I pushed some new changes that > should > address all of those issues. Please let me know if anything is still wrong, > and > in what way it is broken for you if so Great!!! It works perfectly. Thanks a lot. > -- otherwise, I'll port this code into a > new libtool macro and make the next libtool release for m4 master to depend > on. > Then, LT_FUNC_DLSYM_USCORE will be fixed ? > I know I have some other issues you reported to work out in M4, but I'd like > to > clear this one up first so I can make the promised libtool release asap. > No problem. > Many thanks for your help! > Thanks for your efforts. ^^ -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
Re: [PATCH] ltdl: set libltdl_cv_need_uscore to yes on OS/2
Hi/2. Gary V. Vaughan wrote: > Hi! > >> On 27 Nov 2014, at 02:47, KO Myung-Hun wrote: >> >> Hi/2. >> >> Gary V. Vaughan wrote: >>> Hi, >>> >>> Thanks for the report and the patch! >>> >>>> On Nov 22, 2014, at 4:08 AM, KO Myung-Hun wrote: >>>> >>>> On OS/2, dlopen() does not support a program. So libltdl_cv_need_uscore >>>> is set to unknown, but dlsym() requires an underscore prefix. So set >>>> libltdl_cv_need_uscore to yes on OS/2 if lt_cv_sys_symbol_underscore is >>>> yes and libltdl_cv_need_uscore is unknown. >>> >>> Actually, I think the real problem here is that LT_FUNC_DLSYM_USCORE is >>> making the bad assumption that dlsym() only requires a leading symbol >>> name underscore on machines where self dlopening works. >>> >>> Better than your suggested patch, we should really be checking whether >>> dlsym of ordinary loadable module symbol names requires a leading >>> underscore. >> >> I agree. >> >>> I pushed the core of a new macro that does exactly that to M4 master just >>> now. >>> >>> Would you let me know whether this works correctly on OS2 for you please? >> >> Of course. Unfortunately, however, it does not work. dlopen() in >> configure fails due to 'file not found'. > > Thanks for checking. Can you tell me why it fails (module is not compiled > correctly; > path argument to dlopen() is wrong), and maybe suggest what would fix it, > please? > I've look into this problem. Module is not built. To build it, some additional variables are required. They are soname, libname, output_objdir. And archive_cmds on OS/2 consists of multi lines separated by ~. So when using it, quotation is needed. And to eval it the function such as func_execute_cmds is needed. In addition, make sure .libs exist before building a module. Finally, please remember that OS/2 does not support DLLs whose base name is longer than 8 characters. Thanks. -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
Re: [PATCH] ltdl: set libltdl_cv_need_uscore to yes on OS/2
Hi/2. Gary V. Vaughan wrote: > Hi, > > Thanks for the report and the patch! > > On Nov 22, 2014, at 4:08 AM, KO Myung-Hun wrote: >> >> On OS/2, dlopen() does not support a program. So libltdl_cv_need_uscore >> is set to unknown, but dlsym() requires an underscore prefix. So set >> libltdl_cv_need_uscore to yes on OS/2 if lt_cv_sys_symbol_underscore is >> yes and libltdl_cv_need_uscore is unknown. > > Actually, I think the real problem here is that LT_FUNC_DLSYM_USCORE is > making the bad assumption that dlsym() only requires a leading symbol > name underscore on machines where self dlopening works. > > Better than your suggested patch, we should really be checking whether > dlsym of ordinary loadable module symbol names requires a leading underscore. I agree. > I pushed the core of a new macro that does exactly that to M4 master just > now. > > Would you let me know whether this works correctly on OS2 for you please? > Of course. Unfortunately, however, it does not work. dlopen() in configure fails due to 'file not found'. -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
[PATCH] ltdl: set libltdl_cv_need_uscore to yes on OS/2
On OS/2, dlopen() does not support a program. So libltdl_cv_need_uscore is set to unknown, but dlsym() requires an underscore prefix. So set libltdl_cv_need_uscore to yes on OS/2 if lt_cv_sys_symbol_underscore is yes and libltdl_cv_need_uscore is unknown. * m4/ltdl.m4 (LT_FUNC_DLSYM_USCORE): set libltdl_cv_need_uscore to yes on os2*. --- m4/ltdl.m4 | 5 + 1 file changed, 5 insertions(+) diff --git a/m4/ltdl.m4 b/m4/ltdl.m4 index eeb37ac..ce7b2b7 100644 --- a/m4/ltdl.m4 +++ b/m4/ltdl.m4 @@ -804,6 +804,11 @@ if test yes = "$lt_cv_sys_symbol_underscore"; then [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], [], [libltdl_cv_need_uscore=cross]) LIBS=$save_LIBS + if test x"$libltdl_cv_need_uscore" = xunknown; then + case $host_os in + os2*) libltdl_cv_need_uscore=yes ;; + esac + fi ]) fi fi -- 1.8.5.2
Re: [PATCH] OS/2 patches
Hi/2. Gary V. Vaughan wrote: > Hi KO, > > Very sorry for the immense delay in getting to this. > Really. It took too a long time, about 4 years. >> On Nov 4, 2014, at 6:12 AM, KO Myung-Hun wrote: >> >> Hi/2. >> >> I've rebased to master. > > Awesome, and thanks for persevering :) > >> Review, please... >> >> [PATCH 01/11] libtool: don't eliminate duplications in $postdeps and >> $predeps on OS/2 > > no effect on systems other than *-os2*, applied > >> [PATCH 02/11] libtool: support to link against static libraries on OS/2 > > same again, applied with minimal edits to pass `make syntax-check` > >> [PATCH 03/11] ltdl: OS/2 uses other APIs to load a DLL than LoadLibrary() on >> Windows > > no effect on systems other than *-os2*, applied > >> [PATCH 04/11] libtool: there is no need to relink DLLs on OS/2 > > same again, reworded commit message > >> [PATCH 05/11] libtool: set lt_cv_deplibs_check_method to pass_all on OS/2 > > likewise > >> [PATCH 06/11] libtool: support -Zxxx options used on OS/2 > > I have some concerns on letting all -Z options through, as this may affect > other > compilers that I can't test, so I made -Z conditional on $host matching os2*. > >> [PATCH 07/11] libtool: fix DLL creation/installation/uninstallation on OS/2 > > no effect an systems other than *-os2* again, applied with light edits to > commit > message, comments and to fix failures with `make syntax-check`. > >> [PATCH 08/11] libtool: add -os2dllname option > > applied with some edits for English, and moving the NEWS entry to the correct > release > >> [PATCH 09/11] libtool: support -export-symbols and -export-symbols-regex on >> OS/2 > > no effect on systems other than *-os2*, applied with edits to pass `make > syntax-check` > >> [PATCH 10/11] libtool: support versioning on OS/2 > > likewise > >> [PATCH 11/11] bootstrap: double quote an expression with a wildcard > > imported to upstream bootstrap repo, and synchronised with libtool > > Please check that everything still works for you as expected, as I don't have > OS/2 > to maintain the integrity of the OS/2 port. > Great. I've confirmed. libtool works without problems. Thanks a lot. ^^ -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
[PATCH 10/11] libtool: support versioning on OS/2
* build-aux/ltmain.in (func_mode_link): Set major and versuffix. * m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): Set version_type to windows. Add a version information to soname_spec. --- build-aux/ltmain.in |2 +- m4/libtool.m4 |7 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 0d90df9..745b94b 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -6254,7 +6254,7 @@ func_mode_link () elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin* | mingw* | *cegcc*) + *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 76bc96c..e62e7b4 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2808,12 +2808,17 @@ openbsd* | bitrig*) os2*) libname_spec='$name' + version_type=windows shrext_cmds=.dll + need_version=no need_lib_prefix=no # 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='`test -n "$os2dllname" && libname="$os2dllname"; $ECHO $libname | cut -b -8 | tr . _`${shared_ext}' + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; +v=$($ECHO ${release}${versuffix} | tr -d .-); +n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); +$ECHO ${n}${v}`${shared_ext}' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH -- 1.7.3.2
[PATCH 08/11] libtool: add -os2dllname option
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-FILEcreate 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
[PATCH 07/11] libtool: fix DLL creation/installation/uninstallation on OS/2
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. And fix install/uninstall process using link which is not supported OS/2. * build-aux/ltmain.in: Do not strip an import lib. * m4/libtool.m4: Set variables to fix DLL creation, installation and uninstallation. --- build-aux/ltmain.in |7 + m4/libtool.m4 | 66 +++--- 2 files changed, 69 insertions(+), 4 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 3851e69..7a53d19 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -2400,6 +2400,13 @@ func_mode_install () ;; esac ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' diff --git a/m4/libtool.m4 b/m4/libtool.m4 index c4d7619..9fc700e 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2810,9 +2810,27 @@ 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. And replace '.' with '_'. + soname_spec='`eval $ECHO $libname | cut -b -8 | tr . _`${shared_ext}' + library_names_spec='${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" + postinstall_cmds='base_file=`basename \$file`~ +dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ +dldir=$destdir/`dirname \$dlpath`~ +test -d \$dldir || mkdir -p \$dldir~ +$install_prog $dir/$dlname \$dldir/$dlname~ +chmod a+x \$dldir/$dlname~ +if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; +fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ +dlpath=$dir/\$dldll~ +$RM \$dlpath' ;; osf3* | osf4* | osf5*) @@ -4960,6 +4978,22 @@ _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 ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA 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 $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $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 @@ -5591,8 +5625,16 @@ _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 ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA 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 $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='
[PATCH 11/11] bootstrap: double quote an expression with a wildcard
This prevents from expansion of a wildcard, and find from failing with the following error. find: paths must precede expression * bootstrap (require_buildreq_patch): Double quote *.diff * gl/build-aux/bootstrap.in (require_buildreq_patch): Likewise. --- bootstrap |2 +- gl/build-aux/bootstrap.in |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap b/bootstrap index 0d9b152..ecd9c66 100755 --- a/bootstrap +++ b/bootstrap @@ -3546,7 +3546,7 @@ func_require_buildreq_patch () # The ugly find invocation is necessary to exit with non-zero # status for old find binaries that don't support -exec fully. if test ! -d "$local_gl_dir" \ - || find "$local_gl_dir" -name *.diff -exec false {} \; ; then : + || find "$local_gl_dir" -name "*.diff" -exec false {} \; ; then : else func_append buildreq 'patch - http://www.gnu.org/s/patch ' diff --git a/gl/build-aux/bootstrap.in b/gl/build-aux/bootstrap.in index bf3ba9b..4be27c1 100755 --- a/gl/build-aux/bootstrap.in +++ b/gl/build-aux/bootstrap.in @@ -1215,7 +1215,7 @@ func_require_buildreq_patch () # The ugly find invocation is necessary to exit with non-zero # status for old find binaries that don't support -exec fully. if test ! -d "$local_gl_dir" \ - || find "$local_gl_dir" -name *.diff -exec false {} \; ; then : + || find "$local_gl_dir" -name "*.diff" -exec false {} \; ; then : else func_append buildreq 'patch - http://www.gnu.org/s/patch ' -- 1.7.3.2
[PATCH 09/11] libtool: support -export-symbols and -export-symbols-regex on OS/2
* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG): Set archive_expsym_cmds. --- m4/libtool.m4 | 36 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 7d58420..76bc96c 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -4990,6 +4990,18 @@ _LT_EOF emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $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 ;; @@ -5633,6 +5645,18 @@ _LT_EOF emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $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 ;; @@ -6439,6 +6463,18 @@ if test yes != "$_lt_caught_CXX_error"; then emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $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 ;; -- 1.7.3.2
[PATCH 05/11] libtool: set lt_cv_deplibs_check_method to pass_all on OS/2
* m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Same as the title. --- m4/libtool.m4 |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index b281341..c4d7619 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -3452,6 +3452,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) -- 1.7.3.2
[PATCH 06/11] libtool: support -Zxxx options used on OS/2
* build-aux/ltmain.in (fund_mode_link): Add -Z* case. --- build-aux/ltmain.in | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index e216611..3851e69 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -5328,6 +5328,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" -- 1.7.3.2
[PATCH 02/11] libtool: support to link against static libraries on OS/2
From: KO Myung-Hun * m4/libtool.m4 (_LT_COMPILER_PIC): Set lt_prog_compiler_static to ${wl}-static. --- m4/libtool.m4 | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 1c6166b..b281341 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -4060,6 +4060,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)='${wl}-static' + ;; + esac ;; darwin* | rhapsody*) # PIC is the default on this platform @@ -4379,6 +4384,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)='${wl}-static' + ;; + esac ;; darwin* | rhapsody*) @@ -4476,6 +4486,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)='${wl}-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) -- 1.7.3.2
[PATCH] OS/2 patches
Hi/2. I've rebased to master. Review, please... [PATCH 01/11] libtool: don't eliminate duplications in $postdeps and $predeps on OS/2 [PATCH 02/11] libtool: support to link against static libraries on OS/2 [PATCH 03/11] ltdl: OS/2 uses other APIs to load a DLL than LoadLibrary() on Windows [PATCH 04/11] libtool: there is no need to relink DLLs on OS/2 [PATCH 05/11] libtool: set lt_cv_deplibs_check_method to pass_all on OS/2 [PATCH 06/11] libtool: support -Zxxx options used on OS/2 [PATCH 07/11] libtool: fix DLL creation/installation/uninstallation on OS/2 [PATCH 08/11] libtool: add -os2dllname option [PATCH 09/11] libtool: support -export-symbols and -export-symbols-regex on OS/2 [PATCH 10/11] libtool: support versioning on OS/2 [PATCH 11/11] bootstrap: double quote an expression with a wildcard
[PATCH 03/11] ltdl: OS/2 uses other APIs to load a DLL than LoadLibrary() on Windows
* m4/ltdl.m4: Remove os2* from a list for loadlibrary.la. --- m4/ltdl.m4 |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/m4/ltdl.m4 b/m4/ltdl.m4 index 7264d19..eeb37ac 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 ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; -- 1.7.3.2
[PATCH 04/11] libtool: there is no need to relink DLLs on OS/2
* build-aux/ltmain.in (func_mode_link): Set need_relink to no on OS/2. --- build-aux/ltmain.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index e9d0877..e216611 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -6154,7 +6154,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 -- 1.7.3.2
[PATCH 01/11] libtool: don't eliminate duplications in $postdeps and $predeps on OS/2
* build-aux/ltmain.h (libtool_validate_options): Add *os2* to the list. --- build-aux/ltmain.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 8b5945b..e9d0877 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -499,7 +499,7 @@ libtool_validate_options () case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2*) + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; -- 1.7.3.2
[PATCH 02/10] libtool: set lt_prog_compiler_static to -Bstatic on OS/2
* m4/libtool.m4 (_LT_COMPILER_PIC): Same as the title. --- m4/libtool.m4 | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 320d8b3..248d423 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -4060,6 +4060,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 @@ -4379,6 +4384,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*) @@ -4476,6 +4486,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
[PATCH 09/10] libtool: support -export-symbols and -export-symbols-regex on OS/2
With splitting very long archive_cmds into multi-lines. * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG): Set archive_expsym_cmds. --- m4/libtool.m4 | 63 ++-- 1 files changed, 60 insertions(+), 3 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index e360efd..b0414be 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -4983,7 +4983,26 @@ _LT_EOF _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=".dll" - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} 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 $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} 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 $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} 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~ + if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cat $export_symbols | $SED -e 1d -e "s/^\(.*\)$/_\1/g" >> $output_objdir/$libname.def; + else + cat $export_symbols | $SED -e "s/^\(.*\)$/_\1/g" >> $output_objdir/$libname.def; + fi~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $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 ;; @@ -5607,7 +5626,26 @@ _LT_EOF _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=".dll" - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} 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 $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} 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 $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} 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~ + if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cat $export_symbols | $SED -e 1d -e "s/^\(.*\)$/_\1/g" >> $output_objdir/$libname.def; + else + cat $export_symbols | $SED -e "s/^\(.*\)$/_\1/g" >> $output_objdir/$libname.def; + fi~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(o
[PATCH 01/10] libtool: don't eliminate duplications in $postdeps and $predeps on OS/2
* build-aux/ltmain.h (libtool_validate_options): Add *os2* to the list. --- build-aux/ltmain.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 65b5a2d..58e2e34 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -499,7 +499,7 @@ libtool_validate_options () case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2*) + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; -- 1.7.3.2
[PATCH 07/10] libtool: fix DLL creation/installation/uninstallation on OS/2
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. And fix install/uninstall process using link which is not supported OS/2. * build-aux/ltmain.in: Do not strip an import lib. * m4/libtool.m4: Set variables to fix DLL creation, installation and uninstallation. --- build-aux/ltmain.in |7 +++ m4/libtool.m4 | 48 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 5829cf2..86b42dd 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -2400,6 +2400,13 @@ func_mode_install () ;; esac ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 0713c29..e360efd 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2810,9 +2810,27 @@ 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. And replace '.' with '_'. + soname_spec='`eval $ECHO $libname | cut -b -8 | tr . _`${shared_ext}' + library_names_spec='${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" + postinstall_cmds='base_file=`basename \$file`~ +dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ +dldir=$destdir/`dirname \$dlpath`~ +test -d \$dldir || mkdir -p \$dldir~ +$install_prog $dir/$dlname \$dldir/$dlname~ +chmod a+x \$dldir/$dlname~ +if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; +fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ +dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) @@ -4960,6 +4978,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 ${soname%$shared_ext} 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 $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~emximp -o $lib $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 @@ -5578,8 +5606,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 ${soname%$shared_ext} 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 $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_ob
[PATCH 03/10] ltdl: OS/2 uses other APIs to load a DLL than LoadLibrary() on Windows
* m4/ltdl.m4: Remove os2* from a list for loadlibrary.la. --- m4/ltdl.m4 |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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 ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; -- 1.7.3.2
[PATCH 10/10] libtool: support versioning on OS/2
* build-aux/ltmain.in (func_mode_link): Append major to soname_spec. Set major and versuffix. * m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): Set version_type to windows. Append major to soname_spec. --- build-aux/ltmain.in |4 ++-- m4/libtool.m4 |4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 39b1b53..3a1d720 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -4865,7 +4865,7 @@ func_mode_link () continue ;; os2dllname) - soname_spec="\`eval \$ECHO $arg | cut -b -8 | tr . _\`\${shared_ext}" + soname_spec="\`eval \$ECHO $arg | cut -b -\$((8 - \${#major})) | tr . _\`\${major}\${shared_ext}" prev= continue ;; @@ -6252,7 +6252,7 @@ func_mode_link () elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin* | mingw* | *cegcc*) + *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major diff --git a/m4/libtool.m4 b/m4/libtool.m4 index b0414be..dcb0e86 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2808,12 +2808,14 @@ openbsd* | bitrig*) os2*) libname_spec='$name' + version_type=windows shrext_cmds=.dll + need_version=no need_lib_prefix=no # 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='`eval $ECHO $libname | cut -b -$((8 - ${#major})) | tr . _`${major}${shared_ext}' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH -- 1.7.3.2
[PATCH 08/10] libtool: add -os2dllname option
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 | 11 +++ doc/libtool.texi|4 3 files changed, 17 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index 1ca6d65..b2479db 100644 --- a/NEWS +++ b/NEWS @@ -34,6 +34,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 86b42dd..39b1b53 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-FILEcreate 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 @@ -4863,6 +4864,11 @@ func_mode_link () prev= continue ;; + os2dllname) + soname_spec="\`eval \$ECHO $arg | cut -b -8 | tr . _\`\${shared_ext}" + prev= + continue + ;; precious_regex) precious_files_regex=$arg prev= @@ -5172,6 +5178,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?$} -- 1.7.3.2
[PATCH 05/10] libtool: set lt_cv_deplibs_check_method to pass_all on OS/2
* m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Same as the title. --- m4/libtool.m4 |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 248d423..0713c29 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -3452,6 +3452,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) -- 1.7.3.2
[PATCH 06/10] libtool: support -Zxxx options used on OS/2
* build-aux/ltmain.in (fund_mode_link): Add -Z* case. --- build-aux/ltmain.in | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index ed92684..5829cf2 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -5327,6 +5327,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" -- 1.7.3.2
[PATCH] OS/2 patches, retry
Hi/2. These are the patches for OS/2. And these are more cleaned up and enhanced than before. Review, please...
[PATCH 04/10] libtool: there is no need to relink DLLs on OS/2
* build-aux/ltmain.in (func_mode_link): Set need_relink to no on OS/2. --- build-aux/ltmain.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 58e2e34..ed92684 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -6153,7 +6153,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 -- 1.7.3.2
[PATCH] bootstrap: double quote an expression with a wildcard
This prevents from expansion of a wildcard, and find from failing with the following error. find: paths must precede expression * bootstrap (require_buildreq_patch): Double quote *.diff * gl/build-aux/bootstrap.in (require_buildreq_patch): Likewise. --- bootstrap |2 +- gl/build-aux/bootstrap.in |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap b/bootstrap index eecab2c..9cbe2fc 100755 --- a/bootstrap +++ b/bootstrap @@ -3546,7 +3546,7 @@ func_require_buildreq_patch () # The ugly find invocation is necessary to exit with non-zero # status for old find binaries that don't support -exec fully. if test ! -d "$local_gl_dir" \ - || find "$local_gl_dir" -name *.diff -exec false {} \; ; then : + || find "$local_gl_dir" -name "*.diff" -exec false {} \; ; then : else func_append buildreq 'patch - http://www.gnu.org/s/patch ' diff --git a/gl/build-aux/bootstrap.in b/gl/build-aux/bootstrap.in index 266eb20..4d0cabe 100755 --- a/gl/build-aux/bootstrap.in +++ b/gl/build-aux/bootstrap.in @@ -1215,7 +1215,7 @@ func_require_buildreq_patch () # The ugly find invocation is necessary to exit with non-zero # status for old find binaries that don't support -exec fully. if test ! -d "$local_gl_dir" \ - || find "$local_gl_dir" -name *.diff -exec false {} \; ; then : + || find "$local_gl_dir" -name "*.diff" -exec false {} \; ; then : else func_append buildreq 'patch - http://www.gnu.org/s/patch ' -- 1.7.3.2
[PATCH 4/8] ltdl: OS/2 uses other APIs to load a DLL than LoadLibrary() on Windows
* m4/ltdl.m4: Remove os2* from a list for loadlibrary.la. --- m4/ltdl.m4 |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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 ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; -- 1.7.3.2
[PATCH 7/8] libtool: support -Zxxx options used on OS/2
* build-aux/ltmain.in (fund_mode_link): Add -Z* case. --- build-aux/ltmain.in | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 48ae7fa..62c3564 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -5338,6 +5338,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" -- 1.7.3.2
[PATCH 3/8] libtool: set lt_prog_compiler_static to -Bstatic on OS/2
* m4/libtool.m4 (_LT_COMPILER_PIC): Same as the title. --- m4/libtool.m4 | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index da29e57..f54c882 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -4068,6 +4068,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 @@ -4387,6 +4392,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*) @@ -4484,6 +4494,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
[PATCH 8/8] libtool: create an import libraries instead of links to the real library on OS/2
Link is not supported on OS/2. * build-aux/ltmain.in (fund_mode_install): Create an import library. (fund_mode_link): Likewise. --- build-aux/ltmain.in | 23 --- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 62c3564..6af7dac 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -2413,8 +2413,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 @@ -8067,7 +8076,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 -- 1.7.3.2
[PATCH 5/8] libtool: there is no need to relink DLLs on OS/2
* build-aux/ltmain.in (func_mode_link): Set need_relink to no on OS/2. --- build-aux/ltmain.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index cf72c66..48ae7fa 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -6164,7 +6164,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 -- 1.7.3.2
[PATCH 6/8] libtool: set lt_cv_deplibs_check_method to pass_all on OS/2
* m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Same as the title. --- m4/libtool.m4 |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index f54c882..98da38c 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -3460,6 +3460,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) -- 1.7.3.2
[PATCH] OS/2 patches
Hi/2. I attach OS/2 patches. Review, please.
[PATCH 1/8] libtool: add -os2dllname 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 OS/2 DLL name shorter than 8 characters is needed. As well as, OS/2 does not allow OS/2 DLL name to contain '.'. * 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. * m4/libtool.m4: Introduce os2dllname_cmds for -os2dllname. --- NEWS|2 ++ build-aux/ltmain.in | 11 +++ doc/libtool.texi|4 m4/libtool.m4 | 38 ++ 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 1ca6d65..b2479db 100644 --- a/NEWS +++ b/NEWS @@ -34,6 +34,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 65b5a2d..0dea055 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-FILEcreate 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 @@ -4856,6 +4857,11 @@ func_mode_link () prev= continue ;; + os2dllname) + os2dllname_cmds="$ECHO $arg | cut -b -8 | tr . _" + prev= + continue + ;; precious_regex) precious_files_regex=$arg prev= @@ -5165,6 +5171,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 320d8b3..da29e57 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2286,6 +2286,7 @@ BEGIN {RS = " "; FS = "/|\n";} { else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) +os2dllname_cmds= library_names_spec= libname_spec='lib$name' soname_spec= @@ -2810,9 +2811,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. And replace '.' with '_'. + os2dllname_cmds='$ECHO $libname | cut -b -8 | tr . _' + library_names_spec='`eval $os2dllname_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*) @@ -2958,6 +2965,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([], [os2dllname_cmds], [2], [Command to make a OS/2 DLL 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]]) @@ -4942,6 +4950,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 $os2dllname_cmds` INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DA
[PATCH 2/8] libtool: don't eliminate duplications in $postdeps and $predeps on OS/2
* build-aux/ltmain.h (libtool_validate_options): Add *os2* to the list. --- build-aux/ltmain.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 0dea055..cf72c66 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -499,7 +499,7 @@ libtool_validate_options () case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2*) + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; -- 1.7.3.2
[PATCH 9/9] libtool: fix a problem that it fails to find proper libraries if .la is a dependency on OS/2
*build-aux/ltmain.in(func_mode_link): Same as the title. --- build-aux/ltmain.in | 103 +++ 1 files changed, 79 insertions(+), 24 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index bf989d7..7de3676 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -5637,33 +5637,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 @@ -6501,6 +6534,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 + don
[PATCH 8/9] libtool: create an import libraries instead of links to the real library on OS/2
Link is not supported on OS/2. *build-aux/ltmain.in(fund_mode_install): Create an import library. (fund_mode_link): Likewise. --- build-aux/ltmain.in | 23 --- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 3fcaed5..bf989d7 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -2385,8 +2385,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 @@ -7997,7 +8006,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 -- 1.7.3.2
[PATCH 7/9] libtool: support -Zxxx options used on OS/2
*build-aux/ltmain.in(fund_mode_link): Add -Z* case. --- build-aux/ltmain.in | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 10396a7..3fcaed5 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -5272,6 +5272,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" -- 1.7.3.2
[PATCH 6/9] libtool: set lt_cv_deplibs_check_method to pass_all on OS/2
*m4/libtool.m4(_LT_CHECK_MAGIC_METHOD): Same as the title. --- m4/libtool.m4 |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 3d36d5d..3a80989 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -3345,6 +3345,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) -- 1.7.3.2
[PATCH 5/9] libtool: there is no need to relink DLLs on OS/2
*build-aux/ltmain.in(func_mode_link): Set need_relink to no on OS/2. --- build-aux/ltmain.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index ede32eb..10396a7 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -6098,7 +6098,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 -- 1.7.3.2
[PATCH 4/9] ltdl: OS/2 uses other APIs to load a DLL than LoadLibrary() on Windows
*m4/ltdl.m4: Remove os2* from a list for loadlibrary.la. --- m4/ltdl.m4 |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/m4/ltdl.m4 b/m4/ltdl.m4 index b129716..28beadb 100644 --- a/m4/ltdl.m4 +++ b/m4/ltdl.m4 @@ -703,7 +703,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
[PATCH 3/9] libtool: set lt_prog_compiler_static to -Bstatic on OS/2
* m4/libtool.m4(_LT_COMPILER_PIC): Same as the title. --- m4/libtool.m4 | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index f269fc4..3d36d5d 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -3901,6 +3901,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 @@ -4220,6 +4225,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*) @@ -4317,6 +4327,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
[PATCH 2/9] libtool: don't eliminate duplications in $postdeps and $predeps on OS/2
* build-aux/ltmain.h(libtool_validate_options): Add *os2* to the list. --- build-aux/ltmain.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 4e53936..ede32eb 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=: ;; -- 1.7.3.2
[PATCH 1/9] libtool: 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: 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. --- NEWS|2 ++ build-aux/ltmain.in | 11 +++ doc/libtool.texi|4 m4/libtool.m4 | 38 ++ 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 081e82f..33beb68 100644 --- a/NEWS +++ b/NEWS @@ -98,6 +98,8 @@ New in 2.4.2 2011-10-17: git version 2.4.1a, Libtool team: 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. - On Mac OS X .dylib is now tried as well as .so with diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 6151ee9..4e53936 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -1797,6 +1797,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 @@ -4827,6 +4828,11 @@ func_mode_link () prev= continue ;; + shortname) + shortname_cmds="$ECHO $arg | cut -b -8" + prev= + continue + ;; shrext) shrext_cmds=$arg prev= @@ -5147,6 +5153,11 @@ func_mode_link () continue ;; + -shortname) + prev=shortname + continue + ;; + -shrext) prev=shrext continue diff --git a/doc/libtool.texi b/doc/libtool.texi index 57b5485..14082ba 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 37f7d7c..f269fc4 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2228,6 +2228,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= @@ -2732,9 +2733,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*) @@ -2880,6 +2887,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]]) @@ -4769,6 +4777,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" >>
[PATCH] OS/2 patches
Hi/2. These are the patches for OS/2. Review, please.
[PATCH 10/10] Fix a problem that it fails to find proper libraries if .la is a dependency on OS/2
--- build-aux/ltmain.m4sh | 103 +--- 1 files changed, 79 insertions(+), 24 deletions(-) diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh index 690b44b..c721be2 100644 --- a/build-aux/ltmain.m4sh +++ b/build-aux/ltmain.m4sh @@ -5479,33 +5479,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 @@ -6343,6 +6376,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
[PATCH 09/10] Create import libraries instead of links to the real library on OS/2
--- build-aux/ltmain.m4sh | 23 --- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh index 8cae2c3..690b44b 100644 --- a/build-aux/ltmain.m4sh +++ b/build-aux/ltmain.m4sh @@ -2240,8 +2240,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 @@ -7839,7 +7848,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 -- 1.7.3.2
[PATCH 08/10] Support -Zxxx options used on OS/2
--- build-aux/ltmain.m4sh | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh index 5ec111d..8cae2c3 100644 --- a/build-aux/ltmain.m4sh +++ b/build-aux/ltmain.m4sh @@ -5114,6 +5114,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" -- 1.7.3.2
[PATCH 07/10] Set lt_cv_deplibs_check_method to pass_all on OS/2
--- m4/libtool.m4 |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 10bfb81..998ee9d 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -3373,6 +3373,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) -- 1.7.3.2
[PATCH 06/10] There is no need to relink DLLs on OS/2
--- build-aux/ltmain.m4sh |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh index c3b02e6..5ec111d 100644 --- a/build-aux/ltmain.m4sh +++ b/build-aux/ltmain.m4sh @@ -5940,7 +5940,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 -- 1.7.3.2
[PATCH 04/10] OS/2 uses other APIs to load a DLL than LoadLibrary() on Windows.
--- m4/ltdl.m4 |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/m4/ltdl.m4 b/m4/ltdl.m4 index 6cb5727..7987c05 100644 --- a/m4/ltdl.m4 +++ b/m4/ltdl.m4 @@ -703,7 +703,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
[PATCH 05/10] OS/2 uses ld inherited from GNU ld
--- m4/libtool.m4 |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 94bddcb..10bfb81 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -4674,6 +4674,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
[PATCH 03/10] Set lt_prog_compiler_static to -Bstatic on OS/2
--- m4/libtool.m4 | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index a8c43c0..94bddcb 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -3923,6 +3923,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 @@ -4241,6 +4246,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*) @@ -4338,6 +4348,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
[PATCH 02/10] Don't eliminate duplications in $postdeps and $predeps on OS/2
--- build-aux/ltmain.m4sh |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh index 7017dc6..c3b02e6 100644 --- a/build-aux/ltmain.m4sh +++ b/build-aux/ltmain.m4sh @@ -384,7 +384,7 @@ M4SH_GETOPTS( 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=: ;; -- 1.7.3.2
[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 + 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 SUFFIXoverride 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. +@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 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_flag
[PATCH] OS/2 supports
Hi/2. I attach the patches for OS/2 supports. Review, please.
[PATCH 10/10] Fix a problem that it fails to find proper libraries if .la is a dependency on OS/2
--- libltdl/config/ltmain.m4sh | 103 +-- 1 files changed, 79 insertions(+), 24 deletions(-) diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 9052a9d..19b816a 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -5457,33 +5457,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 "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 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=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && 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=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && 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=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + ;; + esac # case $host_os in fi fi ;; # -l @@ -6313,6 +6346,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" ; the
[PATCH 09/10] Create import libraries instead of links to the real library on OS/2
--- libltdl/config/ltmain.m4sh | 23 --- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 3619343..9052a9d 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -,8 +,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 @@ -7799,7 +7808,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 -- 1.7.3.2
[PATCH 08/10] Support -Zxxx options used on OS/2
--- libltdl/config/ltmain.m4sh | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 03a4add..3619343 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -5083,6 +5083,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" -- 1.7.3.2
[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 2361831..9f0e5d7 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -4656,6 +4656,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
[PATCH 07/10] Set lt_cv_deplibs_check_method to pass_all on OS/2
--- 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 9f0e5d7..0dc1055 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -3369,6 +3369,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) -- 1.7.3.2
[PATCH 06/10] There is no need to relink DLLs 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 12e653f..03a4add 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -5910,7 +5910,7 @@ func_mode_link () if test -n "$library_names" && { test "$use_static_libs" = no || 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 -- 1.7.3.2
[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 c2814de..2361831 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -3919,6 +3919,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 @@ -4237,6 +4242,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*) @@ -4320,6 +4330,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
[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 ea76f4d..76f9919 100644 --- a/libltdl/m4/ltdl.m4 +++ b/libltdl/m4/ltdl.m4 @@ -703,7 +703,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
[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 371a973..12e653f 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
[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 90d14b7..566eeb1 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 72bb0fc..2e4c88d 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 9358ec5..371a973 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 @@ -4639,6 +4640,11 @@ func_mode_link () prev= continue ;; + shortname) + shortname_cmds="$ECHO $arg | cut -b -8" + prev= + continue + ;; shrext) shrext_cmds="$arg" prev= @@ -4959,6 +4965,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 2ed41b7..c2814de 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -2225,6 +2225,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= @@ -2751,9 +2752,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*) @@ -2899,6 +2906,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]]) @@ -4772,6 +4780,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/$
[PATCH 00/10] Enhanced OS/2 ports
Hi/2. I attach the enhanced OS/2 ports. Review, please. [PATCH 01/10] Add -shortname option. [PATCH 02/10] Don't eliminate duplications in $postdeps and $predeps on OS/2 [PATCH 03/10] Set lt_prog_compiler_static to -Bstatic on OS/2 [PATCH 04/10] OS/2 uses other APIs to load a DLL than LoadLibrary() on Windows. [PATCH 05/10] OS/2 uses ld inherited from GNU ld [PATCH 06/10] There is no need to relink DLLs on OS/2 [PATCH 07/10] Set lt_cv_deplibs_check_method to pass_all on OS/2 [PATCH 08/10] Support -Zxxx options used on OS/2 [PATCH 09/10] Create import libraries instead of links to the real library on OS/2 [PATCH 10/10] Fix a problem that it fails to find proper libraries if .la is a dependency
[PATCH 10/10] Fix a problem that it fails to find proper libraries if .la is a dependency on OS/2
--- libltdl/config/ltmain.m4sh | 103 +-- 1 files changed, 79 insertions(+), 24 deletions(-) diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 9052a9d..19b816a 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -5457,33 +5457,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 "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 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=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && 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=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && 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=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + ;; + esac # case $host_os in fi fi ;; # -l @@ -6313,6 +6346,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" ; the
[PATCH 09/10] Create import libraries instead of links to the real library on OS/2
--- libltdl/config/ltmain.m4sh | 23 --- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 3619343..9052a9d 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -,8 +,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 @@ -7799,7 +7808,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 -- 1.7.3.2
[PATCH 08/10] Support -Zxxx options used on OS/2
--- libltdl/config/ltmain.m4sh | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 03a4add..3619343 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -5083,6 +5083,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" -- 1.7.3.2
[PATCH 07/10] Set lt_cv_deplibs_check_method to pass_all on OS/2
--- 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 9f0e5d7..0dc1055 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -3369,6 +3369,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) -- 1.7.3.2
[PATCH 06/10] There is no need to relink DLLs 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 12e653f..03a4add 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -5910,7 +5910,7 @@ func_mode_link () if test -n "$library_names" && { test "$use_static_libs" = no || 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 -- 1.7.3.2
[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 2361831..9f0e5d7 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -4656,6 +4656,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
[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 ea76f4d..76f9919 100644 --- a/libltdl/m4/ltdl.m4 +++ b/libltdl/m4/ltdl.m4 @@ -703,7 +703,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
[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 c2814de..2361831 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -3919,6 +3919,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 @@ -4237,6 +4242,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*) @@ -4320,6 +4330,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
[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 371a973..12e653f 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
[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 90d14b7..566eeb1 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 72bb0fc..2e4c88d 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 9358ec5..371a973 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 @@ -4639,6 +4640,11 @@ func_mode_link () prev= continue ;; + shortname) + shortname_cmds="$ECHO $arg | cut -b -8" + prev= + continue + ;; shrext) shrext_cmds="$arg" prev= @@ -4959,6 +4965,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 2ed41b7..c2814de 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -2225,6 +2225,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= @@ -2751,9 +2752,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*) @@ -2899,6 +2906,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]]) @@ -4772,6 +4780,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/$