forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autotools.sh
111 lines (98 loc) · 3.59 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
package: autotools
version: "%(tag_basename)s"
tag: v1.4.0
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
---
#!/bin/bash -e
unset CXXFLAGS
unset CFLAGS
export EMACS=no
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 while we build them
export PATH=$INSTALLROOT/bin:$PATH
export LD_LIBRARY_PATH=$INSTALLROOT/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$INSTALLROOT/lib:$DYLD_LIBRARY_PATH
# m4 -- requires: nothing special
pushd m4*
./configure --disable-dependency-tracking --prefix $INSTALLROOT
make ${JOBS+-j $JOBS}
make 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
# autoconf -- requires: m4
pushd autoconf*
./configure --prefix $INSTALLROOT
make ${JOBS+-j $JOBS}
make install
hash -r
popd
# gettext -- requires: nothing special
pushd gettext*
./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 \
--disable-silent-rules
make ${JOBS+-j $JOBS}
make install
hash -r
popd
# automake -- requires: m4, autoconf, gettext
pushd automake*
./configure --disable-dependency-tracking --prefix $INSTALLROOT
make ${JOBS+-j $JOBS}
make install
hash -r
popd
# 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