bug-libtool
[Top][All Lists]
Advanced

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

rpath problem.


From: Jean-Paul CHAPUT
Subject: rpath problem.
Date: Sat, 24 Jul 2004 19:30:01 +0200

Hi Mr Libtool,


I'm managing a project for wich we uses libtool (& all others autotools)
and I'm encountering a problem with rpath.

To do our development we have adopted the following architecture :

1. - Stables version of libraries resides in a shared directory.
     Says : /asim/project/lib holding
              libA.so.1.0.0 (+.la)
              libB.so.1.0.0 (+.la)
              libC.so.1.0.0 (+.la)
     "C" library depends on "B" and so "B" on "A".

2. - Unstables versions resides in a directory in the developper
     Account. Says : $HOME_B/project/lib holding
                       libB.so.1.0.0 (+.la)

3. - At link time Mr B. wants to use is own version of the "B" library,
     but the stable version of the "A" and "C" libraries. So he writes
     a line like this :

       ... -L$HOME/project/lib -L/asim/project/lib -lC -lB -lA

     In the hope that the first library path to be taken into account
     would be is personal one. But what seems to happens is that the
     rpath taken from "libC.la" overrides the one given in the command
     line and the "B" library which is choosen is the one from
     /asim/project/lib and not from the developper's library.

I've made a quick patch to overcome this problem, but I don't think it's
very clean and it mades two checks from the testsuite to fail. I join
the patch to this mail.

I uses libtool 1.5.6 from a Fedora Core 2 distribution with all updates
applied.


Thanks in advance.




--- libtool-1.5/ltmain.in.rpath 2004-03-22 19:53:45.000000000 +0100
+++ libtool-1.5/ltmain.in       2004-03-22 21:00:55.000000000 +0100
@@ -2164,7 +2164,7 @@
            # We need to hardcode the library path
            if test -n "$shlibpath_var"; then
              # Make sure the rpath contains only unique directories.
-             case "$temp_rpath " in
+             case "$temp_rpath $rpath " in
              *" $dir "*) ;;
              *" $absdir "*) ;;
              *) temp_rpath="$temp_rpath $dir" ;;
@@ -2177,7 +2177,7 @@
            case " $sys_lib_dlsearch_path " in
            *" $absdir "*) ;;
            *)
-             case "$compile_rpath " in
+             case "$compile_rpath $rpath " in
              *" $absdir "*) ;;
              *) compile_rpath="$compile_rpath $absdir"
              esac
@@ -2186,7 +2186,7 @@
            case " $sys_lib_dlsearch_path " in
            *" $libdir "*) ;;
            *)
-             case "$finalize_rpath " in
+             case "$finalize_rpath $rpath " in
              *" $libdir "*) ;;
              *) finalize_rpath="$finalize_rpath $libdir"
              esac
@@ -3071,7 +3071,7 @@
          temp_xrpath="$temp_xrpath -R$libdir"
          case "$finalize_rpath " in
          *" $libdir "*) ;;
-         *) finalize_rpath="$finalize_rpath $libdir" ;;
+         *) finalize_rpath="$libdir $finalize_rpath" ;;
          esac
        done
        if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes;
then
@@ -4043,7 +4043,7 @@
          # This is the magic to use -rpath.
          case "$finalize_rpath " in
          *" $libdir "*) ;;
-         *) finalize_rpath="$finalize_rpath $libdir" ;;
+         *) finalize_rpath="$libdir $finalize_rpath" ;;
          esac
        done
       fi
@@ -4051,7 +4051,7 @@
       # Now hardcode the library paths
       rpath=
       hardcode_libdirs=
-      for libdir in $compile_rpath $finalize_rpath; do
+      for libdir in $finalize_rpath $compile_rpath; do
        if test -n "$hardcode_libdir_flag_spec"; then
          if test -n "$hardcode_libdir_separator"; then
            if test -z "$hardcode_libdirs"; then

-- 
                                                                                
      .-.     J e a n - P a u l   C h a p u t
      /v\                   |
    /(___)\                 |-- e-mail : address@hidden
     ^^ ^^                  `-- Tel    : (33) 01.44.27.53.99
                                              06.66.25.35.55
                                              01.48.28.29.58
                                                                                
    U P M C   Universite Pierre & Marie Curie
    L I P 6   Laboratoire d'Informatique de Paris VI
    A S I M   Architecture des Systemes Integres et Micro-electronique

Attachment: libtool-1.5-rpath.patch
Description: Text Data


reply via email to

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