-#!/bin/sh
+#!/usr/bin/env bash
# Taken from lighthttpd server (BSD). Thanks Jan!
# Run this to generate all the initial makefiles, etc.
# LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
LIBTOOLIZE_FLAGS=" --automake --copy --force"
# ACLOCAL=${ACLOCAL:-aclocal}
+ACLOCAL_FLAGS="-I m4"
# AUTOHEADER=${AUTOHEADER:-autoheader}
# AUTOMAKE=${AUTOMAKE:-automake}
AUTOMAKE_FLAGS="--add-missing --copy --force"
## We do not currently support glibtoolize
if test x$LIBTOOLIZE = x; then
-# if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
-# LIBTOOLIZE=glibtoolize
- if test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
+ if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
+ LIBTOOLIZE=glibtoolize
+ elif test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
LIBTOOLIZE=libtoolize-1.5
elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
LIBTOOLIZE=libtoolize
## suse has aclocal and aclocal-1.9
if test x$ACLOCAL = x; then
- if test \! "x`which aclocal-1.9 2> /dev/null | grep -v '^no'`" = x; then
+ if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then
+ ACLOCAL=aclocal-1.10
+ elif test \! "x`which aclocal-1.9 2> /dev/null | grep -v '^no'`" = x; then
ACLOCAL=aclocal-1.9
elif test \! "x`which aclocal19 2> /dev/null | grep -v '^no'`" = x; then
ACLOCAL=aclocal19
fi
if test x$AUTOMAKE = x; then
- if test \! "x`which automake-1.9 2> /dev/null | grep -v '^no'`" = x; then
+ if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then
+ AUTOMAKE=automake-1.10
+ elif test \! "x`which automake-1.9 2> /dev/null | grep -v '^no'`" = x; then
AUTOMAKE=automake-1.9
elif test \! "x`which automake19 2> /dev/null | grep -v '^no'`" = x; then
AUTOMAKE=automake19
fi
-run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
-run $AUTOHEADER || die "Can't execute autoheader"
-
# --force means overwrite ltmain.sh script if it already exists
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
+run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
+run $AUTOHEADER || die "Can't execute autoheader"
+
# --add-missing instructs automake to install missing auxiliary files
# and --force to overwrite them if they already exist
run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake"