summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam>2005-08-10 20:56:10 +0000
committerjlam <jlam>2005-08-10 20:56:10 +0000
commitb3f78ea1dc65ca87b470169b6f46da18d36bf91b (patch)
tree4d8a0ec4125811389b8272e1e14bc12417f9448c /mk
parent6cc0e59139f460170ef1bc22cecf04a148381243 (diff)
downloadpkgsrc-b3f78ea1dc65ca87b470169b6f46da18d36bf91b.tar.gz
Remove the abuse of buildlink that was pkg-config/buildlink3.mk. That
file's sole purpose was to provide a dependency on pkg-config and set some environment variables. Instead, turn pkg-config into a "tool" in the tools framework, where the pkg-config wrapper automatically adds PKG_CONFIG_LIBDIR to the environment before invoking the real pkg-config. For all package Makefiles that included pkg-config/buildlink3.mk, remove that inclusion and replace it with USE_TOOLS+=pkg-config.
Diffstat (limited to 'mk')
-rw-r--r--mk/tools/bsd.tools.mk3
-rw-r--r--mk/tools/pkg-config.mk50
-rw-r--r--mk/tools/replace.mk13
3 files changed, 64 insertions, 2 deletions
diff --git a/mk/tools/bsd.tools.mk b/mk/tools/bsd.tools.mk
index aa6e2855b5a..f12695bcb9a 100644
--- a/mk/tools/bsd.tools.mk
+++ b/mk/tools/bsd.tools.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.tools.mk,v 1.31 2005/07/17 23:19:04 jlam Exp $
+# $NetBSD: bsd.tools.mk,v 1.32 2005/08/10 20:56:20 jlam Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -117,6 +117,7 @@ USE_TOOLS?= # empty
.include "../../mk/tools/imake.mk"
.include "../../mk/tools/replace.mk"
.include "../../mk/tools/perl.mk"
+.include "../../mk/tools/pkg-config.mk"
.include "../../mk/tools/make.mk"
######################################################################
diff --git a/mk/tools/pkg-config.mk b/mk/tools/pkg-config.mk
new file mode 100644
index 00000000000..5c1d512c030
--- /dev/null
+++ b/mk/tools/pkg-config.mk
@@ -0,0 +1,50 @@
+# $NetBSD: pkg-config.mk,v 1.1 2005/08/10 20:56:20 jlam Exp $
+#
+# Copyright (c) 2005 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Johnny C. Lam.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the NetBSD
+# Foundation, Inc. and its contributors.
+# 4. Neither the name of The NetBSD Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# Override the location where pkg-config searches for *.pc files in the
+# pkg-config wrapper script.
+#
+PKG_CONFIG_LIBDIR?= ${BUILDLINK_DIR}/lib/pkgconfig
+
+TOOLS_SCRIPT.pkg-config= \
+ PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:Q} ${TOOLS_SCRIPT_DFLT.pkg-config}
+
+CONFIGURE_ENV+= PKG_CONFIG=${TOOLS_CMD.pkg-config:Q}
+CONFIGURE_ENV+= PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:Q}
+MAKE_ENV+= PKG_CONFIG=${TOOLS_CMD.pkg-config:Q}
+MAKE_ENV+= PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:Q}
diff --git a/mk/tools/replace.mk b/mk/tools/replace.mk
index 559867d145a..f6186c0b418 100644
--- a/mk/tools/replace.mk
+++ b/mk/tools/replace.mk
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.124 2005/08/10 06:08:48 jlam Exp $
+# $NetBSD: replace.mk,v 1.125 2005/08/10 20:56:20 jlam Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -868,6 +868,17 @@ TOOLS_PATH.perl= ${TOOLS_PREFIX.perl}/bin/perl
. endif
.endif
+.if !defined(TOOLS_IGNORE.pkg-config) && !empty(_USE_TOOLS:Mpkg-config)
+. if !empty(PKGPATH:Mdevel/pkg-config)
+MAKEFLAGS+= TOOLS_IGNORE.pkg-config=
+. elif !empty(_TOOLS_USE_PKGSRC.pkg-config:M[yY][eE][sS])
+TOOLS_DEPENDS.pkg-config?= pkg-config>=0.19:../../devel/pkg-config
+TOOLS_CREATE+= pkg-config
+TOOLS_FIND_PREFIX+= TOOLS_PREFIX.pkg-config=pkg-config
+TOOLS_PATH.pkg-config= ${TOOLS_PREFIX.pkg-config}/bin/pkg-config
+. endif
+.endif
+
.if !defined(TOOLS_IGNORE.pod2man) && !empty(_USE_TOOLS:Mpod2man)
. if !empty(PKGPATH:Mlang/perl5)
MAKEFLAGS+= TOOLS_IGNORE.pod2man=