summaryrefslogtreecommitdiff
path: root/bootstrap.sh
blob: e82f2c944ea05652f6e758082291b7b1a00dbe67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh

if [ "x$1" = "x--force" ]; then
# remove cached files
    rm -f aclocal.m4
    rm -rf autom4te.cache
    FORCE_ARG=--force
else
    FORCE_ARG=
fi

CFGFILE=configure.ac
if [ -f configure.ac ]; then
    CFGFILE=configure.ac
elif [ -f configure.in ]; then
    CFGFILE=configure.in
fi

echo "*** Aclocal"
if [ -d m4 ]; then
	aclocal -I m4 $ACLOCAL_FLAGS $FORCE_ARG || exit 1
else
	aclocal $ACLOCAL_FLAGS $FORCE_ARG || exit 1
fi

echo "*** Autoconf"
autoconf $FORCE_ARG || exit 1

if grep -q '^AC_CONFIG_HEADERS' "$CFGFILE"; then
    echo "*** Autoheader"
    autoheader $FORCE_ARG || exit 1
fi

if grep -q '^AC_PROG_LIBTOOL' "$CFGFILE"; then
	echo "*** Libtoolize"
	libtoolize --automake --copy $FORCE_ARG || exit 1
fi

if [ ! -f NEWS ]; then
	touch NEWS
fi
if [ ! -f README ]; then
	touch README
fi
if [ ! -f AUTHORS ]; then
	echo 'Joel Klinghed <the_jk AT yahoo.com>' > AUTHORS
fi
if [ ! -f ChangeLog ]; then
	touch ChangeLog
fi
echo "*** Automake"
if [ -z "$FORCE_ARG" ]; then
	automake --gnu --copy --add-missing || exit 1
else
	automake --gnu --copy --add-missing --force-missing || exit 1
fi

echo "*** Done"