-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·69 lines (55 loc) · 1.65 KB
/
bootstrap.sh
File metadata and controls
executable file
·69 lines (55 loc) · 1.65 KB
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
#! /bin/bash
# Used to setup the configure.in, autoheader and Makefile.in's if configure
# has not been generated. This script is only needed for developers when
# configure has not been run, or if a Makefile.am in a non-configured directory
# has been updated
builddir=`pwd`
srcdir=`dirname "$0"`
bootstrap() {
if "$@"; then
true # Everything OK
else
echo "$1 failed"
echo "Autotool bootstrapping failed. You will need to investigate and correct" ;
echo "before you can develop on this source tree"
exit 1
fi
}
cd "$srcdir"
# Make sure we are running in the right directory
if [ ! -f main.cc ]; then
echo "You must run this script from the directory containing it"
exit 1
fi
if [[ "$1" =~ "--host=" ]]; then
host="${1#--host=}"
elif hash x86_64-w64-mingw32-g++ 2> /dev/null; then
host="x86_64-w64-mingw32"
elif hash i686-w64-mingw32-g++ 2> /dev/null; then
host="i686-w64-mingw32"
else
echo "mingw32 or mingw64 target g++ required for building setup"
exit 1
fi
export ACLOCAL_PATH=$($host-g++ --print-sysroot)/mingw/share/aclocal
# Make sure cfgaux exists
mkdir -p cfgaux
# Bootstrap the autotool subsystems
echo "bootstrapping in $srcdir"
bootstrap aclocal
# bootstrap autoheader
bootstrap libtoolize --automake
bootstrap autoconf
bootstrap automake --foreign --add-missing
# Run bootstrap in required subdirs, iff it has not yet been run
echo "bootstrapping in $srcdir/libgetopt++"
cd libgetopt++ && ./bootstrap.sh
if test -n "$NOCONFIGURE"; then
echo "Skipping configure per request"
exit 0
fi
cd "$builddir"
build=`$srcdir/cfgaux/config.guess`
echo "running configure"
$srcdir/configure -C --build=$build --host=$host "$@"
exit $?