1 #!/bin/sh |
1 #!/bin/sh |
|
2 |
|
3 #set( $D = '$' ) |
|
4 #[[ |
|
5 # some utility functions |
|
6 isplatform() |
|
7 { |
|
8 for p in $PLATFORM |
|
9 do |
|
10 if [ "$p" = "$1" ]; then |
|
11 return 0 |
|
12 fi |
|
13 done |
|
14 return 1 |
|
15 } |
|
16 notisplatform() |
|
17 { |
|
18 for p in $PLATFORM |
|
19 do |
|
20 if [ "$p" = "$1" ]; then |
|
21 return 1 |
|
22 fi |
|
23 done |
|
24 return 0 |
|
25 } |
|
26 istoolchain() |
|
27 { |
|
28 for t in $TOOLCHAIN |
|
29 do |
|
30 if [ "$t" = "$1" ]; then |
|
31 return 0 |
|
32 fi |
|
33 done |
|
34 return 1 |
|
35 } |
|
36 notistoolchain() |
|
37 { |
|
38 for t in $TOOLCHAIN |
|
39 do |
|
40 if [ "$t" = "$1" ]; then |
|
41 return 1 |
|
42 fi |
|
43 done |
|
44 return 0 |
|
45 } |
|
46 |
|
47 # clean abort |
|
48 abort_configure() |
|
49 { |
|
50 rm -Rf "$TEMP_DIR" |
|
51 exit 1 |
|
52 } |
|
53 |
|
54 # Test for availability of pkg-config |
|
55 PKG_CONFIG=`command -v pkg-config` |
|
56 : ${PKG_CONFIG:="false"} |
|
57 |
|
58 # Simple uname based platform detection |
|
59 # $PLATFORM is used for platform dependent dependency selection |
|
60 OS=`uname -s` |
|
61 OS_VERSION=`uname -r` |
|
62 printf "detect platform... " |
|
63 if [ "$OS" = "SunOS" ]; then |
|
64 PLATFORM="solaris sunos unix svr4" |
|
65 elif [ "$OS" = "Linux" ]; then |
|
66 PLATFORM="linux unix" |
|
67 elif [ "$OS" = "FreeBSD" ]; then |
|
68 PLATFORM="freebsd bsd unix" |
|
69 elif [ "$OS" = "OpenBSD" ]; then |
|
70 PLATFORM="openbsd bsd unix" |
|
71 elif [ "$OS" = "NetBSD" ]; then |
|
72 PLATFORM="netbsd bsd unix" |
|
73 elif [ "$OS" = "Darwin" ]; then |
|
74 PLATFORM="macos osx bsd unix" |
|
75 elif echo "$OS" | grep -i "MINGW" > /dev/null; then |
|
76 PLATFORM="windows mingw" |
|
77 fi |
|
78 : ${PLATFORM:="unix"} |
|
79 |
|
80 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` |
|
81 echo "$PLATFORM_NAME" |
|
82 ]]# |
|
83 |
|
84 # help text |
|
85 printhelp() |
|
86 { |
|
87 echo "Usage: $0 [OPTIONS]..." |
|
88 cat << __EOF__ |
|
89 Installation directories: |
|
90 --prefix=PREFIX path prefix for architecture-independent files |
|
91 [${D}prefix] |
|
92 --exec-prefix=EPREFIX path prefix for architecture-dependent files |
|
93 [PREFIX] |
|
94 |
|
95 --bindir=DIR user executables [EPREFIX/bin] |
|
96 --sbindir=DIR system admin executables [EPREFIX/sbin] |
|
97 --libexecdir=DIR program executables [EPREFIX/libexec] |
|
98 --sysconfdir=DIR system configuration files [PREFIX/etc] |
|
99 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
|
100 --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
|
101 --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] |
|
102 --libdir=DIR object code libraries [EPREFIX/lib] |
|
103 --includedir=DIR C header files [PREFIX/include] |
|
104 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
|
105 --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
|
106 --infodir=DIR info documentation [DATAROOTDIR/info] |
|
107 --mandir=DIR man documentation [DATAROOTDIR/man] |
|
108 --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
|
109 |
|
110 Build Types: |
|
111 --debug add extra compile flags for debug builds |
|
112 --release add extra compile flags for release builds |
|
113 #if( $options.size() > 0 ) |
|
114 |
|
115 Options: |
|
116 #foreach( $opt in $options ) |
|
117 --${opt.argument}=${opt.valuesString} |
|
118 #end |
|
119 #end |
|
120 #if( $features.size() > 0 ) |
|
121 |
|
122 Optional Features: |
|
123 #foreach( $feature in $features ) |
|
124 ${feature.helpText} |
|
125 #end |
|
126 #end |
|
127 |
|
128 __EOF__ |
|
129 } |
2 |
130 |
3 # create temporary directory |
131 # create temporary directory |
4 TEMP_DIR=".tmp-`uname -n`" |
132 TEMP_DIR=".tmp-`uname -n`" |
5 rm -Rf "$TEMP_DIR" |
133 rm -Rf "$TEMP_DIR" |
6 if mkdir -p "$TEMP_DIR"; then |
134 if mkdir -p "$TEMP_DIR"; then |
31 infodir= |
159 infodir= |
32 localedir= |
160 localedir= |
33 mandir= |
161 mandir= |
34 |
162 |
35 # custom variables |
163 # custom variables |
36 #foreach( $var in $vars ) |
164 #foreach( $cfg in $config ) |
37 #if( $var.exec ) |
165 if true \ |
38 ${var.varName}=`${var.value}` |
166 #if( $cfg.platform ) |
39 #else |
167 && isplatform "${cfg.platform}" \ |
40 ${var.varName}="${var.value}" |
168 #end |
41 #end |
169 #foreach( $np in $cfg.notList ) |
|
170 && notisplatform "${np}" \ |
|
171 #end |
|
172 ; then |
|
173 #foreach( $var in $cfg.vars ) |
|
174 #if( $var.exec ) |
|
175 ${var.varName}=`${var.value}` |
|
176 #else |
|
177 ${var.varName}="${var.value}" |
|
178 #end |
|
179 #end |
|
180 fi |
42 #end |
181 #end |
43 |
182 |
44 # features |
183 # features |
45 #foreach( $feature in $features ) |
184 #foreach( $feature in $features ) |
46 #if( ${feature.auto} ) |
185 #if( ${feature.auto} ) |
47 ${feature.varName}=auto |
186 ${feature.varName}=auto |
48 #end |
187 #end |
49 #end |
188 #end |
50 |
189 |
51 # clean abort |
|
52 abort_configure() |
|
53 { |
|
54 rm -Rf "$TEMP_DIR" |
|
55 exit 1 |
|
56 } |
|
57 |
|
58 # help text |
|
59 printhelp() |
|
60 { |
|
61 echo "Usage: $0 [OPTIONS]..." |
|
62 cat << __EOF__ |
|
63 Installation directories: |
|
64 --prefix=PREFIX path prefix for architecture-independent files |
|
65 [/usr] |
|
66 --exec-prefix=EPREFIX path prefix for architecture-dependent files |
|
67 [PREFIX] |
|
68 |
|
69 --bindir=DIR user executables [EPREFIX/bin] |
|
70 --sbindir=DIR system admin executables [EPREFIX/sbin] |
|
71 --libexecdir=DIR program executables [EPREFIX/libexec] |
|
72 --sysconfdir=DIR system configuration files [PREFIX/etc] |
|
73 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
|
74 --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
|
75 --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] |
|
76 --libdir=DIR object code libraries [EPREFIX/lib] |
|
77 --includedir=DIR C header files [PREFIX/include] |
|
78 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
|
79 --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
|
80 --infodir=DIR info documentation [DATAROOTDIR/info] |
|
81 --mandir=DIR man documentation [DATAROOTDIR/man] |
|
82 --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
|
83 |
|
84 #if( $options.size() > 0 ) |
|
85 Options: |
|
86 --debug add extra compile flags for debug builds |
|
87 --release add extra compile flags for release builds |
|
88 #foreach( $opt in $options ) |
|
89 --${opt.argument}=${opt.valuesString} |
|
90 #end |
|
91 |
|
92 #end |
|
93 #if( $features.size() > 0 ) |
|
94 Optional Features: |
|
95 #foreach( $feature in $features ) |
|
96 #if( $feature.auto ) |
|
97 --disable-${feature.arg} |
|
98 #else |
|
99 --enable-${feature.arg} |
|
100 #end |
|
101 #end |
|
102 |
|
103 #end |
|
104 __EOF__ |
|
105 } |
|
106 |
|
107 # |
190 # |
108 # parse arguments |
191 # parse arguments |
109 # |
192 # |
110 BUILD_TYPE="default" |
193 BUILD_TYPE="default" |
111 #set( $D = '$' ) |
|
112 for ARG in "$@" |
194 for ARG in "$@" |
113 do |
195 do |
114 case "$ARG" in |
196 case "$ARG" in |
115 "--prefix="*) prefix=${D}{ARG#--prefix=} ;; |
197 "--prefix="*) prefix=${D}{ARG#--prefix=} ;; |
116 "--exec-prefix="*) exec_prefix=${D}{ARG#--exec-prefix=} ;; |
198 "--exec-prefix="*) exec_prefix=${D}{ARG#--exec-prefix=} ;; |
125 "--localstatedir="*) localstatedir=${D}{ARG#--localstatedir=} ;; |
207 "--localstatedir="*) localstatedir=${D}{ARG#--localstatedir=} ;; |
126 "--includedir="*) includedir=${D}{ARG#--includedir=} ;; |
208 "--includedir="*) includedir=${D}{ARG#--includedir=} ;; |
127 "--infodir="*) infodir=${D}{ARG#--infodir=} ;; |
209 "--infodir="*) infodir=${D}{ARG#--infodir=} ;; |
128 "--mandir"*) mandir=${D}{ARG#--mandir} ;; |
210 "--mandir"*) mandir=${D}{ARG#--mandir} ;; |
129 "--localedir"*) localedir=${D}{ARG#--localedir} ;; |
211 "--localedir"*) localedir=${D}{ARG#--localedir} ;; |
130 "--help"*) printhelp; abort_configure ;; |
212 "--help"*) printhelp; abort_configure ;; |
131 "--debug") BUILD_TYPE="debug" ;; |
213 "--debug") BUILD_TYPE="debug" ;; |
132 "--release") BUILD_TYPE="release" ;; |
214 "--release") BUILD_TYPE="release" ;; |
133 #foreach( $opt in $options ) |
215 #foreach( $opt in $options ) |
134 "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;; |
216 "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;; |
|
217 "--${opt.argument}") echo "option '$ARG' needs a value:"; echo " $ARG=${opt.valuesString}"; abort_configure ;; |
135 #end |
218 #end |
136 #foreach( $feature in $features ) |
219 #foreach( $feature in $features ) |
137 "--enable-${feature.arg}") ${feature.varName}=on ;; |
220 "--enable-${feature.arg}") ${feature.varName}=on ;; |
138 "--disable-${feature.arg}") unset ${feature.varName} ;; |
221 "--disable-${feature.arg}") unset ${feature.varName} ;; |
139 #end |
222 #end |
176 elif [ -f "$prefix/etc/config.site" ]; then |
259 elif [ -f "$prefix/etc/config.site" ]; then |
177 printf "loading site defaults... " |
260 printf "loading site defaults... " |
178 . "$prefix/etc/config.site" |
261 . "$prefix/etc/config.site" |
179 echo ok |
262 echo ok |
180 fi |
263 fi |
181 |
|
182 # Test for availability of pkg-config |
|
183 PKG_CONFIG=`command -v pkg-config` |
|
184 : ${PKG_CONFIG:="false"} |
|
185 |
|
186 # Simple uname based platform detection |
|
187 # $PLATFORM is used for platform dependent dependency selection |
|
188 OS=`uname -s` |
|
189 OS_VERSION=`uname -r` |
|
190 printf "detect platform... " |
|
191 if [ "$OS" = "SunOS" ]; then |
|
192 PLATFORM="solaris sunos unix svr4" |
|
193 fi |
|
194 if [ "$OS" = "Linux" ]; then |
|
195 PLATFORM="linux unix" |
|
196 fi |
|
197 if [ "$OS" = "FreeBSD" ]; then |
|
198 PLATFORM="freebsd bsd unix" |
|
199 fi |
|
200 if [ "$OS" = "Darwin" ]; then |
|
201 PLATFORM="macos osx bsd unix" |
|
202 fi |
|
203 if echo "$OS" | grep -i "MINGW" > /dev/null; then |
|
204 PLATFORM="windows mingw" |
|
205 fi |
|
206 : ${PLATFORM:="unix"} |
|
207 |
|
208 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` |
|
209 echo "$PLATFORM_NAME" |
|
210 |
|
211 isplatform() |
|
212 { |
|
213 for p in $PLATFORM |
|
214 do |
|
215 if [ "$p" = "$1" ]; then |
|
216 return 0 |
|
217 fi |
|
218 done |
|
219 return 1 |
|
220 } |
|
221 notisplatform() |
|
222 { |
|
223 for p in $PLATFORM |
|
224 do |
|
225 if [ "$p" = "$1" ]; then |
|
226 return 1 |
|
227 fi |
|
228 done |
|
229 return 0 |
|
230 } |
|
231 ]]# |
264 ]]# |
232 ## End of unparsed content ** |
265 ## End of unparsed content ** |
233 |
266 |
234 # generate vars.mk |
267 # generate vars.mk |
235 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
268 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
236 prefix="$prefix" |
269 prefix=$prefix |
237 exec_prefix="$exec_prefix" |
270 exec_prefix=$exec_prefix |
238 bindir="$bindir" |
271 bindir=$bindir |
239 sbindir="$sbindir" |
272 sbindir=$sbindir |
240 libdir="$libdir" |
273 libdir=$libdir |
241 libexecdir="$libexecdir" |
274 libexecdir=$libexecdir |
242 datarootdir="$datarootdir" |
275 datarootdir=$datarootdir |
243 datadir="$datadir" |
276 datadir=$datadir |
244 sysconfdir="$sysconfdir" |
277 sysconfdir=$sysconfdir |
245 sharedstatedir="$sharedstatedir" |
278 sharedstatedir=$sharedstatedir |
246 localstatedir="$localstatedir" |
279 localstatedir=$localstatedir |
247 runstatedir="$runstatedir" |
280 runstatedir=$runstatedir |
248 includedir="$includedir" |
281 includedir=$includedir |
249 infodir="$infodir" |
282 infodir=$infodir |
250 mandir="$mandir" |
283 mandir=$mandir |
251 localedir="$localedir" |
284 localedir=$localedir |
252 #foreach( $var in $vars ) |
285 #foreach( $var in $vars ) |
253 ${var.varName}="${D}${var.varName}" |
286 ${var.varName}=${D}${var.varName} |
254 #end |
287 #end |
255 __EOF__ |
288 __EOF__ |
256 |
289 |
257 # toolchain detection utilities |
290 # toolchain detection utilities |
258 . make/toolchain.sh |
291 . make/toolchain.sh |
284 if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : |
317 if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : |
285 else return 1 ; fi |
318 else return 1 ; fi |
286 return 0 |
319 return 0 |
287 } |
320 } |
288 |
321 |
|
322 print_check_msg() |
|
323 { |
|
324 if [ -z "$1" ]; then |
|
325 shift |
|
326 printf "$@" |
|
327 fi |
|
328 } |
|
329 |
289 #foreach( $dependency in $namedDependencies ) |
330 #foreach( $dependency in $namedDependencies ) |
290 dependency_error_${dependency.id}() |
331 dependency_error_${dependency.id}() |
291 { |
332 { |
292 printf "checking for ${dependency.name}... " |
333 print_check_msg "${D}dep_checked_${dependency.id}" "checking for ${dependency.name}... " |
293 #foreach( $sub in $dependency.subdependencies ) |
334 #foreach( $sub in $dependency.subdependencies ) |
294 # dependency $sub.fullName |
335 # dependency $sub.fullName |
295 while true |
336 while true |
296 do |
337 do |
297 #if( $sub.platform ) |
338 #if( $sub.platform ) |
298 if notisplatform "${sub.platform}"; then |
339 if notisplatform "${sub.platform}"; then |
299 break |
340 break |
300 fi |
341 fi |
301 #end |
342 #end |
|
343 #if( $sub.toolchain ) |
|
344 if notistoolchain "${sub.toolchain}"; then |
|
345 break |
|
346 fi |
|
347 #end |
302 #foreach( $np in $sub.notList ) |
348 #foreach( $np in $sub.notList ) |
303 if isplatform "${np}"; then |
349 if isplatform "${np}" || istoolchain "${np}"; then |
304 break |
350 break |
305 fi |
351 fi |
306 #end |
352 #end |
307 #foreach( $lang in $sub.lang ) |
353 #foreach( $lang in $sub.lang ) |
308 if [ -z "$lang_${lang}" ] ; then |
354 if [ -z "$lang_${lang}" ] ; then |
344 cat >> $TEMP_DIR/make.mk << __EOF__ |
390 cat >> $TEMP_DIR/make.mk << __EOF__ |
345 # Dependency: $dependency.name |
391 # Dependency: $dependency.name |
346 $sub.make |
392 $sub.make |
347 __EOF__ |
393 __EOF__ |
348 #end |
394 #end |
349 echo yes |
395 print_check_msg "${D}dep_checked_${dependency.id}" "yes\n" |
|
396 dep_checked_${dependency.id}=1 |
350 return 1 |
397 return 1 |
351 done |
398 done |
352 |
399 |
353 #end |
400 #end |
354 echo no |
401 print_check_msg "${D}dep_checked_${dependency.id}" "no\n" |
|
402 dep_checked_${dependency.id}=1 |
355 return 0 |
403 return 0 |
356 } |
404 } |
357 #end |
405 #end |
358 |
|
359 |
|
360 |
|
361 |
406 |
362 # start collecting dependency information |
407 # start collecting dependency information |
363 echo > "$TEMP_DIR/flags.mk" |
408 echo > "$TEMP_DIR/flags.mk" |
364 |
409 |
365 DEPENDENCIES_FAILED= |
410 DEPENDENCIES_FAILED= |
366 ERROR=0 |
411 ERROR=0 |
367 #if( $dependencies.size() > 0 ) |
412 #if( $dependencies.size() > 0 ) |
368 # unnamed dependencies |
413 # unnamed dependencies |
369 TEMP_CFLAGS= |
414 TEMP_CFLAGS="$CFLAGS" |
370 TEMP_CXXFLAGS= |
415 TEMP_CXXFLAGS="$CXXFLAGS" |
371 TEMP_LDFLAGS= |
416 TEMP_LDFLAGS="$LDFLAGS" |
372 #foreach( $dependency in $dependencies ) |
417 #foreach( $dependency in $dependencies ) |
373 while true |
418 while true |
374 do |
419 do |
375 #if( $dependency.platform ) |
420 #if( $dependency.platform ) |
376 if notisplatform "${dependency.platform}"; then |
421 if notisplatform "${dependency.platform}"; then |
377 break |
422 break |
378 fi |
423 fi |
379 #end |
424 #end |
|
425 #if( $dependency.toolchain ) |
|
426 if notistoolchain "${dependency.toolchain}"; then |
|
427 break |
|
428 fi |
|
429 #end |
380 #foreach( $np in $dependency.notList ) |
430 #foreach( $np in $dependency.notList ) |
381 if isplatform "${np}"; then |
431 if isplatform "${np}" || istoolchain "${np}"; then |
382 break |
432 break |
383 fi |
433 fi |
384 #end |
434 #end |
385 while true |
435 while true |
386 do |
436 do |
395 ERROR=1 |
445 ERROR=1 |
396 break |
446 break |
397 fi |
447 fi |
398 #end |
448 #end |
399 #foreach( $pkg in $dependency.pkgconfig ) |
449 #foreach( $pkg in $dependency.pkgconfig ) |
400 printf "checking for pkg-config package $pkg.name... " |
450 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "checking for pkg-config package $pkg.name... " |
401 if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then |
451 if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then |
402 echo yes |
452 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "yes\n" |
|
453 dep_pkgconfig_checked_${pkg.id}=1 |
403 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`" |
454 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`" |
404 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`" |
455 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`" |
405 else |
456 else |
406 echo no |
457 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "no\n" |
|
458 dep_pkgconfig_checked_${pkg.id}=1 |
407 ERROR=1 |
459 ERROR=1 |
408 break |
460 break |
409 fi |
461 fi |
410 #end |
462 #end |
411 |
463 |
433 done |
485 done |
434 #end |
486 #end |
435 |
487 |
436 # add general dependency flags to flags.mk |
488 # add general dependency flags to flags.mk |
437 echo "# general flags" >> "$TEMP_DIR/flags.mk" |
489 echo "# general flags" >> "$TEMP_DIR/flags.mk" |
438 if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then |
490 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
439 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
491 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
440 fi |
492 fi |
441 if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then |
493 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
442 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
494 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
443 fi |
495 fi |
444 if [ -n "${TEMP_LDFLAGS}" ]; then |
496 if [ -n "${TEMP_LDFLAGS}" ]; then |
445 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
497 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
446 fi |
498 fi |
516 fi |
568 fi |
517 #end |
569 #end |
518 if [ -n "$DISABLE_${feature.varName}" ]; then |
570 if [ -n "$DISABLE_${feature.varName}" ]; then |
519 unset ${feature.varName} |
571 unset ${feature.varName} |
520 fi |
572 fi |
|
573 fi |
|
574 if [ -n "${D}${feature.varName}" ]; then |
|
575 : |
|
576 #foreach( $def in $feature.defines ) |
|
577 TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}" |
|
578 TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}" |
|
579 #end |
|
580 #if( $feature.hasMake() ) |
|
581 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
|
582 $feature.make |
|
583 __EOF__ |
|
584 #end |
|
585 else |
|
586 : |
|
587 #foreach( $def in $feature.disabled.defines ) |
|
588 TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}" |
|
589 TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}" |
|
590 #end |
|
591 #if( $feature.disabled.hasMake() ) |
|
592 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
|
593 $feature.disabled.make |
|
594 __EOF__ |
|
595 #end |
|
596 #foreach( $dependency in $feature.disabled.dependencies ) |
|
597 if dependency_error_$dependency ; then |
|
598 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
|
599 ERROR=1 |
|
600 fi |
|
601 #end |
521 fi |
602 fi |
522 #end |
603 #end |
523 |
604 |
524 #foreach( $opt in $target.options ) |
605 #foreach( $opt in $target.options ) |
525 # Option: --${opt.argument} |
606 # Option: --${opt.argument} |
563 else |
644 else |
564 ERROR=1 |
645 ERROR=1 |
565 DEPENDENCIES_FAILED="option '${opt.argument}' $DEPENDENCIES_FAILED" |
646 DEPENDENCIES_FAILED="option '${opt.argument}' $DEPENDENCIES_FAILED" |
566 fi |
647 fi |
567 #end |
648 #end |
568 fi |
649 else |
569 fi |
650 echo |
570 #end |
651 echo "Invalid option value - usage:" |
571 |
652 echo " --${opt.argument}=${opt.valuesString}" |
572 if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then |
653 abort_configure |
|
654 fi |
|
655 fi |
|
656 #end |
|
657 |
|
658 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
573 echo "${target.cFlags} += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
659 echo "${target.cFlags} += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
574 fi |
660 fi |
575 if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then |
661 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
576 echo "${target.cxxFlags} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
662 echo "${target.cxxFlags} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
577 fi |
663 fi |
578 if [ "$BUILD_TYPE" = "debug" ]; then |
664 if [ "$BUILD_TYPE" = "debug" ]; then |
579 if [ -n "$lang_c" ]; then |
665 if [ -n "$lang_c" ]; then |
580 echo '${target.cFlags} += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
666 echo '${target.cFlags} += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |