diff options
author | Daniel Stenberg <daniel@haxx.se> | 2010-07-12 18:39:40 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-07-12 18:45:21 +0200 |
commit | 241b704e1fcc0d2a5403b3567f390e662a83dff6 (patch) | |
tree | 2c6202d5846e910be62af06e9bc2a18ae0078796 | |
parent | 1dbb9a0ba49a927c5e840d81459fdadc8d3edb27 (diff) |
configure: allow environments variable to override internals
configure checks for grep, egrep, sed and ar and set the variables GREP,
EGREP, SED and AR accordingly. We now let already set variables override
the internal choices to let users make decisions when they know the
right choice already. This is a regression as our configure script used
to allow this back before commit 0b57c475 (up to 7.18.2).
Reported by: "kdekker"
Bug: http://curl.haxx.se/bug/view.cgi?id=3028318
-rw-r--r-- | configure.ac | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac index 18a364234..510cbbf04 100644 --- a/configure.ac +++ b/configure.ac @@ -53,31 +53,40 @@ AC_SUBST(CONFIGURE_OPTIONS) dnl SED is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. -AC_PATH_PROG([SED], [sed], [not_found], - [$PATH:/usr/bin:/usr/local/bin]) -if test -z "$SED" || test "$SED" = "not_found"; then - AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.]) +if test -z "$SED"; then + dnl allow it to be overridden + AC_PATH_PROG([SED], [sed], [not_found], + [$PATH:/usr/bin:/usr/local/bin]) + if test -z "$SED" || test "$SED" = "not_found"; then + AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.]) + fi fi AC_SUBST([SED]) dnl GREP is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. -AC_PATH_PROG([GREP], [grep], [not_found], - [$PATH:/usr/bin:/usr/local/bin]) -if test -z "$GREP" || test "$GREP" = "not_found"; then - AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.]) +if test -z "$GREP"; then + dnl allow it to be overridden + AC_PATH_PROG([GREP], [grep], [not_found], + [$PATH:/usr/bin:/usr/local/bin]) + if test -z "$GREP" || test "$GREP" = "not_found"; then + AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.]) + fi fi AC_SUBST([GREP]) dnl EGREP is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. -if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then - AC_MSG_CHECKING([for egrep]) - EGREP="$GREP -E" - AC_MSG_RESULT([$EGREP]) -else - AC_PATH_PROG([EGREP], [egrep], [not_found], - [$PATH:/usr/bin:/usr/local/bin]) +if test -z "$EGREP"; then + dnl allow it to be overridden + if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then + AC_MSG_CHECKING([for egrep]) + EGREP="$GREP -E" + AC_MSG_RESULT([$EGREP]) + else + AC_PATH_PROG([EGREP], [egrep], [not_found], + [$PATH:/usr/bin:/usr/local/bin]) + fi fi if test -z "$EGREP" || test "$EGREP" = "not_found"; then AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.]) @@ -86,10 +95,13 @@ AC_SUBST([EGREP]) dnl AR is mandatory for configure process and libtool. dnl This is target dependent, so check it as a tool. -AC_PATH_TOOL([AR], [ar], [not_found], - [$PATH:/usr/bin:/usr/local/bin]) -if test -z "$AR" || test "$AR" = "not_found"; then - AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.]) +if test -z "$AR"; then + dnl allow it to be overridden + AC_PATH_TOOL([AR], [ar], [not_found], + [$PATH:/usr/bin:/usr/local/bin]) + if test -z "$AR" || test "$AR" = "not_found"; then + AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.]) + fi fi AC_SUBST([AR]) |