mirror of
https://github.com/curl/curl.git
synced 2025-02-17 14:59:45 +08:00
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
This commit is contained in:
parent
1dbb9a0ba4
commit
241b704e1f
50
configure.ac
50
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])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user