-
-
Notifications
You must be signed in to change notification settings - Fork 99
/
bootstrap.sh
executable file
·59 lines (52 loc) · 2.1 KB
/
bootstrap.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
#!/usr/bin/env sh
set -e
incomplete_source () {
printf '%s\n' \
"$1. Please either:" \
"* $2," \
"* or use the source packages instead of a repo archive" \
"* or use a full Git clone." >&2
exit 1
}
# We need a local copy of the libtexpdf library to compile. If this was
# downloaded as a src distribution package this will exist already, but if not
# and we are part of a git repository that the user has not fully initialized,
# go ahead and do the step of fetching the submodule so the compile process can
# run.
if [ ! -f "libtexpdf/configure.ac" ]; then
if [ -e ".git" ]; then
git submodule update --init --recursive --remote
else
incomplete_source "No libtexpdf sources found" \
"download and extract a copy yourself"
fi
fi
# This enables easy building from Github's snapshot archives
if [ ! -e ".git" ]; then
if [ ! -f ".tarball-version" ]; then
incomplete_source "No version information found" \
"identify the correct version with \`echo \$version > .tarball-version\`"
fi
else
# Just a head start to save a ./configure cycle
./build-aux/git-version-gen .tarball-version > .version
fi
# Autoreconf uses a perl script to inline includes from Makefile.am into
# Makefile.in before ./configure is ever run even once ... which typically
# means AX_AUTOMAKE_MACROS forfeit access to substitutions or conditional logic
# because they enter the picture after those steps. We're intentionally using
# the expanded value of @INC_AMINCLUDE@ directly so the include will be
# inlined. To bootstrap, we must pre-seed an empty file to avoid a 'file not
# found' error on first run. Subsequently running ./configure will generate the
# content based on configure flags and also get re-inlined into Makefile.in.
touch aminclude.am
autoreconf --install
# See discussion in https://github.com/sile-typesetter/sile/issues/82 and
# https://web.archive.org/web/20170111053341/http://blog.gaku.net/autoconf/
case $(uname) in
Darwin*)
glibtoolize -W none
autoreconf --force -W none
;;
esac
build-aux/decore-automake.sh