diff options
author | Explorer09 <explorer09@gmail.com> | 2018-09-22 11:01:53 +0800 |
---|---|---|
committer | Explorer09 <explorer09@gmail.com> | 2018-09-22 11:01:53 +0800 |
commit | 9be1980ef268b7199b3fe26304ddbc1a6ad4bdd7 (patch) | |
tree | 8dc3e838c4477bff4b910211ba9113d1e9505baf | |
parent | 8900923e91e6d00f66ceaf96128afbab341bdf89 (diff) | |
download | flex-git-9be1980ef268b7199b3fe26304ddbc1a6ad4bdd7.tar.gz |
build: Fix autogen.sh $LIBTOOLIZE detection logic
* Don't silence `libtoolize --version` error message. It would be
useful for diagnosing any problem when `libtoolize --version` fails.
(libtoolize not found? No permission to execute? Now you know which
error it is.)
* Change the guessing code of libtoolize program name to a loop.
It'll perform silently.
* Silence the `libtoolize --version` output when it succeeds.
Signed-off-by: Kang-che Sung <explorer09@gmail.com>
-rwxr-xr-x | autogen.sh | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -25,19 +25,20 @@ # and procede with the "normal" build procedures. # use LIBTOOLIZE, if set -LIBTOOLIZE_ORIG="$LIBTOOLIZE"; -if test "x$LIBTOOLIZE" = "x"; then LIBTOOLIZE=libtoolize; fi +if test "x$LIBTOOLIZE" = "x"; then + for ac_prog in libtoolize glibtoolize; do + if $ac_prog --version >/dev/null 2>&1; then + LIBTOOLIZE=$ac_prog + break + fi + done +fi # test libtoolize -$LIBTOOLIZE --version 2>/dev/null -if test "$?" -ne 0; then - LIBTOOLIZE=glibtoolize - $LIBTOOLIZE --version 2>/dev/null - if test "$?" -ne 0; then - echo "error: libtoolize not working, re-run with LIBTOOLIZE=/path/to/libtoolize">&2 - echo " LIBTOOLIZE is currently \"$LIBTOOLIZE_ORIG\"">&2 - exit 1 - fi +if test "x$LIBTOOLIZE" = "x" || ! $LIBTOOLIZE --version >/dev/null; then + echo "error: libtoolize not working, re-run with LIBTOOLIZE=/path/to/libtoolize">&2 + echo " LIBTOOLIZE is currently \"$LIBTOOLIZE\"">&2 + exit 1 fi #if we pretend to have a ChangeLog, then automake is less |