-
Notifications
You must be signed in to change notification settings - Fork 14
/
autotools.sh
162 lines (143 loc) · 4.88 KB
/
autotools.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
package: autotools
version: "%(tag_basename)s"
tag: v1.6.3
source: https://github.com/alisw/autotools
prefer_system: "(?!slc5|slc6)"
prefer_system_check: |
export PATH=$PATH:$(brew --prefix gettext || true)/bin;
which autoconf && which m4 && which automake && which makeinfo && which aclocal && which pkg-config && which autopoint && which libtool;
if [ $? -ne 0 ]; then printf "One or more autotools packages are missing on your system.\n * On a RHEL-compatible system you probably need: autoconf automake texinfo gettext gettext-devel libtool\n * On an Ubuntu-like system you probably need: autoconf automake autopoint texinfo gettext libtool libtool-bin pkg-config\n * On macOS you need: brew install autoconf automake gettext pkg-config"; exit 1; fi
prepend_path:
PKG_CONFIG_PATH: $(pkg-config --debug 2>&1 | grep 'Scanning directory' | sed -e "s/.*'\(.*\)'/\1/" | xargs echo | sed -e 's/ /:/g')
build_requires:
- termcap
- make
---
#!/bin/bash -e
unset CXXFLAGS
unset CFLAGS
export EMACS=no
case $ARCHITECTURE in
slc6*) USE_AUTORECONF=${USE_AUTORECONF:="false"} ;;
*) USE_AUTORECONF=${USE_AUTORECONF:="true"} ;;
esac
echo "Building ALICE autotools. To avoid this install autoconf, automake, autopoint, texinfo, pkg-config."
# Restore original timestamps to avoid reconf (Git does not preserve them)
pushd $SOURCEDIR
./missing-timestamps.sh --apply
popd
rsync -a --delete --exclude '**/.git' $SOURCEDIR/ .
# Use our auto* tools as we build them
export PATH=$INSTALLROOT/bin:$PATH
export LD_LIBRARY_PATH=$INSTALLROOT/lib:$LD_LIBRARY_PATH
# help2man
if [ -d help2man* ]; then
pushd help2man*
./configure --disable-dependency-tracking --prefix $INSTALLROOT
make ${JOBS+-j $JOBS}
make install
hash -r
popd
fi
# m4 -- requires: nothing special
pushd m4*
sed -i '1 i @documentencoding ISO-8859-1' doc/m4.texi
$USE_AUTORECONF && autoreconf -ivf
./configure --disable-dependency-tracking --prefix $INSTALLROOT
make ${JOBS+-j $JOBS}
make install
hash -r
popd
# autoconf -- requires: m4
# FIXME: is that really true? on slc7 it fails if I do it the other way around
# with the latest version of autoconf / m4
pushd autoconf*
$USE_AUTORECONF && autoreconf -ivf
./configure --prefix $INSTALLROOT
make MAKEINFO=true ${JOBS+-j $JOBS}
make MAKEINFO=true install
hash -r
popd
# libtool -- requires: m4
pushd libtool*
./configure --disable-dependency-tracking --prefix $INSTALLROOT --enable-ltdl-install
make ${JOBS+-j $JOBS}
make install
hash -r
popd
# Do not judge me. I am simply trying to float.
# Apparently slc6 needs a different order compared
# to the rest.
case $ARCHITECTURE in
slc6*|ubuntu14*)
# automake -- requires: m4, autoconf, gettext
pushd automake*
$USE_AUTORECONF && [ -e bootstrap ] && sh ./bootstrap
./configure --prefix $INSTALLROOT
make MAKEINFO=true ${JOBS+-j $JOBS}
make MAKEINFO=true install
hash -r
popd
;;
*) ;;
esac
# gettext -- requires: nothing special
pushd gettext*
$USE_AUTORECONF && autoreconf -ivf
./configure --prefix $INSTALLROOT \
--without-xz \
--without-bzip2 \
--disable-curses \
--disable-openmp \
--enable-relocatable \
--disable-rpath \
--disable-nls \
--disable-native-java \
--disable-acl \
--disable-java \
--disable-dependency-tracking \
--without-emacs \
--disable-silent-rules
make ${JOBS+-j $JOBS}
make install
hash -r
popd
# Do not judge me. I am simply trying to float.
case $ARCHITECTURE in
slc6*|ubuntu14*) ;;
*)
# automake -- requires: m4, autoconf, gettext
pushd automake*
$USE_AUTORECONF && [ -e bootstrap ] && sh ./bootstrap
./configure --prefix $INSTALLROOT
make MAKEINFO=true ${JOBS+-j $JOBS}
make MAKEINFO=true install
hash -r
popd
;;
esac
# pkgconfig -- requires: nothing special
pushd pkg-config*
OLD_LDFLAGS="$LDFLAGS"
[[ ${ARCHITECTURE:0:3} == osx ]] && export LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Carbon"
./configure --disable-debug \
--prefix=$INSTALLROOT \
--disable-host-tool \
--with-internal-glib
export LDFLAGS="$OLD_LDFLAGS"
make ${JOBS+-j $JOBS}
make install
hash -r
popd
# We need to detect OSX becase xargs behaves differently there
XARGS_DO_NOT_FAIL='-r'
[[ ${ARCHITECTURE:0:3} == osx ]] && XARGS_DO_NOT_FAIL=
# Fix perl location, required on /usr/bin/perl
grep -l -R -e '^#!.*perl' $INSTALLROOT | \
xargs ${XARGS_DO_NOT_FAIL} -n1 sed -ideleteme -e 's;^#!.*perl;#!/usr/bin/perl;'
find $INSTALLROOT -name '*deleteme' -delete
grep -l -R -e 'exec [^ ]*/perl' $INSTALLROOT | \
xargs ${XARGS_DO_NOT_FAIL} -n1 sed -ideleteme -e 's;exec [^ ]*/perl;exec /usr/bin/perl;g'
find $INSTALLROOT -name '*deleteme' -delete
# Pretend we have a modulefile to make the linter happy (don't delete)
#%Module