summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk6
-rw-r--r--mk/platform/Linux.mk9
2 files changed, 13 insertions, 2 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index d70fff3d588..065ce0aaf4a 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1971 2010/05/19 09:12:15 sbd Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1972 2010/05/20 07:57:22 sbd Exp $
#
# This file is in the public domain.
#
@@ -530,6 +530,10 @@ BUILTIN_PKGS+= ${BUILTIN_PKG.${_pkg_}}
_BUILD_DEFS+= BUILTIN_PKGS
.endif
+.if defined(GLIBC_VERSION)
+_BUILD_DEFS+= GLIBC_VERSION
+.endif # GLIBC_VERSION
+
.PHONY: all
.if !target(all)
all: ${_PKGSRC_BUILD_TARGETS}
diff --git a/mk/platform/Linux.mk b/mk/platform/Linux.mk
index 2afe063a1b3..133ad115622 100644
--- a/mk/platform/Linux.mk
+++ b/mk/platform/Linux.mk
@@ -1,4 +1,4 @@
-# $NetBSD: Linux.mk,v 1.38 2010/05/16 06:59:26 sbd Exp $
+# $NetBSD: Linux.mk,v 1.39 2010/05/20 07:57:23 sbd Exp $
#
# Variable definitions for the Linux operating system.
@@ -111,3 +111,10 @@ _OPSYS_CAN_CHECK_SHLIBS= yes # use readelf in check/bsd.check-vars.mk
ABI?= 64
LIBABISUFFIX?= 64
.endif
+
+## Use _CMD so the command only gets run when needed!
+.if exists(/lib/libc.so.6)
+_GLIBC_VERSION_CMD= /lib/libc.so.6 --version | \
+ sed -ne's/^GNU C.*version \(.*\),.*$$/\1/p'
+GLIBC_VERSION= ${_GLIBC_VERSION_CMD:sh}
+.endif