1#!/bin/sh
2# Run this to generate all the initial makefiles, etc.
3
4srcdir=`dirname $0`
5test -z "$srcdir" && srcdir=.
6
7ORIGDIR=`pwd`
8cd $srcdir
9
10PROJECT=desktop-file-utils
11TEST_TYPE=-f
12FILE=src/validate.h
13
14DIE=0
15
16(autoconf --version) < /dev/null > /dev/null 2>&1 || {
17	echo
18	echo "You must have autoconf installed to compile $PROJECT."
19	echo "Download the appropriate package for your distribution,"
20	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
21	DIE=1
22}
23
24AUTOMAKE=automake
25ACLOCAL=aclocal
26
27($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
28	echo
29	echo "You must have automake installed to compile $PROJECT."
30	echo "Download the appropriate package for your distribution,"
31	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
32	DIE=1
33}
34
35if test "$DIE" -eq 1; then
36	exit 1
37fi
38
39test $TEST_TYPE $FILE || {
40	echo "You must run this script in the top-level $PROJECT directory"
41	exit 1
42}
43
44if test -z "$*"; then
45	echo "I am going to run ./configure with no arguments - if you wish "
46        echo "to pass any to it, please specify them on the $0 command line."
47fi
48
49echo $ACLOCAL $ACLOCAL_FLAGS
50$ACLOCAL $ACLOCAL_FLAGS
51
52# optionally feature autoheader
53(autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader
54
55$AUTOMAKE -a $am_opt
56autoconf || echo "autoconf failed - version 2.5x is probably required"
57
58cd $ORIGDIR
59
60if test -z "$NOCONFIGURE"; then
61    $srcdir/configure "$@"
62    echo
63    echo "Now type 'make' to compile $PROJECT."
64fi
65