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>
This commit is contained in:
Yann E. MORIN" 2012-07-14 18:25:47 +02:00
parent 4e762e4918
commit 9c75afd9d3
3 changed files with 33 additions and 15 deletions

View File

@ -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)"'; \

View File

@ -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],

View File

@ -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