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