-
Notifications
You must be signed in to change notification settings - Fork 36
/
bootstrap.sh
executable file
·47 lines (39 loc) · 1.22 KB
/
bootstrap.sh
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
#!/bin/bash
set -e
usage () {
echo "Usage: $0 [--verbose] [--help]"
echo " --verbose : display autoreconf warnings"
echo " --help : display this message"
}
# parse args
warnings="--warnings=none"
if [ $# -eq 1 ]; then
if [ "$1" == "--verbose" ]; then
warnings=""
elif [ "$1" == "--help" ]; then
usage
exit 0
else
usage
exit 1
fi
elif [ $# -ne 0 ]; then
usage
exit 1
fi
# clean up earlier configuration
if [ -f Makefile ]; then
make distclean
fi
# initial sweep - install missing files, overwriting previous state
autoreconf --install --force $warnings
# check whether we can find the insertion point for our libtool.m4 bugfix
if ! grep -q "\-L\* | \-R\* | \-l\*)" m4/libtool.m4; then
echo "error: could not find target key for patching libtool.m4 - please report this to the IPM developers along with your m4/libtool.m4"
exit 1
fi
# apply the fix
mv m4/libtool.m4 m4/libtool.m4_orig
awk '{ print $0 } /-L\* \| -R\* \| -l\*\)/ { printf("\n\t# Some compilers *also* place space between \"-l\" and the library name.\n\t# Remove the space.\n\tif test $p = \"-l\"; then prev=$p; continue; fi\n\n"); }' m4/libtool.m4_orig > m4/libtool.m4
# autoreconf once more (no --force) to assimilate libtool.m4 changes
autoreconf $warnings