Merge lp://staging/~trond-norbye/libmemcached/bug_395094 into lp://staging/~tangent-org/libmemcached/trunk

Proposed by Trond Norbye
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~trond-norbye/libmemcached/bug_395094
Merge into: lp://staging/~tangent-org/libmemcached/trunk
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~trond-norbye/libmemcached/bug_395094
Reviewer Review Type Date Requested Status
Monty Taylor Pending
Libmemcached-developers Pending
Review via email: mp+8178@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Trond Norbye (trond-norbye) wrote :

Rewrote the autogen.sh script to no longer require bash (plain Bourne shell syntax should be sufficient). I also "re-wrote the detection for all of the binaries to use a common function to avoid the duplication of the "search-logic".

The last change was to include the version numbers from _all_ of the tools, and not only two of them...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config/autorun.sh'
2--- config/autorun.sh 2009-06-15 00:42:52 +0000
3+++ config/autorun.sh 2009-07-03 10:48:15 +0000
4@@ -1,112 +1,88 @@
5-#!/usr/bin/env bash
6+#!/bin/sh
7 # Taken from lighthttpd server (BSD). Thanks Jan!
8 # Run this to generate all the initial makefiles, etc.
9
10 die() { echo "$@"; exit 1; }
11
12-# LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
13+# --force means overwrite ltmain.sh script if it already exists
14 LIBTOOLIZE_FLAGS=" --automake --copy --force"
15-# ACLOCAL=${ACLOCAL:-aclocal}
16+# --add-missing instructs automake to install missing auxiliary files
17+# and --force to overwrite them if they already exist
18+AUTOMAKE_FLAGS="--add-missing --copy --force"
19 ACLOCAL_FLAGS="-I m4"
20-# AUTOHEADER=${AUTOHEADER:-autoheader}
21-# AUTOMAKE=${AUTOMAKE:-automake}
22-AUTOMAKE_FLAGS="--add-missing --copy --force"
23-# AUTOCONF=${AUTOCONF:-autoconf}
24
25 ARGV0=$0
26 ARGS="$@"
27
28-
29 run() {
30 echo "$ARGV0: running \`$@' $ARGS"
31 $@ $ARGS
32 }
33
34-## jump out if one of the programs returns 'false'
35-set -e
36-
37-## We do not currently support glibtoolize
38+# Try to locate a program by using which, and verify that the file is an
39+# executable
40+locate_binary() {
41+ for f in $@
42+ do
43+ file=`which $f 2>/dev/null | grep -v '^no '`
44+ if test -n "$file" -a -x "$file"; then
45+ echo $file
46+ return 0
47+ fi
48+ done
49+
50+ echo ""
51+ return 1
52+}
53+
54+# Try to detect the supported binaries if the user didn't
55+# override that by pushing the environment variable
56 if test x$LIBTOOLIZE = x; then
57- if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
58- LIBTOOLIZE=glibtoolize
59- elif test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
60- LIBTOOLIZE=libtoolize-1.5
61- elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
62- LIBTOOLIZE=libtoolize
63- else
64- echo "libtoolize 1.5.x wasn't found, exiting"; exit 0
65+ LIBTOOLIZE=`locate_binary glibtoolize libtoolize-1.5 libtoolize`
66+ if test x$LIBTOOLIZE = x; then
67+ die "Did not find a supported libtoolize"
68 fi
69 fi
70
71-## suse has aclocal and aclocal-1.9
72 if test x$ACLOCAL = x; then
73- if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then
74- ACLOCAL=aclocal-1.10
75- elif test \! "x`which aclocal-1.9 2> /dev/null | grep -v '^no'`" = x; then
76- ACLOCAL=aclocal-1.9
77- elif test \! "x`which aclocal19 2> /dev/null | grep -v '^no'`" = x; then
78- ACLOCAL=aclocal19
79- elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
80- ACLOCAL=aclocal
81- else
82- echo "automake 1.9.x (aclocal) wasn't found, exiting"; exit 0
83+ ACLOCAL=`locate_binary aclocal-1.10 aclocal-1.9 aclocal19 aclocal`
84+ if test x$ACLOCAL = x; then
85+ die "Did not find a supported aclocal"
86 fi
87 fi
88
89 if test x$AUTOMAKE = x; then
90- if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then
91- AUTOMAKE=automake-1.10
92- elif test \! "x`which automake-1.9 2> /dev/null | grep -v '^no'`" = x; then
93- AUTOMAKE=automake-1.9
94- elif test \! "x`which automake19 2> /dev/null | grep -v '^no'`" = x; then
95- AUTOMAKE=automake19
96- elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
97- AUTOMAKE=automake
98- else
99- echo "automake 1.9.x wasn't found, exiting"; exit 0
100+ AUTOMAKE=`locate_binary automake-1.10 automake-1.9 automake19 automake`
101+ if test x$AUTOMAKE = x; then
102+ die "Did not find a supported automake"
103 fi
104 fi
105
106-
107-## macosx has autoconf-2.59 and autoconf-2.60
108 if test x$AUTOCONF = x; then
109- if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
110- AUTOCONF=autoconf-2.59
111- elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
112- AUTOCONF=autoconf259
113- elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
114- AUTOCONF=autoconf
115- else
116- echo "autoconf 2.59+ wasn't found, exiting"; exit 0
117+ AUTOCONF=`locate_binary autoconf-2.59 autoconf259 autoconf`
118+ if test x$AUTOCONF = x; then
119+ die "Did not find a supported autoconf"
120 fi
121 fi
122
123 if test x$AUTOHEADER = x; then
124- if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
125- AUTOHEADER=autoheader-2.59
126- elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
127- AUTOHEADER=autoheader259
128- elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
129- AUTOHEADER=autoheader
130- else
131- echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 0
132+ AUTOHEADER=`locate_binary autoheader-2.59 autoheader259 autoheader`
133+ if test x$AUTOHEADER = x; then
134+ die "Did not find a supported autoheader"
135 fi
136 fi
137
138-
139-# --force means overwrite ltmain.sh script if it already exists
140 run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
141-
142 run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
143 run $AUTOHEADER || die "Can't execute autoheader"
144-
145-# --add-missing instructs automake to install missing auxiliary files
146-# and --force to overwrite them if they already exist
147 run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake"
148 run $AUTOCONF || die "Can't execute autoconf"
149
150-echo -n "Automade with: "
151-$AUTOMAKE --version | head -1
152-echo -n "Configured with: "
153-$AUTOCONF --version | head -1
154-
155+echo "---"
156+echo "Configured with the following tools:"
157+echo " * `$LIBTOOLIZE --version | head -1`"
158+echo " * `$ACLOCAL --version | head -1`"
159+echo " * `$AUTOHEADER --version | head -1`"
160+echo " * `$AUTOMAKE --version | head -1`"
161+echo " * `$AUTOCONF --version | head -1`"
162+echo "---"

Subscribers

People subscribed via source and target branches

to all changes: