make/configure.vm

changeset 0
b4b281ef2d0f
equal deleted inserted replaced
-1:000000000000 0:b4b281ef2d0f
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 }
130
131 # create temporary directory
132 TEMP_DIR=".tmp-`uname -n`"
133 rm -Rf "$TEMP_DIR"
134 if mkdir -p "$TEMP_DIR"; then
135 :
136 else
137 echo "Cannot create tmp dir $TEMP_DIR"
138 echo "Abort"
139 exit 1
140 fi
141 touch "$TEMP_DIR/options"
142 touch "$TEMP_DIR/features"
143
144 # define standard variables
145 # also define standard prefix (this is where we will search for config.site)
146 prefix=/usr
147 exec_prefix=
148 bindir=
149 sbindir=
150 libdir=
151 libexecdir=
152 datarootdir=
153 datadir=
154 sysconfdir=
155 sharedstatedir=
156 localstatedir=
157 runstatedir=
158 includedir=
159 infodir=
160 localedir=
161 mandir=
162
163 # custom variables
164 #foreach( $cfg in $config )
165 if true \
166 #if( $cfg.platform )
167 && isplatform "${cfg.platform}" \
168 #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
181 #end
182
183 # features
184 #foreach( $feature in $features )
185 #if( ${feature.auto} )
186 ${feature.varName}=auto
187 #end
188 #end
189
190 #
191 # parse arguments
192 #
193 BUILD_TYPE="default"
194 for ARG in "$@"
195 do
196 case "$ARG" in
197 "--prefix="*) prefix=${D}{ARG#--prefix=} ;;
198 "--exec-prefix="*) exec_prefix=${D}{ARG#--exec-prefix=} ;;
199 "--bindir="*) bindir=${D}{ARG#----bindir=} ;;
200 "--sbindir="*) sbindir=${D}{ARG#--sbindir=} ;;
201 "--libdir="*) libdir=${D}{ARG#--libdir=} ;;
202 "--libexecdir="*) libexecdir=${D}{ARG#--libexecdir=} ;;
203 "--datarootdir="*) datarootdir=${D}{ARG#--datarootdir=} ;;
204 "--datadir="*) datadir=${D}{ARG#--datadir=} ;;
205 "--sysconfdir="*) sysconfdir=${D}{ARG#--sysconfdir=} ;;
206 "--sharedstatedir="*) sharedstatedir=${D}{ARG#--sharedstatedir=} ;;
207 "--localstatedir="*) localstatedir=${D}{ARG#--localstatedir=} ;;
208 "--includedir="*) includedir=${D}{ARG#--includedir=} ;;
209 "--infodir="*) infodir=${D}{ARG#--infodir=} ;;
210 "--mandir"*) mandir=${D}{ARG#--mandir} ;;
211 "--localedir"*) localedir=${D}{ARG#--localedir} ;;
212 "--help"*) printhelp; abort_configure ;;
213 "--debug") BUILD_TYPE="debug" ;;
214 "--release") BUILD_TYPE="release" ;;
215 #foreach( $opt in $options )
216 "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;;
217 "--${opt.argument}") echo "option '$ARG' needs a value:"; echo " $ARG=${opt.valuesString}"; abort_configure ;;
218 #end
219 #foreach( $feature in $features )
220 "--enable-${feature.arg}") ${feature.varName}=on ;;
221 "--disable-${feature.arg}") unset ${feature.varName} ;;
222 #end
223 "-"*) echo "unknown option: $ARG"; abort_configure ;;
224 esac
225 done
226
227 ## Begin unparsed content. **
228 #[[
229
230 # set defaults for dir variables
231 : ${exec_prefix:="$prefix"}
232 : ${bindir:='${exec_prefix}/bin'}
233 : ${sbindir:='${exec_prefix}/sbin'}
234 : ${libdir:='${exec_prefix}/lib'}
235 : ${libexecdir:='${exec_prefix}/libexec'}
236 : ${datarootdir:='${prefix}/share'}
237 : ${datadir:='${datarootdir}'}
238 : ${sysconfdir:='${prefix}/etc'}
239 : ${sharedstatedir:='${prefix}/com'}
240 : ${localstatedir:='${prefix}/var'}
241 : ${runstatedir:='${localstatedir}/run'}
242 : ${includedir:='${prefix}/include'}
243 : ${infodir:='${datarootdir}/info'}
244 : ${mandir:='${datarootdir}/man'}
245 : ${localedir:='${datarootdir}/locale'}
246
247 # check if a config.site exists and load it
248 if [ -n "$CONFIG_SITE" ]; then
249 # CONFIG_SITE may contain space separated file names
250 for cs in $CONFIG_SITE; do
251 printf "loading defaults from $cs... "
252 . "$cs"
253 echo ok
254 done
255 elif [ -f "$prefix/share/config.site" ]; then
256 printf "loading site defaults... "
257 . "$prefix/share/config.site"
258 echo ok
259 elif [ -f "$prefix/etc/config.site" ]; then
260 printf "loading site defaults... "
261 . "$prefix/etc/config.site"
262 echo ok
263 fi
264 ]]#
265 ## End of unparsed content **
266
267 # generate vars.mk
268 cat > "$TEMP_DIR/vars.mk" << __EOF__
269 prefix=$prefix
270 exec_prefix=$exec_prefix
271 bindir=$bindir
272 sbindir=$sbindir
273 libdir=$libdir
274 libexecdir=$libexecdir
275 datarootdir=$datarootdir
276 datadir=$datadir
277 sysconfdir=$sysconfdir
278 sharedstatedir=$sharedstatedir
279 localstatedir=$localstatedir
280 runstatedir=$runstatedir
281 includedir=$includedir
282 infodir=$infodir
283 mandir=$mandir
284 localedir=$localedir
285 #foreach( $var in $vars )
286 ${var.varName}=${D}${var.varName}
287 #end
288 __EOF__
289
290 # toolchain detection utilities
291 . make/toolchain.sh
292
293 #
294 # DEPENDENCIES
295 #
296
297 # check languages
298 lang_c=
299 lang_cpp=
300 #foreach( $lang in $languages )
301 if detect_${lang}_compiler ; then
302 lang_${lang}=1
303 fi
304 #end
305
306 # create buffer for make variables required by dependencies
307 echo > "$TEMP_DIR/make.mk"
308
309 test_pkg_config()
310 {
311 if "$PKG_CONFIG" --exists "$1" ; then :
312 else return 1 ; fi
313 if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then :
314 else return 1 ; fi
315 if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then :
316 else return 1 ; fi
317 if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then :
318 else return 1 ; fi
319 return 0
320 }
321
322 print_check_msg()
323 {
324 if [ -z "$1" ]; then
325 shift
326 printf "$@"
327 fi
328 }
329
330 #foreach( $dependency in $namedDependencies )
331 dependency_error_${dependency.id}()
332 {
333 print_check_msg "${D}dep_checked_${dependency.id}" "checking for ${dependency.name}... "
334 #foreach( $sub in $dependency.subdependencies )
335 # dependency $sub.fullName
336 while true
337 do
338 #if( $sub.platform )
339 if notisplatform "${sub.platform}"; then
340 break
341 fi
342 #end
343 #if( $sub.toolchain )
344 if notistoolchain "${sub.toolchain}"; then
345 break
346 fi
347 #end
348 #foreach( $np in $sub.notList )
349 if isplatform "${np}" || istoolchain "${np}"; then
350 break
351 fi
352 #end
353 #foreach( $lang in $sub.lang )
354 if [ -z "$lang_${lang}" ] ; then
355 break
356 fi
357 #end
358 #if( $sub.pkgconfig.size() > 0 )
359 if [ -z "$PKG_CONFIG" ]; then
360 break
361 fi
362 #end
363 #foreach( $test in $sub.tests )
364 if $test > /dev/null ; then
365 :
366 else
367 break
368 fi
369 #end
370 #foreach( $pkg in $sub.pkgconfig )
371 if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then
372 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`"
373 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`"
374 else
375 break
376 fi
377 #end
378 #foreach( $flags in $sub.flags )
379 #if( $flags.exec )
380 if tmp_flags=`$flags.value` ; then
381 TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags"
382 else
383 break
384 fi
385 #else
386 TEMP_$flags.varName="$TEMP_$flags.varName $flags.value"
387 #end
388 #end
389 #if ( $sub.make.length() > 0 )
390 cat >> $TEMP_DIR/make.mk << __EOF__
391 # Dependency: $dependency.name
392 $sub.make
393 __EOF__
394 #end
395 print_check_msg "${D}dep_checked_${dependency.id}" "yes\n"
396 dep_checked_${dependency.id}=1
397 return 1
398 done
399
400 #end
401 print_check_msg "${D}dep_checked_${dependency.id}" "no\n"
402 dep_checked_${dependency.id}=1
403 return 0
404 }
405 #end
406
407 # start collecting dependency information
408 echo > "$TEMP_DIR/flags.mk"
409
410 DEPENDENCIES_FAILED=
411 ERROR=0
412 #if( $dependencies.size() > 0 )
413 # unnamed dependencies
414 TEMP_CFLAGS="$CFLAGS"
415 TEMP_CXXFLAGS="$CXXFLAGS"
416 TEMP_LDFLAGS="$LDFLAGS"
417 #foreach( $dependency in $dependencies )
418 while true
419 do
420 #if( $dependency.platform )
421 if notisplatform "${dependency.platform}"; then
422 break
423 fi
424 #end
425 #if( $dependency.toolchain )
426 if notistoolchain "${dependency.toolchain}"; then
427 break
428 fi
429 #end
430 #foreach( $np in $dependency.notList )
431 if isplatform "${np}" || istoolchain "${np}"; then
432 break
433 fi
434 #end
435 while true
436 do
437 #foreach( $lang in $dependency.lang )
438 if [ -z "$lang_${lang}" ] ; then
439 ERROR=1
440 break
441 fi
442 #end
443 #if( $dependency.pkgconfig.size() > 0 )
444 if [ -z "$PKG_CONFIG" ]; then
445 ERROR=1
446 break
447 fi
448 #end
449 #foreach( $pkg in $dependency.pkgconfig )
450 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "checking for pkg-config package $pkg.name... "
451 if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then
452 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "yes\n"
453 dep_pkgconfig_checked_${pkg.id}=1
454 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`"
455 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`"
456 else
457 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "no\n"
458 dep_pkgconfig_checked_${pkg.id}=1
459 ERROR=1
460 break
461 fi
462 #end
463
464 #foreach( $flags in $dependency.flags )
465 #if( $flags.exec )
466 $flags.value > /dev/null
467 if tmp_flags=`$flags.value` ; then
468 TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags"
469 else
470 ERROR=1
471 break
472 fi
473 #else
474 TEMP_$flags.varName="$TEMP_$flags.varName $flags.value"
475 #end
476 #end
477 #if ( $dependency.make.length() > 0 )
478 cat >> "$TEMP_DIR/make.mk" << __EOF__
479 $dependency.make
480 __EOF__
481 #end
482 break
483 done
484 break
485 done
486 #end
487
488 # add general dependency flags to flags.mk
489 echo "# general flags" >> "$TEMP_DIR/flags.mk"
490 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
491 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
492 fi
493 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
494 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
495 fi
496 if [ -n "${TEMP_LDFLAGS}" ]; then
497 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
498 fi
499 #end
500
501 #
502 # OPTION VALUES
503 #
504 #foreach( $opt in $options )
505 #foreach( $val in $opt.values )
506 ${val.func}()
507 {
508 VERR=0
509 #foreach( $dep in $val.dependencies )
510 if dependency_error_$dep ; then
511 VERR=1
512 fi
513 #end
514 if [ $VERR -ne 0 ]; then
515 return 1
516 fi
517 #foreach( $def in $val.defines )
518 TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}"
519 TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}"
520 #end
521 #if( $val.hasMake() )
522 cat >> "$TEMP_DIR/make.mk" << __EOF__
523 $val.make
524 __EOF__
525 #end
526 return 0
527 }
528 #end
529 #end
530
531 #
532 # TARGETS
533 #
534
535 #foreach( $target in $targets )
536 echo >> "$TEMP_DIR/flags.mk"
537 #if ( $target.name )
538 echo "configuring target: $target.name"
539 echo "# flags for target $target.name" >> "$TEMP_DIR/flags.mk"
540 #else
541 echo "configuring global target"
542 echo "# flags for unnamed target" >> "$TEMP_DIR/flags.mk"
543 #end
544 TEMP_CFLAGS=
545 TEMP_CXXFLAGS=
546 TEMP_LDFLAGS=
547
548 #foreach( $dependency in $target.dependencies )
549 if dependency_error_$dependency; then
550 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} "
551 ERROR=1
552 fi
553 #end
554
555 # Features
556 #foreach( $feature in $target.features )
557 if [ -n "${D}${feature.varName}" ]; then
558 #foreach( $dependency in $feature.dependencies )
559 # check dependency
560 if dependency_error_$dependency ; then
561 # "auto" features can fail and are just disabled in this case
562 if [ "${D}${feature.varName}" = "auto" ]; then
563 DISABLE_${feature.varName}=1
564 else
565 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} "
566 ERROR=1
567 fi
568 fi
569 #end
570 if [ -n "$DISABLE_${feature.varName}" ]; then
571 unset ${feature.varName}
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
602 fi
603 #end
604
605 #foreach( $opt in $target.options )
606 # Option: --${opt.argument}
607 if [ -z "${D}${opt.varName}" ]; then
608 echo "auto-detecting option '${opt.argument}'"
609 SAVED_ERROR="$ERROR"
610 SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED"
611 ERROR=1
612 while true
613 do
614 #foreach( $optdef in $opt.defaults )
615 #if( $optdef.platform )
616 if isplatform "$optdef.platform"; then
617 #end
618 if $optdef.func ; then
619 echo " ${opt.argument}: ${optdef.valueName}" >> "$TEMP_DIR/options"
620 ERROR=0
621 break
622 fi
623 #if( $optdef.platform )
624 fi
625 #end
626 #end
627 break
628 done
629 if [ $ERROR -ne 0 ]; then
630 SAVED_ERROR=1
631 SAVED_DEPENDENCIES_FAILED="option '${opt.argument}' $SAVED_DEPENDENCIES_FAILED"
632 fi
633 ERROR="$SAVED_ERROR"
634 DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED"
635 else
636 echo "checking option ${opt.argument} = ${D}${opt.varName}"
637 if false; then
638 false
639 #foreach( $optval in $opt.values )
640 elif [ "${D}${opt.varName}" = "${optval.value}" ]; then
641 echo " ${opt.argument}: ${D}${opt.varName}" >> $TEMP_DIR/options
642 if $optval.func ; then
643 :
644 else
645 ERROR=1
646 DEPENDENCIES_FAILED="option '${opt.argument}' $DEPENDENCIES_FAILED"
647 fi
648 #end
649 else
650 echo
651 echo "Invalid option value - usage:"
652 echo " --${opt.argument}=${opt.valuesString}"
653 abort_configure
654 fi
655 fi
656 #end
657
658 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
659 echo "${target.cFlags} += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
660 fi
661 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
662 echo "${target.cxxFlags} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
663 fi
664 if [ "$BUILD_TYPE" = "debug" ]; then
665 if [ -n "$lang_c" ]; then
666 echo '${target.cFlags} += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk"
667 fi
668 if [ -n "$lang_cpp" ]; then
669 echo '${target.cxxFlags} += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk"
670 fi
671 fi
672 if [ "$BUILD_TYPE" = "release" ]; then
673 if [ -n "$lang_c" ]; then
674 echo '${target.cFlags} += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk"
675 fi
676 if [ -n "$lang_cpp" ]; then
677 echo '${target.cxxFlags} += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk"
678 fi
679 fi
680 if [ -n "${TEMP_LDFLAGS}" ]; then
681 echo "${target.ldFlags} += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
682 fi
683
684 #end
685
686 # final result
687 if [ $ERROR -ne 0 ]; then
688 echo
689 echo "Error: Unresolved dependencies"
690 echo "$DEPENDENCIES_FAILED"
691 abort_configure
692 fi
693
694 echo "configure finished"
695 echo
696 echo "Build Config:"
697 echo " PREFIX: $prefix"
698 echo " TOOLCHAIN: $TOOLCHAIN_NAME"
699 #if ( $options.size() > 0 )
700 echo "Options:"
701 cat "$TEMP_DIR/options"
702 #end
703 #if ( $features.size() > 0 )
704 echo "Features:"
705 #foreach( $feature in $features )
706 if [ -n "${D}${feature.varName}" ]; then
707 echo " $feature.name: on"
708 else
709 echo " $feature.name: off"
710 fi
711 #end
712 #end
713 echo
714
715 # generate the config.mk file
716 cat > "$TEMP_DIR/config.mk" << __EOF__
717 #
718 # config.mk generated by configure
719 #
720
721 __EOF__
722 write_toolchain_defaults "$TEMP_DIR/toolchain.mk"
723 cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk
724 rm -Rf "$TEMP_DIR"

mercurial