On Thu, May 19, 2005 at 07:17:28PM +0200, Joerg Sonnenberger wrote:
> libtool-1.5.18 doesn't include -pthread in the dependency_libs
> field of the .la file. This leads to link errors on DragonFly,
> when linking against that library. Typical example is
> ligthread from glib, which is a dependency of libORBit-2.
> orbit-name-server-2 is linked against libORBit-2, but without
> explicit -pthread. This fails with missing symbols.

Attached patch only threats -pthread special and leaves the rest of
the flags alone. Please at least comment on this patch, libtool is
seriously broken on DragonFly when used with pkgsrc without it.

Joerg
--- ltmain.sh.orig      2005-05-16 11:39:29.000000000 +0200
+++ ltmain.sh   2005-05-23 18:14:40.000000000 +0200
@@ -1519,7 +1519,15 @@
        continue
        ;;
 
-     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+     -pthread)
+       compiler_flags="$compiler_flags $arg"
+       compile_command="$compile_command $arg"
+       finalize_command="$finalize_command $arg"
+       deplibs="$deplibs $arg"
+       continue
+       ;;
+
+     -mt|-mthreads|-kthread|-Kthread||-pthreads|--thread-safe)
        compiler_flags="$compiler_flags $arg"
        compile_command="$compile_command $arg"
        finalize_command="$finalize_command $arg"
@@ -2006,13 +2014,46 @@
        lib=
        found=no
        case $deplib in
-       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+       -pthread)
          if test "$linkmode,$pass" = "prog,link"; then
            compile_deplibs="$deplib $compile_deplibs"
            finalize_deplibs="$deplib $finalize_deplibs"
          else
            compiler_flags="$compiler_flags $deplib"
          fi
+
+         case $linkmode in
+         lib)
+           deplibs="$deplib $deplibs"
+           test "$pass" = conv && continue
+           newdependency_libs="$deplib $newdependency_libs"
+           ;;
+         prog)
+           if test "$pass" = conv; then
+             deplibs="$deplib $deplibs"
+             continue
+           fi
+           if test "$pass" = scan; then
+             deplibs="$deplib $deplibs"
+           else
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           fi
+           ;;
+         *)
+           ;;
+         esac # linkmode
+
+         continue
+         ;;
+       -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe)
+         if test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$deplib $compile_deplibs"
+           finalize_deplibs="$deplib $finalize_deplibs"
+         else
+           compiler_flags="$compiler_flags $deplib"
+         fi
+
          continue
          ;;
        -l*)
_______________________________________________
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool

Reply via email to