Hi Stephan,

The following patch should be better:

Index: ltcf-cxx.sh
===================================================================
RCS file: /cvs/libtool/Attic/ltcf-cxx.sh,v
retrieving revision 1.1.2.11
diff -u -5 -r1.1.2.11 ltcf-cxx.sh
--- ltcf-cxx.sh 2000/05/26 05:49:14     1.1.2.11
+++ ltcf-cxx.sh 2000/06/03 23:24:52
@@ -725,11 +725,11 @@
 EOF
 
 
 if eval $ac_compile 2>&5; then
   # Parse the compiler output and extract the necessary
-  # object, libraries and library flags.
+  # objects, libraries and library flags.
 
   # Sentinel used to keep track of whether or not we are before
   # the conftest object file.
   pre_test_object_deps_done=no
 
@@ -747,15 +747,24 @@
        else
          prev=
        fi
 
        if test "$pre_test_object_deps_done" = no; then
-         if test -z "$predeps"; then
-           predeps="${prev}${p}"
-         else
-           predeps="${predeps} ${prev}${p}"
-         fi
+         case $p in
+        -L* | -R*)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+           if test -z "$compiler_lib_search_path"; then
+             compiler_lib_search_path="${prev}${p}"
+           else
+             compiler_lib_search_path="${compiler_lib_search_path} ${prev}${p}"
+           fi
+           ;;
+        # The "-l" case would never come before the object being
+         # linked, so don't bother handling this case.
+         esac
        else
          if test -z "$postdeps"; then
            postdeps="${prev}${p}"
          else
            postdeps="${postdeps} ${prev}${p}"
Index: ltconfig.in
===================================================================
RCS file: /cvs/libtool/ltconfig.in,v
retrieving revision 1.246.2.18
diff -u -5 -r1.246.2.18 ltconfig.in
--- ltconfig.in 2000/05/30 00:31:59     1.246.2.18
+++ ltconfig.in 2000/06/03 23:24:52
@@ -220,10 +220,11 @@
 ## Dependencies to place before and after the object being linked:
 predep_objects=
 postdep_objects=
 predeps=
 postdeps=
+compiler_lib_search_path=
 
 ## Link characteristics:
 allow_undefined_flag=
 no_undefined_flag=
 need_lib_prefix=unknown
@@ -1923,11 +1924,11 @@
     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
     library_names_spec soname_spec \
     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
-    predep_objects postdep_objects predeps postdeps \
+    predep_objects postdep_objects predeps postdeps compiler_lib_search_path \
     old_striplib striplib file_magic_cmd export_symbols_cmds \
     deplibs_check_method allow_undefined_flag no_undefined_flag \
     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
     hardcode_libdir_flag_spec hardcode_libdir_separator  \
     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
@@ -2216,10 +2217,14 @@
 predeps=$predeps
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
 postdeps=$postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$compiler_lib_search_path
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$deplibs_check_method
 
 # Command to use when deplibs_check_method == file_magic.
Index: ltmain.in
===================================================================
RCS file: /cvs/libtool/ltmain.in,v
retrieving revision 1.200.2.19
diff -u -5 -r1.200.2.19 ltmain.in
--- ltmain.in   2000/05/29 10:40:46     1.200.2.19
+++ ltmain.in   2000/06/03 23:24:53
@@ -1468,11 +1468,11 @@
       esac
       libs="$libs $deplib"
     done
 
     if test $linkmode = lib; then
-      libs="$predeps $libs $postdeps"
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
     fi
 
     deplibs=
     newdependency_libs=
     newlib_search_path=


Here are the results for the tagdemo in the libtool CXX tagged
configuration on Linux:

# Dependencies to place before the objects being linked to create a
# shared library.
predeps=""

# Dependencies to place after the objects being linked to create a
# shared library.
postdeps="-lstdc++ -lm -lgcc -lc -lgcc"

# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path="-L/usr/lib/gcc-lib/i386-linux/2.95.2"


Here is the contents of the "$libs" variable passed to the ILD
analyser:

libs:  -lm -L/usr/lib/gcc-lib/i386-linux/2.95.2 -lstdc++ -lm -lgcc -lc -lgcc


You're KDE test is of course much more exhaustive then this simple
test.  Can you please give the new patch a try?

Thanks,
-Ossama
-- 
Ossama Othman <[EMAIL PROTECTED]>
Distributed Object Computing Laboratory, Univ. of California at Irvine
1024D/F7A394A8 - 84ED AA0B 1203 99E4 1068  70E6 5EB7 5E71 F7A3 94A8

Reply via email to