-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·31 lines (26 loc) · 1.28 KB
/
bootstrap
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
#!/bin/bash
# This script can be used to bootstrap xarman's autotool setup.
# Due to a minor bug in automake version 1.4, the toplevel Makefile.in
# will be patched. This is only relevant if you plan on doing a
# make dist - I use that, which is why I like it to work.
function die () {
echo "Error:" "$@"
exit 1
}
which aclocal &> /dev/null || die "aclocal program not available - install automake"
which automake &> /dev/null || die "automake program not available - install automake"
which autoheader &> /dev/null || die "autoheader program not available - install autoconf"
which autoconf &> /dev/null || die "autoconf program not available - install autoconf"
echo "Bootstrapping for build"
echo "Setting up m4 macros"
aclocal -I config || die "Unable to run aclocal"
echo "Creating headers"
autoheader || die "Unable to run autoheader"
echo "Autogenerating Makefile.ins"
automake --add-missing --copy || die "Unable to run automake"
echo "Patching toplevel Makefile.in"
cat Makefile.in | sed 's/cp -pr \$\$\/\$/cp -pr \$\$d\/\$/' > Makefile.in.patch || die "Unable to patch toplevel makefile"
mv -f Makefile.in.patch Makefile.in || die "move failed"
echo "Creating configure script"
autoconf || die "autoconf failed"
echo "You can now run ./configure --help (or ./configure && make)"