| 84 |
84 |
| 85 # help text |
85 # help text |
| 86 printhelp() |
86 printhelp() |
| 87 { |
87 { |
| 88 echo "Usage: $0 [OPTIONS]..." |
88 echo "Usage: $0 [OPTIONS]..." |
| 89 cat << __EOF__ |
89 echo 'Configuration:' |
| 90 Installation directories: |
90 #foreach( $cfg in $config ) |
| 91 --prefix=PREFIX path prefix for architecture-independent files |
91 if true \ |
| 92 [${D}prefix] |
92 #if( $cfg.platform ) |
| 93 --exec-prefix=EPREFIX path prefix for architecture-dependent files |
93 && isplatform "${cfg.platform}" \ |
| 94 [PREFIX] |
94 #end |
| 95 |
95 #foreach( $np in $cfg.notList ) |
| 96 --bindir=DIR user executables [EPREFIX/bin] |
96 && notisplatform "${np}" \ |
| 97 --sbindir=DIR system admin executables [EPREFIX/sbin] |
97 #end |
| 98 --libexecdir=DIR program executables [EPREFIX/libexec] |
98 ; then |
| 99 --sysconfdir=DIR system configuration files [PREFIX/etc] |
99 : |
| 100 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
100 #foreach( $var in $cfg.vars ) |
| 101 --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
101 #if( $var.overridable ) |
| 102 --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] |
102 if test -z "${D}${var.varName}__described__"; then |
| 103 --libdir=DIR object code libraries [EPREFIX/lib] |
103 ${var.varName}__described__=1 |
| 104 --includedir=DIR C header files [PREFIX/include] |
104 cat << '__EOF__' |
| 105 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
105 ${var.helpText} |
| 106 --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
106 __EOF__ |
| 107 --infodir=DIR info documentation [DATAROOTDIR/info] |
107 fi |
| 108 --mandir=DIR man documentation [DATAROOTDIR/man] |
108 #end |
| 109 --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
109 #end |
| |
110 fi |
| |
111 #end |
| |
112 cat << '__EOF__' |
| 110 |
113 |
| 111 Build Types: |
114 Build Types: |
| 112 --debug add extra compile flags for debug builds |
115 --debug add extra compile flags for debug builds |
| 113 --release add extra compile flags for release builds |
116 --release add extra compile flags for release builds |
| 114 #if( $options.size() > 0 ) |
117 #if( $options.size() > 0 ) |
| 115 |
118 |
| 116 Options: |
119 Options: |
| 117 #foreach( $opt in $options ) |
120 #foreach( $opt in $options ) |
| 118 --${opt.argument}=${opt.valuesString} |
121 ${opt.helpText} |
| 119 #end |
122 #end |
| 120 #end |
123 #end |
| 121 #if( $features.size() > 0 ) |
124 #if( $features.size() > 0 ) |
| 122 |
125 |
| 123 Optional Features: |
126 Optional Features: |
| 193 # |
182 # |
| 194 BUILD_TYPE="default" |
183 BUILD_TYPE="default" |
| 195 for ARG in "$@" |
184 for ARG in "$@" |
| 196 do |
185 do |
| 197 case "$ARG" in |
186 case "$ARG" in |
| 198 "--prefix="*) prefix=${D}{ARG#--prefix=} ;; |
187 #foreach( $var in $vars ) |
| 199 "--exec-prefix="*) exec_prefix=${D}{ARG#--exec-prefix=} ;; |
188 #if ($var.overridable) |
| 200 "--bindir="*) bindir=${D}{ARG#----bindir=} ;; |
189 "--${var.arg}="*) ${var.varName}=${D}{ARG#--${var.arg}=} ;; |
| 201 "--sbindir="*) sbindir=${D}{ARG#--sbindir=} ;; |
190 #end |
| 202 "--libdir="*) libdir=${D}{ARG#--libdir=} ;; |
191 #end |
| 203 "--libexecdir="*) libexecdir=${D}{ARG#--libexecdir=} ;; |
192 "--help"*) printhelp ;; |
| 204 "--datarootdir="*) datarootdir=${D}{ARG#--datarootdir=} ;; |
193 "--debug") BUILD_TYPE="debug" ;; |
| 205 "--datadir="*) datadir=${D}{ARG#--datadir=} ;; |
194 "--release") BUILD_TYPE="release" ;; |
| 206 "--sysconfdir="*) sysconfdir=${D}{ARG#--sysconfdir=} ;; |
|
| 207 "--sharedstatedir="*) sharedstatedir=${D}{ARG#--sharedstatedir=} ;; |
|
| 208 "--localstatedir="*) localstatedir=${D}{ARG#--localstatedir=} ;; |
|
| 209 "--includedir="*) includedir=${D}{ARG#--includedir=} ;; |
|
| 210 "--infodir="*) infodir=${D}{ARG#--infodir=} ;; |
|
| 211 "--mandir"*) mandir=${D}{ARG#--mandir} ;; |
|
| 212 "--localedir"*) localedir=${D}{ARG#--localedir} ;; |
|
| 213 "--help"*) printhelp; abort_configure ;; |
|
| 214 "--debug") BUILD_TYPE="debug" ;; |
|
| 215 "--release") BUILD_TYPE="release" ;; |
|
| 216 #foreach( $opt in $options ) |
195 #foreach( $opt in $options ) |
| 217 "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;; |
196 "--${opt.arg}="*) ${opt.varName}=${D}{ARG#--${opt.arg}=} ;; |
| 218 "--${opt.argument}") echo "option '$ARG' needs a value:"; echo " $ARG=${opt.valuesString}"; abort_configure ;; |
197 "--${opt.arg}") echo "option '$ARG' needs a value:"; echo " $ARG=${opt.valuesString}"; abort_configure ;; |
| 219 #end |
198 #end |
| 220 #foreach( $feature in $features ) |
199 #foreach( $feature in $features ) |
| 221 "--enable-${feature.arg}") ${feature.varName}=on ;; |
200 "--enable-${feature.arg}") ${feature.varName}=on ;; |
| 222 "--disable-${feature.arg}") unset ${feature.varName} ;; |
201 "--disable-${feature.arg}") unset ${feature.varName} ;; |
| 223 #end |
202 #end |
| 224 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
203 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
| 225 esac |
204 esac |
| 226 done |
205 done |
| |
206 |
| |
207 # toolchain detection utilities |
| |
208 . make/toolchain.sh |
| |
209 |
| |
210 # check languages |
| |
211 lang_c= |
| |
212 lang_cpp= |
| |
213 #foreach( $lang in $languages ) |
| |
214 if detect_${lang}_compiler ; then |
| |
215 lang_${lang}=1 |
| |
216 fi |
| |
217 #end |
| 227 |
218 |
| 228 ## Begin unparsed content. ** |
219 ## Begin unparsed content. ** |
| 229 #[[ |
220 #[[ |
| 230 |
221 |
| 231 # set defaults for dir variables |
222 # set defaults for dir variables |
| 234 : ${sbindir:='${exec_prefix}/sbin'} |
225 : ${sbindir:='${exec_prefix}/sbin'} |
| 235 : ${libdir:='${exec_prefix}/lib'} |
226 : ${libdir:='${exec_prefix}/lib'} |
| 236 : ${libexecdir:='${exec_prefix}/libexec'} |
227 : ${libexecdir:='${exec_prefix}/libexec'} |
| 237 : ${datarootdir:='${prefix}/share'} |
228 : ${datarootdir:='${prefix}/share'} |
| 238 : ${datadir:='${datarootdir}'} |
229 : ${datadir:='${datarootdir}'} |
| 239 : ${sysconfdir:='${prefix}/etc'} |
|
| 240 : ${sharedstatedir:='${prefix}/com'} |
230 : ${sharedstatedir:='${prefix}/com'} |
| 241 : ${localstatedir:='${prefix}/var'} |
231 if [ -z "$sysconfdir" ]; then |
| 242 : ${runstatedir:='${localstatedir}/run'} |
232 if [ "$prefix" = '/usr' ]; then |
| |
233 sysconfdir='/etc' |
| |
234 else |
| |
235 sysconfdir='${prefix}/etc' |
| |
236 fi |
| |
237 fi |
| |
238 if [ -z "$localstatedir" ]; then |
| |
239 if [ "$prefix" = '/usr' ]; then |
| |
240 localstatedir='/var' |
| |
241 else |
| |
242 localstatedir='${prefix}/var' |
| |
243 fi |
| |
244 fi |
| |
245 if [ -z "$runstatedir" ]; then |
| |
246 if [ "$prefix" = '/usr' ]; then |
| |
247 runstatedir='/var/run' |
| |
248 else |
| |
249 runstatedir='${prefix}/var' |
| |
250 fi |
| |
251 fi |
| 243 : ${includedir:='${prefix}/include'} |
252 : ${includedir:='${prefix}/include'} |
| 244 : ${infodir:='${datarootdir}/info'} |
253 : ${infodir:='${datarootdir}/info'} |
| 245 : ${mandir:='${datarootdir}/man'} |
254 : ${mandir:='${datarootdir}/man'} |
| 246 : ${localedir:='${datarootdir}/locale'} |
255 : ${localedir:='${datarootdir}/locale'} |
| 247 |
256 |
| 248 # remember the above values and compare them later |
|
| 249 orig_bindir="$bindir" |
|
| 250 orig_sbindir="$sbindir" |
|
| 251 orig_libdir="$libdir" |
|
| 252 orig_libexecdir="$libexecdir" |
|
| 253 orig_datarootdir="$datarootdir" |
|
| 254 orig_datadir="$datadir" |
|
| 255 orig_sysconfdir="$sysconfdir" |
|
| 256 orig_sharedstatedir="$sharedstatedir" |
|
| 257 orig_localstatedir="$localstatedir" |
|
| 258 orig_runstatedir="$runstatedir" |
|
| 259 orig_includedir="$includedir" |
|
| 260 orig_infodir="$infodir" |
|
| 261 orig_mandir="$mandir" |
|
| 262 orig_localedir="$localedir" |
|
| 263 |
257 |
| 264 # check if a config.site exists and load it |
258 # check if a config.site exists and load it |
| |
259 CONFIG_SITE_OK=0 |
| 265 if [ -n "$CONFIG_SITE" ]; then |
260 if [ -n "$CONFIG_SITE" ]; then |
| 266 # CONFIG_SITE may contain space separated file names |
261 # CONFIG_SITE may contain space separated file names |
| 267 for cs in $CONFIG_SITE; do |
262 for cs in $CONFIG_SITE; do |
| 268 printf "loading defaults from $cs... " |
263 printf "loading defaults from $cs... " |
| 269 . "$cs" |
264 if [ -f "$cs" ]; then |
| 270 echo ok |
265 . "$cs" |
| |
266 echo ok |
| |
267 CONFIG_SITE_OK=1 |
| |
268 break |
| |
269 else |
| |
270 echo "not found" |
| |
271 fi |
| 271 done |
272 done |
| 272 elif [ -f "$prefix/share/config.site" ]; then |
273 elif [ -f "$prefix/share/config.site" ]; then |
| 273 printf "loading site defaults... " |
274 printf "loading site defaults... " |
| 274 . "$prefix/share/config.site" |
275 . "$prefix/share/config.site" |
| 275 echo ok |
276 echo ok |
| |
277 CONFIG_SITE_OK=1 |
| 276 elif [ -f "$prefix/etc/config.site" ]; then |
278 elif [ -f "$prefix/etc/config.site" ]; then |
| 277 printf "loading site defaults... " |
279 printf "loading site defaults... " |
| 278 . "$prefix/etc/config.site" |
280 . "$prefix/etc/config.site" |
| 279 echo ok |
281 echo ok |
| 280 else |
282 CONFIG_SITE_OK=1 |
| |
283 fi |
| |
284 |
| |
285 if [ $CONFIG_SITE_OK -eq 0 ]; then |
| 281 # try to detect the correct libdir on our own, except it was changed by the user |
286 # try to detect the correct libdir on our own, except it was changed by the user |
| 282 if test "$libdir" = '${exec_prefix}/lib'; then |
287 if [ "$libdir" = '${exec_prefix}/lib' ] ; then |
| 283 if [ "$OS" = "SunOS" ]; then |
288 if [ "$TOOLCHAIN_WSIZE" = "64" ] ; then |
| 284 test -d "${exec_prefix}/lib/amd64" && libdir='${exec_prefix}/lib/amd64' |
289 if [ "$OS" = "SunOS" ]; then |
| 285 else |
290 [ -d "${exec_prefix}/lib/64" ] && libdir='${exec_prefix}/lib/64' |
| 286 # check if the standard libdir even exists |
|
| 287 if test -d "${exec_prefix}/lib" ; then |
|
| 288 : |
|
| 289 else |
291 else |
| 290 # if it does not, maybe a lib32 exists |
292 [ -d "${exec_prefix}/lib64" ] && libdir='${exec_prefix}/lib64' |
| 291 test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32' |
|
| 292 fi |
293 fi |
| 293 # now check if there is a special 64bit libdir that we should use |
294 elif [ "$TOOLCHAIN_WSIZE" = "32" ] ; then |
| 294 for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do |
295 if [ "$OS" = "SunOS" ]; then |
| 295 if [ $ARCH = $i ]; then |
296 [ -d "${exec_prefix}/lib/32" ] && libdir='${exec_prefix}/lib/32' |
| 296 test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64' |
297 else |
| 297 break |
298 [ -d "${exec_prefix}/lib32" ] && libdir='${exec_prefix}/lib32' |
| 298 fi |
299 fi |
| 299 done |
|
| 300 fi |
300 fi |
| 301 fi |
301 fi |
| 302 fi |
302 fi |
| 303 ]]# |
303 ]]# |
| 304 ## End of unparsed content ** |
304 ## End of unparsed content ** |
| 305 |
305 |
| 306 # generate vars.mk |
306 # generate vars.mk |
| 307 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
307 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
| 308 prefix=$prefix |
|
| 309 exec_prefix=$exec_prefix |
|
| 310 bindir=$bindir |
|
| 311 sbindir=$sbindir |
|
| 312 libdir=$libdir |
|
| 313 libexecdir=$libexecdir |
|
| 314 datarootdir=$datarootdir |
|
| 315 datadir=$datadir |
|
| 316 sysconfdir=$sysconfdir |
|
| 317 sharedstatedir=$sharedstatedir |
|
| 318 localstatedir=$localstatedir |
|
| 319 runstatedir=$runstatedir |
|
| 320 includedir=$includedir |
|
| 321 infodir=$infodir |
|
| 322 mandir=$mandir |
|
| 323 localedir=$localedir |
|
| 324 #foreach( $var in $vars ) |
308 #foreach( $var in $vars ) |
| 325 ${var.varName}=${D}${var.varName} |
309 ${var.varName}=${D}${var.varName} |
| 326 #end |
310 #end |
| 327 __EOF__ |
311 __EOF__ |
| 328 |
312 |
| 329 # toolchain detection utilities |
|
| 330 . make/toolchain.sh |
|
| 331 |
313 |
| 332 # |
314 # |
| 333 # DEPENDENCIES |
315 # DEPENDENCIES |
| 334 # |
316 # |
| 335 |
317 |
| 336 # check languages |
318 |
| 337 lang_c= |
|
| 338 lang_cpp= |
|
| 339 #foreach( $lang in $languages ) |
|
| 340 if detect_${lang}_compiler ; then |
|
| 341 lang_${lang}=1 |
|
| 342 fi |
|
| 343 #end |
|
| 344 |
319 |
| 345 # create buffer for make variables required by dependencies |
320 # create buffer for make variables required by dependencies |
| 346 echo > "$TEMP_DIR/make.mk" |
321 echo > "$TEMP_DIR/make.mk" |
| 347 |
322 |
| 348 test_pkg_config() |
323 test_pkg_config() |
| 738 fi |
713 fi |
| 739 if [ -n "$TOOLCHAIN_CSTD" ]; then |
714 if [ -n "$TOOLCHAIN_CSTD" ]; then |
| 740 echo " default C std: $TOOLCHAIN_CSTD" |
715 echo " default C std: $TOOLCHAIN_CSTD" |
| 741 fi |
716 fi |
| 742 echo |
717 echo |
| 743 echo "Build Config:" |
718 echo "Config:" |
| 744 echo " prefix: $prefix" |
719 #foreach( $var in $vars ) |
| 745 echo " exec_prefix: $exec_prefix" |
720 #if ($var.overridable) |
| 746 if [ "$orig_bindir" != "$bindir" ]; then |
721 printf ' %-16s' '${var.arg}:' |
| 747 echo " bindir: $bindir" |
722 echo "${D}${var.varName}" |
| 748 fi |
723 #end |
| 749 if [ "$orig_sbindir" != "$sbindir" ]; then |
724 #end |
| 750 echo " sbindir: $sbindir" |
|
| 751 fi |
|
| 752 if [ "$orig_libdir" != "$libdir" ]; then |
|
| 753 echo " libdir: $libdir" |
|
| 754 fi |
|
| 755 if [ "$orig_libexecdir" != "$libexecdir" ]; then |
|
| 756 echo " libexecdir: $libexecdir" |
|
| 757 fi |
|
| 758 if [ "$orig_datarootdir" != "$datarootdir" ]; then |
|
| 759 echo " datarootdir: $datarootdir" |
|
| 760 fi |
|
| 761 if [ "$orig_datadir" != "$datadir" ]; then |
|
| 762 echo " datadir: $datadir" |
|
| 763 fi |
|
| 764 if [ "$orig_sysconfdir" != "$sysconfdir" ]; then |
|
| 765 echo " sysconfdir: $sysconfdir" |
|
| 766 fi |
|
| 767 if [ "$orig_sharedstatedir" != "$sharedstatedir" ]; then |
|
| 768 echo " sharedstatedir: $sharedstatedir" |
|
| 769 fi |
|
| 770 if [ "$orig_localstatedir" != "$localstatedir" ]; then |
|
| 771 echo " localstatedir: $localstatedir" |
|
| 772 fi |
|
| 773 if [ "$orig_runstatedir" != "$runstatedir" ]; then |
|
| 774 echo " runstatedir: $runstatedir" |
|
| 775 fi |
|
| 776 if [ "$orig_includedir" != "$includedir" ]; then |
|
| 777 echo " includedir: $includedir" |
|
| 778 fi |
|
| 779 if [ "$orig_infodir" != "$infodir" ]; then |
|
| 780 echo " infodir: $infodir" |
|
| 781 fi |
|
| 782 if [ "$orig_mandir" != "$mandir" ]; then |
|
| 783 echo " mandir: $mandir" |
|
| 784 fi |
|
| 785 if [ "$orig_localedir" != "$localedir" ]; then |
|
| 786 echo " localedir: $localedir" |
|
| 787 fi |
|
| 788 #if ( $options.size() > 0 ) |
725 #if ( $options.size() > 0 ) |
| 789 echo |
726 echo |
| 790 echo "Options:" |
727 echo "Options:" |
| 791 cat "$TEMP_DIR/options" |
728 cat "$TEMP_DIR/options" |
| 792 #end |
729 #end |
| 793 #if ( $features.size() > 0 ) |
730 #if ( $features.size() > 0 ) |
| 794 echo |
731 echo |
| 795 echo "Features:" |
732 echo "Features:" |
| 796 #foreach( $feature in $features ) |
733 #foreach( $feature in $features ) |
| |
734 printf ' %-16s' '$feature.name:' |
| 797 if [ -n "${D}${feature.varName}" ]; then |
735 if [ -n "${D}${feature.varName}" ]; then |
| 798 echo " $feature.name: on" |
736 echo 'on' |
| 799 else |
737 else |
| 800 echo " $feature.name: off" |
738 echo 'off' |
| 801 fi |
739 fi |
| 802 #end |
740 #end |
| 803 #end |
741 #end |
| 804 echo |
742 echo |
| 805 |
743 |