libtool
[Top][All Lists]
Advanced

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

Re: Relinking module at install time with dependency


From: Albert Chin
Subject: Re: Relinking module at install time with dependency
Date: Mon, 7 Apr 2003 14:31:32 -0500
User-agent: Mutt/1.4i

On Mon, Apr 07, 2003 at 01:37:08PM -0500, Albert Chin wrote:
> I am trying to build KDE 3.1.1 on Solaris 9/SPARC with the latest CVS
> libtool. It tries to link module1.la at install time which is
> dependent on module2.la. The creation at build time of module1.so
> works (it links against module2.so). However, at install time, libtool
> tries to link the dependent module2.la with -lmodule2 which of course
> won't work because there is 'lib' string prepended to 'module2.la'. I
> presume this is a libtool bug. Because the build worked by hardcoding
> the path of the module2.so file, I'd expect the same thing to occur
> while relinking at install time.

Ok, when module1.la is built, the section of code that embeds
module2.la is ~line 2308 in ltmain.in:
          if test "$linkmode" = prog || test "$mode" != relink; then
            add_shlibpath=
            add_dir=
            add=
            lib_linked=yes
            case $hardcode_action in
            immediate | unsupported)

At install time, because we relink, $mode == relink so this code never
gets executed. Instead, we execute what follows:
          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
              ...
            elif test "$hardcode_minus_L" = yes; then
              ...
            elif test "$hardcode_shlibpath_var" = yes; then
              ...
            elif test "$hardcode_automatic" = yes; then
              ...
            else
              # We cannot seem to hardcode it, guess we'll fake it.
              add_dir="-L$libdir"
              # Try looking first in the location we're being installed to.
              if test -n "$inst_prefix_dir"; then
                case "$libdir" in
                  [\\/]*)
                    add_dir="-L$inst_prefix_dir$libdir $add_dir"
                    ;;
                esac
              fi
              add="-l$name"
            fi

On Solaris 9, we run the final else which adds -lmodule2 causing the
failure. Why don't we handle $harcode_action=immediate here? Maybe
something like the following?
            # Finalize command for both is simple: just hardcode it.
            if test "$hardcode_action" = immediate && \
            test "$hardcode_direct" = no; then
              add="$libdir/$linklib"
            elif test "$hardcode_direct" = yes; then
              ...

-- 
albert chin (address@hidden)




reply via email to

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