-
Notifications
You must be signed in to change notification settings - Fork 9
/
compileit
executable file
·46 lines (36 loc) · 1.15 KB
/
compileit
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
#!/bin/sh -e
PROCESSOR_TYPE=`uname -m`
echo "$PROCESSOR_TYPE detected."
case "$PROCESSOR_TYPE" in
i686)
CXXFLAGS="-flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti"
LDFLAGS="-Wl,-O1"
;;
x86_64)
CXXFLAGS="-flto -fuse-linker-plugin -mtune=generic -Os -pipe -fno-exceptions -fno-rtti"
LDFLAGS="-Wl,-O1"
;;
armv*)
CXXFLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe -fno-exceptions -fno-rtti"
LDFLAGS="-Wl,-O1"
;;
*)
echo "$PROCESSOR_TYPE: Unknown processor type. CXXFLAGS and LDFLAGS may need to be adjusted."
;;
esac
if [ "$(fltk-config --ldflags | grep Xft)" ]; then
CPPFLAGS="-DHAVE_XFT"
fi
CXXFLAGS="$CXXFLAGS `fltk-config --cxxflags`"
CXXFLAGS="$CXXFLAGS -Wall -ffunction-sections -fdata-sections -Wno-strict-aliasing"
LDFLAGS="$LDFLAGS `fltk-config --ldflags --use-images`"
LDFLAGS="$LDFLAGS -Wl,-gc-sections"
echo -e "\nCXXFLAGS=$CXXFLAGS\n"
echo -e "LDFLAGS=$LDFLAGS\n"
echo -e "CPPFLAGS=$CPPFLAGS\n"
echo Building flwm...
g++ -o flwm *.C $CXXFLAGS $LDFLAGS $CPPFLAGS
sstrip flwm
echo Building flwm_topside...
g++ -o flwm_topside -DTOPSIDE *.C $CXXFLAGS $LDFLAGS $CPPFLAGS
sstrip flwm_topside