Smake: Use glibtoolize instead of libtoolize, if it is available.
[pspp] / Smake
diff --git a/Smake b/Smake
index 1e54533169d49dce7924720ff9502fb77a96c0fe..47821265bce4796e052d8fe2789939fc4e0e7b8e 100644 (file)
--- a/Smake
+++ b/Smake
@@ -48,11 +48,13 @@ GNULIB_MODULES = \
         mbiter \
        memcasecmp \
        memchr \
+       memchr2 \
        mempcpy \
        memrchr \
        minmax \
        mkdtemp \
        mkstemp \
+       pipe2 \
        printf-posix \
        printf-safe \
        progname \
@@ -62,12 +64,14 @@ GNULIB_MODULES = \
        relocatable-prog \
        rename \
        round \
+       select \
        snprintf \
        snprintf-posix \
        sprintf-posix \
        stdarg \
        stdbool \
        stdint \
+       strcasestr \
        stpcpy \
        strerror \
        strftime \
@@ -126,7 +130,15 @@ prep_ph:
                --source-base=gl --lib=libgl --tests-base=tests \
                --doc-base=gl/doc --aux-dir=build-aux  \
                --libtool $(GNULIB_MODULES)
-       libtoolize --force --automake
+       if (glibtoolize --version) >/dev/null 2>&1; then        \
+               LIBTOOLIZE=glibtoolize;                         \
+       elif (libtoolize --version) >/dev/null 2>&1; then       \
+               LIBTOOLIZE=libtoolize;                          \
+       else                                                    \
+               echo >&2 "libtoolize not found";                \
+               exit 1;                                         \
+       fi;                                                     \
+       $$LIBTOOLIZE --force --automake
 
 aclocal.m4:
        aclocal -I m4 -I gl/m4