-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathfpc-wrapper.sh
More file actions
43 lines (30 loc) · 818 Bytes
/
fpc-wrapper.sh
File metadata and controls
43 lines (30 loc) · 818 Bytes
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
#!/usr/bin/env bash
# a wrapper for fpc to automatically add enough flags
set -e
if [[ `command -v fpc` == "" ]]
then
echo "Could not find fpc on your system."
exit 1
fi
HERE=$(readlink -f $(dirname $0))
PLATFORM="x86_32-linux";
if [[ `uname` == "Linux" ]] && [[ `uname -m` -eq "x86_64" ]];
then
PLATFORM="x86_64-linux"
fi
if [[ `uname` == "FreeBSD" ]] && [[ `uname -m` -eq "x86_64" ]];
then
PLATFORM="x86_64-freebsd"
fi
if [[ `uname` == "OpenBSD" ]] && [[ `uname -m` -eq "x86_64" ]];
then
PLATFORM="x86_64-openbsd"
fi
if [[ `uname` == "NetBSD" ]] && [[ `uname -m` -eq "x86_64" ]];
then
PLATFORM="x86_64-netbsd"
fi
echo "PLATFORM=" $PLATFORM
BASE_FLAGS="-MObjFPC -Scghi -Cg -l -B -vewnhibq"
INCLUDE_FLAGS="-Fl$HERE/libs/$PLATFORM -Fu$HERE/source -Fu$HERE/headers"
fpc $BASE_FLAGS $INCLUDE_FLAGS $*