libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch] interlibrary dependency parsing in libltdl from CVS HEAD


From: Matthias Koeppe
Subject: [Patch] interlibrary dependency parsing in libltdl from CVS HEAD
Date: 20 Oct 2000 15:22:38 +0200

While trying to use the new interlibrary dependency resolution
(load_deplibs) in the CVS version of libtool, we found out that it is
never passed the list of library dependencies. The reason is a wrong
define in ltdl.c which doesn't match the keyword generated by the
libtool script. A patch is included below.

There was also a bunch of missing quotes around `test' arguments in
the scripts, which confused /bin/test on Solaris 2.7 boxes.

2000-10-20  Utz-Uwe Haus  <address@hidden>

        * libltdl/ltdl.c (lt_dlopen): Changed "dl_dependency_libs" keyword
        to "dependency_libs".

        * ltmain.in: Put double quotes around test arguments; Solaris'
        /bin/test would lose. 

Index: libltdl/ltdl.c
===================================================================
RCS file: /var/cvs/libtool/libltdl/ltdl.c,v
retrieving revision 1.111
diff -u -r1.111 ltdl.c
--- libltdl/ltdl.c      2000/09/04 06:09:25     1.111
+++ libltdl/ltdl.c      2000/10/20 12:25:44
@@ -1429,7 +1429,7 @@
                                        &line[sizeof(STR_LIBDIR) - 1]);
                        else
 #                      undef  STR_DL_DEPLIBS
-#                      define STR_DL_DEPLIBS   "dl_dependency_libs="
+#                      define STR_DL_DEPLIBS   "dependency_libs="
                        if (strncmp(line, STR_DL_DEPLIBS,
                                sizeof(STR_DL_DEPLIBS) - 1) == 0)
                                error = trim(&deplibs,
Index: ltmain.in
===================================================================
RCS file: /var/cvs/libtool/ltmain.in,v
retrieving revision 1.238
diff -u -r1.238 ltmain.in
--- ltmain.in   2000/10/02 01:18:16     1.238
+++ ltmain.in   2000/10/20 12:25:44
@@ -1359,14 +1359,14 @@
        libs="$deplibs"
        deplibs=
       fi
-      if test $linkmode = prog; then
+      if test "$linkmode" = prog; then
        case $pass in
        dlopen) libs="$dlfiles" ;;
        dlpreopen) libs="$dlprefiles" ;;
        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
        esac
       fi
-      if test $pass = dlopen; then
+      if test "$pass" = dlopen; then
        # Collect dlpreopened libraries
        save_deplibs="$deplibs"
        deplibs=
@@ -1380,7 +1380,7 @@
            $echo "$modename: warning: \`-l' is ignored for archives/objects" 
1>&2
            continue
          fi
-         if test $pass = conv; then
+         if test "$pass" = conv; then
            deplibs="$deplib $deplibs"
            continue
          fi
@@ -1399,7 +1399,7 @@
              finalize_deplibs="$deplib $finalize_deplibs"
            else
              deplibs="$deplib $deplibs"
-             test $linkmode = lib && newdependency_libs="$deplib 
$newdependency_libs"
+             test "$linkmode" = lib && newdependency_libs="$deplib 
$newdependency_libs"
            fi
            continue
          fi
@@ -1408,16 +1408,16 @@
          case $linkmode in
          lib)
            deplibs="$deplib $deplibs"
-           test $pass = conv && continue
+           test "$pass" = conv && continue
            newdependency_libs="$deplib $newdependency_libs"
            newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed 
-e 's/^-L//'`
            ;;
          prog)
-           if test $pass = conv; then
+           if test "$pass" = conv; then
              deplibs="$deplib $deplibs"
              continue
            fi
-           if test $pass = scan; then
+           if test "$pass" = scan; then
              deplibs="$deplib $deplibs"
              newlib_search_path="$newlib_search_path "`$echo "X$deplib" | 
$Xsed -e 's/^-L//'`
            else
@@ -1432,7 +1432,7 @@
          continue
          ;;
        -R*)
-         if test $pass = link; then
+         if test "$pass" = link; then
            dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
            # Make sure the xrpath contains only unique directories.
            case "$xrpath " in
@@ -1445,7 +1445,7 @@
          ;;
        *.la) lib="$deplib" ;;
        *.$libext)
-         if test $pass = conv; then
+         if test "$pass" = conv; then
            deplibs="$deplib $deplibs"
            continue
          fi
@@ -1477,10 +1477,10 @@
          esac
          ;;
        *.lo | *.$objext)
-         if test $pass = conv; then
+         if test "$pass" = conv; then
            deplibs="$deplib $deplibs"
-         elif test $linkmode = prog; then
-           if test $pass = dlpreopen || test "$dlopen_support" != yes || test 
"$build_libtool_libs" = no; then
+         elif test "$linkmode" = prog; then
+           if test "$pass" = dlpreopen || test "$dlopen_support" != yes || 
test "$build_libtool_libs" = no; then
              # If there is no dlopen support or we're linking statically,
              # we need to preload.
              newdlprefiles="$newdlprefiles $deplib"
@@ -1497,7 +1497,7 @@
          continue
          ;;
        esac
-       if test $found = yes || test -f "$lib"; then :
+       if test "$found" = yes || test -f "$lib"; then :
        else
          $echo "$modename: cannot find the library \`$lib'" 1>&2
          exit 1
@@ -1536,7 +1536,7 @@
          test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
        fi
 
-       if test $pass = conv; then
+       if test "$pass" = conv; then
          # only check for convenience libraries
          deplibs="$lib $deplibs"
          if test -z "$libdir"; then
@@ -1573,7 +1573,7 @@
        fi
 
        # This library was specified with -dlopen.
-       if test $pass = dlopen; then
+       if test "$pass" = dlopen; then
          if test -z "$libdir"; then
            $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 
1>&2
            exit 1
@@ -1622,7 +1622,7 @@
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
 
        # This library was specified with -dlpreopen.
-       if test $pass = dlpreopen; then
+       if test "$pass" = dlpreopen; then
          if test -z "$libdir"; then
            $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 
1>&2
            exit 1
@@ -1641,7 +1641,7 @@
 
        if test -z "$libdir"; then
          # link the convenience library
-         if test $linkmode = lib; then
+         if test "$linkmode" = lib; then
            deplibs="$dir/$old_library $deplibs"
          elif test "$linkmode,$pass" = "prog,link"; then
            compile_deplibs="$dir/$old_library $compile_deplibs"
@@ -1652,7 +1652,7 @@
          continue
        fi
 
-       if test $linkmode = prog && test $pass != link; then
+       if test "$linkmode" = prog && test $pass != link; then
          newlib_search_path="$newlib_search_path $ladir"
          deplibs="$lib $deplibs"
 
@@ -1668,7 +1668,7 @@
            -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | 
$Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
            esac
            # Need to link against all dependency_libs?
-           if test $linkalldeplibs = yes; then
+           if test "$linkalldeplibs" = yes; then
              deplibs="$deplib $deplibs"
            else
              # Need to hardcode shared library paths
@@ -1737,7 +1737,7 @@
            need_relink=yes
          fi
          # This is a shared library
-         if test $linkmode = lib &&
+         if test "$linkmode" = lib &&
             test $hardcode_into_libs = yes; then
            # Hardcode the library path.
            # Skip directories that are in the system default run-time
@@ -1808,7 +1808,7 @@
            linklib=$newlib
          fi
 
-         if test $linkmode = prog || test "$mode" != relink; then
+         if test "$linkmode" = prog || test "$mode" != relink; then
            add_shlibpath=
            add_dir=
            add=
@@ -1857,7 +1857,7 @@
              *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
              esac
            fi
-           if test $linkmode = prog; then
+           if test "$linkmode" = prog; then
              test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
              test -n "$add" && compile_deplibs="$add $compile_deplibs"
            else
@@ -1874,7 +1874,7 @@
            fi
          fi
 
-         if test $linkmode = prog || test "$mode" = relink; then
+         if test "$linkmode" = prog || test "$mode" = relink; then
            add_shlibpath=
            add_dir=
            add=
@@ -1896,7 +1896,7 @@
              add="-l$name"
            fi
 
-           if test $linkmode = prog; then
+           if test "$linkmode" = prog; then
              test -n "$add_dir" && finalize_deplibs="$add_dir 
$finalize_deplibs"
              test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
            else
@@ -1904,7 +1904,7 @@
              test -n "$add" && deplibs="$add $deplibs"
            fi
          fi
-       elif test $linkmode = prog; then
+       elif test "$linkmode" = prog; then
          # Here we assume that one of hardcode_direct or hardcode_minus_L
          # is not unsupported.  This is valid on all known static and
          # shared platforms.
@@ -1936,7 +1936,7 @@
          fi
        fi
 
-       if test $linkmode = lib; then
+       if test "$linkmode" = lib; then
          if test -n "$dependency_libs" &&
             { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
               test $link_static = yes; }; then
@@ -2012,7 +2012,7 @@
        fi
       done
       dependency_libs="$newdependency_libs"
-      if test $pass = dlpreopen; then
+      if test "$pass" = dlpreopen; then
        # Link the dlpreopened libraries before other libraries
        for deplib in $save_deplibs; do
          deplibs="$deplib $deplibs"
@@ -2073,7 +2073,7 @@
        done
       fi
     done
-    if test $linkmode = prog; then
+    if test "$linkmode" = prog; then
       dlfiles="$newdlfiles"
       dlprefiles="$newdlprefiles"
     fi
@@ -4516,7 +4516,7 @@
        objdir="$dir/$objdir"
       fi
       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-      test $mode = uninstall && objdir="$dir"
+      test "$mode" = uninstall && objdir="$dir"
 
       rmfiles="$file"
 
@@ -4531,9 +4531,9 @@
            rmfiles="$rmfiles $objdir/$n"
          done
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-         test $mode = clean && rmfiles="$rmfiles $objdir/$name 
$objdir/${name}i"
+         test "$mode" = clean && rmfiles="$rmfiles $objdir/$name 
$objdir/${name}i"
 
-         if test $mode = uninstall; then
+         if test "$mode" = uninstall; then
            if test -n "$library_names"; then
              # Do each command in the postuninstall commands.
              eval cmds=\"$postuninstall_cmds\"
@@ -4571,7 +4571,7 @@
 
       *)
        # Do a test to see if this is a libtool program.
-       if test $mode = clean &&
+       if test "$mode" = clean &&
           (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 
2>&1; then
          relink_command=
          . $dir/$file

-- 
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]