]>
Commit | Line | Data |
---|---|---|
f6100b6f RC |
1 | #! /bin/sh |
2 | # Used to setup the configure.in, autoheader and Makefile.in's if configure | |
3 | # has not been generated. This script is only needed for developers when | |
4 | # configure has not been run, or if a Makefile.am in a non-configured directory | |
5 | # has been updated | |
6 | ||
2d598be1 YS |
7 | builddir=`pwd` |
8 | srcdir=`dirname "$0"` | |
f6100b6f RC |
9 | |
10 | bootstrap() { | |
11 | if "$@"; then | |
12 | true # Everything OK | |
13 | else | |
14 | echo "$1 failed" | |
15 | echo "Autotool bootstrapping failed. You will need to investigate and correct" ; | |
16 | echo "before you can develop on this source tree" | |
17 | exit 1 | |
18 | fi | |
19 | } | |
20 | ||
2d598be1 YS |
21 | cd "$srcdir" |
22 | ||
56c60dcc | 23 | # Make sure we are running in the right directory |
63365b8b | 24 | if [ ! -f main.cc ]; then |
56c60dcc MB |
25 | echo "You must run this script from the directory containing it" |
26 | exit 1 | |
27 | fi | |
28 | ||
56c60dcc | 29 | |
f6100b6f RC |
30 | # Make sure cfgaux exists |
31 | mkdir -p cfgaux | |
32 | ||
33 | # Bootstrap the autotool subsystems | |
2d598be1 | 34 | echo "bootstrapping in $srcdir" |
f6100b6f RC |
35 | bootstrap aclocal |
36 | # bootstrap autoheader | |
6908b7d7 | 37 | bootstrap libtoolize --automake |
f6100b6f RC |
38 | bootstrap autoconf |
39 | bootstrap automake --foreign --add-missing | |
40 | ||
644ca185 | 41 | # Run bootstrap in required subdirs, iff it has not yet been run |
2d598be1 | 42 | echo "bootstrapping in $srcdir/libgetopt++" |
4a8be6e0 | 43 | cd libgetopt++ && ./bootstrap.sh |
644ca185 | 44 | |
2d598be1 YS |
45 | if test -n "$NOCONFIGURE"; then |
46 | echo "Skipping configure per request" | |
47 | exit 0 | |
48 | fi | |
49 | ||
50 | cd "$builddir" | |
51 | ||
52 | build=`$srcdir/cfgaux/config.guess` | |
2d598be1 | 53 | |
a17ea4ab YS |
54 | if hash i686-w64-mingw32-g++ 2> /dev/null; then |
55 | host="i686-w64-mingw32" | |
56 | elif hash i686-pc-mingw32-g++ 2> /dev/null; then | |
57 | host="i686-pc-mingw32" | |
b07cb84a JT |
58 | elif hash x86_64-w64-mingw32-g++ 2> /dev/null; then |
59 | host="x86_64-w64-mingw32" | |
2d598be1 | 60 | else |
b07cb84a | 61 | echo "mingw32 or mingw64 target g++ required for building setup" |
a17ea4ab | 62 | exit 1 |
2d598be1 YS |
63 | fi |
64 | ||
65 | echo "running configure" | |
0963fbe7 | 66 | $srcdir/configure -C --build=$build --host=$host "$@" |
2d598be1 YS |
67 | |
68 | exit $? |