diff options
author | jschauma <jschauma@pkgsrc.org> | 2003-06-19 17:20:41 +0000 |
---|---|---|
committer | jschauma <jschauma@pkgsrc.org> | 2003-06-19 17:20:41 +0000 |
commit | 07aec53fd8bbbcf2493fd3bb7cc2a8874997995c (patch) | |
tree | 2c1ddbdc6bc8d440475a0107e6fed623c6082a4e | |
parent | 8abe09af63aee24c966491bdc2bacde4b5cc3045 (diff) | |
download | pkgsrc-07aec53fd8bbbcf2493fd3bb7cc2a8874997995c.tar.gz |
Apply patch by Joachim Koenig-Baltes (joachim at handshake dot de) in
followup to PR pkg/20529:
Some libraries (in this example, a given Linux's native libpthread) don't
come with a version number at all and/or are in fact symlinks. Test for
this and act accordingly in fake-la.
This allows packages that use pthread to buildlink under various Linuxen.
Should close PR pkg/20529 and PR pkg/21854. Thanks, Joachim.
-rw-r--r-- | mk/buildlink2/bsd.buildlink2.mk | 3 | ||||
-rw-r--r-- | mk/buildlink2/fake-la | 25 |
2 files changed, 23 insertions, 5 deletions
diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk index fc2a5205acb..0add32dfc3d 100644 --- a/mk/buildlink2/bsd.buildlink2.mk +++ b/mk/buildlink2/bsd.buildlink2.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.buildlink2.mk,v 1.84 2003/05/06 17:42:02 jmmv Exp $ +# $NetBSD: bsd.buildlink2.mk,v 1.85 2003/06/19 17:20:41 jschauma Exp $ # # An example package buildlink2.mk file: # @@ -934,6 +934,7 @@ ${_BLNK_FAKE_LA}: ${.CURDIR}/../../mk/buildlink2/fake-la -e "s|@BUILDLINK_DIR@|${BUILDLINK_DIR}|g" \ -e "s|@BUILDLINK_X11_DIR@|${BUILDLINK_X11_DIR}|g" \ -e "s|@BUILDLINK_SHELL@|${BUILDLINK_SHELL}|g" \ + -e "s|@AWK@|${AWK:Q}|g" \ -e "s|@BASENAME@|${BASENAME:Q}|g" \ -e "s|@CC@|${BUILDLINK_CC:Q}|g" \ -e "s|@CP@|${CP:Q}|g" \ diff --git a/mk/buildlink2/fake-la b/mk/buildlink2/fake-la index a2cb11619c2..b39f2b3aeec 100644 --- a/mk/buildlink2/fake-la +++ b/mk/buildlink2/fake-la @@ -1,7 +1,8 @@ #!@BUILDLINK_SHELL@ # -# $NetBSD: fake-la,v 1.4 2003/01/06 04:30:12 jlam Exp $ +# $NetBSD: fake-la,v 1.5 2003/06/19 17:20:42 jschauma Exp $ +AWK="@AWK@" BASENAME="@BASENAME@" CC="@CC@" CP="@CP@" @@ -21,8 +22,22 @@ realdir=`${DIRNAME} $reallib` libname=`${BASENAME} $reallib` tmpdir=${BUILDLINK_DIR}/.tmp -if ${TEST} ! -f $tmpdir/inst/$libbase.la; then - case $libname in +case $libname in + *.so) + # no version in name which happens e.g. for libpthread.so on Linux + # Suse 8.1, Slackware 8.1 and others, but there, the library is a link + # to a library with a version in it + libbase=`${ECHO} $libname | ${SED} -e "s/\.so$//"` + if ${TEST} -h $reallib; then + liblinked=`ls -l $reallib | ${AWK} '{print $NF}'` + version=`${ECHO} $liblinked | ${SED} -e "s/.*\.so\.//;s/\./:/g"` + else + # bail out + ${ECHO} "could not determine version of $reallib" + exit 1 + fi + ;; + *.so.[0-9]*) libbase=`${ECHO} $libname | ${SED} -e "s/\.so\.[0-9.]*$//"` version=`${ECHO} $libname | ${SED} -e "s/.*\.so\.//;s/\./:/g"` @@ -32,7 +47,9 @@ if ${TEST} ! -f $tmpdir/inst/$libbase.la; then libbase=`${ECHO} $libname | ${SED} -e "s/\.[0-9.]*\.dylib$//"` version=`${ECHO} $libname | ${SED} -e "s/^[^.]*\.\([0-9]*\.[0-9]*\)\.dylib/\1/;s/\./:/g"` ;; - esac +esac + +if ${TEST} ! -f $tmpdir/inst/$libbase.la; then ${MKDIR} $tmpdir/inst cd $tmpdir ${ECHO} "static int i;" > nonempty.c # create a nonempty input file |