Sun, 11 Feb 2024 22:24:50 +0100
minimal working menubar (GTK)
156 | 1 | #!/bin/sh |
2 | ||
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
3 | #foreach( $var in $vars ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
4 | #if( $var.exec ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
5 | ${var.name}=`${var.value}` |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
6 | #else |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
7 | ${var.name}=${var.value} |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
8 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
9 | #end |
156 | 10 | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
11 | #if ( ! $project.hasVar("PREFIX") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
12 | PREFIX=/usr |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
13 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
14 | #if ( ! $project.hasVar("EPREFIX") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
15 | EPREFIX=$PREFIX |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
16 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
17 | |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
18 | #if ( ! $project.hasVar("BINDIR") ) |
156 | 19 | BINDIR= |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
20 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
21 | #if ( ! $project.hasVar("SBINDIR") ) |
156 | 22 | SBINDIR= |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
23 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
24 | #if ( ! $project.hasVar("LIBDIR") ) |
156 | 25 | LIBDIR= |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
26 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
27 | #if ( ! $project.hasVar("LIBEXECDIR") ) |
156 | 28 | LIBEXECDIR= |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
29 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
30 | #if ( ! $project.hasVar("DATADIR") ) |
156 | 31 | DATADIR= |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
32 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
33 | #if ( ! $project.hasVar("SYSCONFDIR") ) |
156 | 34 | SYSCONFDIR= |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
35 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
36 | #if ( ! $project.hasVar("SHAREDSTATEDIR") ) |
156 | 37 | SHAREDSTATEDIR= |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
38 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
39 | #if ( ! $project.hasVar("LOCALSTATEDIR") ) |
156 | 40 | LOCALSTATEDIR= |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
41 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
42 | #if ( ! $project.hasVar("INCLUDEDIR") ) |
156 | 43 | INCLUDEDIR= |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
44 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
45 | #if ( ! $project.hasVar("INFODIR") ) |
156 | 46 | INFODIR= |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
47 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
48 | #if ( ! $project.hasVar("MANDIR") ) |
156 | 49 | MANDIR= |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
50 | #end |
156 | 51 | |
52 | OS=`uname -s` | |
53 | OS_VERSION=`uname -r` | |
54 | ||
55 | TEMP_DIR=".tmp-`uname -n`" | |
56 | mkdir -p $TEMP_DIR | |
57 | if [ $? -ne 0 ]; then | |
58 | echo "Cannot create tmp dir" | |
59 | echo "Abort" | |
60 | fi | |
61 | touch $TEMP_DIR/options | |
62 | touch $TEMP_DIR/features | |
63 | ||
64 | # features | |
65 | #foreach( $feature in $features ) | |
66 | #if( ${feature.isDefault()} ) | |
67 | ${feature.getVarName()}=on | |
68 | #end | |
69 | #end | |
70 | ||
71 | # help text | |
72 | printhelp() | |
73 | { | |
74 | echo "Usage: $0 [OPTIONS]..." | |
75 | cat << __EOF__ | |
76 | Installation directories: | |
77 | --prefix=PREFIX path prefix for architecture-independent files | |
78 | [/usr] | |
79 | --exec-prefix=EPREFIX path prefix for architecture-dependent files | |
80 | [PREFIX] | |
81 | ||
82 | --bindir=DIR user executables [EPREFIX/bin] | |
83 | --sbindir=DIR system admin executables [EPREFIX/sbin] | |
84 | --libexecdir=DIR program executables [EPREFIX/libexec] | |
85 | --sysconfdir=DIR system configuration files [PREFIX/etc] | |
86 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] | |
87 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] | |
88 | --libdir=DIR object code libraries [EPREFIX/lib] | |
89 | --includedir=DIR C header files [PREFIX/include] | |
90 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] | |
91 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] | |
92 | --infodir=DIR info documentation [DATAROOTDIR/info] | |
93 | --mandir=DIR man documentation [DATAROOTDIR/man] | |
94 | ||
95 | #if( $options.size() > 0 ) | |
96 | Options: | |
97 | #foreach( $opt in $options ) | |
98 | --${opt.getArgument()}=${opt.getValuesString()} | |
99 | #end | |
100 | ||
101 | #end | |
102 | #if( $features.size() > 0 ) | |
103 | Optional Features: | |
104 | #foreach( $feature in $features ) | |
105 | #if( $feature.default ) | |
106 | --disable-${feature.arg} | |
107 | #else | |
108 | --enable-${feature.arg} | |
109 | #end | |
110 | #end | |
111 | ||
112 | #end | |
113 | __EOF__ | |
114 | } | |
115 | ||
116 | # | |
117 | # parse arguments | |
118 | # | |
119 | #set( $D = '$' ) | |
120 | for ARG in $@ | |
121 | do | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
122 | case "$ARG" in |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
123 | "--prefix="*) PREFIX=${D}{ARG#--prefix=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
124 | "--exec-prefix="*) EPREFIX=${D}{ARG#--exec-prefix=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
125 | "--bindir="*) BINDIR=${D}{ARG#----bindir=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
126 | "--sbindir="*) SBINDIR=${D}{ARG#--sbindir=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
127 | "--libdir="*) LIBDIR=${D}{ARG#--libdir=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
128 | "--libexecdir="*) LIBEXECDIR=${D}{ARG#--libexecdir=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
129 | "--datadir="*) DATADIR=${D}{ARG#--datadir=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
130 | "--sysconfdir="*) SYSCONFDIR=${D}{ARG#--sysconfdir=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
131 | "--sharedstatedir="*) SHAREDSTATEDIR=${D}{ARG#--sharedstatedir=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
132 | "--localstatedir="*) LOCALSTATEDIR=${D}{ARG#--localstatedir=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
133 | "--includedir="*) INCLUDEDIR=${D}{ARG#--includedir=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
134 | "--infodir="*) INFODIR=${D}{ARG#--infodir=} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
135 | "--mandir"*) MANDIR=${D}{ARG#--mandir} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
136 | "--help"*) printhelp; exit 1 ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
137 | #foreach( $opt in $options ) |
159
84a6e7a7b457
fix configure target options
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
158
diff
changeset
|
138 | "--${opt.getArgument()}="*) ${opt.getVarName()}=${D}{ARG#--${opt.getArgument()}=} ;; |
156 | 139 | #end |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
140 | #foreach( $feature in $features ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
141 | "--enable-${feature.arg}") ${feature.getVarName()}=on ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
142 | "--disable-${feature.arg}") unset ${feature.getVarName()} ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
143 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
144 | "-"*) echo "unknown option: $ARG"; exit 1 ;; |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
145 | esac |
156 | 146 | done |
147 | ||
148 | # set dir variables | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
149 | if [ -z "$BINDIR" ]; then |
156 | 150 | BINDIR=$EPREFIX/bin |
151 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
152 | if [ -z "$SBINDIR" ]; then |
156 | 153 | SBINDIR=$EPREFIX/sbin |
154 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
155 | if [ -z "$LIBDIR" ]; then |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
156 | LIBDIR=$EPREFIX/lib |
156 | 157 | fi |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
158 | if [ -z "$LIBEXEC" ]; then |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
159 | LIBEXECDIR=$EPREFIX/libexec |
156 | 160 | fi |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
161 | if [ -z "$DATADIR" ]; then |
156 | 162 | DATADIR=$PREFIX/share |
163 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
164 | if [ -z "$SYSCONFDIR" ]; then |
156 | 165 | SYSCONFDIR=$PREFIX/etc |
166 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
167 | if [ -z "$SHAREDSTATEDIR" ]; then |
156 | 168 | SHAREDSTATEDIR=$PREFIX/com |
169 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
170 | if [ -z "$LOCALSTATEDIR" ]; then |
156 | 171 | LOCALSTATEDIR=$PREFIX/var |
172 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
173 | if [ -z "$INCLUDEDIR" ]; then |
156 | 174 | INCLUDEDIR=$PREFIX/include |
175 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
176 | if [ -z "$INFODIR" ]; then |
156 | 177 | INFODIR=$PREFIX/info |
178 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
179 | if [ -z "$MANDIR" ]; then |
156 | 180 | MANDIR=$PREFIX/man |
181 | fi | |
182 | ||
183 | which pkg-config > /dev/null | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
184 | if [ $? -eq 0 ]; then |
156 | 185 | PKG_CONFIG=pkg-config |
186 | else | |
187 | PKG_CONFIG=false | |
188 | fi | |
189 | ||
190 | # Simple uname based platform detection | |
191 | # $PLATFORM is used for platform dependent dependency selection | |
192 | printf "detect platform... " | |
193 | if [ $OS = SunOS ]; then | |
194 | PLATFORM="solaris sunos unix svr4" | |
195 | fi | |
196 | if [ $OS = Linux ]; then | |
197 | PLATFORM="linux unix" | |
198 | fi | |
199 | if [ $OS = FreeBSD ]; then | |
200 | PLATFORM="freebsd bsd unix" | |
201 | fi | |
202 | if [ $OS = Darwin ]; then | |
203 | PLATFORM="macos osx bsd unix" | |
204 | fi | |
205 | echo $OS | grep "MINGW" > /dev/null | |
206 | if [ $? -eq 0 ]; then | |
207 | PLATFORM="windows mingw" | |
208 | fi | |
209 | ||
210 | if [ -z "$PLATFORM" ]; then | |
211 | PLATFORM="unix" | |
212 | fi | |
213 | ||
214 | for p in $PLATFORM | |
215 | do | |
216 | PLATFORM_NAME=$p | |
217 | break | |
218 | done | |
219 | echo $PLATFORM_NAME | |
220 | ||
221 | isplatform() | |
222 | { | |
223 | for p in $PLATFORM | |
224 | do | |
225 | if [ $p = $1 ]; then | |
226 | return 0 | |
227 | fi | |
228 | done | |
229 | return 1 | |
230 | } | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
231 | isnotplatform() |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
232 | { |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
233 | for p in $PLATFORM |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
234 | do |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
235 | if [ $p = $1 ]; then |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
236 | return 1 |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
237 | fi |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
238 | done |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
239 | return 0 |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
240 | } |
156 | 241 | |
242 | # generate config.mk and config.h | |
243 | cat > $TEMP_DIR/config.mk << __EOF__ | |
244 | # | |
245 | # config.mk generated by configure | |
246 | # | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
247 | |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
248 | # general vars |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
249 | #foreach( $var in $vars ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
250 | ${var.name}=$${var.name} |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
251 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
252 | |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
253 | #if ( ! $project.hasVar("PREFIX") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
254 | PREFIX=$PREFIX |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
255 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
256 | #if ( ! $project.hasVar("EPREFIX") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
257 | EPREFIX=$EPREFIX |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
258 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
259 | |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
260 | #if ( ! $project.hasVar("BINDIR") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
261 | BINDIR=$BINDIR |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
262 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
263 | #if ( ! $project.hasVar("SBINDIR") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
264 | SBINDIR=$SBINDIR |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
265 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
266 | #if ( ! $project.hasVar("LIBDIR") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
267 | LIBDIR=$LIBDIR |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
268 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
269 | #if ( ! $project.hasVar("LIBEXECDIR") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
270 | LIBEXECDIR=$LIBEXECDIR |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
271 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
272 | #if ( ! $project.hasVar("DATADIR") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
273 | DATADIR=$DATADIR |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
274 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
275 | #if ( ! $project.hasVar("SYSCONFDIR") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
276 | SYSCONFDIR=$SYSCONFDIR |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
277 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
278 | #if ( ! $project.hasVar("SHAREDSTATEDIR") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
279 | SHAREDSTATEDIR=$SHAREDSTATEDIR |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
280 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
281 | #if ( ! $project.hasVar("LOCALSTATEDIR") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
282 | LOCALSTATEDIR=$LOCALSTATEDIR |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
283 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
284 | #if ( ! $project.hasVar("INCLUDEDIR") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
285 | INCLUDEDIR=$INCLUDEDIR |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
286 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
287 | #if ( ! $project.hasVar("INFODIR") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
288 | INFODIR=$INFODIR |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
289 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
290 | #if ( ! $project.hasVar("MANDIR") ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
291 | MANDIR=$MANDIR |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
292 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
293 | |
156 | 294 | __EOF__ |
295 | ||
296 | echo > $TEMP_DIR/make.mk | |
297 | ||
298 | ENV_CFLAGS=$CFLAGS | |
299 | ENV_LDFLAGS=$LDFLAGS | |
300 | ENV_CXXFLAGS=$CXXFLAGS | |
301 | ||
302 | # Toolchain detection | |
303 | # this will insert make vars to config.mk | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
304 | . make/toolchain.sh |
156 | 305 | |
306 | # add user specified flags to config.mk | |
307 | echo >> $TEMP_DIR/config.mk | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
308 | if [ ! -z "${ENV_CFLAGS}" ]; then |
156 | 309 | echo "CFLAGS += $ENV_CFLAGS" >> $TEMP_DIR/config.mk |
310 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
311 | if [ ! -z "${ENV_CXXFLAGS}" ]; then |
156 | 312 | echo "CXXFLAGS += $ENV_CXXFLAGS" >> $TEMP_DIR/config.mk |
313 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
314 | if [ ! -z "${ENV_LDFLAGS}" ]; then |
156 | 315 | echo "LDFLAGS += $ENV_LDFLAGS" >> $TEMP_DIR/config.mk |
316 | fi | |
317 | ||
318 | # | |
319 | # DEPENDENCIES | |
320 | # | |
321 | ||
322 | #foreach( $dependency in $namedDependencies ) | |
323 | dependency_${dependency.name}() | |
324 | { | |
325 | printf "checking for ${dependency.name}... " | |
326 | #foreach( $sub in $dependency.getSubdependencies() ) | |
327 | # dependency $sub.name $sub.getPlatformString() | |
328 | while true | |
329 | do | |
330 | #if( $sub.platform ) | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
331 | if isnotplatform "${sub.platform}"; then |
156 | 332 | break |
333 | fi | |
334 | #end | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
335 | #foreach( $not in $sub.getNotList() ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
336 | if isplatform "${not}"; then |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
337 | break |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
338 | fi |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
339 | #end |
156 | 340 | #if( $sub.pkgconfig.size() > 0 ) |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
341 | if [ -z "$PKG_CONFIG" ]; then |
156 | 342 | break |
343 | fi | |
344 | #end | |
345 | #foreach( $pkg in $sub.pkgconfig ) | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
346 | $PKG_CONFIG $pkg.getPkgConfigParam() |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
347 | if [ $? -ne 0 ] ; then |
156 | 348 | break |
349 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
350 | CFLAGS="$CFLAGS `$PKG_CONFIG --cflags $pkg.getPkgConfigParam()`" |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
351 | LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs $pkg.getPkgConfigParam()`" |
156 | 352 | #end |
353 | #foreach( $flags in $sub.flags ) | |
354 | #if( $flags.exec ) | |
355 | $flags.value > /dev/null | |
356 | if [ $? -eq 0 ]; then | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
357 | $flags.varName="$$flags.varName `$flags.value`" |
156 | 358 | else |
359 | break | |
360 | fi | |
361 | #else | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
362 | $flags.varName="$$flags.varName $flags.value" |
156 | 363 | #end |
364 | #end | |
365 | #foreach( $test in $sub.tests ) | |
366 | $test > /dev/null | |
367 | if [ $? -ne 0 ]; then | |
368 | break | |
369 | fi | |
370 | #end | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
371 | #if ( $sub.make.length() > 0 ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
372 | cat >> $TEMP_DIR/make.mk << __EOF__ |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
373 | # Dependency: $dependency.name |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
374 | $sub.make |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
375 | __EOF__ |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
376 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
377 | echo yes |
156 | 378 | return 0 |
379 | done | |
380 | ||
381 | #end | |
382 | echo no | |
383 | return 1 | |
384 | } | |
385 | #end | |
386 | ||
387 | DEPENDENCIES_FAILED= | |
388 | ERROR=0 | |
389 | #if( $dependencies.size() > 0 ) | |
390 | # general dependencies | |
391 | CFLAGS= | |
392 | LDFLAGS= | |
393 | #foreach( $dependency in $dependencies ) | |
394 | while true | |
395 | do | |
396 | #if( $dependency.platform ) | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
397 | if isnotplatform "${dependency.platform}"; then |
156 | 398 | break |
399 | fi | |
400 | #end | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
401 | #foreach( $not in $dependency.getNotList() ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
402 | if isplatform "${not}"; then |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
403 | break |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
404 | fi |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
405 | #end |
156 | 406 | while true |
407 | do | |
408 | #if( $dependency.pkgconfig.size() > 0 ) | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
409 | if [ -z "$PKG_CONFIG" ]; then |
156 | 410 | ERROR=1 |
411 | break | |
412 | fi | |
413 | #end | |
414 | #foreach( $pkg in $dependency.pkgconfig ) | |
415 | printf "checking for pkg-config package $pkg.getPkgConfigParam()... " | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
416 | $PKG_CONFIG $pkg.getPkgConfigParam() |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
417 | if [ $? -ne 0 ]; then |
156 | 418 | echo no |
419 | ERROR=1 | |
420 | break | |
421 | fi | |
422 | echo yes | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
423 | CFLAGS="$CFLAGS `$PKG_CONFIG --cflags $pkg.getPkgConfigParam()`" |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
424 | LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs $pkg.getPkgConfigParam()`" |
156 | 425 | #end |
426 | ||
427 | #foreach( $flags in $dependency.flags ) | |
428 | #if( $flags.exec ) | |
429 | $flags.value > /dev/null | |
430 | if [ $? -ne 0 ]; then | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
431 | $flags.varName="$$flags.varName `$flags.value`" |
156 | 432 | else |
433 | ERROR=1 | |
434 | break | |
435 | fi | |
436 | #else | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
437 | $flags.varName="$$flags.varName $flags.value" |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
438 | #end |
156 | 439 | #end |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
440 | #if ( $dependency.make.length() > 0 ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
441 | cat >> $TEMP_DIR/make.mk << __EOF__ |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
442 | $dependency.make |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
443 | __EOF__ |
156 | 444 | #end |
445 | ||
446 | break | |
447 | done | |
448 | ||
449 | break | |
450 | done | |
451 | #end | |
452 | ||
453 | # add general dependency flags to config.mk | |
454 | echo >> $TEMP_DIR/config.mk | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
455 | if [ ! -z "${CFLAGS}" ]; then |
156 | 456 | echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk |
457 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
458 | if [ ! -z "${CXXFLAGS}" ]; then |
156 | 459 | echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk |
460 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
461 | if [ ! -z "${LDFLAGS}" ]; then |
156 | 462 | echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk |
463 | fi | |
464 | #end | |
465 | ||
466 | # | |
467 | # OPTION VALUES | |
468 | # | |
469 | #foreach( $opt in $options ) | |
470 | #foreach( $val in $opt.values ) | |
471 | ${val.func}() | |
472 | { | |
473 | VERR=0 | |
474 | #foreach( $dep in $val.dependencies ) | |
475 | dependency_$dep | |
476 | if [ $? -ne 0 ]; then | |
477 | VERR=1 | |
478 | fi | |
479 | #end | |
480 | if [ $VERR -ne 0 ]; then | |
481 | return 1 | |
482 | fi | |
483 | #foreach( $def in $val.defines ) | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
484 | CFLAGS="$CFLAGS ${def.toFlags()}" |
156 | 485 | #end |
486 | #if( $val.hasMake() ) | |
487 | cat >> $TEMP_DIR/make.mk << __EOF__ | |
488 | $val.make | |
489 | __EOF__ | |
490 | #end | |
491 | return 0 | |
492 | } | |
493 | #end | |
494 | #end | |
495 | ||
496 | # | |
497 | # TARGETS | |
498 | # | |
499 | CFLAGS= | |
500 | CXXFLAGS= | |
501 | LDFLAGS= | |
502 | ||
503 | #foreach( $target in $targets ) | |
504 | #if ( $target.name ) | |
505 | # Target: $target.name | |
506 | #else | |
507 | # Target | |
508 | #end | |
509 | CFLAGS= | |
510 | LDFLAGS= | |
511 | CXXFLAGS= | |
512 | ||
513 | #foreach( $dependency in $target.dependencies ) | |
514 | dependency_$dependency | |
515 | if [ $? -ne 0 ]; then | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
516 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
156 | 517 | ERROR=1 |
518 | fi | |
519 | #end | |
520 | ||
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
521 | # Features |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
522 | #foreach( $feature in $target.features ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
523 | if [ ! -z "$${feature.getVarName()}" ]; then |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
524 | #foreach( $dependency in $feature.dependencies ) |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
525 | # check dependency |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
526 | dependency_$dependency |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
527 | if [ $? -ne 0 ]; then |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
528 | # "auto" features can fail and are just disabled in this case |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
529 | if [ $${feature.getVarName()} != "auto" ]; then |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
530 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
531 | ERROR=1 |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
532 | fi |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
533 | fi |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
534 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
535 | fi |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
536 | #end |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
537 | |
156 | 538 | #foreach( $opt in $target.options ) |
539 | # Option: --${opt.argument} | |
540 | if [ -z ${D}${opt.getVarName()} ]; then | |
541 | SAVED_ERROR=$ERROR | |
542 | SAVED_DEPENDENCIES_FAILED=$DEPENDENCIES_FAILED | |
543 | ERROR=0 | |
544 | while true | |
545 | do | |
546 | #foreach( $optdef in $opt.defaults ) | |
547 | #if( $optdef.platform ) | |
548 | if isplatform "$optdef.platform"; then | |
549 | #end | |
550 | $optdef.func | |
551 | if [ $? -eq 0 ]; then | |
552 | echo " ${opt.argument}: ${optdef.valueName}" >> $TEMP_DIR/options | |
553 | ERROR=0 | |
554 | break | |
555 | fi | |
556 | #if( $optdef.platform ) | |
557 | fi | |
558 | #end | |
559 | #end | |
560 | break | |
561 | done | |
562 | if [ $ERROR -ne 0 ]; then | |
563 | SAVED_ERROR=1 | |
564 | fi | |
565 | ERROR=$SAVED_ERROR | |
566 | DEPENDENCIES_FAILED=$SAVED_DEPENDENCIES_FAILED= | |
567 | else | |
568 | if false; then | |
569 | false | |
570 | #foreach( $optval in $opt.values ) | |
571 | elif [ ${D}${opt.getVarName()} = "${optval.value}" ]; then | |
572 | echo " ${opt.argument}: ${D}${opt.getVarName()}" >> $TEMP_DIR/options | |
573 | $optval.func | |
574 | if [ $? -ne 0 ]; then | |
575 | ERROR=1 | |
576 | fi | |
577 | #end | |
578 | fi | |
579 | fi | |
580 | #end | |
581 | ||
582 | echo >> $TEMP_DIR/config.mk | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
583 | if [ ! -z "${CFLAGS}" ]; then |
156 | 584 | echo "${target.getCFlags()} += $CFLAGS" >> $TEMP_DIR/config.mk |
585 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
586 | if [ ! -z "${CXXFLAGS}" ]; then |
156 | 587 | echo "${target.getCXXFlags()} += $CXXFLAGS" >> $TEMP_DIR/config.mk |
588 | fi | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
589 | if [ ! -z "${LDFLAGS}" ]; then |
156 | 590 | echo "${target.getLDFlags()} += $LDFLAGS" >> $TEMP_DIR/config.mk |
591 | fi | |
592 | ||
593 | #end | |
594 | if [ $ERROR -ne 0 ]; then | |
595 | echo | |
596 | echo "Error: Unresolved dependencies" | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
597 | echo $DEPENDENCIES_FAILED |
156 | 598 | rm -Rf $TEMP_DIR |
599 | exit 1 | |
600 | fi | |
601 | ||
602 | echo "configure finished" | |
603 | echo | |
604 | echo "Build Config:" | |
605 | echo " PREFIX: $PREFIX" | |
606 | echo " TOOLCHAIN: $TOOLCHAIN_NAME" | |
607 | #if ( $options.size() > 0 ) | |
608 | echo "Options:" | |
609 | cat $TEMP_DIR/options | |
610 | #end | |
611 | echo | |
612 | cat $TEMP_DIR/config.mk $TEMP_DIR/make.mk > config.mk | |
613 | rm -Rf $TEMP_DIR | |
614 | ||
615 |