-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-alglib.sh
executable file
·58 lines (48 loc) · 1.46 KB
/
build-alglib.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
#!/usr/bin/env bash
# vim: ts=4 sw=4 et
set -e
VER="$1"
ARCH="$2"
TOP="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
function usage {
echo "USAGE: $0 <version> <arch>"
echo "Ex:"
echo " $0 3.14.0 rhel9-x86_64"
exit 1
}
if [ -z "$VER" ]; then
usage
fi
if [ -z "$ARCH" ]; then
usage
fi
mkdir -p $EPICS_PACKAGE_TOP/alglib/$VER
cd $EPICS_PACKAGE_TOP/alglib/$VER
# Clone alglib-gnubld if not already
if [ ! -d alglib-gnubld ]; then
git clone [email protected]:slac-epics/alglib-gnubld.git --recursive
cd alglib-gnubld
autoreconf -i
cd ..
fi
# Grab tarball
if [ ! -f "alglib-$VER.cpp.gpl.tgz" ]; then
wget "https://www.alglib.net/translator/re/alglib-$VER.cpp.gpl.tgz"
tar -xf "alglib-$VER.cpp.gpl.tgz"
ln -s ./cpp/src ./src
fi
mkdir -p "build/$ARCH"
cd "build/$ARCH"
if [[ $ARCH = *"rtems"* ]]; then
echo "Building for RTEMS"
. $EPICS_PACKAGE_TOP/build-scripts/toolchains/$ARCH.bash
../../alglib-gnubld/configure --prefix="$PWD/../../$ARCH" --enable-rtemsbsp="${RTEMS_BSPS}" --exec-prefix="${EPICS_PACKAGE_TOP}/alglib/$VER/RTEMS-\${rtems_bsp}" --with-rtems-top="${RTEMS_TOP}"
elif [[ $ARCH = *"buildroot"* ]]; then
echo "Building for buildroot"
. $EPICS_PACKAGE_TOP/build-scripts/toolchains/$ARCH.bash
export PATH="${TOOLCHAIN_PATH}/bin:$PATH"
../../alglib-gnubld/configure --prefix="$PWD/../../$ARCH" --host $TARGET_SYSTEM
else
../../alglib-gnubld/configure --prefix="$PWD/../../$ARCH"
fi
make -j$(nproc) install