aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2012-10-13 08:27:01 (GMT)
committerUlrich Müller <ulm@gentoo.org>2012-10-13 08:46:20 (GMT)
commit89efdeb043758ed074c58f389b98bc23b9241dfa (patch)
tree935a9e8a10e1122387d45cd90588781d708eb6d4
parentconfigure.ac: Remove excessive quoting and whitespace. (diff)
downloadeselect-89efdeb043758ed074c58f389b98bc23b9241dfa.zip
eselect-89efdeb043758ed074c58f389b98bc23b9241dfa.tar.gz
eselect-89efdeb043758ed074c58f389b98bc23b9241dfa.tar.bz2
Fix configure test for sed, bug 438112.
* configure.ac (SED): Replace broken ES_PROG_GNU_SED code by a straightforward check for GNU sed. Fixes bug 438112. (READLINK, REALPATH): Simplify logic and add output messages. (RST2HTML): Simplify. * acinclude.m4: Remove file.
-rw-r--r--ChangeLog8
-rw-r--r--acinclude.m427
-rw-r--r--configure.ac43
3 files changed, 32 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index 857a31f..386e250 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-10-13 Ulrich Müller <ulm@gentoo.org>
+
+ * configure.ac (SED): Replace broken ES_PROG_GNU_SED code by
+ a straightforward check for gsed or sed, bug 438112.
+ (READLINK, REALPATH): Simplify logic and add output messages.
+ (RST2HTML): Simplify.
+ * acinclude.m4: File removed.
+
2012-10-11 Ulrich Müller <ulm@gentoo.org>
* libs/package-manager.bash.in (arch): Add amd64 as case label.
diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644
index bde52c0..0000000
--- a/acinclude.m4
+++ /dev/null
@@ -1,27 +0,0 @@
-AC_DEFUN([ES_PROG_GNU_SED],
-[AC_MSG_CHECKING([for GNU sed])
-AC_CACHE_VAL(es_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-saved_IFS=$IFS ; IFS=:
-for es_dir in $PATH
-do
- IFS=$saved_IFS
- if test -x "$es_dir/sed" ; then
- if "$es_dir/sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null ; then
- es_path_sed="$es_dir/sed"
- fi
- fi
-
- if test -z "$es_path_sed" && test -x "$es_dir/gsed" ; then
- if "$es_dir/gsed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null ; then
- es_path_sed="$es_dir/gsed"
- fi
- fi
-
- es_cv_path_SED=$es_path_sed
-done
-])
-SED=$es_cv_path_SED
-AC_MSG_RESULT([$SED])
-AC_SUBST(SED)
-])
diff --git a/configure.ac b/configure.ac
index 2f62b9e..379705e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,8 +17,17 @@ if test x$BASH = x; then
AC_MSG_ERROR([bash is required])
fi
-ES_PROG_GNU_SED
+# AC_PROG_SED doesn't work here, because on Gentoo FreeBSD systems it
+# is confused by a wrapper script that is in the PATH at build time.
+AC_PATH_PROGS(SED, [gsed sed])
if test x$SED = x; then
+ AC_MSG_ERROR([sed is required])
+fi
+AC_MSG_CHECKING([whether $SED is GNU sed])
+if $SED 'v4.0' </dev/null >/dev/null 2>&1; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
AC_MSG_ERROR([GNU sed is required])
fi
@@ -29,36 +38,32 @@ AC_PATH_PROG(ENV_UPDATE, env-update, /usr/sbin/env-update,
AC_PATH_PROG(READLINK, greadlink)
if test x$READLINK = x; then
- AC_CHECK_PROG(READLINK, readlink -f ., yes, no, [$PATH])
- if test x$READLINK = xyes; then
- AC_PATH_PROG(READLINK, readlink)
- fi
-
- CANONICALISE_TEST=`$READLINK -f . > /dev/null 2>&1`
- if ! test x$? = x0; then
- unset READLINK
+ AC_PATH_PROG(READLINK, readlink)
+ if test x$READLINK != x; then
+ AC_MSG_CHECKING([whether readlink supports -f])
+ if $READLINK -f . >/dev/null 2>&1; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ READLINK=""
+ fi
fi
-
if test x$READLINK = x; then
AC_PATH_PROG(REALPATH, realpath)
- if test x$REALPATH = x; then
- AC_MSG_ERROR([Either GNU readlink or realpath is required])
- fi
fi
fi
if test x$READLINK != x; then
CANONICALISE="$READLINK -f"
-else
+elif test x$REALPATH != x; then
CANONICALISE="$REALPATH"
+else
+ AC_MSG_ERROR([Either GNU readlink or realpath is required])
fi
AC_SUBST(CANONICALISE)
# Gentoo uses rst2html.py but most other
-# distro's/OS's install it w/o the .py extension
-AC_PATH_PROG(RST2HTML, rst2html)
-if test x$RST2HTML = x; then
- AC_PATH_PROG(RST2HTML, rst2html.py)
-fi
+# distros install it w/o the .py extension
+AC_PATH_PROGS(RST2HTML, [rst2html rst2html.py])
# Support for Gentoo Prefix
AC_MSG_CHECKING([if target installation is in an offset prefix])