]> granicus.if.org Git - flex/commitdiff
build: check for how to call libtoolize.
authorSimon Sobisch <simonsobisch@web.de>
Tue, 2 May 2017 10:04:00 +0000 (12:04 +0200)
committerWill Estes <westes575@gmail.com>
Tue, 2 May 2017 18:43:49 +0000 (14:43 -0400)
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.

autogen.sh

index 46611bf3d87154752307a267cd8cba9ee4dd1450..e81633cc2aa4b47ceaad510eda31f4cf1d8e8377 100755 (executable)
 # 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