summaryrefslogtreecommitdiff
path: root/mk/buildlink3
diff options
context:
space:
mode:
authorjlam <jlam>2004-11-12 04:57:31 +0000
committerjlam <jlam>2004-11-12 04:57:31 +0000
commite6766b648e7de0659c4c3d5970446d573944fd17 (patch)
treefe7cef71d410083dbbc27dd94eea25fad2146442 /mk/buildlink3
parentc321dfee13eb84ce5c18296a30c32333746030aa (diff)
downloadpkgsrc-e6766b648e7de0659c4c3d5970446d573944fd17.tar.gz
Add a new variable BUILDLINK_LIBS.<pkg> which contains a list of -l...
options (library options) to be appended automatically to LIBS when building against <pkg>. LIBS is used by GNU configure scripts to note the library options that are automatically added to the link command line.
Diffstat (limited to 'mk/buildlink3')
-rw-r--r--mk/buildlink3/bsd.buildlink3.mk42
1 files changed, 32 insertions, 10 deletions
diff --git a/mk/buildlink3/bsd.buildlink3.mk b/mk/buildlink3/bsd.buildlink3.mk
index a4804e2c1e1..c053bd6522d 100644
--- a/mk/buildlink3/bsd.buildlink3.mk
+++ b/mk/buildlink3/bsd.buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.159 2004/10/05 15:28:50 jlam Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.160 2004/11/12 04:57:31 jlam Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -261,6 +261,10 @@ ${_depmethod_}+= ${_BLNK_ADD_TO.${_depmethod_}}
# compiler/linker so that building against
# <pkg> will work.
#
+# BUILDLINK_LIBS.<pkg> contain -l... (library) options that are
+# automatically appended to the LIBS
+# variable when building against <pkg>.
+#
# BUILDLINK_INCDIRS.<pkg>,
# BUILDLINK_LIBDIRS.<pkg>,
# BUILDLINK_RPATHDIRS.<pkg> subdirectories of BUILDLINK_PREFIX.<pkg>
@@ -342,6 +346,7 @@ WRAPPER_VARS+= BUILDLINK_PREFIX.${_pkg_}
BUILDLINK_CPPFLAGS.${_pkg_}?= # empty
BUILDLINK_LDFLAGS.${_pkg_}?= # empty
+BUILDLINK_LIBS.${_pkg_}?= # empty
BUILDLINK_INCDIRS.${_pkg_}?= include
BUILDLINK_LIBDIRS.${_pkg_}?= lib${ABI}
. if !empty(BUILDLINK_DEPMETHOD.${_pkg_}:Mfull)
@@ -351,14 +356,15 @@ BUILDLINK_RPATHDIRS.${_pkg_}?= # empty
. endif
.endfor
-# BUILDLINK_CPPFLAGS and BUILDLINK_LDFLAGS contain the proper -I...
-# and -L.../-Wl,-R... options to be passed to the compiler and linker
-# to find the headers and libraries for the various packages at
-# configure/build time. BUILDLINK_CFLAGS contains any special compiler
-# options needed when building against the various packages.
+# BUILDLINK_CPPFLAGS, BUILDLINK_LDFLAGS, and BUILDLINK_LIBS contain the
+# proper -I..., -L.../-Wl,-R..., and -l... options to be passed to the
+# compiler and linker to find the headers and libraries for the various
+# packages at configure/build time. BUILDLINK_CFLAGS contains any special
+# compiler options needed when building against the various packages.
#
BUILDLINK_CPPFLAGS= # empty
BUILDLINK_LDFLAGS= # empty
+BUILDLINK_LIBS= # empty
BUILDLINK_CFLAGS= # empty
.for _pkg_ in ${_BLNK_PACKAGES}
@@ -377,6 +383,11 @@ BUILDLINK_LDFLAGS+= ${_flag_}
BUILDLINK_CFLAGS+= ${_flag_}
. endif
. endfor
+. for _flag_ in ${BUILDLINK_LIBS.${_pkg_}}
+. if empty(BUILDLINK_LIBS:M${_flag_})
+BUILDLINK_LIBS+= ${_flag_}
+. endif
+. endfor
. if !empty(BUILDLINK_INCDIRS.${_pkg_})
. for _dir_ in ${BUILDLINK_INCDIRS.${_pkg_}:S/^/${BUILDLINK_PREFIX.${_pkg_}}\//}
. if exists(${_dir_})
@@ -449,6 +460,12 @@ BUILDLINK_LDFLAGS+= ${COMPILER_RPATH_FLAG}${X11BASE}/lib${ABI}
. endif
.endif
+CFLAGS?= # empty
+CPPFLAGS?= # empty
+CXXFLAGS?= # empty
+LDFLAGS?= # empty
+LIBS?= # empty
+
.for _flag_ in ${BUILDLINK_CFLAGS}
. if empty(CFLAGS:M${_flag_})
CFLAGS+= ${_flag_}
@@ -457,14 +474,14 @@ CFLAGS+= ${_flag_}
CXXFLAGS+= ${_flag_}
. endif
.endfor
-.for _flag_ in ${BUILDLINK_CPPFLAGS}
-. if empty(CPPFLAGS:M${_flag_})
-CPPFLAGS+= ${_flag_}
-. endif
#
# We add BUILDLINK_CPPFLAGS to both CFLAGS and CXXFLAGS since much software
# ignores the value of CPPFLAGS that we set in the environment.
#
+.for _flag_ in ${BUILDLINK_CPPFLAGS}
+. if empty(CPPFLAGS:M${_flag_})
+CPPFLAGS+= ${_flag_}
+. endif
. if empty(CFLAGS:M${_flag_})
CFLAGS+= ${_flag_}
. endif
@@ -477,6 +494,11 @@ CXXFLAGS+= ${_flag_}
LDFLAGS+= ${_flag_}
. endif
.endfor
+.for _flag_ in ${BUILDLINK_LIBS}
+. if empty(LIBS:M${_flag_})
+LIBS+= ${_flag_}
+. endif
+.endfor
# Create the buildlink include and lib directories so that the Darwin
# compiler/linker won't complain verbosely (on stdout, even!) when