2 # Taken from lighthttpd server (BSD). Thanks Jan!
3 # Run this to generate all the initial makefiles, etc.
5 die
() { echo "$@"; exit 1; }
7 # LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
8 LIBTOOLIZE_FLAGS
=" --automake --copy --force"
9 # ACLOCAL=${ACLOCAL:-aclocal}
10 # AUTOHEADER=${AUTOHEADER:-autoheader}
11 # AUTOMAKE=${AUTOMAKE:-automake}
12 AUTOMAKE_FLAGS
="--add-missing --copy --force"
13 # AUTOCONF=${AUTOCONF:-autoconf}
20 echo "$ARGV0: running \`$@' $ARGS"
24 ## jump out if one of the programs returns 'false'
27 ## We do not currently support glibtoolize
28 if test x
$LIBTOOLIZE = x
; then
29 if test \
! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x
; then
30 LIBTOOLIZE
=glibtoolize
31 elif test \
! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x
; then
32 LIBTOOLIZE
=libtoolize-1.5
33 elif test \
! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x
; then
36 echo "libtoolize 1.5.x wasn't found, exiting"; exit 0
40 ## suse has aclocal and aclocal-1.9
41 if test x
$ACLOCAL = x
; then
42 if test \
! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x
; then
44 elif test \
! "x`which aclocal-1.9 2> /dev/null | grep -v '^no'`" = x
; then
46 elif test \
! "x`which aclocal19 2> /dev/null | grep -v '^no'`" = x
; then
48 elif test \
! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x
; then
51 echo "automake 1.9.x (aclocal) wasn't found, exiting"; exit 0
55 if test x
$AUTOMAKE = x
; then
56 if test \
! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x
; then
57 AUTOMAKE
=automake-1.10
58 elif test \
! "x`which automake-1.9 2> /dev/null | grep -v '^no'`" = x
; then
60 elif test \
! "x`which automake19 2> /dev/null | grep -v '^no'`" = x
; then
62 elif test \
! "x`which automake 2> /dev/null | grep -v '^no'`" = x
; then
65 echo "automake 1.9.x wasn't found, exiting"; exit 0
70 ## macosx has autoconf-2.59 and autoconf-2.60
71 if test x
$AUTOCONF = x
; then
72 if test \
! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x
; then
73 AUTOCONF
=autoconf-2.59
74 elif test \
! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x
; then
76 elif test \
! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x
; then
79 echo "autoconf 2.59+ wasn't found, exiting"; exit 0
83 if test x
$AUTOHEADER = x
; then
84 if test \
! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x
; then
85 AUTOHEADER
=autoheader-2.59
86 elif test \
! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x
; then
87 AUTOHEADER
=autoheader259
88 elif test \
! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x
; then
91 echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 0
96 run
$ACLOCAL $ACLOCAL_FLAGS || die
"Can't execute aclocal"
97 run
$AUTOHEADER || die
"Can't execute autoheader"
99 # --force means overwrite ltmain.sh script if it already exists
100 run
$LIBTOOLIZE $LIBTOOLIZE_FLAGS || die
"Can't execute libtoolize"
102 # --add-missing instructs automake to install missing auxiliary files
103 # and --force to overwrite them if they already exist
104 run
$AUTOMAKE $AUTOMAKE_FLAGS || die
"Can't execute automake"
105 run
$AUTOCONF || die
"Can't execute autoconf"