forked from xapian/xapian
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap
executable file
·685 lines (630 loc) · 20.3 KB
/
bootstrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
#!/bin/sh
# bootstrap a xapian source tree obtained from git to produce a tree like
# you'd get from unpacking the results of "make dist"
#
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014 Olly Betts
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
# USA
if [ "$1" = "--help" ] ; then
echo "$0 [--ftp] [--without-autotools|--clean]"
exit 0
fi
trap 'echo "Bootstrap failed"' EXIT
set -e
# The variables which specify the autotools to use. And doxygen.
autotools="AUTORECONF AUTOCONF AUTOHEADER AUTOM4TE AUTOMAKE ACLOCAL LIBTOOLIZE DOXYGEN"
# Tool for downloading a file from a URL (currently wget or curl).
FETCH_URL_TOOL=
check_sha1sum() {
checksum=$1
tarball=$2
if [ -z "$SHA1SUM_TOOL" ] ; then
for SHA1SUM_TOOL in \
'${SHA1SUM-sha1sum} 2>/dev/null|cut -d\ -f1' \
'${SHASUM-shasum} 2>/dev/null|cut -d\ -f1' \
'$(OPENSSL-openssl} sha1 2>/dev/null|sed "s/.* //"' \
'' ; do
if [ -z "$SHA1SUM_TOOL" ] ; then
echo <<'END'
Need sha1sum or shasum or openssl installed to check SHA1 checksums.
Set environment variable SHA1SUM, SHASUM or OPENSSL if the tool isn't on
your PATH.
END
exit 1
fi
r=`:|eval "$SHA1SUM_TOOL"`
[ X"$r" != Xda39a3ee5e6b4b0d3255bfef95601890afd80709 ] || break
done
fi
r=`< $tarball eval "$SHA1SUM_TOOL"`
if [ X"$r" != X"$checksum" ] ; then
echo "$tarball: computed SHA1 checksum did NOT match"
echo "computed: $r with $SHA1SUM_TOOL"
echo "expected: $checksum"
ls -l $tarball
file $tarball || true
mv "$tarball" "$tarball.$r"
echo "Renamed $tarball to $tarball.$r"
exit 1
fi
}
lazy_build() {
package=$1
basename=$package-$2
ext=$3
checksum=$4
if [ "$ext" = "tar.xz" ] ; then
if [ -z "$xz_ok" ] ; then
if ${XZ-xz} --version > /dev/null 2>&1 ; then
xz_ok=1
else
xz_ok=0
fi
fi
if [ "$xz_ok" = 0 ] ; then
shift 2
ext=$3
checksum=$4
fi
fi
if [ "$ext" = "tar.bz2" ] ; then
if [ -z "$bz2_ok" ] ; then
# bzip2 --version doesn't exit with code 0 in upstream version (though
# Debian at least patch this bug), so use --help to check it.
if bzip2 --help > /dev/null 2>&1 ; then
bz2_ok=1
else
bz2_ok=0
fi
fi
if [ "$bz2_ok" = 0 ] ; then
shift 2
ext=$3
checksum=$4
fi
fi
tarball=$basename.$ext
case $basename in
*[24680][a-z]) basename=`echo "$basename"|sed 's/[a-z]$//'` ;;
esac
# Create the stamp file in INST so that rerunning bootstrap after
# "rm -rf INST" recovers nicely.
stamp=../INST/$package.stamp
# Download the tarball if required.
if [ ! -f "$tarball" ] ; then
if [ -z "$FETCH_URL_TOOL" ] ; then
if ${WGET-wget} --version > /dev/null 2>&1 ; then
FETCH_URL_TOOL="${WGET-wget} -O-"
elif ${CURL-curl} --version > /dev/null 2>&1 || [ "$?" = 2 ] ; then
# curl --version exits with code 2.
# -L is needed to follow HTTP redirects.
FETCH_URL_TOOL="${CURL-curl} -L"
elif ${LWP_REQUEST-lwp-request} -v > /dev/null 2>&1 || [ "$?" = 9 -o "$?" = 255 ] ; then
# lwp-request -v exits with code 9 (5.810) or 255 (6.03)
FETCH_URL_TOOL="${LWP_REQUEST-lwp-request} -mGET"
else
cat <<END >&2
Neither wget nor curl nor lwp-request found - install one of them or if already
installed, set WGET, CURL or LWP_REQUEST to the full path. Alternatively,
download $url
to directory `pwd`
then rerun this script.
END
exit 1
fi
fi
case $basename in
doxygen-*)
if [ "$use_ftp" = yes ] ; then
url="ftp://ftp.stack.nl/pub/users/dimitri/$tarball"
else
url="http://ftp.stack.nl/pub/users/dimitri/$tarball"
fi ;;
file-*)
if [ "$use_ftp" = yes ] ; then
url="ftp://ftp.astron.com/pub/file/$tarball"
else
url="http://fossies.org/unix/misc/$tarball"
fi ;;
*[13579][a-z])
# GNU alpha release
if [ "$use_ftp" = yes ] ; then
url="ftp://alpha.gnu.org/gnu/$package/$tarball"
else
url="http://alpha.gnu.org/gnu/$package/$tarball"
fi ;;
*)
if [ "$use_ftp" = yes ] ; then
url="ftp://ftp.gnu.org/gnu/$package/$tarball"
else
url="http://ftpmirror.gnu.org/$package/$tarball"
fi ;;
esac
rm -f download.tmp
echo "Downloading <$url>"
$FETCH_URL_TOOL "$url" > download.tmp && mv download.tmp "$tarball"
fi
if [ -f "$stamp" ] ; then
find_stdout=`find "$stamp" -newer "$tarball" -print`
else
find_stdout=
fi
if [ -z "$find_stdout" ] ; then
# Verify the tarball's checksum before building it.
check_sha1sum "$checksum" "$tarball"
# Remove tarballs of other versions.
for f in "$package"-* ; do
[ "$f" = "$tarball" ] || rm -rf "$f"
done
case $ext in
tar.xz)
${XZ-xz} -dc "$tarball"| tar xf - ;;
tar.bz2)
bzip2 -dc "$tarball"| tar xf - ;;
*)
gzip -dc "$tarball"| tar xf - ;;
esac
cd "$basename"
# Fix doxygen/Qt stupid and pointless enumerating of Mac OS X releases
# which stops it building on each new OS X release.
if [ -f qtools/qglobal.h ] ; then
sed 's!^[ ]*#[ ]*error.*Mac *OS *X is unsupported!// &!' \
qtools/qglobal.h > qtools/qglobal.hT
mv qtools/qglobal.hT qtools/qglobal.h
fi
if [ -d "../../patches/$package" ] ; then
for p in "../../patches/$package/"* ; do
patch -p1 < "$p"
done
fi
if test -n "$AUTOCONF" ; then
./configure --prefix "$instdir" AUTOCONF="$AUTOCONF"
else
./configure --prefix "$instdir"
fi
make
make install
cd ..
rm -rf "$basename"
touch "$stamp"
fi
}
handle_svn_external() {
path=$1
if [ ! -f "$path/.nobootstrap" ] ; then
revopt=$2
url=$3
if [ ! -d "$path" ] ; then
git svn init "$url" "$path"/
fi
(cd "$path" && git svn fetch "$revopt" && git reset --hard `git svn log "$revopt" --oneline --show-commit|awk '{print $3}'`)
fi
}
handle_git_external() {
path=$1
if [ ! -f "$path/.nobootstrap" ] ; then
rev=$2
url=$3
if [ ! -d "$path" ] ; then
git clone --no-checkout -- "$url" "$path"
elif (cd "$path" && git reflog "$rev" -- 2>/dev/null) ; then
: # Already have that revision locally
else
(cd "$path" && git fetch)
fi
(cd "$path" && git checkout "$rev")
fi
}
update_config() {
from=$1
to=$2
ts_from=`perl -ne '/^timestamp=(\W?)([-\d]+)$1/ and do {$_=$2;y/-//d;print;exit}' "$from"`
ts_to=`perl -ne '/^timestamp=(\W?)([-\d]+)$1/ and do {$_=$2;y/-//d;print;exit}' "$to"`
if [ "$ts_from" -gt "$ts_to" ] ; then
echo "Updating $to ($ts_to) with $from ($ts_from)"
# rm first in case the existing file is a symlink.
rm -f "$to"
cp "$from" "$to"
fi
}
curdir=`pwd`
# cd to srcdir if we aren't already there.
srcdir=`echo "$0"|sed 's!/*[^/]*$!!'`
case $srcdir in
""|.)
srcdir=. ;;
*)
cd "$srcdir" ;;
esac
# Commit hash to pass to handle_git_external for swig.
swig_git_commit_hash=618868ce3dbbde24bff185afea0c019d031cf857
swig_origin_url=git://github.com/swig/swig.git
if [ -d .git ] ; then
for emptydir in xapian-applications/omega/m4 xapian-bindings/m4 xapian-letor/m4 ; do
if test -d "$emptydir" ; then
:
else
parent=`echo "$emptydir"|sed 's,/[^/]*$,,'`
if test -d "$parent" ; then
mkdir "$emptydir"
fi
fi
done
if [ -f .git/info/exclude ] ; then
sed '/^\(swig\|xapian-applications\/omega\/common$\)/d' .git/info/exclude > .git/info/exclude~
else
[ -d .git/info ] || mkdir .git/info
fi
cat <<END >> .git/info/exclude~
swig
xapian-applications/omega/common
xapian-letor/common
END
if [ -f .git/info/exclude ] &&
cmp .git/info/exclude~ .git/info/exclude > /dev/null ; then
rm .git/info/exclude~
else
mv .git/info/exclude~ .git/info/exclude
fi
if git config --get svn-remote.svn.url >/dev/null ; then
# git repo checked out with git-svn from svn.xapian.org.
# Pull in each svn:externals as a separate little git repo:
git svn show-externals | while read path revopt url ; do
# For example:
# /swig -r12724 svn://svn.tartarus.org/swig/trunk/
if [ -n "$url" ] ; then
case $path in
/swig)
# Should no longer be present, but skip in case we're used with
# an older tree or a different branch.
;;
/*)
path=`echo "$path"|sed 's,^/,,'`
handle_svn_external "$path" "$revopt" "$url"
;;
esac
fi
done
if [ -d swig/.git/svn ] ; then
# Old git-svn checkout - move it aside rather than
# deleting in case there are local changes.
echo 'Moving old git-svn checkout of swig to swig.git-svn.old'
echo 'If you have not modified it locally, you can safely delete'
echo 'this now'
mv swig swig.git-svn.old
fi
handle_git_external swig "$swig_git_commit_hash" "$swig_origin_url"
else
# git repo cloned from git.xapian.org or a mirror of it.
# If this tree is checked out from the github mirror, use the same access
# method for other things checked out from github (e.g. swig) so we avoid
# firewall issues. If there's no default remote, the git config command
# will exit with status 1, so ignore that failure.
origin_url=`git config remote.origin.url||:`
case $origin_url in
*[@/]github.com[:/]*)
github_base_url=`echo "X$origin_url"|sed 's/^X//;s!\([@/]github.com[:/]\).*!\1!'` ;;
*)
github_base_url=git://github.com/ ;;
esac
swig_origin_url=${github_base_url}swig/swig.git
handle_git_external swig "$swig_git_commit_hash" "$swig_origin_url"
# Equivalent to r17604 in the Xapian SVN tree:
handle_git_external xapian-applications/omega/.common.git 55ab15617e24de7b094ea21c44f2541898d2d782 .
ln -sf .common.git/xapian-core/common xapian-applications/omega/common
# Equivalent to r16320 in the Xapian SVN tree:
handle_git_external xapian-letor/.common.git dbd42ffed2d76a79d505242b32a357246ab63348 .
ln -sf .common.git/xapian-core/common xapian-letor/common
fi
elif [ -d .svn ] ; then
if [ -d swig/.svn ] ; then
# Old svn checkout - move it aside rather than
# deleting in case there are local changes.
echo 'Moving old svn checkout of swig to swig.svn.old'
echo 'If you have not modified it locally, you can safely delete'
echo 'this now'
mv swig swig.svn.old
fi
handle_git_external swig "$swig_git_commit_hash" "$swig_origin_url"
fi
# Prefer http downloads as they are more likely to work through firewalls.
use_ftp=no
if [ "$1" = "--ftp" ] ; then
shift
use_ftp=yes
fi
if [ "$1" = "--without-autotools" ] ; then
shift
else
if [ "$1" = "--clean" ] ; then
shift
rm -rf INST
fi
[ -d INST ] || mkdir INST
instdir=`pwd`/INST
[ -d BUILD ] || mkdir BUILD
cd BUILD
# The last field is the SHA1 checksum of the tarball.
lazy_build doxygen 1.8.7 \
src.tar.gz 3728f183f390f96b4ec39d02782a7c2d91f7bfca
lazy_build autoconf 2.68 \
tar.xz 63a3b495400c1c053f2f6b62efb7a5c0ad4156c9 \
tar.bz2 b534c293b22048c022b1ff3a372b9c03f26170b4 \
tar.gz 843f7dfcc6addf129dc2c8b12f7d72d371478f42
# 2.69 is fussy about the m4 version
# lazy_build autoconf 2.69 tar.gz 562471cbcb0dd0fa42a76665acf0dbb68479b78a
AUTOCONF=$instdir/bin/autoconf \
lazy_build automake 1.14.1 \
tar.xz 2ced676f6b792a95c5919243f81790b1172c7f5b \
tar.gz 0bb1714b78d70cab9907d2013082978a28f48a46
lazy_build libtool 2.4.2 \
tar.xz 4671f3323f2fbc712a70afce57602ce906a82a15 \
tar.gz 22b71a8b5ce3ad86e1094e7285981cae10e6ff88
if [ "$1" = "--deps=libmagic" ] ; then
shift
lazy_build file 5.10 tar.gz 72fd435e78955ee122b7b3d323ff2f92e6263e89
fi
for v in $autotools ; do
tool=`echo "$v"|tr A-Z a-z`
eval "$v=\"\$instdir\"/bin/$tool;export $v"
done
cd ..
fi
case `${LIBTOOLIZE-libtoolize} --version` in
"")
echo "${LIBTOOLIZE-libtoolize} not found"
exit 1 ;;
"libtoolize (GNU libtool) 1.4.*")
echo "${LIBTOOLIZE-libtoolize} is from libtool 1.4 which is too old - libtool 2.2 is required."
echo "If you have both installed, set LIBTOOLIZE to point to the correct version."
exit 1 ;;
"libtoolize (GNU libtool) 1.5.*")
echo "${LIBTOOLIZE-libtoolize} is from libtool 1.5 which is too old - libtool 2.2 is required."
echo "If you have both installed, set LIBTOOLIZE to point to the correct version."
exit 1 ;;
esac
ACLOCAL="${ACLOCAL-aclocal} -I `pwd`/xapian-core/m4-macros"
intree_swig=no
modules=
for module in xapian-core xapian-applications/omega swig xapian-bindings xapian-letor ; do
d=$module
if [ -f "$d/configure.ac" -o -f "$d/configure.in" ] ; then
:
else
# Skip any directories we can't bootstrap.
continue
fi
if [ -f "$d/.nobootstrap" ] ; then
# Report why to save head scratching when someone forgets they created
# a .nobootstrap file.
echo "Skipping '$module' due to presence of '$d/.nobootstrap'."
continue
fi
if [ "$d" = swig ] && [ -f "xapian-bindings/.nobootstrap" ] ; then
# No point bootstrapping SWIG if we aren't going to use it.
echo "Skipping '$d' due to presence of 'xapian-bindings/.nobootstrap'."
continue
fi
echo "Bootstrapping \`$module'"
[ -f "$d/preautoreconf" ] && "$d/preautoreconf"
# If we have a custom INSTALL file, preserve it since autoreconf insists on
# replacing INSTALL with "generic installation instructions" when --force
# is used. Be careful to replace it if autoreconf fails.
if [ -f "$d/INSTALL" ] ; then
if grep 'generic installation instructions' "$d/INSTALL" >/dev/null 2>&1 ; then
:
else
mv -f "$d/INSTALL" "$d/INSTALL.preserved-by-bootstrap"
fi
fi
autoreconf_rc=
if [ swig = "$module" ] ; then
# SWIG provides its own bootstrapping script.
curdir=`pwd`
cd "$d"
./autogen.sh || autoreconf_rc=$?
cd "$curdir"
# Use the uninstalled wrapper for the in-tree copy of SWIG.
intree_swig=yes
else
# Use --install as debian's autoconf wrapper uses 2.5X if it sees it
# (but it doesn't check for -i).
#
# Use --force so that we update files if autoconf, automake, or libtool
# has been upgraded.
${AUTORECONF-autoreconf} --install --force "$d" || autoreconf_rc=$?
fi
if [ -f "$d/INSTALL.preserved-by-bootstrap" ] ; then
mv -f "$d/INSTALL.preserved-by-bootstrap" "$d/INSTALL"
fi
if [ -n "$autoreconf_rc" ] ; then
exit $autoreconf_rc
fi
for f in config.guess config.sub ; do
if [ -f "$d/$f" ] ; then
update_config "config/$f" "$d/$f"
fi
done
modules="$modules $module"
done
# Generate the top-level configure script.
rm -f configure.tmp
cat <<'TOP_OF_CONFIGURE' > configure.tmp
#!/bin/sh
# configure each submodule in a xapian source tree
# Generated by Xapian top-level bootstrap script.
#
# Copyright (C) 2003,2004,2007,2008 Olly Betts
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
# USA
trap 'echo "configure failed"' EXIT
set -e
# Produced escaped version of command suitable for pasting back into sh
cmd=$0
for a ; do
case $a in
*[^-A-Za-z0-9_+=:@/.,]*)
esc_a=`echo "$a"|sed 's!\([^-A-Za-z0-9_+=:@/.,]\)!\\\\\\1!g'`
cmd="$cmd $esc_a" ;;
*)
cmd="$cmd $a" ;;
esac
done
here=`pwd`
TOP_OF_CONFIGURE
# Produce an absolute path to srcdir.
srcdir_abs=`pwd`
# This section is unquoted so we can substitute variables.
cat <<MIDDLE_OF_CONFIGURE >> configure.tmp
srcdir="$srcdir_abs"
modules="$modules"
MIDDLE_OF_CONFIGURE
vars=
if [ yes = "$intree_swig" ] ; then
# We want the path to SWIG to point into srcdir, which isn't known until
# configure-time, so we need to expand $here in configure. We can't just set
# SWIG here and let the case below handle it as that would escape the value
# such that $here didn't get expanded at all.
echo ': ${SWIG="$here/swig/preinst-swig"}' >> configure.tmp
echo "export SWIG" >> configure.tmp
vars=' SWIG=$here/swig/preinst-swig'
# Kill any existing setting of SWIG so that we don't try to handle it again
# below.
SWIG=
fi
for tool in SWIG $autotools ; do
eval "val=\$$tool"
if [ -n "$val" ] ; then
echo ': ${'"$tool=\"$val\""'}' >> configure.tmp
echo "export $tool" >> configure.tmp
vars="$vars $tool='"`echo "$val"|sed 's/\(['"\\'"']\)/\\\1/g'`"'"
fi
done
if [ -n "$vars" ] ; then
# $vars will always have a leading space.
echo "set$vars "'"$@"' >> configure.tmp
fi
cat <<'END_OF_CONFIGURE' >> configure.tmp
dirs=
revdirs=
XAPIAN_CONFIG=$here/xapian-core/xapian-config
for d in $modules ; do
if [ "$here" = "$srcdir" ] ; then
configure=./configure
configure_from_here=$d/configure
else
configure=$srcdir/$d/configure
configure_from_here=$configure
fi
if [ -f "$configure_from_here" ] ; then
if [ -d "$d" ] ; then : ; else
case $d in
xapian-applications/*) [ -d xapian-applications ] || mkdir xapian-applications ;;
esac
mkdir "$d"
fi
echo "Configuring \`$d'"
# Use a shared config.cache for speed and to save a bit of diskspace, but
# don't share it with SWIG just in case it manages to probe and cache
# different answers (e.g. because it uses a C compiler).
case $d in
swig)
cd "$d" && "$configure" ${1+"$@"}
;;
xapian-core)
cd "$d" && "$configure" --enable-maintainer-mode --disable-option-checking --cache-file="$here/config.cache" ${1+"$@"}
;;
xapian-applications/omega)
cd "$d" && "$configure" --enable-maintainer-mode --disable-option-checking XAPIAN_CONFIG="$XAPIAN_CONFIG" CPPFLAGS="-I$srcdir/INST/include" LDFLAGS="-L$srcdir/INST/lib" ${1+"$@"}
;;
*)
cd "$d" && "$configure" --enable-maintainer-mode --disable-option-checking --cache-file="$here/config.cache" XAPIAN_CONFIG="$XAPIAN_CONFIG" ${1+"$@"}
;;
esac
cd "$here"
dirs="$dirs $d"
revdirs="$d $revdirs"
fi
done
rm -f Makefile.tmp
cat <<EOF > Makefile.tmp
# Makefile generated by:
# $cmd
EOF
targets='all install uninstall install-strip clean distclean mostlyclean maintainer-clean dist check distcheck'
for target in $targets ; do
echo
echo "$target:"
case $target in
uninstall|*clean)
# When uninstalling or cleaning, process directories in reverse order, so
# that we process a directory after any directories which might use it.
list=$revdirs ;;
*)
list=$dirs ;;
esac
for d in $list ; do
case $d,$target in
swig,install*|swig,uninstall)
# Nothing to do with swig when installing/uninstalling.
;;
swig,dist|swig,check|swig,distcheck|swig,all)
# Need to ensure swig is built before "make dist", "make check", etc.
echo " cd $d && \$(MAKE)" ;;
swig,mostlyclean)
echo " cd $d && \$(MAKE) clean" ;;
xapian-bindings,distcheck)
# FIXME: distcheck doesn't currently work for xapian-bindings because
# xapian-core isn't installed.
echo " cd $d && \$(MAKE) check && \$(MAKE) dist" ;;
*)
echo " cd $d && \$(MAKE) $target" ;;
esac
done
case $target in
distclean|maintainer-clean) echo " rm -f Makefile config.cache" ;;
esac
done >> Makefile.tmp
cat <<EOF >> Makefile.tmp
recheck:
$cmd
Makefile: $srcdir/configure
$cmd
$srcdir/configure: $srcdir/bootstrap
$srcdir/bootstrap
.PHONY: $targets recheck
EOF
mv -f Makefile.tmp Makefile
trap - EXIT
echo "Configured successfully - now run \"${MAKE-make}\""
END_OF_CONFIGURE
chmod +x configure.tmp
mv -f configure.tmp configure
trap - EXIT
echo "Bootstrapped successfully - now run \"$srcdir/configure\" and \"${MAKE-make}\""