diff options
author | jlam <jlam@pkgsrc.org> | 2002-09-18 00:46:58 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2002-09-18 00:46:58 +0000 |
commit | 7d8a00b308d64b4ef37135a15f9094e390dbdfe4 (patch) | |
tree | a911fa15d313d972d0162c693c22f7bf205c7678 /mk/buildlink2/fake-la | |
parent | 0d2ebb8aba825f051b375b26d1b6bc8bd854c581 (diff) | |
download | pkgsrc-7d8a00b308d64b4ef37135a15f9094e390dbdfe4.tar.gz |
Modifications and additions to create a dummy libtool archive to represent
a system library so that we can prefer a system library to a pkgsrc one
when building with pkgsrc.
Diffstat (limited to 'mk/buildlink2/fake-la')
-rw-r--r-- | mk/buildlink2/fake-la | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mk/buildlink2/fake-la b/mk/buildlink2/fake-la new file mode 100644 index 00000000000..da40f702f3b --- /dev/null +++ b/mk/buildlink2/fake-la @@ -0,0 +1,40 @@ +#!@BUILDLINK_SHELL@ +# +# $NetBSD: fake-la,v 1.1 2002/09/18 00:46:59 jlam Exp $ + +BASENAME="@BASENAME@" +CC="@CC@" +CP="@CP@" +DIRNAME="@DIRNAME@" +ECHO="@ECHO@" +LIBTOOL="@LIBTOOL@ --quiet" +MKDIR="@MKDIR@" +MV="@MV@" +RM="@RM@" +SED="@SED@" + +BUILDLINK_DIR="@BUILDLINK_DIR@" + +reallib="$1" +realdir=`${DIRNAME} $reallib` +libname=`${BASENAME} $reallib` +tmpdir=${BUILDLINK_DIR}/.tmp + +if [ ! -f $tmpdir/inst/$libbase.la ]; then + case $libname in + *.so.[0-9]*) + libbase=`${ECHO} $libname | ${SED} -e "s/\.so\.[0-9.]*$//"` + version=`${ECHO} $libname | ${SED} -e "s/.*\.so\.//;s/\./:/g"` + ;; + + *[0-9].dylib) + libbase=`${ECHO} $libname | ${SED} -e "s/\.[0-9.]*\.dylib$//"` + version=`${ECHO} $libname | ${SED} -e "s/^[^.]*\.\([0-9]*\.[0-9]*\)\.dylib/\1/;s/\./:/g"` + ;; + esac + ${MKDIR} $tmpdir/inst + cd $tmpdir + ${LIBTOOL} ${CC} -o $libbase.la -rpath $tmpdir/inst -version-info $version + ${LIBTOOL} --mode=install ${CP} $libbase.la $tmpdir/inst >/dev/null +fi +${SED} -e "s,$tmpdir/inst,$realdir,g" $tmpdir/inst/$libbase.la |