autogen.sh 936 Bytes
Newer Older
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
1 2
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
3
test -n "$srcdir" || srcdir=`dirname "$0"`
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
4
test -z "$srcdir" && srcdir=.
5 6
olddir=`pwd`
cd "$srcdir"
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
7

8
(test -f configure.ac) || {
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
9
    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
10
    echo " top-level directory"
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
11 12 13
    exit 1
}

14 15 16 17 18 19
if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
    echo "*** WARNING: I am going to run 'configure' with no arguments." >&2
    echo "*** If you wish to pass any to it, please specify them on the" >&2
    echo "*** '$0' command line." >&2
    echo "" >&2
fi
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
20

21 22
aclocal --install || exit 1  # autoreconf will do this automatically in future
autoreconf --verbose --force --install || exit 1
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
23

24 25 26
cd "$olddir"
if [ "$NOCONFIGURE" = "" ]; then
    "$srcdir/configure" "$@" || exit 1
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
27

28 29 30 31 32
    if [ "$1" = "--help" ]; then exit 0 else
        echo "Now type 'make' to compile" || exit 1
    fi
else
    echo "Skipping configure process."
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
33
fi