-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·209 lines (179 loc) · 5.17 KB
/
autogen.sh
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
#! /bin/sh
# autogen.sh
# This re-creates all the "configure" scripts and the like. It is needed
# when the machine being used does not have the same versions of autoconf
# and automake as the machine used by the developer.
#
# Usage:
# autogen.sh [--fast] [options as for the configure script]
#
# If no arguments are passed the script will rebuild everything. If
# --with-csl or --with-psl is specified only that section of the tree
# will be processed. In the CSL case "--with-wx", "--withoug-gui",
# and perhaps other sub-options will be checked to try to save reworking
# directories that would not be used.
#
# "--fast" prevents it from using "force" options and so if things are
# already up to date the steps should be faster, and it also does a lot in
# parallel.
# I used to have an option (enabled by default) to do the autoconf-ing
# concurrently in all relevant source directories. However libtoolize
# seems to be able to be upset if you use it at the same time in several
# directories where one is contained within the other, so despite that
# having been a good time-saver I have removed it.
# I want this script to be one I can launch from anywhere.
here="$0";while test -L "$here";do here=`ls -ld "$here" | sed 's/.*-> //'`;done
here=`cd \`dirname "$here"\` ; pwd -P`
save=`pwd`
cd $here
ccache -C > /dev/null
find . -name config.cache | xargs rm -rf
find . -name autom4te.cache | xargs rm -rf
if test "$1" = "--fast"
then
fast="yes"
procids=""
shift
else
fast="no"
fi
# On the Mac with macports the command needed here is glibtoolize rather than
# libtoolize.
if which libtoolize > /dev/null
then
LIBTOOLIZE=libtoolize
else
LIBTOOLIZE=glibtoolize
fi
if ! which autoconf > /dev/null || \
! which automake > /dev/null || \
! which $LIBTOOLIZE > /dev/null
then
printf "You need to have autoconf, automake and $LIBTOOLIZE installed.\n"
printf "I seem not to be able to find them.\n"
printf "Note that on some Linux systems it is in a package called libtool-bin\n"
printf "Stopping...\n"
exit 1
fi
# Here I list all the directories that might be relevant. Note that in
# some circumstances some may not be present!
# There are some directories that I have chosen not to process here:
# ./csl/foxtests
# ./generic/libreduce/src
# taking a view that people who wish to build those already have to take
# special steps... and so they can run autoconf etc for themselves if it
# is needed. If I did so here it would slow things down for everybody in
# a way I would view as unhelpful. And this is already slow enough!
printf "autogen.sh arguments: $*\n"
if test $# -eq 0
then
a="--with-psl --with-csl --with-fox"
else
a="$*"
fi
# I will re-process the top level first before any lower level
printf "+++ top-level of Reduce tree\n"
mkdir -p m4
rm -rf ltmain.sh config.cache autom4te.cache m4/libtool.m4 \
m4/lt-obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4
if test "$fast" = "yes"
then
( $LIBTOOLIZE --copy && \
aclocal && \
autoreconf -i ) &
procids="$procids $!"
else
$LIBTOOLIZE --force --copy
aclocal --force
autoreconf -f -i
fi
# Here are the directories that I will always process...
LIBEDIT_VERSION=libedit-20140620-3.1
#LIBEDIT_VERSION=libedit-20210216-3.1
L="./scripts ./libraries/crlibm ./libraries/$LIBEDIT_VERSION \
./generic/newfront"
case $a in
*--without-psl* | *with-psl=no*)
;;
*--with-psl* | *--with-both*)
L="$L ./psl"
;;
*)
;;
esac
# I want "--with-wx" to imply "--without-fox". At present I do not
# feel the need for the converse because this script does not try to
# autoreconf wxWidgets anyway.
case $a in
*--with-wx=no* | "--without-wx*")
;;
*--with-wx*)
a="$a --without-fox"
;;
*)
;;
esac
case $a in
*--without-csl* | *--with-csl=no*)
;;
*--with-csl* | *--with-both*)
L="$L ./csl ./csl/cslbase ./csl/cslbase-nothrow ./libraries/SoftFloat-3a/source"
# On Apple m1 (ie arm64) I will want to build a universal version of the
# libffi library and that is done in a way that differs from standrad builds.
case "`uname -s` `uname -m`" in
*Darwin*arm64*)
L="$L ./libraries/libffi-for-mac/libffi-3.3-arm64"
L="$L ./libraries/libffi-for-mac/libffi-3.3-x86_64"
L="$L ./libraries/libffi"
;;
*)
L="$L ./libraries/libffi"
;;
esac
case $a in
*--without-fox* | *with-fox=no* | \
*--without-gui* | *with-gui=no*)
;;
*)
L="$L ./csl/fox"
;;
esac
;;
*)
;;
esac
for d in $L
do
if test -d $d
then
printf "+++ $d\n"
cd $d
mkdir -p m4
rm -rf ltmain.sh config.cache autom4te.cache m4/libtool.m4 \
m4/lt-obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4
if test "$fast" = "yes"
then
( printf "$d: $LIBTOOLIZE/aclocal/autoreconf -i -v\n" && \
$LIBTOOLIZE --copy && \
aclocal && \
autoreconf -f -i -v ) &
procids="$procids $!"
else
printf "$d: $LIBTOOLIZE --force --copy; aclocal --force\n"
$LIBTOOLIZE --force --copy
printf "$d: aclocal/autoreconf -f -i -v\n"
aclocal --force
autoreconf -f -i -v
fi
cd $here
fi
done
if test "$fast" = "yes"
then
wait $procids
fi
scripts/resetall.sh
cd $save
printf "\nAll autoconf files now up to date\n"
exit 0
# end of autogen.sh