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=hicolor-icon-theme
11TEST_TYPE=-f
12FILE=index.theme
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
24if test "$DIE" -eq 1; then
25	exit 1
26fi
27
28test $TEST_TYPE $FILE || {
29	echo "You must run this script in the top-level $PROJECT directory"
30	exit 1
31}
32
33if test -z "$*"; then
34	echo "I am going to run ./configure with no arguments - if you wish "
35        echo "to pass any to it, please specify them on the $0 command line."
36fi
37
38autoreconf --force --install || echo "autoconf failed - version 2.5x is probably required"
39
40cd $ORIGDIR
41
42run_configure=true
43for arg in $*; do
44    case $arg in
45        --no-configure)
46            run_configure=false
47            ;;
48        *)
49            ;;
50    esac
51done
52
53if $run_configure; then
54    $srcdir/configure --enable-maintainer-mode --config-cache "$@"
55    echo
56    echo "Now type 'make' to compile $PROJECT."
57else
58    echo
59    echo "Now run 'configure' and 'make' to compile $PROJECT."
60fi
61
62