summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.debug.mk
diff options
context:
space:
mode:
authorrillig <rillig>2007-01-08 11:06:44 +0000
committerrillig <rillig>2007-01-08 11:06:44 +0000
commit8ddb416c6b6cd8acc198b2e9c732de6427aa8cce (patch)
tree78a3c79bb351556a2a7269ab877f9650487b1b2b /mk/bsd.pkg.debug.mk
parent776c8291f36de7a512e239fb1fe0fa840b942b83 (diff)
downloadpkgsrc-8ddb416c6b6cd8acc198b2e9c732de6427aa8cce.tar.gz
Rewrote the config.h parsing code to work with both autoconf 2.13 and
2.59. Tested with devel/libslang, which is particularly nasty because it comes without a configure.ac file and also does not use the standard config.h filename.
Diffstat (limited to 'mk/bsd.pkg.debug.mk')
-rw-r--r--mk/bsd.pkg.debug.mk40
1 files changed, 20 insertions, 20 deletions
diff --git a/mk/bsd.pkg.debug.mk b/mk/bsd.pkg.debug.mk
index 0aec7d07204..2c67bd5ccdd 100644
--- a/mk/bsd.pkg.debug.mk
+++ b/mk/bsd.pkg.debug.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.debug.mk,v 1.12 2007/01/08 02:38:42 rillig Exp $
+# $NetBSD: bsd.pkg.debug.mk,v 1.13 2007/01/08 11:06:44 rillig Exp $
#
# The `debug' target outputs the values of some commonly used variables
@@ -87,26 +87,26 @@ _show-dbginfo-config.status:
_show-dbginfo-config.h:
.if !empty(CONFIGURE_DIRS:M*)
${_PKG_SILENT}${_PKG_DEBUG} set -e; \
- if ${TEST} -d ${WRKSRC:Q}; then cd ${WRKSRC:Q}; \
+ [ -d ${WRKSRC} ] || exit 0; \
+ print_config_h() { \
+ printf "%s:\\n" "`pwd`/$$1"; \
+ awk '/^#define / { print "\t"$$0; } /^\/\* #undef / { print "\t" $$2 " " $$3; }' < "$$1"; \
+ printf "\\n"; \
+ }; \
for cdir in ${CONFIGURE_DIRS}; do \
- ch="$${cdir}/config.h"; \
- if ${TEST} ! -f "$${ch}"; then \
- cac="$${cdir}/configure.ac"; \
- if ${TEST} ! -f "$${cac}"; then \
- cac="$${cdir}/configure.in"; \
- fi; \
- if ${TEST} ! -f "$${cac}"; then \
- continue; \
- fi; \
- ch="$${cdir}/"`${SED} -n 's,.*AC_CONFIG_HEADERS(\[\([[:graph:]]*\)\]).*,\1,p' < "$${cac}"`; \
- if ${TEST} ! -f "$${ch}"; then \
- continue; \
- fi; \
- fi; \
- ${PRINTF} "%s:\\n" "$${ch}"; \
- ${AWK} '/^#define / { print "\t"$$0; } /^\/\* #undef / { print "\t" $$2 " " $$3; }' < "$${ch}"; \
- ${PRINTF} "\\n"; \
- done; fi
+ cd ${WRKSRC}; [ -d "$$cdir" ] || continue; cd "$$cdir"; \
+ [ ! -f config.h ] || { print_config_h config.h; continue; }; \
+ [ ! -f config.status ] || { \
+ : "autoconf 2.59"; \
+ chs=`sed -n 's,^config_headers="\(.*\)".*,\1,p' config.status || true`; \
+ : "autoconf 2.13"; \
+ [ "$$chs" ] || chs=`sed -n 's,^ CONFIG_HEADERS="\([^:"]*\).*,\1,p' config.status || true`; \
+ done=no; \
+ for ch in $$chs; do print_config_h "$$ch"; done=yes; done; \
+ [ $$done = no ] || continue; \
+ }; \
+ printf "WARNING: No config header found in `pwd`.\\n\\n"; \
+ done
.else
@${DO_NADA}
.endif