1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
1 |
#!/bin/sh
|
1192.3.50
by Monty Taylor
Updated header on autorun.sh. |
2 |
#
|
3 |
# Copyright (c) 2006 Jan Kneschke
|
|
4 |
# Copyright (c) 2009 Sun Microsystems
|
|
5 |
# All rights reserved.
|
|
6 |
#
|
|
7 |
# Redistribution and use in source and binary forms, with or without
|
|
8 |
# modification, are permitted provided that the following conditions are met:
|
|
9 |
#
|
|
10 |
# 1. Redistributions of source code must retain the above copyright
|
|
11 |
# notice, this list of conditions and the following disclaimer.
|
|
12 |
# 2. Redistributions in binary form must reproduce the above copyright
|
|
13 |
# notice, this list of conditions and the following disclaimer in the
|
|
14 |
# documentation and/or other materials provided with the distribution.
|
|
15 |
# 3. The name of the author may not be used to endorse or promote products
|
|
16 |
# derived from this software without specific prior written permission.
|
|
17 |
#
|
|
18 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
19 |
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
20 |
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
21 |
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
22 |
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
23 |
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
24 |
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
25 |
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
26 |
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
27 |
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
28 |
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
29 |
#
|
|
40
by Brian Aker
Updating to modern autorun |
30 |
# Run this to generate all the initial makefiles, etc.
|
14
by brian
Adding autorun statement |
31 |
|
32 |
die() { echo "$@"; exit 1; } |
|
33 |
||
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
34 |
# --force means overwrite ltmain.sh script if it already exists
|
520.1.4
by Brian Aker
Merging Monty's work |
35 |
LIBTOOLIZE_FLAGS=" --automake --copy --force" |
524
by Monty
Removed --force from automake to prevent older automakes from copying in older versions of config.guess and config.sub. |
36 |
# --add-missing instructs automake to install missing auxiliary files
|
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
37 |
# and --force to overwrite them if they already exist
|
520.1.4
by Brian Aker
Merging Monty's work |
38 |
AUTOMAKE_FLAGS="--add-missing --copy --force" |
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
39 |
ACLOCAL_FLAGS="-I m4" |
40
by Brian Aker
Updating to modern autorun |
40 |
|
41 |
ARGV0=$0 |
|
42 |
ARGS="$@" |
|
43 |
||
44 |
run() { |
|
45 |
echo "$ARGV0: running \`$@' $ARGS" |
|
46 |
$@ $ARGS |
|
47 |
}
|
|
48 |
||
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
49 |
# Try to locate a program by using which, and verify that the file is an
|
50 |
# executable
|
|
51 |
locate_binary() { |
|
52 |
for f in $@ |
|
1081.1.1
by Monty Taylor
Whole boat-load of build fixes. |
53 |
do
|
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
54 |
file=`which $f 2>/dev/null | grep -v '^no '` |
55 |
if test -n "$file" -a -x "$file"; then |
|
56 |
echo $file |
|
57 |
return 0 |
|
1081.1.1
by Monty Taylor
Whole boat-load of build fixes. |
58 |
fi
|
59 |
done
|
|
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
60 |
|
61 |
echo "" |
|
62 |
return 1 |
|
63 |
}
|
|
64 |
||
65 |
||
66 |
if test -f config/pre_hook.sh |
|
67 |
then
|
|
68 |
. config/pre_hook.sh |
|
1081.1.1
by Monty Taylor
Whole boat-load of build fixes. |
69 |
fi
|
992.1.21
by Monty Taylor
First pass at replacing plugin.m4. |
70 |
|
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
71 |
# Try to detect the supported binaries if the user didn't
|
72 |
# override that by pushing the environment variable
|
|
527
by Monty Taylor
Fixed the libtool crap. (maybe?) |
73 |
if test x$LIBTOOLIZE = x; then |
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
74 |
LIBTOOLIZE=`locate_binary glibtoolize libtoolize-1.5 libtoolize` |
75 |
if test x$LIBTOOLIZE = x; then |
|
76 |
die "Did not find a supported libtoolize"
|
|
527
by Monty Taylor
Fixed the libtool crap. (maybe?) |
77 |
fi
|
78 |
fi
|
|
79 |
||
40
by Brian Aker
Updating to modern autorun |
80 |
if test x$ACLOCAL = x; then |
1093.9.24
by Monty Taylor
Added support for automake 1.11 and silent build rules. |
81 |
ACLOCAL=`locate_binary aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal19 aclocal` |
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
82 |
if test x$ACLOCAL = x; then |
83 |
die "Did not find a supported aclocal"
|
|
40
by Brian Aker
Updating to modern autorun |
84 |
fi
|
85 |
fi
|
|
86 |
||
87 |
if test x$AUTOMAKE = x; then |
|
1093.9.24
by Monty Taylor
Added support for automake 1.11 and silent build rules. |
88 |
AUTOMAKE=`locate_binary automake-1.11 automake-1.10 automake-1.9 automake19 automake` |
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
89 |
if test x$AUTOMAKE = x; then |
90 |
die "Did not find a supported automake"
|
|
40
by Brian Aker
Updating to modern autorun |
91 |
fi
|
92 |
fi
|
|
93 |
||
94 |
if test x$AUTOCONF = x; then |
|
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
95 |
AUTOCONF=`locate_binary autoconf-2.59 autoconf259 autoconf` |
96 |
if test x$AUTOCONF = x; then |
|
97 |
die "Did not find a supported autoconf"
|
|
40
by Brian Aker
Updating to modern autorun |
98 |
fi
|
99 |
fi
|
|
100 |
||
101 |
if test x$AUTOHEADER = x; then |
|
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
102 |
AUTOHEADER=`locate_binary autoheader-2.59 autoheader259 autoheader` |
103 |
if test x$AUTOHEADER = x; then |
|
104 |
die "Did not find a supported autoheader"
|
|
40
by Brian Aker
Updating to modern autorun |
105 |
fi
|
106 |
fi
|
|
107 |
||
527
by Monty Taylor
Fixed the libtool crap. (maybe?) |
108 |
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize" |
40
by Brian Aker
Updating to modern autorun |
109 |
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal" |
110 |
run $AUTOHEADER || die "Can't execute autoheader" |
|
111 |
run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake" |
|
112 |
run $AUTOCONF || die "Can't execute autoconf" |
|
1090.3.1
by Monty Taylor
Merged in trond's new autorun.sh from libmemcached. |
113 |
|
114 |
if test -f config/post_hook.sh |
|
115 |
then
|
|
116 |
. config/post_hook.sh |
|
117 |
fi
|
|
118 |
||
119 |
echo "---" |
|
120 |
echo "Configured with the following tools:" |
|
121 |
echo " * `$LIBTOOLIZE --version | head -1`" |
|
122 |
echo " * `$ACLOCAL --version | head -1`" |
|
123 |
echo " * `$AUTOHEADER --version | head -1`" |
|
124 |
echo " * `$AUTOMAKE --version | head -1`" |
|
125 |
echo " * `$AUTOCONF --version | head -1`" |
|
126 |
echo "---" |