| 1 | #!/bin/sh |
|---|
| 2 | # Run this to generate all the initial makefiles, etc. |
|---|
| 3 | |
|---|
| 4 | # LIBTOOLIZE=${LIBTOOLIZE:-libtoolize} |
|---|
| 5 | LIBTOOLIZE_FLAGS="--copy --force" |
|---|
| 6 | # ACLOCAL=${ACLOCAL:-aclocal} |
|---|
| 7 | # AUTOHEADER=${AUTOHEADER:-autoheader} |
|---|
| 8 | # AUTOMAKE=${AUTOMAKE:-automake} |
|---|
| 9 | AUTOMAKE_FLAGS="--add-missing --copy" |
|---|
| 10 | # AUTOCONF=${AUTOCONF:-autoconf} |
|---|
| 11 | |
|---|
| 12 | ARGV0=$0 |
|---|
| 13 | ARGS="$@" |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | run() { |
|---|
| 17 | echo "$ARGV0: running \`$@' $ARGS" |
|---|
| 18 | $@ $ARGS |
|---|
| 19 | } |
|---|
| 20 | |
|---|
| 21 | ## jump out if one of the programs returns 'false' |
|---|
| 22 | set -e |
|---|
| 23 | |
|---|
| 24 | ## on macosx glibtoolize, others have libtool |
|---|
| 25 | if test x$LIBTOOLIZE = x; then |
|---|
| 26 | if test \! x`which glibtoolize 2> /dev/null` = x; then |
|---|
| 27 | LIBTOOLIZE=glibtoolize |
|---|
| 28 | elif test \! x`which libtoolize-1.5 2> /dev/null` = x; then |
|---|
| 29 | LIBTOOLIZE=libtoolize-1.5 |
|---|
| 30 | elif test \! x`which libtoolize 2> /dev/null` = x; then |
|---|
| 31 | LIBTOOLIZE=libtoolize |
|---|
| 32 | else |
|---|
| 33 | echo "libtoolize 1.5.x wasn't found, exiting"; exit 0 |
|---|
| 34 | fi |
|---|
| 35 | fi |
|---|
| 36 | |
|---|
| 37 | ## suse has aclocal and aclocal-1.9 |
|---|
| 38 | if test x$ACLOCAL = x; then |
|---|
| 39 | if test \! x`which aclocal-1.9 2> /dev/null` = x; then |
|---|
| 40 | ACLOCAL=aclocal-1.9 |
|---|
| 41 | elif test \! x`which aclocal19 2> /dev/null` = x; then |
|---|
| 42 | ACLOCAL=aclocal19 |
|---|
| 43 | elif test \! x`which aclocal 2> /dev/null` = x; then |
|---|
| 44 | ACLOCAL=aclocal |
|---|
| 45 | else |
|---|
| 46 | echo "automake 1.9.x (aclocal) wasn't found, exiting"; exit 0 |
|---|
| 47 | fi |
|---|
| 48 | fi |
|---|
| 49 | |
|---|
| 50 | if test x$AUTOMAKE = x; then |
|---|
| 51 | if test \! x`which automake-1.9 2> /dev/null` = x; then |
|---|
| 52 | AUTOMAKE=automake-1.9 |
|---|
| 53 | elif test \! x`which automake19 2> /dev/null` = x; then |
|---|
| 54 | AUTOMAKE=automake19 |
|---|
| 55 | elif test \! x`which automake 2> /dev/null` = x; then |
|---|
| 56 | AUTOMAKE=automake |
|---|
| 57 | else |
|---|
| 58 | echo "automake 1.9.x wasn't found, exiting"; exit 0 |
|---|
| 59 | fi |
|---|
| 60 | fi |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | ## macosx has autoconf-2.59 and autoconf-2.60 |
|---|
| 64 | if test x$AUTOCONF = x; then |
|---|
| 65 | if test \! x`which autoconf-2.59 2> /dev/null` = x; then |
|---|
| 66 | AUTOCONF=autoconf-2.59 |
|---|
| 67 | elif test \! x`which autoconf259 2> /dev/null` = x; then |
|---|
| 68 | AUTOCONF=autoconf259 |
|---|
| 69 | elif test \! x`which autoconf 2> /dev/null` = x; then |
|---|
| 70 | AUTOCONF=autoconf |
|---|
| 71 | else |
|---|
| 72 | echo "autoconf 2.59+ wasn't found, exiting"; exit 0 |
|---|
| 73 | fi |
|---|
| 74 | fi |
|---|
| 75 | |
|---|
| 76 | if test x$AUTOHEADER = x; then |
|---|
| 77 | if test \! x`which autoheader-2.59 2> /dev/null` = x; then |
|---|
| 78 | AUTOHEADER=autoheader-2.59 |
|---|
| 79 | elif test \! x`which autoheader259 2> /dev/null` = x; then |
|---|
| 80 | AUTOHEADER=autoheader259 |
|---|
| 81 | elif test \! x`which autoheader 2> /dev/null` = x; then |
|---|
| 82 | AUTOHEADER=autoheader |
|---|
| 83 | else |
|---|
| 84 | echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 0 |
|---|
| 85 | fi |
|---|
| 86 | fi |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | run $LIBTOOLIZE $LIBTOOLIZE_FLAGS |
|---|
| 90 | run $ACLOCAL $ACLOCAL_FLAGS |
|---|
| 91 | run $AUTOHEADER |
|---|
| 92 | run $AUTOMAKE $AUTOMAKE_FLAGS |
|---|
| 93 | run $AUTOCONF |
|---|
| 94 | test "$ARGS" = "" && echo "Now type './configure ...' and 'make' to compile." |
|---|