-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure-all.sh
executable file
·60 lines (49 loc) · 1.58 KB
/
configure-all.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
#!/bin/bash
set -e
ARGS=
if which port > /dev/null
then
ARGS+=" --with-libraries=/opt/local/lib --with-includes=/opt/local/include"
elif which brew > /dev/null
then
INCLUDES=
LIBS=
for pkg in openssl readline libxml2; do
prefix=$(brew --prefix $pkg)
if [ -n "$INCLUDES" ]; then INCLUDES+=:; fi
INCLUDES+="$prefix/include"
if [ -n "$LIBS" ]; then LIBS+=:; fi
LIBS+="$prefix/lib"
export PATH="$prefix/bin:$PATH"
done
ARGS+=" --with-tclconfig=/usr/local/opt/tcl-tk/lib"
ARGS+=" --with-includes=$INCLUDES"
ARGS+=" --with-libraries=$LIBS"
fi
ARGS+=" --with-tcl --with-libxml --with-openssl"
DEBUG_ARGS="--enable-depend --enable-cassert --enable-debug"
# Enable tap tests if IPC::Run is available
if [ -n "$(perldoc -lm IPC::Run)" ]
then
DEBUG_ARGS+=" --enable-tap-tests"
fi
CFLAGS="-O0 -g -fno-omit-frame-pointer"
# openSUSE and SUSE have tclConfig.sh in /usr/lib64 for x86_64 machines
if [ -f "/etc/SuSE-release" ] && [ "$(uname -m)" == 'x86_64' ]; then
ARGS+=" --with-tclconfig=/usr/lib64"
fi
if (which ccache && which clang ) > /dev/null
then
ARGS+=" CC='ccache clang -Qunused-arguments -fcolor-diagnostics'"
fi
for a in dev master $(ls -rd *REL*)
do
# if the directory doesn't exist skip it
[ -d $a ] || continue
# if an argument is provided install only that version
[ -n "$1" ] && [ "$1" != "$a" ] && [ "REL${1/./_}_STABLE" != "$a" ] && [ "REL_${1}_STABLE" != "$a" ] && continue
instdir="$HOME/.pgenv/versions/$a"
pushd $a
./configure --prefix="$instdir" ${DEBUG_ARGS} ${ARGS} CFLAGS="$CFLAGS"
popd
done