libtool
[Top][All Lists]
Advanced

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

Re: Hack for inter-library dependency (make DESTDIR=... install) problem


From: roth . gnu
Subject: Re: Hack for inter-library dependency (make DESTDIR=... install) problem.
Date: 07 Dec 2001 14:58:14 -0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley)

==> "mn" == Martin Norbäck <address@hidden> writes:

    >> > Agreed -- the same is true with Debian -- minimizing the
    >> Debian diff > is a good idea, all other things being equal.  In
    >> any case, thanks > so much.  I'll try this -- it looks like a
    >> good solution.
    >> 
    >> That appeared to work perfectly -- thanks again.

    mn> Worked for me too when building RPMS!

I didn't realize it was that popular.  In that case, here is the shell
script I'm using.  It's not easy to stick helper scripts into spec
files, so you'll probably need to put it in as a Source: file and
refer to it using $RPM_SOURCE_DIR:

======================== 8< ==========================================
#!/bin/sh
#
# find_la_libdirs
#
# Find all of the .la libdirs under the current directory for prelinking.
#
# Author: Carl D. Roth <address@hidden>
#

if test -z "$DESTDIR"; then
  if test $# -ne 1; then
    echo "$0: *** need to supply a DESTDIR"
    exit 1
  fi
  DESTDIR=$1
fi

builddir=.

# Find each la-file, and search for its' libdir:
for lafile in `find $builddir -name "*.la" -print`; do
  libdir=`sed -n -e "s:libdir='\(.*\)':\1:p" $lafile`
  test "$libdir" || continue
  
  case " $libpath " in
    *\ $libdir\ *) continue ;;
  esac

  libpath="$libpath $libdir"
done

# make it colon-separated for LIBRARY_PATH:
for lib in $libpath; do
  libpathc=$libpathc${libpathc+":"}$DESTDIR$lib
done

echo $libpathc

exit 0
======================== 8< ==========================================

Here is a spec file fragment (libgii.spec, to be specific);


======================== 8< ==========================================
%install
[ -e "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

# get the set of libtool library paths:
LIBRARY_PATH=$LIBRARY_PATH${LIBRARY_PATH+":"}`$RPM_SOURCE_DIR/find_la_libdirs 
$RPM_BUILD_ROOT`
export LIBRARY_PATH

%makeinstall
======================== 8< ==========================================

Sorry, I don't speak ".deb".

The script is a little heavy-handed; it picks up any .la files,
whether they are lib_*, libexec_*, or noinst_*.

- C




reply via email to

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