-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·275 lines (248 loc) · 7.69 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
#!/bin/bash
# Run this to generate all the initial makefiles, etc.
DIE=0
CLEANONLY=0
NOCONFIGURE=0
UPDATEONLY=0
CONFIGURE_ARGS=()
for __BS_ARG__; do
case "${__BS_ARG__}" in
-h|--help)
echo "Usage: ${0##*/} [OPTION]"
echo
echo 'Options:'
echo
echo ' -h, --help Show this help message'
echo ' -z, --noconfigure Prepare the build system without launching the'
echo ' `configure` script'
echo ' -c, --clean Remove all the files generated by this script'
echo
echo 'If this script is invoked without the `--noconfigure` option all unrecognized'
echo 'arguments will be passed to `configure`.'
exit 0
;;
-z|--noconfigure)
NOCONFIGURE=1
;;
-c|--clean)
CLEANONLY=1
;;
*)
CONFIGURE_ARGS+=("${__BS_ARG__}")
;;
esac
done
srcdir=`dirname ${0}`
test -z "${srcdir}" && srcdir=.
if test "${CLEANONLY}" -ne 0; then
echo 'Cleaning package...'
test -f 'Makefile' && make maintainer-clean
rm -Rf autom4te.cache m4 build-aux no-dist `find . -type d -name .deps`
rm -f *'~' 'ABOUT-NLS' 'aclocal.m4' 'compile' 'config'.* 'configure' \
'depcomp' 'install-sh' 'intltool-*' 'libtool' 'ltmain.sh' \
'missing' `find . -name Makefile.in` 'po/boldquot.sed' \
'po/[email protected]' 'po/[email protected]' \
'po/insert-header.sin' 'po/'*'~' 'po/Makefile.in.in' \
'po/Makevars.template' 'po/quot.sed' 'po/remove-potcdate.sin' \
'po/Rules-quot' 'po/'*'.pot'
echo 'Done'
exit 0
fi
if test -n "${GNOME2_DIR}"; then
ACLOCAL_FLAGS="-I ${GNOME2_DIR}/share/aclocal ${ACLOCAL_FLAGS}"
LD_LIBRARY_PATH="${GNOME2_DIR}/lib:${LD_LIBRARY_PATH}"
PATH="${GNOME2_DIR}/bin:${PATH}"
export PATH
export LD_LIBRARY_PATH
fi
test -f "${srcdir}/configure.ac" || {
echo
echo "**Error**: Directory \`${srcdir}\` does not look like the top-level package directory"
echo
exit 1
} >&2
autoconf --version < /dev/null > /dev/null 2>&1 || {
echo
echo '**Error**: You must have `autoconf` installed. Download the appropriate package'
echo 'for your distribution, or get the source tarball at'
echo 'https://www.gnu.org/software/autoconf/'
echo
DIE=1
} >&2
if grep "^IT_PROG_INTLTOOL" "${srcdir}/configure.ac" >/dev/null; then
intltoolize --version < /dev/null > /dev/null 2>&1 || {
echo
echo '**Error**: You must have `intltool` installed. You can get it from'
echo 'https://freedesktop.org/wiki/Software/intltool/'
echo
DIE=1
} >&2
fi
if grep "^AM_PROG_XML_I18N_TOOLS" "${srcdir}/configure.ac" >/dev/null; then
xml-i18n-toolize --version < /dev/null > /dev/null 2>&1 || {
echo
echo '**Error**: You must have `xml-i18n-tools` installed. You can get it from'
echo 'https://download.gnome.org/sources/xml-i18n-tools/'
echo
DIE=1
} >&2
fi
if grep "^LT_INIT" "${srcdir}/configure.ac" >/dev/null; then
if [[ `test -z "${OSTYPE}" && uname -s || echo "${OSTYPE}"` =~ ^[Dd]arwin* ]]; then
if test -z "${LIBTOOL}"; then
echo 'macOS detected. Using glibtool.'
LIBTOOL='glibtool'
fi
if test -z "${LIBTOOLIZE}"; then
echo 'macOS detected. Using glibtoolize.'
LIBTOOLIZE='glibtoolize'
fi
else
if test -z "${LIBTOOL}"; then
LIBTOOL='libtool'
fi
if test -z "${LIBTOOLIZE}"; then
LIBTOOLIZE='libtoolize'
fi
fi
("${LIBTOOL}" --version) < /dev/null > /dev/null 2>&1 || {
echo
echo '**Error**: You must have `libtool` installed. You can get it from'
echo 'https://www.gnu.org/software/libtool/'
echo
DIE=1
} >&2
fi
if grep "^AM_GNU_GETTEXT" "${srcdir}/configure.ac" >/dev/null; then
grep "sed.*POTFILES" "${srcdir}/configure.ac" > /dev/null || \
gettextize --version < /dev/null > /dev/null 2>&1 || {
echo
echo '**Error**: You must have `gettext` installed. You can get it from'
echo 'https://www.gnu.org/software/gettext/'
echo
DIE=1
} >&2
fi
if grep "^AM_GLIB_GNU_GETTEXT" "${srcdir}/configure.ac" >/dev/null; then
grep "sed.*POTFILES" "${srcdir}/configure.ac" > /dev/null || \
glib-gettextize --version < /dev/null > /dev/null 2>&1 || {
echo
echo '**Error**: You must have `glib` installed. You can get it from'
echo 'https://gitlab.gnome.org/GNOME/glib'
echo
DIE=1
} >&2
fi
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo '**Error**: You must have `automake` installed. You can get it from'
echo 'https://www.gnu.org/software/automake/'
echo
DIE=1
NO_AUTOMAKE=yes
} >&2
# if no automake, don't bother testing for aclocal
test -n "${NO_AUTOMAKE}" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo '**Error**: Missing `aclocal`. The version of `automake` installed doesn'\''t appear'
echo 'recent enough. You can get automake from https://www.gnu.org/software/automake/'
echo
DIE=1
} >&2
if test "${DIE}" -ne 0; then
exit 1
fi
echo
if test "${NOCONFIGURE}" -eq 0; then
echo 'I am going to prepare the build system and then run the `configure` script. If'
echo 'you wish differently, please specify the `--noconfigure` argument on the'
echo "\`${0##*/}\` command line."
echo
if test -z "$*"; then
echo '**Warning**: I am going to run `configure` with no arguments. If you wish to'
echo "pass any, please specify them on the \`${0##*/}\` command line."
echo
fi
else
echo 'I am going to prepare the build system without running the `configure` script.'
echo
if test ${#CONFIGURE_ARGS[@]} -gt 0; then
echo '**Warning**: The following arguments will be ignored:'
for __IDX__ in ${!CONFIGURE_ARGS[@]}; do
echo " $((__IDX__ + 1)). \`${CONFIGURE_ARGS[$__IDX__]}\`"
done
echo
fi
fi
echo 'Preparing the build system... please wait'
case "${CC}" in
xlc )
am_opt=--include-deps
;;
esac
for coin in `find "${srcdir}" -path "${srcdir}/CVS" -prune -o -name configure.ac -print`; do
dr=`dirname "${coin}"`
if test -f "${dr}/NO-AUTO-GEN"; then
echo "skipping ${dr} -- flagged as no auto-gen"
else
echo "Processing '${dr}' ..."
( cd "${dr}"
aclocalinclude="${ACLOCAL_FLAGS}"
[[ -d 'm4' ]] || mkdir 'm4'
if grep "^AM_GNU_GETTEXT" configure.ac >/dev/null; then
echo 'Running autopoint...'
autopoint --force
fi
if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then
echo "Creating ${dr}/aclocal.m4..."
test -r "${dr}/aclocal.m4" || touch "${dr}/aclocal.m4"
echo 'Running glib-gettextize... Ignore non-fatal messages.'
echo 'no' | glib-gettextize --force --copy
echo "Making ${dr}/aclocal.m4 writable..."
test -r "${dr}/aclocal.m4" && chmod u+w "${dr}/aclocal.m4"
fi
if grep "^IT_PROG_INTLTOOL" configure.ac >/dev/null; then
echo 'Running intltoolize...'
intltoolize --copy --force --automake
fi
if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then
echo 'Running xml-i18n-toolize...'
xml-i18n-toolize --copy --force --automake
fi
if grep "^LT_INIT" configure.ac >/dev/null; then
if test -z "${NO_LIBTOOLIZE}" ; then
echo 'Running libtoolize...'
"${LIBTOOLIZE}" --force --copy
fi
fi
echo "Running aclocal ${aclocalinclude} ..."
aclocal ${aclocalinclude}
if grep "^A[CM]_CONFIG_HEADER" configure.ac >/dev/null; then
echo 'Running autoheader...'
autoheader
fi
echo "Running automake --gnu ${am_opt} ..."
automake --add-missing --copy --gnu ${am_opt}
echo 'Running autoconf...'
autoconf
)
fi
done
if test "${NOCONFIGURE}" -eq 0; then
echo -n "Running ${srcdir}/configure"
for __CF_ARG__ in "${CONFIGURE_ARGS[@]}"; do
echo -n " [${__CF_ARG__}]"
done
echo ' ...'
if "${srcdir}/configure" "${CONFIGURE_ARGS[@]}"; then
echo "Now type \`make\` to compile, or type \`${0} --clean\` to delete all the"
echo 'files generated by this script.'
else
exit 1
fi
else
echo 'Skipping the configure process. Type `configure --help` to list the configure'
echo "options, or type \`${0} --clean\` to delete all the files generated by"
echo 'this script.'
fi
# EOF