Tue Aug 6 21:47:01 2013 UTC ()
Add the "-g -D__gnu__" flags when invoking M4 via CONFIGURE_ARGS
in tools/Makefile.gnuhost.  This makes the tools version of m4
behave like GNU m4.

Remove similar code from tools/autoconf/Makefile, where it didn't
work because Makefile.gnuhost would previously have overridden it.

This fixes a problem in which the tools version of autoconf complained
"M4sugar requires GNU M4.
Install it before installing M4sugar or set the M4 environment variable to its path name."


(apb)
diff -r1.39 -r1.40 src/tools/Makefile.gnuhost
diff -r1.4 -r1.5 src/tools/autoconf/Makefile

cvs diff -r1.39 -r1.40 src/tools/Makefile.gnuhost (expand / switch to unified diff)

--- src/tools/Makefile.gnuhost 2012/06/19 21:48:33 1.39
+++ src/tools/Makefile.gnuhost 2013/08/06 21:47:01 1.40
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile.gnuhost,v 1.39 2012/06/19 21:48:33 hans Exp $ 1# $NetBSD: Makefile.gnuhost,v 1.40 2013/08/06 21:47:01 apb Exp $
2# 2#
3# Rules used when building a GNU host package. Expects MODULE to be set. 3# Rules used when building a GNU host package. Expects MODULE to be set.
4# 4#
5# There's not a lot we can do to build reliably in the face of many 5# There's not a lot we can do to build reliably in the face of many
6# available configuration options. To be as low-overhead as possible, 6# available configuration options. To be as low-overhead as possible,
7# we follow the following scheme: 7# we follow the following scheme:
8# 8#
9# * Configuration is only re-run when an autoconf source file (such as 9# * Configuration is only re-run when an autoconf source file (such as
10# "configure" or "config.sub") is changed. 10# "configure" or "config.sub") is changed.
11# 11#
12# * "config.status" is run to rebuild Makefiles and .h files if an 12# * "config.status" is run to rebuild Makefiles and .h files if an
13# autoconf-parsed file (such as Makefile.in) is changed. 13# autoconf-parsed file (such as Makefile.in) is changed.
14# 14#
@@ -46,27 +46,27 @@ _GNU_CFGSRC!= find ${GNUHOSTDIST} ${FIND @@ -46,27 +46,27 @@ _GNU_CFGSRC!= find ${GNUHOSTDIST} ${FIND
46.endif 46.endif
47 47
48CONFIGURE_ENV+= \ 48CONFIGURE_ENV+= \
49 AR=${HOST_AR:Q} \ 49 AR=${HOST_AR:Q} \
50 AWK=${TOOL_AWK:Q} \ 50 AWK=${TOOL_AWK:Q} \
51 CC=${HOST_CC:Q} \ 51 CC=${HOST_CC:Q} \
52 CFLAGS=${HOST_CFLAGS:Q} \ 52 CFLAGS=${HOST_CFLAGS:Q} \
53 CPPFLAGS=${HOST_CPPFLAGS:Q} \ 53 CPPFLAGS=${HOST_CPPFLAGS:Q} \
54 CXX=${HOST_CXX:Q} \ 54 CXX=${HOST_CXX:Q} \
55 CXXFLAGS=${HOST_CXXFLAGS:Q} \ 55 CXXFLAGS=${HOST_CXXFLAGS:Q} \
56 INSTALL=${HOST_INSTALL_FILE:Q} \ 56 INSTALL=${HOST_INSTALL_FILE:Q} \
57 LDFLAGS=${HOST_LDFLAGS:Q} \ 57 LDFLAGS=${HOST_LDFLAGS:Q} \
58 LEX=${LEX:Q} \ 58 LEX=${LEX:Q} \
59 M4=${TOOL_M4:Q} \ 59 M4=${TOOL_M4:Q}" -g -D__gnu__" \
60 MAKE=${MAKE_PROGRAM:Q} \ 60 MAKE=${MAKE_PROGRAM:Q} \
61 PATH="${TOOLDIR}/bin:$$PATH" \ 61 PATH="${TOOLDIR}/bin:$$PATH" \
62 RANLIB=${HOST_RANLIB:Q} \ 62 RANLIB=${HOST_RANLIB:Q} \
63 YACC=${YACC:Q} 63 YACC=${YACC:Q}
64 64
65BUILD_ENV+= ${CONFIGURE_ENV} 65BUILD_ENV+= ${CONFIGURE_ENV}
66 66
67CONFIGURE_ARGS+=--prefix=${TOOLDIR} 67CONFIGURE_ARGS+=--prefix=${TOOLDIR}
68.if ${MKPIC} == "no" 68.if ${MKPIC} == "no"
69CONFIGURE_ARGS+=--disable-shared 69CONFIGURE_ARGS+=--disable-shared
70.endif 70.endif
71 71
72.if ${MAKE_PROGRAM} == ${MAKE} 72.if ${MAKE_PROGRAM} == ${MAKE}

cvs diff -r1.4 -r1.5 src/tools/autoconf/Makefile (expand / switch to unified diff)

--- src/tools/autoconf/Makefile 2002/12/08 20:19:57 1.4
+++ src/tools/autoconf/Makefile 2013/08/06 21:47:01 1.5
@@ -1,8 +1,7 @@ @@ -1,8 +1,7 @@
1# $NetBSD: Makefile,v 1.4 2002/12/08 20:19:57 thorpej Exp $ 1# $NetBSD: Makefile,v 1.5 2013/08/06 21:47:01 apb Exp $
2 2
3MODULE= autoconf 3MODULE= autoconf
4 4
5CONFIGURE_ARGS= --program-prefix=${_TOOL_PREFIX} 5CONFIGURE_ARGS= --program-prefix=${_TOOL_PREFIX}
6CONFIGURE_ENV= M4="${TOOLDIR}/bin/${_TOOL_PREFIX}m4 -g -D__gnu__" 
7 6
8.include "${.CURDIR}/../Makefile.gnuhost" 7.include "${.CURDIR}/../Makefile.gnuhost"