summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@free.fr>2012-07-14 16:25:47 (GMT)
committerYann E. MORIN" <yann.morin.1998@free.fr>2012-07-14 16:25:47 (GMT)
commit9c75afd9d322a42573a69e9a45347eb2e3fa4b7c (patch)
tree1f7de7f9254652d3604041f0e1d9ccea68022fdf
parent4e762e4918d8755e762db1db328760dfa5fc7a14 (diff)
configure: check for GNU awk, not any awk
Building glibc requires GNU awk, not any other. Reported-by: Han Sooloo <hansooloo@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-rw-r--r--Makefile.in4
-rw-r--r--configure.ac20
-rw-r--r--kconfig/kconfig.mk24
3 files changed, 33 insertions, 15 deletions
diff --git a/Makefile.in b/Makefile.in
index b74a929..3772058 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -53,6 +53,7 @@ export mandir := @mandir@
export datarootdir := @datarootdir@
export install := @INSTALL@
export bash := @_BASH@
+export awk := @_AWK@
export grep := @GREP@
export make := @MAKE@
export sed := @SED@
@@ -177,6 +178,7 @@ define sed_it
-e 's,@@CT_DATE@@,$(DATE),g;' \
-e 's,@@CT_make@@,$(make),g;' \
-e 's,@@CT_bash@@,$(bash),g;' \
+ -e 's,@@CT_awk@@,$(awk),g;' \
$< >$@
endef
@@ -195,6 +197,7 @@ paths.mk: FORCE
@echo " GEN '$@'"
@(echo 'export install=$(install)'; \
echo 'export bash=$(bash)'; \
+ echo 'export awk=$(awk)'; \
echo 'export grep=$(grep)'; \
echo 'export make=$(make)'; \
echo 'export sed=$(sed)'; \
@@ -210,6 +213,7 @@ paths.sh: FORCE
@echo " GEN '$@'"
@(echo 'export install="$(install)"'; \
echo 'export bash="$(bash)"'; \
+ echo 'export awk="$(awk)"'; \
echo 'export grep="$(grep)"'; \
echo 'export make="$(make)"'; \
echo 'export sed="$(sed)"'; \
diff --git a/configure.ac b/configure.ac
index 9c4fa98..e9950c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,7 +99,7 @@ AS_IF(
AC_CACHE_VAL([ac_cv_path_SED],
[AC_ARG_WITH([sed],
AS_HELP_STRING([--with-sed=PATH],
- [Specify the full PATH to sed]),
+ [Specify the full PATH to GNU sed]),
[ac_cv_path_SED=$withval])])
AC_PROG_SED
AC_MSG_CHECKING([whether sed understands -r -i -e])
@@ -129,7 +129,6 @@ ACX_PATH_TOOL_REQ([READELF], [readelf])
ACX_CHECK_PROGS_REQ([bison], [bison])
ACX_CHECK_PROGS_REQ([flex], [flex])
ACX_CHECK_PROGS_REQ([gperf], [gperf])
-ACX_CHECK_PROGS_REQ([awk], [gawk mawk nawk awk])
ACX_CHECK_PROGS_REQ([makeinfo], [makeinfo])
ACX_CHECK_PROGS_REQ([cut], [cut])
ACX_CHECK_PROGS_REQ([stat], [stat])
@@ -151,7 +150,7 @@ ACX_PATH_PROGS_REQ([PATCH], [patch])
AC_CACHE_VAL([ac_cv_path__BASH],
[AC_ARG_WITH([bash],
AS_HELP_STRING([--with-bash=PATH],
- [Specify the full PATH to bash >= 3.1]),
+ [Specify the full PATH to GNU bash >= 3.1]),
[ac_cv_path__BASH=$withval])])
AC_CACHE_CHECK([for bash >= 3.1], [ac_cv_path__BASH],
[AC_PATH_PROGS_FEATURE_CHECK([_BASH], [bash],
@@ -162,6 +161,21 @@ AC_CACHE_CHECK([for bash >= 3.1], [ac_cv_path__BASH],
AC_MSG_ERROR([could not find bash >= 3.1])])])
AC_SUBST([_BASH], [$ac_cv_path__BASH])
+# We need a awk that *is* GNU awk
+AC_CACHE_VAL([ac_cv_path__AWK],
+ [AC_ARG_WITH([awk],
+ AS_HELP_STRING([--with-awk=PATH],
+ [Specify the full PATH to GNU awk]),
+ [ac_cv_path__AWK=$withval])])
+AC_CACHE_CHECK([for GNU awk], [ac_cv_path__AWK],
+ [AC_PATH_PROGS_FEATURE_CHECK([_AWK], [awk gawk],
+ [[_AWK_ver=$($ac_path__AWK --version 2>&1 \
+ |$EGREP '^GNU Awk ')
+ test -n "$_AWK_ver" && ac_cv_path__AWK=$ac_path__AWK ac_path__AWK_found=:]],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([could not find GNU awk])])])
+AC_SUBST([_AWK], [$ac_cv_path__AWK])
+
#----------------------------------------
# Check for GNU make 3.80 or above
AC_CACHE_VAL([ac_cv_path_MAKE],
diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk
index cc6aa46..8748287 100644
--- a/kconfig/kconfig.mk
+++ b/kconfig/kconfig.mk
@@ -29,18 +29,18 @@ oldconfig: .config
# Always be silent, the stdout an be >.config
extractconfig:
- @awk 'BEGIN { dump=0; } \
- dump==1 && $$0~/^\[.....\][[:space:]]+(# |)CT_/ { \
- $$1=""; \
- gsub("^[[:space:]]",""); \
- print; \
- } \
- $$0~/Dumping user-supplied crosstool-NG configuration: done in/ { \
- dump=0; \
- } \
- $$0~/Dumping user-supplied crosstool-NG configuration$$/ { \
- dump=1; \
- }'
+ @$(awk) 'BEGIN { dump=0; } \
+ dump==1 && $$0~/^\[.....\][[:space:]]+(# |)CT_/ { \
+ $$1=""; \
+ gsub("^[[:space:]]",""); \
+ print; \
+ } \
+ $$0~/Dumping user-supplied crosstool-NG configuration: done in/ { \
+ dump=0; \
+ } \
+ $$0~/Dumping user-supplied crosstool-NG configuration$$/ { \
+ dump=1; \
+ }'
#-----------------------------------------------------------
# Help text used by make help