summaryrefslogtreecommitdiff
path: root/mk/bsd.buildlink.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-06-21 03:45:03 +0000
committerjlam <jlam@pkgsrc.org>2001-06-21 03:45:03 +0000
commit5d681ec5c03bf357bd4f5804ad3b9ab5820d6035 (patch)
tree5734df9d04f11b9543a73558fe0b19fd100351dd /mk/bsd.buildlink.mk
parent0477b99b80a0d9be7827e426bf32657f497152f5 (diff)
downloadpkgsrc-5d681ec5c03bf357bd4f5804ad3b9ab5820d6035.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.
Diffstat (limited to 'mk/bsd.buildlink.mk')
-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