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
9PROJECT=libfo-examples
10TEST_TYPE=-f
11FILE=xmlroff-basic.c
12
13DIE=0
14
15have_libtool=false
16if libtool --version < /dev/null > /dev/null 2>&1 ; then
17	libtool_version=`libtoolize --version |	 libtoolize --version | sed 's/^[^0-9]*\([0-9].[0-9.]*\).*/\1/'`
18	case $libtool_version in
19	    1.4*|1.5*|2.*)
20		have_libtool=true
21		;;
22	esac
23fi
24if $have_libtool ; then : ; else
25	echo
26	echo "You must have libtool 1.4 or later installed to compile $PROJECT."
27	echo "Install the appropriate package for your distribution,"
28	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
29	DIE=1
30fi
31
32(autoconf --version) < /dev/null > /dev/null 2>&1 || {
33	echo
34	echo "You must have autoconf installed to compile $PROJECT."
35	echo "Download the appropriate package for your distribution,"
36	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
37	DIE=1
38}
39
40(automake --version) < /dev/null > /dev/null 2>&1 || {
41	echo
42	echo "You must have automake installed to compile $PROJECT."
43	echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4.tar.gz"
44	echo "(or a newer version if it is available)"
45	DIE=1
46}
47
48if test "$DIE" -eq 1; then
49	exit 1
50fi
51
52test $TEST_TYPE $FILE || {
53	echo "You must run this script in the top-level $PROJECT directory"
54	exit 1
55}
56
57if test -z "$*"; then
58	echo "I am going to run ./configure with no arguments - if you wish "
59        echo "to pass any to it, please specify them on the $0 command line."
60fi
61
62libtoolize --copy --force
63aclocal $ACLOCAL_FLAGS
64
65# optionally run autoheader
66(autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader
67
68automake -a $am_opt
69autoconf
70cd $ORIGDIR
71
72$srcdir/configure --enable-maintainer-mode "$@"
73
74echo
75echo "Now type 'make' to compile $PROJECT."
76