summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2002-10-09 20:58:10 +0000
committerjlam <jlam@pkgsrc.org>2002-10-09 20:58:10 +0000
commit917d46efdf9cdeb8849c4ad28f8eee55a032fce8 (patch)
treeb6cde45656345cb3673e62fee7cc750343c6245f /mk
parenta4ec645faa4b21b3282e1f9ae18177f9891844a7 (diff)
downloadpkgsrc-917d46efdf9cdeb8849c4ad28f8eee55a032fce8.tar.gz
* Create variables BUILDLINK_CPPFLAGS and BUILDLINK_LDFLAGS that are
readable through CONFIGURE_ENV and MAKE_ENV. These may be used to fix up packages that use imake to check the appropriate locations for headers and libraries. * Don't be so aggressive in prepending _BLNK_{CPP,LD}FLAGS to {C,CPP,CXX,LD}FLAGS. The buildlink2 wrapper scripts will automatically filter out bad -[IL] paths, even if their added inadvertantly by package Makefiles, so we can simply append them to the existing {C,CPP,CXX,LD}FLAGS. We try to be smarter about appending them to avoid needless duplication.
Diffstat (limited to 'mk')
-rw-r--r--mk/buildlink2/bsd.buildlink2.mk31
1 files changed, 24 insertions, 7 deletions
diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk
index da1cac8f695..d063929d692 100644
--- a/mk/buildlink2/bsd.buildlink2.mk
+++ b/mk/buildlink2/bsd.buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink2.mk,v 1.37 2002/10/09 10:24:34 jlam Exp $
+# $NetBSD: bsd.buildlink2.mk,v 1.38 2002/10/09 20:58:10 jlam Exp $
#
# An example package buildlink2.mk file:
#
@@ -38,7 +38,7 @@ MAKE_ENV+= BUILDLINK_DIR="${BUILDLINK_DIR}"
CONFIGURE_ENV+= BUILDLINK_X11PKG_DIR="${BUILDLINK_X11PKG_DIR}"
MAKE_ENV+= BUILDLINK_X11PKG_DIR="${BUILDLINK_X11PKG_DIR}"
_BLNK_CPPFLAGS= -I${LOCALBASE}/include
-_BLNK_LDFLAGS= -L${LOCALBASE}/lib
+_BLNK_LDFLAGS= -L${LOCALBASE}/lib -Wl,-R${LOCALBASE}/lib
_BLNK_OPSYS= ${OPSYS}
# The configure process usually tests for outlandish or missing things
@@ -58,13 +58,30 @@ BUILDLINK_X11_DIR= ${LOCALBASE}/share/x11-links
CONFIGURE_ENV+= BUILDLINK_X11_DIR="${BUILDLINK_X11_DIR}"
MAKE_ENV+= BUILDLINK_X11_DIR="${BUILDLINK_X11_DIR}"
_BLNK_CPPFLAGS+= -I${X11BASE}/include
-_BLNK_LDFLAGS+= -L${X11BASE}/lib
+_BLNK_LDFLAGS+= -L${X11BASE}/lib -Wl,-R${X11BASE}/lib
.endif
-CFLAGS:= ${_BLNK_CPPFLAGS} ${CFLAGS}
-CXXFLAGS:= ${_BLNK_CPPFLAGS} ${CXXFLAGS}
-CPPFLAGS:= ${_BLNK_CPPFLAGS} ${CPPFLAGS}
-LDFLAGS:= ${_BLNK_LDFLAGS} ${LDFLAGS}
+CONFIGURE_ENV+= BUILDLINK_CPPFLAGS="${_BLNK_CPPFLAGS}"
+MAKE_ENV+= BUILDLINK_CPPFLAGS="${_BLNK_CPPFLAGS}"
+CONFIGURE_ENV+= BUILDLINK_LDFLAGS="${_BLNK_LDFLAGS}"
+MAKE_ENV+= BUILDLINK_LDFLAGS="${_BLNK_LDFLAGS}"
+
+.for FLAG in ${_BLNK_CPPFLAGS}
+. if empty(CFLAGS:M${FLAG})
+CFLAGS+= ${FLAG}
+. endif
+. if empty(CXXFLAGS:M${FLAG})
+CXXFLAGS+= ${FLAG}
+. endif
+. if empty(CPPFLAGS:M${FLAG})
+CPPFLAGS+= ${FLAG}
+. endif
+.endfor
+.for FLAG in ${_BLNK_LDFLAGS}
+. if empty(LDFLAGS:M${FLAG})
+LDFLAGS+= ${FLAG}
+. endif
+.endfor
# Prepend ${BUILDLINK_DIR}/bin to the PATH so that the wrappers are found
# first when searching for executables.