| | 1 | #!/bin/sh |
| | 2 | # Run this to generate all the initial makefiles, etc. |
| | 3 | |
| | 4 | srcdir=`dirname $0` |
| | 5 | test -z "$srcdir" && srcdir=. |
| | 6 | |
| | 7 | ORIGDIR=`pwd` |
| | 8 | cd $srcdir |
| | 9 | |
| | 10 | PROJECT=psmodule |
| | 11 | TEST_TYPE=-f |
| | 12 | FILE=psmodule.pc.in |
| | 13 | |
| | 14 | DIE=0 |
| | 15 | |
| | 16 | if [ "`which glibtoolize 2> /dev/null`" != "" ] |
| | 17 | then LIBTOOLIZE=glibtoolize |
| | 18 | else LIBTOOLIZE=libtoolize |
| | 19 | fi |
| | 20 | |
| | 21 | ACLOCAL=aclocal |
| | 22 | AUTOHEADER=autoheader |
| | 23 | AUTOMAKE=automake |
| | 24 | AUTOCONF=autoconf |
| | 25 | |
| | 26 | ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { |
| | 27 | echo |
| | 28 | echo "You must have $LIBTOOlIZE installed to compile $PROJECT." |
| | 29 | echo "Download the appropriate package for your distribution," |
| | 30 | echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/" |
| | 31 | DIE=1 |
| | 32 | } |
| | 33 | |
| | 34 | ($ACLOCAL --version) < /dev/null > /dev/null 2>&1 || { |
| | 35 | echo |
| | 36 | echo "You must have $ACLOCAL installed to compile $PROJECT." |
| | 37 | echo "Download the appropriate package for your distribution," |
| | 38 | echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" |
| | 39 | DIE=1 |
| | 40 | } |
| | 41 | |
| | 42 | ($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 || { |
| | 43 | echo |
| | 44 | echo "You must have $AUTOHEADER installed to compile $PROJECT." |
| | 45 | echo "Download the appropriate package for your distribution," |
| | 46 | echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/" |
| | 47 | DIE=1 |
| | 48 | } |
| | 49 | |
| | 50 | ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || { |
| | 51 | echo |
| | 52 | echo "You must have $AUTOMAKE installed to compile $PROJECT." |
| | 53 | echo "Download the appropriate package for your distribution," |
| | 54 | echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" |
| | 55 | DIE=1 |
| | 56 | } |
| | 57 | |
| | 58 | ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || { |
| | 59 | echo |
| | 60 | echo "You must have $AUTOCONF installed to compile $PROJECT." |
| | 61 | echo "Download the appropriate package for your distribution," |
| | 62 | echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/" |
| | 63 | DIE=1 |
| | 64 | } |
| | 65 | |
| | 66 | if test "$DIE" -eq 1; then |
| | 67 | exit 1 |
| | 68 | fi |
| | 69 | |
| | 70 | test $TEST_TYPE $FILE || { |
| | 71 | echo "You must run this script in the top-level $PROJECT directory" |
| | 72 | exit 1 |
| | 73 | } |
| | 74 | |
| | 75 | if test -z "$*"; then |
| | 76 | echo "I am going to run ./configure with no arguments - if you wish " |
| | 77 | echo "to pass any to it, please specify them on the $0 command line." |
| | 78 | fi |
| | 79 | |
| | 80 | $LIBTOOLIZE --copy --force || echo "$LIBTOOlIZE failed" |
| | 81 | $ACLOCAL || echo "$ACLOCAL failed" |
| | 82 | $AUTOHEADER || echo "$AUTOHEADER failed" |
| | 83 | $AUTOMAKE --add-missing --force-missing --copy || echo "$AUTOMAKE failed" |
| | 84 | $AUTOCONF || echo "$AUTOCONF failed" |
| | 85 | |
| | 86 | cd $ORIGDIR |
| | 87 | |
| | 88 | run_configure=true |
| | 89 | for arg in $*; do |
| | 90 | case $arg in |
| | 91 | --no-configure) |
| | 92 | run_configure=false |
| | 93 | ;; |
| | 94 | *) |
| | 95 | ;; |
| | 96 | esac |
| | 97 | done |
| | 98 | |
| | 99 | if $run_configure; then |
| | 100 | $srcdir/configure --enable-maintainer-mode "$@" |
| | 101 | echo |
| | 102 | echo "Now type 'make' to compile $PROJECT." |
| | 103 | else |
| | 104 | echo |
| | 105 | echo "Now run 'configure' and 'make' to compile $PROJECT." |
| | 106 | fi |