-
Notifications
You must be signed in to change notification settings - Fork 1
/
gprbuild-for-alire.sh
executable file
·56 lines (42 loc) · 1.72 KB
/
gprbuild-for-alire.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
# Build and install gprconfig & gprbuild (but not libgpr) for use in
# Alire, using an existing compiler on PATH.
script_loc=`cd $(dirname $0) && pwd -P`
. $script_loc/common.sh
# build next to gcc
GPRBUILD_PREFIX=$PREFIX/../gprbuild
# Install gprconfig first.
gprconfig_install_loc=$GPRBUILD_PREFIX/share/gprconfig
mkdir -p $gprconfig_install_loc
cp -p $GPRCONFIG_SRC/db/* $gprconfig_install_loc/
rm -rf *
# We're going to use our own xmlada.gpr (we can't use the one that
# xmlada would install with the compiler, because it's an aggregate;
# we only want a static build anyway).
GPR_PROJECT_PATH=$script_loc
# That xmlada.gpr needs $XMLADA_SRC, but it's only a local variable so
# far because common.sh is sourced.
export XMLADA_SRC
echo "*** cleaning ***"
make -w -f $GPRBUILD_SRC/Makefile \
TARGET=$BUILD \
ENABLE_SHARED=yes \
clean || true # otherwise, fail because there's no Fortran
echo "*** setting up ***"
make -w -f $GPRBUILD_SRC/Makefile \
GPR_PROJECT_PATH=$GPR_PROJECT_PATH \
TARGET=$BUILD \
ENABLE_SHARED=yes \
setup
echo "*** building ***"
make -w -j$CORES \
-f $GPRBUILD_SRC/Makefile \
GPR_PROJECT_PATH=$GPR_PROJECT_PATH \
all
echo "*** installing ***"
make -w \
-f $GPRBUILD_SRC/Makefile \
GPR_PROJECT_PATH=$GPR_PROJECT_PATH \
prefix=$GPRBUILD_PREFIX \
install
# Remove the highly-misleading script installed in the top-level directory.
rm -f $GPRBUILD_PREFIX/doinstall