forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autotools.sh
117 lines (104 loc) · 3.52 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
package: autotools
version: "%(tag_basename)s"
source: https://github.com/alisw/autotools
tag: v1.4.0
prefer_system: "(?!slc5|slc6)"
prefer_system_check: |
export PATH=$PATH:$(brew --prefix gettext || true)/bin
which autoconf || { echo "autoconf missing" && exit 1; }
which m4 || { echo "m4 missing" && exit 1; }
which automake || { echo "automake missing" && exit 1; }
which makeinfo || { echo "makeinfo missing" && exit 1; }
which aclocal || { echo "aclocal missing" && exit 1; }
which pkg-config || { echo "pkg-config missing" && exit 1; }
which autopoint || { echo "autopoint / automake missing" && exit 1; }
which libtool || { echo "libtool missing" && exit 1; }
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