forked from debrouxl/hplp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
recompile_hplp.sh
executable file
·44 lines (35 loc) · 1.34 KB
/
recompile_hplp.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
#! /bin/sh
# Maintainer script for automating the compilation and installation of hplp
# from a checkout of the complete hplp repository over at Github.
# Simplified from the tilp / gfm script (recompile_tilp.sh).
#
# Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Lionel Debroux
# The prefix where the binaries will be installed, e.g. $HOME, /usr, /usr/local.
PREFIX="$HOME"
# Common flags and definitions.
CCFLAGS="-fstack-protector-all --param=ssp-buffer-size=1 -fsanitize=undefined,bounds" # This set of flags is intentionally small, the bulk is set by configure.ac.
CCPPFLAGS="-D_FORTIFY_SOURCE=2"
# Configure and build the given module
handle_one_module() {
module_name="$1"
shift # Kick the first argument, so as to be able to pass the rest to configure.
cd "$module_name"
echo "Configuring $module_name"
rm -f config.cache
./configure CPPFLAGS="$CCPPFLAGS" CFLAGS="$CCFLAGS $CFLAGS" CXXFLAGS="$CCFLAGS $CFLAGS" --prefix="$PREFIX" $@ || return 1
echo "Building $module_name"
make clean || return 1
make || return 1
echo "Installing $module_name"
make check || return 1
make install || return 1
cd -
}
if [ "x$NOAUTORECONF" = "x" -a "x$NO_AUTORECONF" = "x" ]; then
echo "=== AUTORECONF ==="
sh run_autoreconf.sh
fi
echo "=== UPDATEPOT ==="
sh run_updatepot.sh
echo "=== libhpcalcs ==="
handle_one_module libhpcalcs || exit 1