summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2002-03-18 17:45:34 +0000
committerjlam <jlam@pkgsrc.org>2002-03-18 17:45:34 +0000
commit54f9720d097b946dbd65ec1d0f1970e71bcd56bc (patch)
treebad9886d3c920f822aaaaaabfe10acfbe88e12e0
parentd08dd9d6790906669fefebf2f5129e1ddb5afb31 (diff)
downloadpkgsrc-54f9720d097b946dbd65ec1d0f1970e71bcd56bc.tar.gz
_LIBTOOL_ARCHIVE_TRANSFORM creates $${dest} from $${file}, where
$${file} is a libtool archive (*.la). It allows libtool to properly interact with buildlink at link time by linking against the libraries pointed to by symlinks in ${BUILDLINK_DIR}. This change has been tested by me on NetBSD-1.5ZA/i386 and by Mark Davies <mark@mcs.vuw.ac.nz> on Solaris.
-rw-r--r--mk/bsd.buildlink.mk23
1 files changed, 20 insertions, 3 deletions
diff --git a/mk/bsd.buildlink.mk b/mk/bsd.buildlink.mk
index f543a94a2bf..59e28863183 100644
--- a/mk/bsd.buildlink.mk
+++ b/mk/bsd.buildlink.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink.mk,v 1.57 2002/03/08 19:35:57 jlam Exp $
+# $NetBSD: bsd.buildlink.mk,v 1.58 2002/03/18 17:45:34 jlam Exp $
#
# This Makefile fragment is included by package buildlink.mk files. This
# file does the following things:
@@ -119,6 +119,8 @@ _BSD_BUILDLINK_MK= # defined
BUILDLINK_DIR= ${WRKDIR}/.buildlink
+.include "../../mk/bsd.prefs.mk"
+
.if !defined(_BUILDLINK_CPPFLAGS) || !defined(_BUILDLINK_LDFLAGS)
_BUILDLINK_CPPFLAGS= -I${BUILDLINK_DIR}/include
_BUILDLINK_LDFLAGS= -L${BUILDLINK_DIR}/lib
@@ -139,6 +141,22 @@ MAKE_ENV+= BUILDLINK_LDFLAGS="${_BUILDLINK_LDFLAGS}"
ECHO_BUILDLINK_MSG?= ${ECHO_MSG} "=>"
+# _LIBTOOL_ARCHIVE_TRANSFORM creates $${dest} from $${file}, where
+# $${file} is a libtool archive (*.la). It allows libtool to properly
+# interact with buildlink at link time by linking against the libraries
+# pointed to by symlinks in ${BUILDLINK_DIR}.
+#
+_LIBTOOL_ARCHIVE_TRANSFORM_SED= \
+ -e "s|${LOCALBASE}\(/lib/[^ ]*\.la\)|${BUILDLINK_DIR}\1|g" \
+ -e "s|${X11BASE}\(/lib/[^ ]*\.la\)|${BUILDLINK_DIR}\1|g"
+
+.if defined(USE_BUILDLINK_ONLY)
+_LIBTOOL_ARCHIVE_TRANSFORM_SED+= ${_BUILDLINK_CONFIG_WRAPPER_SED}
+.endif
+
+_LIBTOOL_ARCHIVE_TRANSFORM= \
+ ${SED} ${_LIBTOOL_ARCHIVE_TRANSFORM_SED} $${file} > $${dest}
+
_BUILDLINK_USE: .USE
${_PKG_SILENT}${_PKG_DEBUG} \
cookie=${BUILDLINK_DIR}/.${.TARGET:S/-buildlink//}_buildlink_done; \
@@ -161,6 +179,7 @@ _BUILDLINK_USE: .USE
${RM} -f $${dest}; \
case $${file} in \
*.la) \
+ ${_LIBTOOL_ARCHIVE_TRANSFORM}; \
;; \
*) \
${LN} -sf $${file} $${dest}; \
@@ -249,8 +268,6 @@ _BUILDLINK_SUBST_USE: .USE
fi; \
fi
-.include "../../mk/bsd.prefs.mk"
-
MAKEFILE_PATTERNS+= ${MAKEFILE:T}
MAKEFILE_PATTERNS+= Makefile
MAKEFILE_PATTERNS+= Makeconf