This repository has been archived by the owner on Jan 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbootstrap
executable file
·119 lines (105 loc) · 2.34 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
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
ARGS=1
BF_OPTIONS=
MAINT_FLAGS="--cache-file=config.cache"
while [ $ARGS != 0 ]
do
case "$1" in
bat)
cmd /c bootstrap.bat $BF_OPTIONS
exit 0
;;
nodoc)
BF_OPTIONS="-DBUILDDOCS=no $BF_OPTIONS"
shift
;;
noex)
BF_OPTIONS="-DBUILDEXAMPLES=no $BF_OPTIONS"
shift
;;
nolib)
BF_OPTIONS="-DBUILDLIBRARY=no $BF_OPTIONS"
shift
;;
nomaint)
MAINT_FLAGS=
shift
;;
noopt)
export CXXFLAGS="-g -O0"
shift
;;
pedantic)
export CXXFLAGS="-g -O2 -ansi -pedantic -Wall -Wextra -W -Wold-style-cast -Wfloat-equal -Wwrite-strings -Wno-overloaded-virtual -Wno-long-long -Wno-variadic-macros -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC"
shift
;;
*)
ARGS=0
;;
esac
done
# Check for existence of needed tools, so we can give a better error
# message than the shell will.
tools="make" # POSIX
tools="$tools aclocal autoconf autoheader libtoolize" # autotools
tools="$tools bakefile bakefilize bakefile_gen" # Bakefile
for tool in $tools
do
if ! type -p $tool > /dev/null
then
echo "FAILED to find build tool '$tool'!"
echo
echo BOOTSTRAP FAILED!
echo
exit 1
fi
done
# Find location of Bakefile's stock M4 autoconf macros
for d in /usr/share/aclocal /usr/local/share/aclocal \
'/c/Program Files (x86)/Bakefile/autoconf'
do
BAKEFILE_M4="$d"
if [ -e "$BAKEFILE_M4/bakefile.m4" ] ; then break ; fi
done
if [ ! -e "$BAKEFILE_M4/bakefile.m4" ]
then
echo
echo "Failed to find bakefile.m4. Add the directory containing"
echo "this to the bootstrap script."
echo
exit 1
fi
# Do Bakefile stuff first. Autoconf can't succeed without
# autoconf_in.m4, which Bakefile creates.
success=
set -x &&
for d in 3 5 8 ; do mkdir -p vc200$d ; done &&
bakefilize &&
rm -f INSTALL &&
bakefile_gen $BF_OPTIONS &&
bakefile -f gnu -o Makefile.simple -DBUILDLIBRARY=no mysql++.bkl &&
set +x &&
success=shonuff
# Do the autotools stuff if Bakefile steps succeeded
if [ -n "$success" ]
then
rm -f config.cache
mv autoconf_inc.m4 config > /dev/null 2>&1 # don't care if it fails
set -x &&
aclocal -I config -I "$BAKEFILE_M4" &&
libtoolize &&
autoheader &&
autoconf &&
./configure $MAINT_FLAGS $* &&
make lib/querydef.h lib/ssqls.h &&
set +x &&
success=awyeah
fi
# Detect failure in any part of above
if [ -z "$success" ]
then
echo
echo BOOTSTRAP FAILED!
echo
exit 1
fi