Make fake-la work on a.out machines. Fix based on patch in pkg/18694

by itohy@netbsd.org.
This commit is contained in:
jlam 2002-10-18 15:41:08 +00:00
parent d85dfe731b
commit 68e548cdf0
2 changed files with 18 additions and 3 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: bsd.buildlink2.mk,v 1.41 2002/10/13 07:13:42 jlam Exp $
# $NetBSD: bsd.buildlink2.mk,v 1.42 2002/10/18 15:41:08 jlam Exp $
#
# An example package buildlink2.mk file:
#
@ -933,6 +933,12 @@ ${_BLNK_LIBTOOL_FIX_LA}: ${.CURDIR}/../../mk/buildlink2/libtool-fix-la
${.ALLSRC} > ${.TARGET}.tmp
${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET}
.if ${OBJECT_FMT} == "a.out"
_RESET_LD_SO_CACHE?= ${LDCONFIG}
.else
_RESET_LD_SO_CACHE?= ${TRUE}
.endif
${_BLNK_FAKE_LA}: ${.CURDIR}/../../mk/buildlink2/fake-la
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
${_PKG_SILENT}${_PKG_DEBUG}${SED} \
@ -944,6 +950,7 @@ ${_BLNK_FAKE_LA}: ${.CURDIR}/../../mk/buildlink2/fake-la
-e "s|@DIRNAME@|${DIRNAME:Q}|g" \
-e "s|@ECHO@|${ECHO:Q}|g" \
-e "s|@EGREP@|${EGREP:Q}|g" \
-e "s|@RESET_LD_SO_CACHE@|${_RESET_LD_SO_CACHE:Q}|g" \
-e "s|@LIBTOOL@|${BUILDLINK_LIBTOOL:Q}|g" \
-e "s|@MKDIR@|${MKDIR:Q}|g" \
-e "s|@MV@|${MV:Q}|g" \

View file

@ -1,6 +1,6 @@
#!@BUILDLINK_SHELL@
#
# $NetBSD: fake-la,v 1.1 2002/09/18 00:46:59 jlam Exp $
# $NetBSD: fake-la,v 1.2 2002/10/18 15:41:08 jlam Exp $
BASENAME="@BASENAME@"
CC="@CC@"
@ -34,7 +34,15 @@ if [ ! -f $tmpdir/inst/$libbase.la ]; then
esac
${MKDIR} $tmpdir/inst
cd $tmpdir
${LIBTOOL} ${CC} -o $libbase.la -rpath $tmpdir/inst -version-info $version
${ECHO} "static int i;" > nonempty.c # create a nonempty input file
${LIBTOOL} --mode=compile ${CC} -c nonempty.c
${LIBTOOL} ${CC} -o $libbase.la nonempty.lo -rpath $tmpdir/inst -version-info $version
${LIBTOOL} --mode=install ${CP} $libbase.la $tmpdir/inst >/dev/null
# Reset the ld.so cache as "libtool --mode=install" may have executed
# ldconfig to add "$tmpdir/inst" to the cache.
#
@RESET_LD_SO_CACHE@ >/dev/null 2>&1
fi
${SED} -e "s,$tmpdir/inst,$realdir,g" $tmpdir/inst/$libbase.la