summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorSimon Sobisch <simonsobisch@web.de>2017-05-02 12:04:00 +0200
committerWill Estes <westes575@gmail.com>2017-05-02 14:43:49 -0400
commit0a9687d138b5a154f38381bfb26269decd196560 (patch)
tree81bbc3b0f156743c438f42a72e3be293eecc052a /autogen.sh
parent89f10ee36f95430f18ac70f971fe9f9f894d9dc5 (diff)
build: check for how to call libtoolize.
Previously, we would call libtoolize and if that failed, we would call glibtoolize since some platforms have the libtoolize program under that name. Instead, we check to see if the environment variable LIBTOOLIZE is set and use that if so. Otherwise, we try to find a program "libtoolize" on the path and failing that glibtoolize. We alert the user if no suitable program can be found.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/autogen.sh b/autogen.sh
index 46611bf..e81633c 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -24,10 +24,26 @@
# If you see no configure script, then run ./autogen.sh to create it
# and procede with the "normal" build procedures.
+# use LIBTOOLIZE, if set
+LIBTOOLIZE_ORIG="$LIBTOOLIZE";
+if test "x$LIBTOOLIZE" = "x"; then LIBTOOLIZE=libtoolize; 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"
+ echo " LIBTOOLIZE is currently \"$LIBTOOLIZE_ORIG\""
+ exit 1
+ fi
+fi
+
#if we pretend to have a ChangeLog, then automake is less
#worried. (Don't worry, we *do* have a ChangeLog, we just need the
#Makefile first.)
touch ChangeLog
-libtoolize --install --force || glibtoolize --install --force
+"$LIBTOOLIZE" --install --force
autoreconf --install --force