Add command-line option help-text localization
[cygwin-setup.git] / bootstrap.sh
blob6dcd0ed38502f6b01b17f2be2875ae4e47c509a7
1 #! /bin/bash
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
7 builddir=`pwd`
8 srcdir=`dirname "$0"`
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
21 cd "$srcdir"
23 # Make sure we are running in the right directory
24 if [ ! -f main.cc ]; then
25 echo "You must run this script from the directory containing it"
26 exit 1
29 if [[ "$1" =~ "--host=" ]]; then
30 host="${1#--host=}"
31 elif hash i686-w64-mingw32-g++ 2> /dev/null; then
32 host="i686-w64-mingw32"
33 elif hash i686-pc-mingw32-g++ 2> /dev/null; then
34 host="i686-pc-mingw32"
35 elif hash x86_64-w64-mingw32-g++ 2> /dev/null; then
36 host="x86_64-w64-mingw32"
37 else
38 echo "mingw32 or mingw64 target g++ required for building setup"
39 exit 1
42 export ACLOCAL_PATH=$($host-g++ --print-sysroot)/mingw/share/aclocal
44 # Make sure cfgaux exists
45 mkdir -p cfgaux
47 # Bootstrap the autotool subsystems
48 echo "bootstrapping in $srcdir"
49 bootstrap aclocal
50 # bootstrap autoheader
51 bootstrap libtoolize --automake
52 bootstrap autoconf
53 bootstrap automake --foreign --add-missing
55 # Run bootstrap in required subdirs, iff it has not yet been run
56 echo "bootstrapping in $srcdir/libgetopt++"
57 cd libgetopt++ && ./bootstrap.sh
59 if test -n "$NOCONFIGURE"; then
60 echo "Skipping configure per request"
61 exit 0
64 cd "$builddir"
66 build=`$srcdir/cfgaux/config.guess`
68 echo "running configure"
69 $srcdir/configure -C --build=$build --host=$host "$@"
71 exit $?