]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltconfig.in: Oops, replace the remaining $objdir's
authorThomas Tanner <tanner@ffii.org>
Thu, 27 Jan 2000 20:33:40 +0000 (20:33 +0000)
committerThomas Tanner <tanner@gmx.de>
Thu, 27 Jan 2000 20:33:40 +0000 (20:33 +0000)
* ltmain.in: merge library linking code of programs and libraries,
  some cleanups

ChangeLog
ltconfig.in
ltmain.in

index f02de1b4e0ec604ec703a71d75b768f4b599f189..c85b7c4a67a528cd0cf75bba24942e32d3cc0f19 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-01-27  Thomas Tanner  <tanner@ffii.org>
+
+       * ltconfig.in: Oops, replace the remaining $objdir's
+       
+       * ltmain.in: merge library linking code of programs and libraries,
+         some cleanups
+
 2000-01-27  Gary V. Vaughan  <gary@oranda.demon.co.uk>
 
        * NEWS: Updated.
index b94efbff229a9cfb5fb1a7f9d7b581c46c9636fa..6d356c72238cb9d2b0b6773225e0c456cf1e16a9 100755 (executable)
@@ -1264,9 +1264,9 @@ else
 
   irix5* | irix6*)
     if test "$with_gcc" = yes; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
     else
-      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
     fi
     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
     hardcode_libdir_separator=:
@@ -1302,10 +1302,10 @@ else
   osf3*)
     if test "$with_gcc" = yes; then
       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
     else
       allow_undefined_flag=' -expect_unresolved \*'
-      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
     fi
     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
     hardcode_libdir_separator=:
@@ -1314,10 +1314,10 @@ else
   osf4* | osf5*)       # as osf3* with the addition of -msym flag
     if test "$with_gcc" = yes; then
       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
     else
       allow_undefined_flag=' -expect_unresolved \*'
-      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
     fi
     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
     hardcode_libdir_separator=:
index bead245162f7d1f7238d4fc97fd6c3b9ef64f891..b7e2e3a823777c423d904241bc3207f581a44e54 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -1433,16 +1433,10 @@ compiler."
            continue
          fi
          ;;
+       *.la) lib="$deplib" ;;
        *.a | *.lib)
-         if test $linkmode = prog; then
-           if test $pass = scan; then
-             deplibs="$deplibs $deplib"
-           else
-             compile_command="$compile_command $deplib"
-             finalize_command="$finalize_command $deplib"
-           fi
-           continue
-         elif test $linkmode = lib; then
+         case $linkmode in
+         lib)
            if test "$deplibs_check_method" != pass_all; then
              echo
              echo "*** Warning: This library needs some functionality provided by $deplib."
@@ -1456,15 +1450,22 @@ compiler."
              deplibs="$deplibs $deplib"
            fi
            continue
-         fi
+           ;;
+         prog)
+           if test $pass = scan; then
+             deplibs="$deplibs $deplib"
+           else
+             compile_command="$compile_command $deplib"
+             finalize_command="$finalize_command $deplib"
+           fi
+           continue
+           ;;
+         esac
          ;;
        %DEPLIBS%)
          alldeplibs=yes
          continue
          ;;
-       *)
-         lib="$deplib"
-         ;;
        esac
        if test $found = yes || test -f "$lib"; then :
        else
@@ -1525,22 +1526,22 @@ compiler."
          new_lib_search_path="$new_lib_search_path $ladir"
          deplibs="$deplibs $lib"
 
+         linkalldeplibs=no
+         if test "$link_all_deplibs" != no || test "$fast_install" != no || \
+            test "$build_libtool_libs" = no || test -z "$library_names"; then
+           linkalldeplibs=yes
+         else
+           # Need to hardcode shared library paths
+           # or/and link against static libraries
+           newdependency_libs="$newdependency_libs $dependeny_libs"
+         fi
+
          for deplib in $dependency_libs; do
            case "$deplib" in
            -L*) new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
            esac
-
-           if test "$link_all_deplibs" != no || \
-              test "$fast_install" != no || \
-              test "$build_libtool_libs" = no || \
-              test -z "$library_names"; then
-             # Need to link against all dependency_libs
-             deplibs="$deplibs $deplib"
-           else
-             # Need to hardcode shared library paths
-             # or/and link against static libraries
-             newdependency_libs="$newdependency_libs $deplib"
-           fi
+            # Need to link against all dependency_libs?
+           test $linkalldeplibs = yes && deplibs="$deplibs $deplib"
          done
          continue
        fi
@@ -1580,10 +1581,10 @@ compiler."
 
        if test -z "$libdir"; then
          # It is a libtool convenience library, so add in its objects.
-         convenience="$convenience $ladir/$objdir/$old_library"
-         old_convenience="$old_convenience $ladir/$objdir/$old_library"
+         convenience="$convenience $dir/$old_library"
+         old_convenience="$old_convenience $dir/$old_library"
          if test $linkmode = lib; then
-           deplibs="$deplibs $ladir/$objdir/$old_library"
+           deplibs="$deplibs $dir/$old_library"
            newdependency_libs="$newdependency_libs $dependency_libs"
          elif test "$linkmode,$pass" = "prog,link"; then
            compile_command="$compile_command $dir/$old_library"
@@ -1593,9 +1594,8 @@ compiler."
        fi
 
        if test "$linkmode,$pass" = "prog,link"; then
-         hardcode=yes
-         test "$hardcode_into_libs" = all && test "$alldeplibs" = yes && hardcode=no
-         if test "$hardcode" = yes && test -n "$library_names" &&
+         if test -n "$library_names" &&
+            { test "$hardcode_into_libs" != all || test "$alldeplibs" != yes; } &&
             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
            # We need to hardcode the library path
            if test -n "$shlibpath_var"; then
@@ -1716,39 +1716,37 @@ compiler."
            linklib=$newlib
          fi
 
-         if test $linkmode = lib; then
-
-         add_dir=
-         add_shlibpath=
-         add_name=no
-         if test "$mode" != relink; then
+         if test $linkmode = prog || test "$mode" != relink; then
+           add_shlibpath=
+           add_dir=
+           add=
            lib_linked=yes
            case "$hardcode_action" in
            immediate | unsupported)
              if test "$hardcode_direct" = no; then
-               deplibs="$deplibs $dir/$linklib"
+               add="$dir/$linklib"
              elif test "$hardcode_minus_L" = no; then
                case "$host" in
                *-*-sunos*) add_shlibpath="$dir" ;;
                esac
                add_dir="-L$dir"
-               add_name=yes
+               add="-l$name"
              elif test "$hardcode_shlibpath_var" = no; then
                add_shlibpath="$dir"
-               add_name=yes
+               add="-l$name"
              else
                lib_linked=no
              fi
              ;;
            relink)
              if test "$hardcode_direct" = yes; then
-               deplibs="$deplibs $dir/$linklib"
+               add="$dir/$linklib"
              elif test "$hardcode_minus_L" = yes; then
                add_dir="-L$dir"
-               add_name=yes
+               add="-l$name"
              elif test "$hardcode_shlibpath_var" = yes; then
                add_shlibpath="$dir"
-               add_name=yes
+               add="-l$name"
              else
                lib_linked=no
              fi
@@ -1767,123 +1765,72 @@ compiler."
              *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
              esac
            fi
-         else
-           # Install command for both is simple: just hardcode it.
+           if test $linkmode = prog; then
+             if test -n "$add_dir"; then
+               case "$compile_command " in
+               *" $add_dir "*) ;;
+               *) compile_command="$compile_command $add_dir" ;;
+               esac
+             fi
+             test -n "$add" && compile_command="$compile_command $add"
+           else
+             if test -n "$add_dir"; then
+               case "$deplibs " in
+               *" $add_dir "*) ;;
+               *) deplibs="$deplibs $add_dir" ;;
+               esac
+             fi
+             test -n "$add" && deplibs="$deplibs $add"
+             if test "$hardcode_direct" != yes && \
+                test "$hardcode_minus_L" != yes && \
+                test "$hardcode_shlibpath_var" = yes; then
+                 case ":$finalize_shlibpath:" in
+                 *":$libdir:"*) ;;
+                 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+                 esac
+             fi
+           fi
+         fi
+
+         if test $linkmode = prog || test "$mode" = relink; then
+           add_shlibpath=
+           add_dir=
+           add=
+           # Finalize command for both is simple: just hardcode it.
            if test "$hardcode_direct" = yes; then
-             deplibs="$deplibs $libdir/$linklib"
+             add="$libdir/$linklib"
            elif test "$hardcode_minus_L" = yes; then
              add_dir="-L$libdir"
-             add_name=yes
+             add="-l$name"
            elif test "$hardcode_shlibpath_var" = yes; then
-             add_name=yes
-           else
-             # We cannot seem to hardcode it, guess we'll fake it.
-             add_dir="-L$libdir"
-             add_name=yes
-           fi
-         fi
-         if test "$hardcode_direct" != yes && \
-            test "$hardcode_minus_L" != yes && \
-            test "$hardcode_shlibpath_var" = yes; then
              case ":$finalize_shlibpath:" in
              *":$libdir:"*) ;;
              *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
              esac
-         fi
-         if test -n "$add_dir"; then
-           case "$deplibs " in
-           *" $add_dir "*) ;;
-           *) deplibs="$deplibs $add_dir" ;;
-           esac
-         fi
-         test "$add_name" = yes && deplibs="$deplibs -l$name"
-
-         else
-
-         lib_linked=yes
-         add_dir=
-         add_shlibpath=
-         add_name=no
-         case "$hardcode_action" in
-         immediate | unsupported)
-           if test "$hardcode_direct" = no; then
-             compile_command="$compile_command $dir/$linklib"
-           elif test "$hardcode_minus_L" = no; then
-             case "$host" in
-             *-*-sunos*) add_shlibpath="$dir" ;;
-             esac
-             add_dir="-L$dir"
-             add_name=yes
-           elif test "$hardcode_shlibpath_var" = no; then
-             add_shlibpath="$dir"
-             add_name=yes
+             add="-l$name"
            else
-             lib_linked=no
+             # We cannot seem to hardcode it, guess we'll fake it.
+             add_dir="-L$libdir"
+             add="-l$name"
            fi
-           ;;
 
-         relink)
-           if test "$hardcode_direct" = yes; then
-             compile_command="$compile_command $absdir/$linklib"
-           elif test "$hardcode_minus_L" = yes; then
-             add_dir="-L$absdir"
-             add_name=yes
-           elif test "$hardcode_shlibpath_var" = yes; then
-             add_shlibpath="$absdir"
-             add_name=yes
+           if test $linkmode = prog; then
+             if test -n "$add_dir"; then
+               case "$finalize_command " in
+               *" $add_dir "*) ;;
+               *) finalize_command="$finalize_command $add_dir" ;;
+               esac
+             fi
+             test -n "$add" && finalize_command="$finalize_command $add"
            else
-             lib_linked=no
+             if test -n "$add_dir"; then
+               case "$deplibs " in
+               *" $add_dir "*) ;;
+               *) deplibs="$deplibs $add_dir" ;;
+               esac
+             fi
+             test -n "$add" && deplibs="$deplibs $add"
            fi
-           ;;
-
-         *) lib_linked=no ;;
-         esac
-
-         if test "$lib_linked" != yes; then
-           $echo "$modename: configuration error: unsupported hardcode properties"
-           exit 1
-         fi
-         if test -n "$add_dir"; then
-           case "$compile_command " in
-           *" $add_dir "*) ;;
-           *) compile_command="$compile_command $add_dir" ;;
-           esac
-         fi
-         if test -n "$add_shlibpath"; then
-           case ":$compile_shlibpath:" in
-           *":$add_shlibpath:"*) ;;
-           *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
-           esac
-         fi
-         test "$add_name" = yes && compile_command="$compile_command -l$name"
-
-         add_dir=
-         add_name=no
-         # Finalize command for both is simple: just hardcode it.
-         if test "$hardcode_direct" = yes; then
-           finalize_command="$finalize_command $libdir/$linklib"
-         elif test "$hardcode_minus_L" = yes; then
-           add_dir="-L$libdir"
-           add_name=yes
-         elif test "$hardcode_shlibpath_var" = yes; then
-           case ":$finalize_shlibpath:" in
-           *":$libdir:"*) ;;
-           *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
-           esac
-           add_name=yes
-         else
-           # We cannot seem to hardcode it, guess we'll fake it.
-           add_dir="-L$libdir"
-           add_name=yes
-         fi
-         if test -n "$add_dir"; then
-           case "$finalize_command " in
-           *" $add_dir "*) ;;
-           *) finalize_command="$finalize_command $add_dir" ;;
-           esac
-         fi
-         test "$add_name" = yes && finalize_command="$finalize_command -l$name"
-
          fi
        elif test $linkmode = prog; then
          # Here we assume that one of hardcode_direct or hardcode_minus_L
@@ -1925,7 +1872,7 @@ compiler."
          fi
        fi
 
-       if test "$linkmode" = "lib"; then
+       if test $linkmode = lib; then
          if test -n "$dependency_libs" &&
             { test "$hardcode_into_libs" = no || test $build_old_libs = yes ||
               test $link_static = yes; }; then
@@ -2004,7 +1951,7 @@ compiler."
       lib_search_path="$lib_search_path $sys_lib_search_path"
     done
 
-    case "$linkmode" in
+    case $linkmode in
     oldlib)
       if test -n "$deplibs"; then
        $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2