66 --sbindir=DIR system admin executables [EPREFIX/sbin] |
70 --sbindir=DIR system admin executables [EPREFIX/sbin] |
67 --libexecdir=DIR program executables [EPREFIX/libexec] |
71 --libexecdir=DIR program executables [EPREFIX/libexec] |
68 --sysconfdir=DIR system configuration files [PREFIX/etc] |
72 --sysconfdir=DIR system configuration files [PREFIX/etc] |
69 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
73 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
70 --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
74 --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
|
75 --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] |
71 --libdir=DIR object code libraries [EPREFIX/lib] |
76 --libdir=DIR object code libraries [EPREFIX/lib] |
72 --includedir=DIR C header files [PREFIX/include] |
77 --includedir=DIR C header files [PREFIX/include] |
73 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
78 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
74 --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
79 --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
75 --infodir=DIR info documentation [DATAROOTDIR/info] |
80 --infodir=DIR info documentation [DATAROOTDIR/info] |
76 --mandir=DIR man documentation [DATAROOTDIR/man] |
81 --mandir=DIR man documentation [DATAROOTDIR/man] |
|
82 --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
77 |
83 |
78 #if( $options.size() > 0 ) |
84 #if( $options.size() > 0 ) |
79 Options: |
85 Options: |
80 --debug add extra compile flags for debug builds |
86 --debug add extra compile flags for debug builds |
81 --release add extra compile flags for release builds |
87 --release add extra compile flags for release builds |
82 #foreach( $opt in $options ) |
88 #foreach( $opt in $options ) |
83 --${opt.getArgument()}=${opt.getValuesString()} |
89 --${opt.argument}=${opt.valuesString} |
84 #end |
90 #end |
85 |
91 |
86 #end |
92 #end |
87 #if( $features.size() > 0 ) |
93 #if( $features.size() > 0 ) |
88 Optional Features: |
94 Optional Features: |
89 #foreach( $feature in $features ) |
95 #foreach( $feature in $features ) |
90 #if( $feature.default ) |
96 #if( $feature.auto ) |
91 --disable-${feature.arg} |
97 --disable-${feature.arg} |
92 #else |
98 #else |
93 --enable-${feature.arg} |
99 --enable-${feature.arg} |
94 #end |
100 #end |
95 #end |
101 #end |
104 BUILD_TYPE="default" |
110 BUILD_TYPE="default" |
105 #set( $D = '$' ) |
111 #set( $D = '$' ) |
106 for ARG in "$@" |
112 for ARG in "$@" |
107 do |
113 do |
108 case "$ARG" in |
114 case "$ARG" in |
109 "--prefix="*) PREFIX=${D}{ARG#--prefix=} ;; |
115 "--prefix="*) prefix=${D}{ARG#--prefix=} ;; |
110 "--exec-prefix="*) EPREFIX=${D}{ARG#--exec-prefix=} ;; |
116 "--exec-prefix="*) exec_prefix=${D}{ARG#--exec-prefix=} ;; |
111 "--bindir="*) BINDIR=${D}{ARG#----bindir=} ;; |
117 "--bindir="*) bindir=${D}{ARG#----bindir=} ;; |
112 "--sbindir="*) SBINDIR=${D}{ARG#--sbindir=} ;; |
118 "--sbindir="*) sbindir=${D}{ARG#--sbindir=} ;; |
113 "--libdir="*) LIBDIR=${D}{ARG#--libdir=} ;; |
119 "--libdir="*) libdir=${D}{ARG#--libdir=} ;; |
114 "--libexecdir="*) LIBEXECDIR=${D}{ARG#--libexecdir=} ;; |
120 "--libexecdir="*) libexecdir=${D}{ARG#--libexecdir=} ;; |
115 "--datadir="*) DATADIR=${D}{ARG#--datadir=} ;; |
121 "--datarootdir="*) datarootdir=${D}{ARG#--datarootdir=} ;; |
116 "--sysconfdir="*) SYSCONFDIR=${D}{ARG#--sysconfdir=} ;; |
122 "--datadir="*) datadir=${D}{ARG#--datadir=} ;; |
117 "--sharedstatedir="*) SHAREDSTATEDIR=${D}{ARG#--sharedstatedir=} ;; |
123 "--sysconfdir="*) sysconfdir=${D}{ARG#--sysconfdir=} ;; |
118 "--localstatedir="*) LOCALSTATEDIR=${D}{ARG#--localstatedir=} ;; |
124 "--sharedstatedir="*) sharedstatedir=${D}{ARG#--sharedstatedir=} ;; |
119 "--includedir="*) INCLUDEDIR=${D}{ARG#--includedir=} ;; |
125 "--localstatedir="*) localstatedir=${D}{ARG#--localstatedir=} ;; |
120 "--infodir="*) INFODIR=${D}{ARG#--infodir=} ;; |
126 "--includedir="*) includedir=${D}{ARG#--includedir=} ;; |
121 "--mandir"*) MANDIR=${D}{ARG#--mandir} ;; |
127 "--infodir="*) infodir=${D}{ARG#--infodir=} ;; |
|
128 "--mandir"*) mandir=${D}{ARG#--mandir} ;; |
|
129 "--localedir"*) localedir=${D}{ARG#--localedir} ;; |
122 "--help"*) printhelp; abort_configure ;; |
130 "--help"*) printhelp; abort_configure ;; |
123 "--debug") BUILD_TYPE="debug" ;; |
131 "--debug") BUILD_TYPE="debug" ;; |
124 "--release") BUILD_TYPE="release" ;; |
132 "--release") BUILD_TYPE="release" ;; |
125 #foreach( $opt in $options ) |
133 #foreach( $opt in $options ) |
126 "--${opt.getArgument()}="*) ${opt.getVarName()}=${D}{ARG#--${opt.getArgument()}=} ;; |
134 "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;; |
127 #end |
135 #end |
128 #foreach( $feature in $features ) |
136 #foreach( $feature in $features ) |
129 "--enable-${feature.arg}") ${feature.getVarName()}=on ;; |
137 "--enable-${feature.arg}") ${feature.varName}=on ;; |
130 "--disable-${feature.arg}") unset ${feature.getVarName()} ;; |
138 "--disable-${feature.arg}") unset ${feature.varName} ;; |
131 #end |
139 #end |
132 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
140 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
133 esac |
141 esac |
134 done |
142 done |
135 |
143 |
136 ## Begin unparsed content. ** |
144 ## Begin unparsed content. ** |
137 #[[ |
145 #[[ |
138 # set dir variables |
146 |
139 : ${EPREFIX:="$PREFIX"} |
147 # set defaults for dir variables |
140 : ${BINDIR:="$EPREFIX/bin"} |
148 : ${exec_prefix:="$prefix"} |
141 : ${SBINDIR:="$EPREFIX/sbin"} |
149 : ${bindir:='${exec_prefix}/bin'} |
142 : ${LIBDIR:="$EPREFIX/lib"} |
150 : ${sbindir:='${exec_prefix}/sbin'} |
143 : ${LIBEXECDIR:="$EPREFIX/libexec"} |
151 : ${libdir:='${exec_prefix}/lib'} |
144 : ${DATADIR:="$PREFIX/share"} |
152 : ${libexecdir:='${exec_prefix}/libexec'} |
145 : ${SYSCONFDIR:="$PREFIX/etc"} |
153 : ${datarootdir:='${prefix}/share'} |
146 : ${SHAREDSTATEDIR:="$PREFIX/com"} |
154 : ${datadir:='${datarootdir}'} |
147 : ${LOCALSTATEDIR:="$PREFIX/var"} |
155 : ${sysconfdir:='${prefix}/etc'} |
148 : ${INCLUDEDIR:="$PREFIX/include"} |
156 : ${sharedstatedir:='${prefix}/com'} |
149 : ${INFODIR:="$PREFIX/info"} |
157 : ${localstatedir:='${prefix}/var'} |
150 : ${MANDIR:="$PREFIX/man"} |
158 : ${runstatedir:='${localstatedir}/run'} |
|
159 : ${includedir:='${prefix}/include'} |
|
160 : ${infodir:='${datarootdir}/info'} |
|
161 : ${mandir:='${datarootdir}/man'} |
|
162 : ${localedir:='${datarootdir}/locale'} |
|
163 |
|
164 # check if a config.site exists and load it |
|
165 if [ -n "$CONFIG_SITE" ]; then |
|
166 # CONFIG_SITE may contain space separated file names |
|
167 for cs in $CONFIG_SITE; do |
|
168 printf "loading defaults from $cs... " |
|
169 . "$cs" |
|
170 echo ok |
|
171 done |
|
172 elif [ -f "$prefix/share/config.site" ]; then |
|
173 printf "loading site defaults... " |
|
174 . "$prefix/share/config.site" |
|
175 echo ok |
|
176 elif [ -f "$prefix/etc/config.site" ]; then |
|
177 printf "loading site defaults... " |
|
178 . "$prefix/etc/config.site" |
|
179 echo ok |
|
180 fi |
151 |
181 |
152 # Test for availability of pkg-config |
182 # Test for availability of pkg-config |
153 PKG_CONFIG=`command -v pkg-config` |
183 PKG_CONFIG=`command -v pkg-config` |
154 : ${PKG_CONFIG:="false"} |
184 : ${PKG_CONFIG:="false"} |
155 |
185 |
201 ]]# |
231 ]]# |
202 ## End of unparsed content ** |
232 ## End of unparsed content ** |
203 |
233 |
204 # generate vars.mk |
234 # generate vars.mk |
205 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
235 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
206 PREFIX=$PREFIX |
236 prefix="$prefix" |
207 EPREFIX=$EPREFIX |
237 exec_prefix="$exec_prefix" |
208 BINDIR=$BINDIR |
238 bindir="$bindir" |
209 SBINDIR=$SBINDIR |
239 sbindir="$sbindir" |
210 LIBDIR=$LIBDIR |
240 libdir="$libdir" |
211 LIBEXECDIR=$LIBEXECDIR |
241 libexecdir="$libexecdir" |
212 DATADIR=$DATADIR |
242 datarootdir="$datarootdir" |
213 SYSCONFDIR=$SYSCONFDIR |
243 datadir="$datadir" |
214 SHAREDSTATEDIR=$SHAREDSTATEDIR |
244 sysconfdir="$sysconfdir" |
215 LOCALSTATEDIR=$LOCALSTATEDIR |
245 sharedstatedir="$sharedstatedir" |
216 INCLUDEDIR=$INCLUDEDIR |
246 localstatedir="$localstatedir" |
217 INFODIR=$INFODIR |
247 runstatedir="$runstatedir" |
218 MANDIR=$MANDIR |
248 includedir="$includedir" |
|
249 infodir="$infodir" |
|
250 mandir="$mandir" |
|
251 localedir="$localedir" |
219 #foreach( $var in $vars ) |
252 #foreach( $var in $vars ) |
220 ${var.varName}=$${var.varName} |
253 ${var.varName}="${D}${var.varName}" |
221 #end |
254 #end |
222 __EOF__ |
255 __EOF__ |
223 sort -u -o "$TEMP_DIR/vars.mk" "$TEMP_DIR/vars.mk" |
|
224 |
|
225 |
256 |
226 # toolchain detection utilities |
257 # toolchain detection utilities |
227 . make/toolchain.sh |
258 . make/toolchain.sh |
228 |
259 |
229 # |
260 # |
469 fi |
500 fi |
470 #end |
501 #end |
471 |
502 |
472 # Features |
503 # Features |
473 #foreach( $feature in $target.features ) |
504 #foreach( $feature in $target.features ) |
474 if [ -n "$${feature.getVarName()}" ]; then |
505 if [ -n "${D}${feature.varName}" ]; then |
475 #foreach( $dependency in $feature.dependencies ) |
506 #foreach( $dependency in $feature.dependencies ) |
476 # check dependency |
507 # check dependency |
477 if dependency_error_$dependency ; then |
508 if dependency_error_$dependency ; then |
478 # "auto" features can fail and are just disabled in this case |
509 # "auto" features can fail and are just disabled in this case |
479 if [ "$${feature.getVarName()}" = "auto" ]; then |
510 if [ "${D}${feature.varName}" = "auto" ]; then |
480 DISABLE_${feature.getVarName()}=1 |
511 DISABLE_${feature.varName}=1 |
481 else |
512 else |
482 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
513 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
483 ERROR=1 |
514 ERROR=1 |
484 fi |
515 fi |
485 fi |
516 fi |
486 #end |
517 #end |
487 if [ -n "$DISABLE_${feature.getVarName()}" ]; then |
518 if [ -n "$DISABLE_${feature.varName}" ]; then |
488 unset ${feature.getVarName()} |
519 unset ${feature.varName} |
489 fi |
520 fi |
490 fi |
521 fi |
491 #end |
522 #end |
492 |
523 |
493 #foreach( $opt in $target.options ) |
524 #foreach( $opt in $target.options ) |
494 # Option: --${opt.argument} |
525 # Option: --${opt.argument} |
495 if [ -z ${D}${opt.getVarName()} ]; then |
526 if [ -z "${D}${opt.varName}" ]; then |
|
527 echo "auto-detecting option '${opt.argument}'" |
496 SAVED_ERROR="$ERROR" |
528 SAVED_ERROR="$ERROR" |
497 SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED" |
529 SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED" |
498 ERROR=1 |
530 ERROR=1 |
499 while true |
531 while true |
500 do |
532 do |
513 #end |
545 #end |
514 break |
546 break |
515 done |
547 done |
516 if [ $ERROR -ne 0 ]; then |
548 if [ $ERROR -ne 0 ]; then |
517 SAVED_ERROR=1 |
549 SAVED_ERROR=1 |
|
550 SAVED_DEPENDENCIES_FAILED="option '${opt.argument}' $SAVED_DEPENDENCIES_FAILED" |
518 fi |
551 fi |
519 ERROR="$SAVED_ERROR" |
552 ERROR="$SAVED_ERROR" |
520 DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED" |
553 DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED" |
521 else |
554 else |
|
555 echo "checking option ${opt.argument} = ${D}${opt.varName}" |
522 if false; then |
556 if false; then |
523 false |
557 false |
524 #foreach( $optval in $opt.values ) |
558 #foreach( $optval in $opt.values ) |
525 elif [ "${D}${opt.getVarName()}" = "${optval.value}" ]; then |
559 elif [ "${D}${opt.varName}" = "${optval.value}" ]; then |
526 echo " ${opt.argument}: ${D}${opt.getVarName()}" >> $TEMP_DIR/options |
560 echo " ${opt.argument}: ${D}${opt.varName}" >> $TEMP_DIR/options |
527 if $optval.func ; then |
561 if $optval.func ; then |
528 : |
562 : |
529 else |
563 else |
530 ERROR=1 |
564 ERROR=1 |
531 fi |
565 DEPENDENCIES_FAILED="option '${opt.argument}' $DEPENDENCIES_FAILED" |
532 #end |
566 fi |
533 fi |
567 #end |
534 fi |
568 fi |
535 #end |
569 fi |
536 |
570 #end |
537 if [ -n "${TEMP_CFLAGS}" ]; then |
571 |
538 echo "${target.getCFlags()} += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
572 if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then |
539 fi |
573 echo "${target.cFlags} += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
540 if [ -n "${TEMP_CXXFLAGS}" ]; then |
574 fi |
541 echo "${target.getCXXFlags()} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
575 if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then |
|
576 echo "${target.cxxFlags} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
542 fi |
577 fi |
543 if [ "$BUILD_TYPE" = "debug" ]; then |
578 if [ "$BUILD_TYPE" = "debug" ]; then |
544 echo '${target.getCFlags()} += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
579 if [ -n "$lang_c" ]; then |
545 echo '${target.getCXXFlags()} += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
580 echo '${target.cFlags} += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
581 fi |
|
582 if [ -n "$lang_cpp" ]; then |
|
583 echo '${target.cxxFlags} += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
584 fi |
546 fi |
585 fi |
547 if [ "$BUILD_TYPE" = "release" ]; then |
586 if [ "$BUILD_TYPE" = "release" ]; then |
548 echo '${target.getCFlags()} += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
587 if [ -n "$lang_c" ]; then |
549 echo '${target.getCXXFlags()} += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
588 echo '${target.cFlags} += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
589 fi |
|
590 if [ -n "$lang_cpp" ]; then |
|
591 echo '${target.cxxFlags} += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
592 fi |
550 fi |
593 fi |
551 if [ -n "${TEMP_LDFLAGS}" ]; then |
594 if [ -n "${TEMP_LDFLAGS}" ]; then |
552 echo "${target.getLDFlags()} += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
595 echo "${target.ldFlags} += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
553 fi |
596 fi |
554 |
597 |
555 #end |
598 #end |
556 |
599 |
557 # final result |
600 # final result |