~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to config/autorun.sh

Removed SCCS references.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env bash
2
 
# Taken from lighthttpd server (BSD). Thanks Jan!
3
 
# Run this to generate all the initial makefiles, etc.
 
1
#!/bin/sh
 
2
# Create MySQL autotools infrastructure
4
3
 
5
4
die() { echo "$@"; exit 1; }
6
5
 
7
 
# LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
8
 
LIBTOOLIZE_FLAGS=" --automake --copy --force"
9
 
# ACLOCAL=${ACLOCAL:-aclocal}
10
 
ACLOCAL_FLAGS="-I m4"
11
 
# AUTOHEADER=${AUTOHEADER:-autoheader}
12
 
# AUTOMAKE=${AUTOMAKE:-automake}
13
 
AUTOMAKE_FLAGS="--add-missing --copy --force"
14
 
# AUTOCONF=${AUTOCONF:-autoconf}
15
 
 
16
 
ARGV0=$0
17
 
ARGS="$@"
18
 
 
19
 
 
20
 
run() {
21
 
        echo "$ARGV0: running \`$@' $ARGS"
22
 
        $@ $ARGS
23
 
}
24
 
 
25
 
## jump out if one of the programs returns 'false'
26
 
set -e
27
 
 
28
 
if test -d ".bzr" ; then
29
 
  bzr log --short > ChangeLog || touch ChangeLog
30
 
else
31
 
  touch ChangeLog
32
 
fi
33
 
 
34
 
if test x$LIBTOOLIZE = x; then
35
 
  if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
36
 
    LIBTOOLIZE=glibtoolize
37
 
  elif test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
38
 
    LIBTOOLIZE=libtoolize-1.5
39
 
  elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
40
 
    LIBTOOLIZE=libtoolize
41
 
  elif test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
42
 
    LIBTOOLIZE=glibtoolize
43
 
  else 
44
 
    echo "libtoolize 1.5.x wasn't found, exiting"; exit 1
45
 
  fi
46
 
fi
47
 
 
48
 
if test x$ACLOCAL = x; then
49
 
  if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then
50
 
    ACLOCAL=aclocal-1.10
51
 
  elif test \! "x`which aclocal110 2> /dev/null | grep -v '^no'`" = x; then
52
 
    ACLOCAL=aclocal110
53
 
  elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
54
 
    ACLOCAL=aclocal
55
 
  else 
56
 
    echo "automake 1.10.x (aclocal) wasn't found, exiting"; exit 1
57
 
  fi
58
 
fi
59
 
 
60
 
if test x$AUTOMAKE = x; then
61
 
  if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then
62
 
    AUTOMAKE=automake-1.10
63
 
  elif test \! "x`which automake110 2> /dev/null | grep -v '^no'`" = x; then
64
 
    AUTOMAKE=automake110
65
 
  elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
66
 
    AUTOMAKE=automake
67
 
  else 
68
 
    echo "automake 1.10.x wasn't found, exiting"; exit 1
69
 
  fi
70
 
fi
71
 
 
72
 
 
73
 
## macosx has autoconf-2.59 and autoconf-2.60
74
 
if test x$AUTOCONF = x; then
75
 
  if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
76
 
    AUTOCONF=autoconf-2.59
77
 
  elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
78
 
    AUTOCONF=autoconf259
79
 
  elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
80
 
    AUTOCONF=autoconf
81
 
  else 
82
 
    echo "autoconf 2.59+ wasn't found, exiting"; exit 1
83
 
  fi
84
 
fi
85
 
 
86
 
if test x$AUTOHEADER = x; then
87
 
  if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
88
 
    AUTOHEADER=autoheader-2.59
89
 
  elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
90
 
    AUTOHEADER=autoheader259
91
 
  elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
92
 
    AUTOHEADER=autoheader
93
 
  else 
94
 
    echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 1
95
 
  fi
96
 
fi
97
 
 
98
 
 
99
 
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
100
 
run $AUTOHEADER || die "Can't execute autoheader"
101
 
 
 
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"
102
25
# --force means overwrite ltmain.sh script if it already exists 
103
 
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
104
 
 
 
26
$LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
 
27
  
105
28
# --add-missing instructs automake to install missing auxiliary files
106
29
# and --force to overwrite them if they already exist
107
 
run $AUTOMAKE $AUTOMAKE_FLAGS  || die "Can't execute automake"
108
 
run $AUTOCONF || die "Can't execute autoconf"
109
 
echo -n "Automade with: "
110
 
$AUTOMAKE --version | head -1
111
 
echo -n "Configured with: "
112
 
$AUTOCONF --version | head -1
 
30
automake --add-missing --force  --copy || die "Can't execute automake"
 
31
autoconf || die "Can't execute autoconf"