[PATCH 9/9] libtool: fix a problem that it fails to find proper libraries if .la is a dependency on OS/2

KO Myung-Hun <[email protected]>
Newsgroups gmane.comp.gnu.libtool.patches
Message-ID <[email protected]>
*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
+		    done
+		    if test -f "$absdir/$objdir/$depdepl" ; then
+		      depdepl="$absdir/$objdir/$depdepl"
+		      compiler_flags="$compiler_flags $depdepl"
+		      linker_flags="$linker_flags $depdepl"
+		    fi
+		  fi
+		  path=
+		  ;;
 		*)
 		  path=-L$absdir/$objdir
 		  ;;
-- 
1.7.3.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.