~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to config/autorun.sh

MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# Create MySQL autotools infrastructure
 
1
#!/usr/bin/env bash
 
2
# Taken from lighthttpd server (BSD). Thanks Jan!
 
3
# Run this to generate all the initial makefiles, etc.
3
4
 
4
5
die() { echo "$@"; exit 1; }
5
6
 
6
 
# Handle "glibtoolize" (e.g., for native OS X autotools) as another
7
 
# name for "libtoolize". Use the first one, either name, found in PATH.
8
 
LIBTOOLIZE=libtoolize  # Default
9
 
IFS="${IFS=   }"; save_ifs="$IFS"; IFS=':'
10
 
for dir in $PATH
11
 
do
12
 
  if test -x $dir/glibtoolize
13
 
  then
14
 
    LIBTOOLIZE=glibtoolize
15
 
    break
16
 
  elif test -x $dir/libtoolize
17
 
  then
18
 
    break
19
 
  fi
20
 
done
21
 
IFS="$save_ifs"
22
 
 
23
 
aclocal || die "Can't execute aclocal" 
24
 
autoheader || die "Can't execute autoheader"
 
7
# LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
 
8
LIBTOOLIZE_FLAGS=" --automake --copy --force"
 
9
# ACLOCAL=${ACLOCAL:-aclocal}
 
10
# AUTOHEADER=${AUTOHEADER:-autoheader}
 
11
# AUTOMAKE=${AUTOMAKE:-automake}
 
12
AUTOMAKE_FLAGS="--add-missing --copy --force"
 
13
# AUTOCONF=${AUTOCONF:-autoconf}
 
14
 
 
15
ARGV0=$0
 
16
ARGS="$@"
 
17
 
 
18
 
 
19
run() {
 
20
        echo "$ARGV0: running \`$@' $ARGS"
 
21
        $@ $ARGS
 
22
}
 
23
 
 
24
## jump out if one of the programs returns 'false'
 
25
set -e
 
26
 
 
27
## We do not currently support glibtoolize
 
28
if test x$LIBTOOLIZE = x; then
 
29
#  if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
 
30
#    LIBTOOLIZE=glibtoolize
 
31
  if test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
 
32
    LIBTOOLIZE=libtoolize-1.5
 
33
  elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
 
34
    LIBTOOLIZE=libtoolize
 
35
  else 
 
36
    echo "libtoolize 1.5.x wasn't found, exiting"; exit 0
 
37
  fi
 
38
fi
 
39
 
 
40
## suse has aclocal and aclocal-1.9
 
41
if test x$ACLOCAL = x; then
 
42
  if test \! "x`which aclocal-1.9 2> /dev/null | grep -v '^no'`" = x; then
 
43
    ACLOCAL=aclocal-1.9
 
44
  elif test \! "x`which aclocal19 2> /dev/null | grep -v '^no'`" = x; then
 
45
    ACLOCAL=aclocal19
 
46
  elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
 
47
    ACLOCAL=aclocal
 
48
  else 
 
49
    echo "automake 1.9.x (aclocal) wasn't found, exiting"; exit 0
 
50
  fi
 
51
fi
 
52
 
 
53
if test x$AUTOMAKE = x; then
 
54
  if test \! "x`which automake-1.9 2> /dev/null | grep -v '^no'`" = x; then
 
55
    AUTOMAKE=automake-1.9
 
56
  elif test \! "x`which automake19 2> /dev/null | grep -v '^no'`" = x; then
 
57
    AUTOMAKE=automake19
 
58
  elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
 
59
    AUTOMAKE=automake
 
60
  else 
 
61
    echo "automake 1.9.x wasn't found, exiting"; exit 0
 
62
  fi
 
63
fi
 
64
 
 
65
 
 
66
## macosx has autoconf-2.59 and autoconf-2.60
 
67
if test x$AUTOCONF = x; then
 
68
  if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
 
69
    AUTOCONF=autoconf-2.59
 
70
  elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
 
71
    AUTOCONF=autoconf259
 
72
  elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
 
73
    AUTOCONF=autoconf
 
74
  else 
 
75
    echo "autoconf 2.59+ wasn't found, exiting"; exit 0
 
76
  fi
 
77
fi
 
78
 
 
79
if test x$AUTOHEADER = x; then
 
80
  if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
 
81
    AUTOHEADER=autoheader-2.59
 
82
  elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
 
83
    AUTOHEADER=autoheader259
 
84
  elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
 
85
    AUTOHEADER=autoheader
 
86
  else 
 
87
    echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 0
 
88
  fi
 
89
fi
 
90
 
 
91
 
 
92
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
 
93
run $AUTOHEADER || die "Can't execute autoheader"
 
94
 
25
95
# --force means overwrite ltmain.sh script if it already exists 
26
 
$LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
27
 
  
 
96
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
 
97
 
28
98
# --add-missing instructs automake to install missing auxiliary files
29
99
# and --force to overwrite them if they already exist
30
 
automake --add-missing --force  --copy --gnu -Wall || die "Can't execute automake"
31
 
autoconf || die "Can't execute autoconf"
 
100
run $AUTOMAKE $AUTOMAKE_FLAGS  || die "Can't execute automake"
 
101
run $AUTOCONF || die "Can't execute autoconf"