summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2001-06-21 03:45:03 +0000
committerjlam <jlam>2001-06-21 03:45:03 +0000
commit3076593b748ebe3de79c083502d6891fc9165cf3 (patch)
tree5734df9d04f11b9543a73558fe0b19fd100351dd
parent1cb1cc1a14240297d1ba4e9c7051f47e0727dea1 (diff)
downloadpkgsrc-3076593b748ebe3de79c083502d6891fc9165cf3.tar.gz
Add code that runs at post-build time to fix references to ${BUILDLINK_DIR}
into ${LOCALBASE} in libtool archives if USE_LIBTOOL is defined.
-rw-r--r--mk/bsd.buildlink.mk24
1 files changed, 23 insertions, 1 deletions
diff --git a/mk/bsd.buildlink.mk b/mk/bsd.buildlink.mk
index 26d1e0036f4..eb1ef2cedeb 100644
--- a/mk/bsd.buildlink.mk
+++ b/mk/bsd.buildlink.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink.mk,v 1.12 2001/06/20 23:49:43 jlam Exp $
+# $NetBSD: bsd.buildlink.mk,v 1.13 2001/06/21 03:45:03 jlam Exp $
#
# This Makefile fragment is included by package buildlink.mk files. This
# file does the following things:
@@ -142,4 +142,26 @@ _BUILDLINK_CONFIG_WRAPPER_USE: .USE
${TOUCH} ${TOUCH_FLAGS} $${cookie}; \
fi
+.if defined(USE_LIBTOOL)
+post-build: buildlink-fix-libtool-archives
+
+# Note: This target _MUST_ know something about libtool internals to correctly
+# fix the references to ${BUILDLINK_DIR} into ${LOCALBASE}.
+#
+buildlink-fix-libtool-archives:
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ cookie=${BUILDLINK_DIR}/.buildlink_fix_libtool_archives_done; \
+ if [ ! -f $${cookie} ]; then \
+ ${ECHO_MSG} "Fixing directory references in libtool archives."; \
+ lai_files=`${FIND} ${WRKSRC} -name "*.lai"`; \
+ for file in $${lai_files}; do \
+ ${MV} -f $${file} $${file}.fixme; \
+ ${SED} -e "s|-L${BUILDLINK_DIR}|-L${LOCALBASE}|g" \
+ $${file}.fixme > $${file}; \
+ ${RM} -f $${file}.fixme; \
+ done; \
+ ${TOUCH} ${TOUCH_FLAGS} $${cookie}; \
+ fi
+.endif
+
.endif # _BSD_BUILDLINK_MK