diff options
Diffstat (limited to '')
-rwxr-xr-x | build.sh | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -6,6 +6,10 @@ BUEXPSRC="regex.cpp" | |||
6 | BUEXPHDR="regex.h" | 6 | BUEXPHDR="regex.h" |
7 | BUCOMPAT="config.h compat/linux.h compat/win32.h compat/osx.h" | 7 | BUCOMPAT="config.h compat/linux.h compat/win32.h compat/osx.h" |
8 | 8 | ||
9 | if [ -z "${CXX}" ]; then | ||
10 | CXX="g++" | ||
11 | fi | ||
12 | |||
9 | function bld() | 13 | function bld() |
10 | { | 14 | { |
11 | OUTFILE="$1" | 15 | OUTFILE="$1" |
@@ -30,7 +34,7 @@ function cmd() | |||
30 | 34 | ||
31 | function gpp() | 35 | function gpp() |
32 | { | 36 | { |
33 | bld "$1" "$2" || cmd CXX "$1" g++ -ggdb -fPIC -W -Wall -Iminibu -c -o "$1" "$2" | 37 | bld "$1" "$2" || cmd CXX "$1" ${CXX} -ggdb -fPIC -W -Wall -Iminibu -c -o "$1" "$2" |
34 | } | 38 | } |
35 | 39 | ||
36 | function presetup() | 40 | function presetup() |
@@ -74,9 +78,16 @@ if [ ! -z "$1" ]; then | |||
74 | presetup | 78 | presetup |
75 | exit | 79 | exit |
76 | else | 80 | else |
77 | echo "The only option supported is \"clean\", otherwise run $0" | 81 | echo "Without parameters build.sh will download extra components and" |
78 | echo "with no parameters to compile build." | 82 | echo "compile build." |
79 | echo | 83 | echo |
84 | echo "Parameters:" | ||
85 | echo " clean | -c Delete all opbject code and downloaded source." | ||
86 | echo " setup | -s Download and perform initial setup, but do not" | ||
87 | echo " compile." | ||
88 | echo | ||
89 | echo "Using ${CXX} to complie code." | ||
90 | echo | ||
80 | exit | 91 | exit |
81 | fi | 92 | fi |
82 | fi | 93 | fi |
@@ -92,5 +103,5 @@ for F in src/*.c src/*.cpp; do | |||
92 | OUTPUT=${F%.*}.o | 103 | OUTPUT=${F%.*}.o |
93 | gpp "$OUTPUT" "$F" | 104 | gpp "$OUTPUT" "$F" |
94 | done | 105 | done |
95 | bld build src/*.o minibu/src/*.o || cmd LINK build g++ -fPIC -rdynamic -Wl,-export-dynamic -o build src/*.o minibu/src/*.o -ldl | 106 | bld build src/*.o minibu/src/*.o || cmd LINK build ${CXX} -fPIC -rdynamic -Wl,-export-dynamic -o build src/*.o minibu/src/*.o -ldl |
96 | bld build~ build || cmd CP build~ cp build build~ | 107 | bld build~ build || cmd CP build~ cp build build~ |