summaryrefslogtreecommitdiff
path: root/devel/gmp
diff options
context:
space:
mode:
authorrichard <richard@pkgsrc.org>2015-07-16 09:16:30 +0000
committerrichard <richard@pkgsrc.org>2015-07-16 09:16:30 +0000
commit30f4b8b817425e943c00855ec383fe136c032c7f (patch)
treeb26c7db11cc26c367ca50582dad4b4dc126ea395 /devel/gmp
parent7027e152cc10147caddfd8139444b75e9bb1b5ce (diff)
downloadpkgsrc-30f4b8b817425e943c00855ec383fe136c032c7f.tar.gz
Fix builtin to not need any compiler elements in path, only to determine
version string... use awk instead to construct directly from gmp.h
Diffstat (limited to 'devel/gmp')
-rw-r--r--devel/gmp/builtin.mk14
1 files changed, 8 insertions, 6 deletions
diff --git a/devel/gmp/builtin.mk b/devel/gmp/builtin.mk
index b86e1936a31..8d2b05c5b6f 100644
--- a/devel/gmp/builtin.mk
+++ b/devel/gmp/builtin.mk
@@ -1,14 +1,16 @@
-# $NetBSD: builtin.mk,v 1.7 2014/04/18 10:49:01 adam Exp $
+# $NetBSD: builtin.mk,v 1.8 2015/07/16 09:16:30 richard Exp $
BUILTIN_PKG:= gmp
BUILTIN_FIND_HEADERS_VAR:= H_GMP
BUILTIN_FIND_HEADERS.H_GMP= gmp.h gmp/gmp.h
-BUILTIN_VERSION_SCRIPT.gmp= \
- { ${ECHO} "\#include <${H_GMP}>"; \
- ${ECHO} "__GNU_MP_VERSION/__GNU_MP_VERSION_MINOR/__GNU_MP_VERSION_PATCHLEVEL"; \
- } | ${CCPATH:U${CC}} -E - | ${SED} -e 's,/,.,g' | ${TAIL} -1
+BUILTIN_VERSION_SCRIPT.gmp= ${AWK} \
+ '/\#define[ \t]*__GNU_MP_VERSION[ \t]/ { major = $$3; } \
+ /\#define[ \t]*__GNU_MP_VERSION_MINOR[ \t]/ { minor = $$3; } \
+ /\#define[ \t]*__GNU_MP_VERSION_PATCHLEVEL[ \t]/ { patch = $$3; } \
+ END { if (major!="" && minor!="" && patch!="") \
+ print major "." minor "." patch; else print ""; }'
.include "../../mk/buildlink3/bsd.builtin.mk"
@@ -31,7 +33,7 @@ MAKEVARS+= IS_BUILTIN.gmp
.if !defined(BUILTIN_PKG.gmp) && \
!empty(IS_BUILTIN.gmp:M[yY][eE][sS]) && \
empty(H_GMP:M__nonexistent__)
-BUILTIN_VERSION.gmp!= ${BUILTIN_VERSION_SCRIPT.gmp}
+BUILTIN_VERSION.gmp!= ${BUILTIN_VERSION_SCRIPT.gmp} ${H_GMP}
BUILTIN_PKG.gmp= gmp-${BUILTIN_VERSION.gmp}
.endif
MAKEVARS+= BUILTIN_PKG.gmp