1 |
#! /bin/sh |
#! /bin/sh |
2 |
# bootstrap -- Helps bootstrapping libtool, when checked out from CVS. |
# bootstrap -- Helps bootstrapping libtool, when checked out from CVS. |
3 |
# |
# |
4 |
# Copyright (C) 2003, 2004, 2005 Free Software Foundation |
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. |
5 |
# |
# |
6 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
7 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
24 |
# better features, and configure.ac documents oldest version of each |
# better features, and configure.ac documents oldest version of each |
25 |
# required for bootstrap (AC_PREREQ, and AM_INIT_AUTOMAKE). |
# required for bootstrap (AC_PREREQ, and AM_INIT_AUTOMAKE). |
26 |
|
|
27 |
|
: ${AUTORECONF=autoreconf} |
28 |
|
: ${AUTOM4TE=autom4te} |
29 |
|
: ${MAKE=make} |
30 |
|
: ${GREP=grep} |
31 |
|
: ${EGREP=egrep} |
32 |
|
: ${FGREP=fgrep} |
33 |
|
: ${SED=sed} |
34 |
|
: ${LN_S='ln -s'} |
35 |
|
|
36 |
test -f ./configure.ac || { |
test -f ./configure.ac || { |
37 |
echo "bootstrap: can't find ./configure.ac, please rerun from top_srcdir" |
echo "bootstrap: can't find ./configure.ac, please rerun from top_srcdir" |
38 |
exit 1 |
exit 1 |
58 |
fi |
fi |
59 |
|
|
60 |
# Extract the package name and version number from configure.ac: |
# Extract the package name and version number from configure.ac: |
61 |
set dummy `sed '/AC_INIT/{s/[][,()]/ /g; p;};d' configure.ac` |
set dummy `$SED '/AC_INIT/{s/[][,()]/ /g; p;};d' configure.ac` |
62 |
shift |
shift |
63 |
|
|
64 |
|
# Whip up a dirty Makefile: |
65 |
|
test -f Makefile \ |
66 |
|
|| $SED '/^if /,/^endif$/d;/^else$/,/^endif$/d' Makefile.am > Makefile |
67 |
|
|
68 |
# Building distributed files from configure is bad for automake, so we |
# Building distributed files from configure is bad for automake, so we |
69 |
# generate them here, and have Makefile rules to keep them up to date. |
# generate them here, and have Makefile rules to keep them up to date. |
70 |
# We don't have all the substitution values to build ltmain.sh from this |
# We don't have all the substitution values to build ltmain.sh from this |
71 |
# script yet, but we need config/ltmain.sh for the libtool commands in |
# script yet, but we need config/ltmain.sh for the libtool commands in |
72 |
# configure, and ltversion.m4 to generate configure in the first place: |
# configure, and ltversion.m4 to generate configure in the first place: |
73 |
rm -f ./config/ltmain.sh ./m4/ltversion.m4 |
rm -f ./config/ltmain.sh ./m4/ltversion.m4 |
|
test -f Makefile || { makefile=Makefile; cp Makefile.am $makefile; } |
|
|
make ./config/ltmain.sh ./m4/ltversion.m4 ./libtoolize.in ./tests/defs.in \ |
|
|
top_srcdir=. PACKAGE="$2" VERSION="$3" M4SH="autom4te -l m4sh" |
|
|
|
|
|
test -f clcommit.m4sh && make -f Makefile.maint commit \ |
|
|
top_srcdir=. PACKAGE="$2" VERSION="$3" M4SH="autom4te -l m4sh" \ |
|
|
SED=sed GREP=grep FGREP=fgrep EGREP=egrep LN_S="ln -s" |
|
74 |
|
|
75 |
test -z "$makefile" || rm -f "$makefile" |
$MAKE ./config/ltmain.sh ./m4/ltversion.m4 ./libtoolize.in ./tests/defs.in \ |
76 |
|
srcdir=. top_srcdir=. PACKAGE="$2" VERSION="$3" \ |
77 |
|
PACKAGE_BUGREPORT="bug-$2@gnu.org" M4SH="$AUTOM4TE --language=m4sh" |
78 |
|
|
79 |
|
test -f clcommit.m4sh && $MAKE -f Makefile.maint commit \ |
80 |
|
srcdir=. top_srcdir=. PACKAGE="$2" VERSION="$3" M4SH="autom4te -l m4sh" \ |
81 |
|
SED="$SED" GREP="$GREP" FGREP="$FGREP" EGREP="$EGREP" LN_S="$LN_S" |
82 |
|
|
83 |
|
rm -f Makefile |
84 |
|
|
85 |
# Make a dummy libtoolize script for autoreconf: |
# Make a dummy libtoolize script for autoreconf: |
86 |
test -f clcommit.m4sh && cat > ./config/libtoolize <<'EOF' |
test -f clcommit.m4sh && cat > ./config/libtoolize <<'EOF' |
97 |
export LIBTOOLIZE |
export LIBTOOLIZE |
98 |
|
|
99 |
for sub in $reconfdirs; do |
for sub in $reconfdirs; do |
100 |
autoreconf --force --verbose --install $sub |
$AUTORECONF --force --verbose --install $sub |
101 |
done |
done |
102 |
|
|
103 |
# Remove our dummy libtoolize |
# Remove our dummy libtoolize |