summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig>2006-11-09 10:26:50 +0000
committerrillig <rillig>2006-11-09 10:26:50 +0000
commit3e7805984766f53939bd59dd0498dd15a681aea0 (patch)
treed9799445860ccf21d367f578012e98a06533713f /mk
parent4ad2107b89d8f1c45fbf98e9a29c08e505c05730 (diff)
downloadpkgsrc-3e7805984766f53939bd59dd0498dd15a681aea0.tar.gz
Added an explanation how to fix the errors reported by this check.
Diffstat (limited to 'mk')
-rw-r--r--mk/check/check-headers.sh32
1 files changed, 31 insertions, 1 deletions
diff --git a/mk/check/check-headers.sh b/mk/check/check-headers.sh
index 27281d87f59..6c0db56f482 100644
--- a/mk/check/check-headers.sh
+++ b/mk/check/check-headers.sh
@@ -1,4 +1,4 @@
-# $NetBSD: check-headers.sh,v 1.2 2006/11/09 09:51:46 rillig Exp $
+# $NetBSD: check-headers.sh,v 1.3 2006/11/09 10:26:50 rillig Exp $
#
# This program checks the header files for possible problems.
#
@@ -12,6 +12,8 @@ set -eu
. "${PKGSRCDIR}/mk/check/check-subr.sh"
cs_setprogname "$0"
+found_unresolved_variable=no
+
# usage: check_header <fname>
check_header() {
# See the end of the loop for the redirection.
@@ -20,6 +22,7 @@ check_header() {
# Check for "${" in macro definitions.
case "$line" in
"#define"*"\${"*)
+ found_unresolved_variable=yes
cs_error_heading "Found unresolved variable in macro:"
cs_error_msg "$fname: $line"
;;
@@ -40,5 +43,32 @@ find * -type f -print 2>/dev/null \
;;
esac
done
+
+ if [ $found_unresolved_variable = yes ]; then
+ cat 1>&2 <<EOF
+
+===========================================================================
+The above macros probably contain references to shell variables.
+
+The cause of this problem is usually that in a configure.ac or
+configure.in file, there is some code like
+
+ FOO_DIR=\"\${bindir}\"
+ AC_DEFINE_UNQUOTED(FOO_DIR, \"\$FOO_DIR\", [Directory where foo files go])
+
+You can fix this by telling the original package author not to use
+AC_DEFINE_UNQUOTED for directories. Instead, {he,she} should do
+something like this:
+
+ # in configure.ac:
+ foodir=\"\${bindir}\"
+ AC_SUBST(FOO_DIR)
+
+ # in the Makefile.am files (can be more than one):
+ AM_CPPFLAGS= -DFOO_DIR=\\\"@FOO_DIR@\\\"
+===========================================================================
+EOF
+
+ fi
cs_exit
}