py-setuptools: 0.6c8 -> 0.6c9
[nslu2-linux/optware.git] / sources / appweb / configure
blob9a789c7d5eced371e56e542cab6fbfe1293b3d7f
1 #!/bin/bash
3 ###############################################################################
5 # configure -- Build configuration script for Mbedthis AppWeb Server
6 # Copyright (c) Mbedthis Software LLC, 2003-2005. All Rights Reserved.
8 ###############################################################################
10 # This script creates the config.h, config.make and config.sh
11 # configuration files. config.h is included in every C/C++ source file,
12 # config.make is included by all makefiles and config.sh is included by the
13 # bld program and some other scripts.
15 # It uses the conf/template.config.* files as output templates.
16 # The initial default settings are derrived from conf/config.defaults and
17 # the current settings are stored in conf/config.cache.
19 ###############################################################################
21 CONFIG_VERSION=1.0.0
22 FIRST_TIME=0
23 PRODUCTS="appWeb appWebDeviceManager myAppWeb"
25 ###############################################################################
27 checkSetup() {
30 # Ensure we can write to key directories
32 for d in . conf bin obj
34 echo >$d/.test 2>/dev/null
35 if [ $? != 0 ]
36 then
37 echo "You do not have write permission for the conf directory."
38 echo "Log in as root or modify the permissions of this directory"
39 echo "and all its files."
40 exit 255
42 rm -f $d/.test
43 done
45 if [ ! -f ./configure -o ! -d mpr ]
46 then
47 echo "configure: You must be in the top source directory."
48 exit 255
50 BLD_TOP=.
51 BLD_TOOLS_DIR=${BLD_TOP}/bin
52 BLD_BIN_DIR=${BLD_TOP}/bin
55 ###############################################################################
57 linkFile()
59 source=$1
60 dir=`dirname $2`
61 base=`basename $2`
63 rm -f $2
64 if [ "$base" != "$2" ]
65 then
66 source=`echo $source | sed -e "s^${dir}/^^"`
68 ln -s $source $2 2>/dev/null
69 if [ $? != 0 ]
70 then
71 cp $1 $2
75 ###############################################################################
77 # Set the system configuration.
79 # Usage: setSystemConfiguration cpu-vendor-os OS UNIX CPU CPU_ARCH
80 # The upper case parameters are output parameters.
83 setSystemConfiguration() {
85 system=$1
86 os=$2
87 unix=$3
88 cpu=$4
89 cpuArch=$5
92 # Parse the host system configuration
94 parseSystem $system $cpu unused $os
96 case $os in
97 WIN)
98 eval ${unix}=0
100 LINUX)
101 eval ${unix}=1
103 SOLARIS*)
104 eval ${unix}=1
105 eval ${os}=SOLARIS
107 MACOSX)
108 eval ${unix}=1
110 VXWORKS)
111 eval ${unix}=0
114 eval ${unix}=0
116 esac
119 # Determine the CPU family
121 case ${cpu} in
122 arm*|strongarm*)
123 eval ${cpuArch}=MPR_CPU_ARM
125 m68k**)
126 eval ${cpuArch}=MPR_CPU_68K
128 mips*)
129 eval ${cpuArch}=MPR_CPU_MIPS
131 ppc*|powerpc*)
132 eval ${cpuArch}=MPR_CPU_PPC
134 sparc*|sparclite)
135 eval ${cpuArch}=MPR_CPU_SPARC
137 x86*|i?86*)
138 eval ${cpuArch}=MPR_CPU_IX86
140 xscale*)
141 eval ${cpuArch}=MPR_CPU_XSCALE
143 simnt|sim)
144 eval ${cpuArch}=MPR_CPU_SIMNT
146 simsparc)
147 eval ${cpuArch}=MPR_CPU_SIMSPARC
150 eval ${cpuArch}=MPR_CPU_UNKNOWN
151 echo "configure: CPU architecture unknown. Porting $BLD_PRODUCT is required. "
152 exit 2
154 esac
157 ###############################################################################
159 # Prompt the user to select from a set of options.
160 # Usage: ans=`prompt "prompt" "default" "option1" "option2" ...`
161 # Returns the selection or default if <ENTER> is pressed
164 prompt() {
165 echo -e "\n${1}:" 1>&2 ; shift
166 default=$1 ; shift
167 count=1
168 index=1
169 for o in $*
171 echo " $count. $o" 1>&2
172 [ "$o" = "$default" ] && index=$count
173 eval option_${count}=$o
174 count=`expr $count + 1`
175 done
176 echo -n "Enter selection [$index] : " 1>&2
177 read ans
178 if [ "$ans" = "" ]
179 then echo $default
180 else
181 eval echo $`echo option_${ans}`
185 ###############################################################################
187 firstTimeBuild()
189 if [ ! -f conf/config.defaults -a "${BLD_PRODUCT}" = "" ]
190 then
191 BLD_PRODUCT=`prompt "Select your product" appWeb ${PRODUCTS}`
193 if [ ! -f conf/config.defaults ]
194 then
195 cd conf/${BLD_PRODUCT} >/dev/null
196 DEFAULTS=`echo *.defaults`
197 file=`prompt "Select your ${BLD_PRODUCT} configuration defaults" \
198 release.defaults ${DEFAULTS}`
199 echo
200 cd - >/dev/null
201 [ $quiet = 0 ] && \
202 echo " # Link conf/${BLD_PRODUCT}/${file} to conf/config.defaults"
203 linkFile conf/${BLD_PRODUCT}/${file} conf/config.defaults
204 FIRST_TIME=1
208 ###############################################################################
210 # Ensure users have set required environment variables
213 checkEnv() {
215 if [ $BLD_HOST_OS = "LINUX" -o $BLD_HOST_OS = "SOLARIS" ]
216 then
217 if [ "`echo $LD_LIBRARY_PATH | grep bin`" = "" ]
218 then
219 # Only warn first time
220 if [ ! -f conf/config.cache -a $quiet = 0 \
221 -a ! -f ${BLD_TOP}/mbedthis ]
222 then
223 echo " "
224 echo " #"
225 echo " # If you wish to debug natively in the build tree,"
226 echo " # you will need to set the LD_LIBRARY_PATH environment variable to include "
227 echo " # the \"bin\" directory. Try:"
228 echo -e " #\n # export LD_LIBRARY_PATH=`pwd`/bin"
229 echo -e " #\n # See \"INSTALL.TXT\" for details."
230 echo -e " #\n"
236 ###############################################################################
238 createConfigHeader()
240 NAME=$1
241 FILE=$2
243 rm -f $NAME
244 if [ "$NAME" = config.h ]
245 then
246 cat >$FILE <<!EOF_CONFIG_HEADER_H
248 * ${NAME} -- Build configuration file.
250 * WARNING: DO NOT EDIT. This file is generated by configure.
252 * If you wish to modify the defaults, then edit conf/config.defaults.* and
253 * then run "configure --reset".
256 !EOF_CONFIG_HEADER_H
257 else
258 cat >$FILE <<!EOF_CONFIG_HEADER
260 # ${NAME} -- Build configuration file.
262 # WARNING: DO NOT EDIT. This file is generated by configure.
264 # If you wish to modify the defaults, then edit conf/config.defaults.* and
265 # then run "configure --reset".
267 ################################################################################
269 !EOF_CONFIG_HEADER
274 ###############################################################################
276 # Fix module dependencies
278 fixDependencies()
280 BUILTIN=0
281 LOADABLE=0
282 [ BLD_FEATURE_DLL = 1 ] && BUILTIN=1
283 [ BLD_FEATURE_DLL = 0 ] && LOADABLE=1
285 if [ "$BLD_FEATURE_C_API_CLIENT" = 1 ]
286 then
287 if [ $BLD_FEATURE_C_API_MODULE = 0 ]
288 then
289 echo "configure: --enable-c-api-client requires --with-c-api. Enabling the C API."
290 BLD_FEATURE_C_API_MODULE=1
291 BLD_FEATURE_C_API_MODULE_BUILTIN=$BUILTIN
292 BLD_FEATURE_C_API_MODULE_LOADABLE=$LOADABLE
296 if [ $BLD_FEATURE_COMPAT_MODULE = 1 ]
297 then
298 if [ $BLD_FEATURE_EGI_MODULE = 0 ]
299 then
300 echo " "
301 echo "configure: --with-gacompat requires --with-egi. Enabling EGI."
302 BLD_FEATURE_EGI_MODULE=1
303 BLD_FEATURE_EGI_MODULE_BUILTIN=$BUILTIN
304 BLD_FEATURE_EGI_MODULE_LOADABLE=$LOADABLE
306 if [ $BLD_FEATURE_EGI_MODULE = 0 ]
307 then
308 echo " "
309 echo "configure: --with-gacompat requires --with-esp. Enabling ESP."
310 BLD_FEATURE_EJS=1
311 BLD_FEATURE_ESP_MODULE=1
312 BLD_FEATURE_ESP_MODULE_BUILTIN=$BUILTIN
313 BLD_FEATURE_ESP_MODULE_LOADABLE=$LOADABLE
315 if [ $BLD_FEATURE_C_API_MODULE = 0 ]
316 then
317 echo " "
318 echo "configure: --with-gacompat requires --with-c-api. Enabling the C API."
319 BLD_FEATURE_C_API_MODULE=1
320 BLD_FEATURE_C_API_MODULE_BUILTIN=$BUILTIN
321 BLD_FEATURE_C_API_MODULE_LOADABLE=$LOADABLE
326 # Need quotes as this package may not be defined
328 if [ "$BLD_FEATURE_MATRIXSSL_MODULE" = 1 ]
329 then
330 if [ $BLD_FEATURE_SSL_MODULE = 0 ]
331 then
332 echo " "
333 echo "configure: --with-matrixssl requires --with-ssl. Enabling SSL."
334 BLD_FEATURE_SSL=1
335 BLD_FEATURE_SSL_MODULE=1
336 BLD_FEATURE_SSL_MODULE_BUILTIN=$BUILTIN
337 BLD_FEATURE_SSL_MODULE_LOADABLE=$LOADABLE
341 if [ "$BLD_FEATURE_OPENSSL_MODULE" = 1 ]
342 then
343 if [ $BLD_FEATURE_SSL_MODULE = 0 ]
344 then
345 echo " "
346 echo "configure: --with-matrixssl requires --with-ssl. Enabling SSL."
347 BLD_FEATURE_SSL=1
348 BLD_FEATURE_SSL_MODULE=1
349 BLD_FEATURE_SSL_MODULE_BUILTIN=$BUILTIN
350 BLD_FEATURE_SSL_MODULE_LOADABLE=$LOADABLE
354 if [ $BLD_FEATURE_ESP_MODULE = 1 ]
355 then
356 BLD_FEATURE_EJS=1
359 if [ $BLD_HOST_OS = VXWORKS -a $BLD_FEATURE_CGI_MODULE = 1 \
360 -a $BLD_FEATURE_MULTITHREAD = 0 ]
361 then
362 echo " "
363 echo "configure: --with-cgi requires --enable-multi-thread. Enabling multithreading."
364 BLD_FEATURE_MULTITHREAD=1
368 ###############################################################################
370 createConfig()
372 NAME=$1
374 rm -f $NAME
375 createConfigHeader $NAME $NAME
377 [ $NAME = config.sh -o $NAME = config.h ] && IFQUOTE='"'
379 cat >>$NAME <<!EOF_CONFIG1
381 # Key Product Settigns
383 BLD_PRODUCT="$BLD_PRODUCT"
384 BLD_NAME="$BLD_NAME"
385 BLD_VERSION="$BLD_VERSION"
386 BLD_NUMBER="$BLD_NUMBER"
387 BLD_TYPE="$BLD_TYPE"
388 BLD_DEFAULTS="$BLD_DEFAULTS"
389 BLD_PACKAGES="$BLD_PACKAGES"
390 BLD_APPWEB_CONFIG="$BLD_APPWEB_CONFIG"
391 BLD_APPWEB=$BLD_APPWEB
394 # Other Product Settings
396 BLD_COMPANY="$BLD_COMPANY"
397 BLD_DEBUG=$BLD_DEBUG
398 BLD_DIRS="$BLD_DIRS"
399 BLD_HTTP_PORT=$BLD_HTTP_PORT
400 BLD_LIB_VERSION="$BLD_LIB_VERSION"
401 BLD_SSL_PORT=$BLD_SSL_PORT
402 BLD_CLEAN_INSTALL="$BLD_CLEAN_INSTALL"
403 BLD_LICENSE="$BLD_LICENSE"
404 BLD_COMMERCIAL="$BLD_COMMERCIAL"
407 # Host and Build System Settings.
409 BLD_HOST_SYSTEM="$BLD_HOST_SYSTEM"
410 BLD_BUILD_SYSTEM="$BLD_BUILD_SYSTEM"
413 # Host System Settings
415 BLD_HOST_OS=${IFQUOTE}$BLD_HOST_OS${IFQUOTE}
416 BLD_HOST_CPU_ARCH=$BLD_HOST_CPU_ARCH
417 BLD_HOST_CPU="$BLD_HOST_CPU"
418 BLD_HOST_UNIX=$BLD_HOST_UNIX
419 !EOF_CONFIG1
421 [ $BLD_HOST_OS = VXWORKS ] && echo "BLD_VX_ARCH=$BLD_VX_ARCH" >>$NAME
423 cat >>$NAME <<!EOF_CONFIG2
426 # Build System Settings for Build Tools
428 BLD_BUILD_OS=${IFQUOTE}$BLD_BUILD_OS${IFQUOTE}
429 BLD_BUILD_CPU_ARCH=$BLD_BUILD_CPU_ARCH
430 BLD_BUILD_CPU=$BLD_BUILD_CPU
431 BLD_BUILD_UNIX=$BLD_BUILD_UNIX
434 # System and Installation Directories
436 BLD_ROOT_PREFIX="$BLD_ROOT_PREFIX"
437 BLD_PREFIX="$BLD_PREFIX"
438 BLD_DOC_PREFIX="$BLD_DOC_PREFIX"
439 BLD_INC_PREFIX="$BLD_INC_PREFIX"
440 BLD_LIB_PREFIX="$BLD_LIB_PREFIX"
441 BLD_SBIN_PREFIX="$BLD_SBIN_PREFIX"
442 BLD_SRC_PREFIX="$BLD_SRC_PREFIX"
443 BLD_WEB_PREFIX="$BLD_WEB_PREFIX"
446 # Feature Selection
448 BLD_FEATURE_ACCESS_LOG=$BLD_FEATURE_ACCESS_LOG
449 BLD_FEATURE_ADMIN_MODULE=$BLD_FEATURE_ADMIN_MODULE
450 BLD_FEATURE_ASPNET_MODULE=$BLD_FEATURE_ASPNET_MODULE
451 BLD_FEATURE_ASSERT=$BLD_FEATURE_ASSERT
452 BLD_FEATURE_AUTH_MODULE=$BLD_FEATURE_AUTH_MODULE
453 BLD_FEATURE_C_API_MODULE=$BLD_FEATURE_C_API_MODULE
454 BLD_FEATURE_C_API_CLIENT=$BLD_FEATURE_C_API_CLIENT
455 BLD_FEATURE_CGI_MODULE=$BLD_FEATURE_CGI_MODULE
456 BLD_FEATURE_COMPAT_MODULE=$BLD_FEATURE_COMPAT_MODULE
457 BLD_FEATURE_CONFIG_PARSE=$BLD_FEATURE_CONFIG_PARSE
458 BLD_FEATURE_CONFIG_SAVE=$BLD_FEATURE_CONFIG_SAVE
459 BLD_FEATURE_COOKIE=$BLD_FEATURE_COOKIE
460 BLD_FEATURE_COPY_MODULE=$BLD_FEATURE_COPY_MODULE
461 BLD_FEATURE_DIGEST=$BLD_FEATURE_DIGEST
462 BLD_FEATURE_DLL=$BLD_FEATURE_DLL
463 BLD_FEATURE_EGI_MODULE=$BLD_FEATURE_EGI_MODULE
464 BLD_FEATURE_EJS=$BLD_FEATURE_EJS
465 BLD_FEATURE_ESP_MODULE=$BLD_FEATURE_ESP_MODULE
466 BLD_FEATURE_ESP3_MODULE=$BLD_FEATURE_ESP3_MODULE
467 BLD_FEATURE_EVAL_PERIOD=$BLD_FEATURE_EVAL_PERIOD
468 BLD_FEATURE_FLOATING_POINT=$BLD_FEATURE_FLOATING_POINT
469 BLD_FEATURE_IF_MODIFIED=$BLD_FEATURE_IF_MODIFIED
470 BLD_FEATURE_INT64=$BLD_FEATURE_INT64
471 BLD_FEATURE_KEEP_ALIVE=$BLD_FEATURE_KEEP_ALIVE
472 BLD_FEATURE_LEGACY_API=$BLD_FEATURE_LEGACY_API
473 BLD_FEATURE_LIB_STDCPP=$BLD_FEATURE_LIB_STDCPP
474 BLD_FEATURE_LICENSE=$BLD_FEATURE_LICENSE
475 BLD_FEATURE_LOG=$BLD_FEATURE_LOG
476 BLD_FEATURE_MULTITHREAD=$BLD_FEATURE_MULTITHREAD
477 BLD_FEATURE_MALLOC=$BLD_FEATURE_MALLOC
478 BLD_FEATURE_MALLOC_STATS=$BLD_FEATURE_MALLOC_STATS
479 BLD_FEATURE_MALLOC_LEAK=$BLD_FEATURE_MALLOC_LEAK
480 BLD_FEATURE_MALLOC_HOOK=$BLD_FEATURE_MALLOC_HOOK
481 BLD_FEATURE_NUM_TYPE=$BLD_FEATURE_NUM_TYPE
482 BLD_FEATURE_NUM_TYPE_ID=$BLD_FEATURE_NUM_TYPE_ID
483 BLD_FEATURE_ROMFS=$BLD_FEATURE_ROMFS
484 BLD_FEATURE_RUN_AS_SERVICE=$BLD_FEATURE_RUN_AS_SERVICE
485 BLD_FEATURE_SAFE_STRINGS=$BLD_FEATURE_SAFE_STRINGS
486 BLD_FEATURE_SAMPLES=$BLD_FEATURE_SAMPLES
487 BLD_FEATURE_SESSION=$BLD_FEATURE_SESSION
488 BLD_FEATURE_SHARED=$BLD_FEATURE_SHARED
489 BLD_FEATURE_SQUEEZE=$BLD_FEATURE_SQUEEZE
490 BLD_FEATURE_SSL_MODULE=$BLD_FEATURE_SSL_MODULE
491 BLD_FEATURE_STATIC=$BLD_FEATURE_STATIC
492 BLD_FEATURE_STATIC_LINK_LIBC=$BLD_FEATURE_STATIC_LINK_LIBC
493 BLD_FEATURE_TEST=$BLD_FEATURE_TEST
494 BLD_FEATURE_UPLOAD_MODULE=$BLD_FEATURE_UPLOAD_MODULE
495 BLD_FEATURE_XDB_MODULE=$BLD_FEATURE_XDB_MODULE
498 # Builtin Modules
500 BLD_FEATURE_ADMIN_MODULE_BUILTIN=$BLD_FEATURE_ADMIN_MODULE_BUILTIN
501 BLD_FEATURE_ASPNET_MODULE_BUILTIN=$BLD_FEATURE_ASPNET_MODULE_BUILTIN
502 BLD_FEATURE_AUTH_MODULE_BUILTIN=$BLD_FEATURE_AUTH_MODULE_BUILTIN
503 BLD_FEATURE_C_API_MODULE_BUILTIN=$BLD_FEATURE_C_API_MODULE_BUILTIN
504 BLD_FEATURE_CGI_MODULE_BUILTIN=$BLD_FEATURE_CGI_MODULE_BUILTIN
505 BLD_FEATURE_COMPAT_MODULE_BUILTIN=$BLD_FEATURE_COMPAT_MODULE_BUILTIN
506 BLD_FEATURE_COPY_MODULE_BUILTIN=$BLD_FEATURE_COPY_MODULE_BUILTIN
507 BLD_FEATURE_EGI_MODULE_BUILTIN=$BLD_FEATURE_EGI_MODULE_BUILTIN
508 BLD_FEATURE_ESP_MODULE_BUILTIN=$BLD_FEATURE_ESP_MODULE_BUILTIN
509 BLD_FEATURE_ESP3_MODULE_BUILTIN=$BLD_FEATURE_ESP3_MODULE_BUILTIN
510 BLD_FEATURE_SSL_MODULE_BUILTIN=$BLD_FEATURE_SSL_MODULE_BUILTIN
511 BLD_FEATURE_UPLOAD_MODULE_BUILTIN=$BLD_FEATURE_UPLOAD_MODULE_BUILTIN
512 BLD_FEATURE_XDB_MODULE_BUILTIN=$BLD_FEATURE_XDB_MODULE_BUILTIN
515 # Loadable Modules
517 BLD_FEATURE_ADMIN_MODULE_LOADABLE=$BLD_FEATURE_ADMIN_MODULE_LOADABLE
518 BLD_FEATURE_ASPNET_MODULE_LOADABLE=$BLD_FEATURE_ASPNET_MODULE_LOADABLE
519 BLD_FEATURE_AUTH_MODULE_LOADABLE=$BLD_FEATURE_AUTH_MODULE_LOADABLE
520 BLD_FEATURE_C_API_MODULE_LOADABLE=$BLD_FEATURE_C_API_MODULE_LOADABLE
521 BLD_FEATURE_CGI_MODULE_LOADABLE=$BLD_FEATURE_CGI_MODULE_LOADABLE
522 BLD_FEATURE_COMPAT_MODULE_LOADABLE=$BLD_FEATURE_COMPAT_MODULE_LOADABLE
523 BLD_FEATURE_COPY_MODULE_LOADABLE=$BLD_FEATURE_COPY_MODULE_LOADABLE
524 BLD_FEATURE_EGI_MODULE_LOADABLE=$BLD_FEATURE_EGI_MODULE_LOADABLE
525 BLD_FEATURE_ESP_MODULE_LOADABLE=$BLD_FEATURE_ESP_MODULE_LOADABLE
526 BLD_FEATURE_ESP3_MODULE_LOADABLE=$BLD_FEATURE_ESP3_MODULE_LOADABLE
527 BLD_FEATURE_SSL_MODULE_LOADABLE=$BLD_FEATURE_SSL_MODULE_LOADABLE
528 BLD_FEATURE_UPLOAD_MODULE_LOADABLE=$BLD_FEATURE_UPLOAD_MODULE_LOADABLE
529 BLD_FEATURE_XDB_MODULE_LOADABLE=$BLD_FEATURE_XDB_MODULE_LOADABLE
531 ################################################################################
533 # Programs for building tools to run on the build system (native)
535 BLD_AR_FOR_BUILD="$BLD_AR_FOR_BUILD"
536 BLD_CC_FOR_BUILD="$BLD_CC_FOR_BUILD"
537 BLD_CSC_FOR_BUILD="$BLD_CSC_FOR_BUILD"
538 BLD_JAVAC_FOR_BUILD="$BLD_JAVAC_FOR_BUILD"
539 BLD_LD_FOR_BUILD="$BLD_LD_FOR_BUILD"
540 BLD_RANLIB_FOR_BUILD="$BLD_RANLIB_FOR_BUILD"
541 BLD_NM_FOR_BUILD="$BLD_NM_FOR_BUILD"
544 # Native build flags
546 BLD_CFLAGS_FOR_BUILD="$BLD_CFLAGS_FOR_BUILD"
547 BLD_IFLAGS_FOR_BUILD="$BLD_IFLAGS_FOR_BUILD"
548 BLD_LDFLAGS_FOR_BUILD="$BLD_LDFLAGS_FOR_BUILD"
551 # Native file extensions
553 BLD_ARCHIVE_FOR_BUILD="$BLD_ARCHIVE_FOR_BUILD"
554 BLD_EXE_FOR_BUILD="$BLD_EXE_FOR_BUILD"
555 BLD_OBJ_FOR_BUILD="$BLD_OBJ_FOR_BUILD"
556 BLD_PIOBJ_FOR_BUILD="$BLD_PIOBJ_FOR_BUILD"
557 BLD_CLASS_FOR_BUILD="$BLD_CLASS_FOR_BUILD"
558 BLD_SHLIB_FOR_BUILD="$BLD_SHLIB_FOR_BUILD"
559 BLD_SHOBJ_FOR_BUILD="$BLD_SHOBJ_FOR_BUILD"
562 # Build programs for the host
564 BLD_AR_FOR_HOST="$BLD_AR_FOR_HOST"
565 BLD_CC_FOR_HOST="$BLD_CC_FOR_HOST"
566 BLD_CSC_FOR_HOST="$BLD_CSC_FOR_HOST"
567 BLD_JAVAC_FOR_HOST="$BLD_JAVAC_FOR_HOST"
568 BLD_LD_FOR_HOST="$BLD_LD_FOR_HOST"
569 BLD_RANLIB_FOR_HOST="$BLD_RANLIB_FOR_HOST"
570 BLD_NM_FOR_HOST="$BLD_NM_FOR_HOST"
573 # Build flags for the host
575 BLD_CFLAGS_FOR_HOST="$BLD_CFLAGS_FOR_HOST"
576 BLD_IFLAGS_FOR_HOST="$BLD_IFLAGS_FOR_HOST"
577 BLD_LDFLAGS_FOR_HOST="$BLD_LDFLAGS_FOR_HOST"
580 # File extensions for the host
582 BLD_ARCHIVE_FOR_HOST="$BLD_ARCHIVE_FOR_HOST"
583 BLD_EXE_FOR_HOST="$BLD_EXE_FOR_HOST"
584 BLD_OBJ_FOR_HOST="$BLD_OBJ_FOR_HOST"
585 BLD_PIOBJ_FOR_HOST="$BLD_PIOBJ_FOR_HOST"
586 BLD_CLASS_FOR_HOST="$BLD_CLASS_FOR_HOST"
587 BLD_SHLIB_FOR_HOST="$BLD_SHLIB_FOR_HOST"
588 BLD_SHOBJ_FOR_HOST="$BLD_SHOBJ_FOR_HOST"
590 !EOF_CONFIG2
592 [ $NAME = config.make ] && echo 'ifeq ($(BLD_NATIVE),1)' >>$NAME
593 [ $NAME = config.sh ] && echo -e 'if [ "${BLD_NATIVE}" = 1 ]\nthen' >>$NAME
595 if [ $NAME != config.h ]
596 then
597 cat >>$NAME <<!EOF_CONFIG3
599 # Build programs for building tools to run natively on the build system
601 BLD_AR="$BLD_AR_FOR_BUILD"
602 BLD_CC="$BLD_CC_FOR_BUILD"
603 BLD_CSC="$BLD_CSC_FOR_BUILD"
604 BLD_JAVAC="$BLD_JAVAC_FOR_BUILD"
605 BLD_LD="$BLD_LD_FOR_BUILD"
606 BLD_RANLIB="$BLD_RANLIB_FOR_BUILD"
607 BLD_NM="$BLD_NM_FOR_BUILD"
610 # Build flags
612 BLD_CFLAGS="$BLD_CFLAGS_FOR_BUILD"
613 BLD_IFLAGS="$BLD_IFLAGS_FOR_BUILD"
614 BLD_LDFLAGS="$BLD_LDFLAGS_FOR_BUILD"
617 # File extensions
619 BLD_ARCHIVE=$BLD_ARCHIVE_FOR_BUILD
620 BLD_EXE=$BLD_EXE_FOR_BUILD
621 BLD_OBJ=$BLD_OBJ_FOR_BUILD
622 BLD_PIOBJ=$BLD_PIOBJ_FOR_BUILD
623 BLD_CLASS=$BLD_CLASS_FOR_BUILD
624 BLD_SHLIB=$BLD_SHLIB_FOR_BUILD
625 BLD_SHOBJ=$BLD_SHOBJ_FOR_BUILD
626 !EOF_CONFIG3
629 if [ $NAME != config.h ]
630 then
631 if [ "${BLD_FEATURE_SHARED}" = "1" ]
632 then
633 echo " BLD_LIB=${BLD_SHOBJ_FOR_BUILD}" >>$NAME
634 elif [ "${BLD_FEATURE_STATIC}" = "1" ]
635 then
636 echo " BLD_LIB=Static${BLD_ARCHIVE}" >>$NAME
637 else
638 echo "Static or Shared must be defined"
639 exit 255
642 cat >>$NAME <<!EOF_CONFIG4
644 else
646 # Build programs on the host system
648 BLD_AR="$BLD_AR_FOR_HOST"
649 BLD_CC="$BLD_CC_FOR_HOST"
650 BLD_CSC="$BLD_CSC_FOR_HOST"
651 BLD_JAVAC="$BLD_JAVAC_FOR_HOST"
652 BLD_LD="$BLD_LD_FOR_HOST"
653 BLD_RANLIB="$BLD_RANLIB_FOR_HOST"
654 BLD_NM="$BLD_NM_FOR_HOST"
657 # Build flags for the host
659 BLD_CFLAGS="$BLD_CFLAGS_FOR_HOST"
660 BLD_IFLAGS="$BLD_IFLAGS_FOR_HOST"
661 BLD_LDFLAGS="$BLD_LDFLAGS_FOR_HOST"
664 # File extensions
666 BLD_ARCHIVE=$BLD_ARCHIVE_FOR_HOST
667 BLD_EXE=$BLD_EXE_FOR_HOST
668 BLD_OBJ=$BLD_OBJ_FOR_HOST
669 BLD_PIOBJ=$BLD_PIOBJ_FOR_HOST
670 BLD_CLASS=$BLD_CLASS_FOR_HOST
671 BLD_SHLIB=$BLD_SHLIB_FOR_HOST
672 BLD_SHOBJ=$BLD_SHOBJ_FOR_HOST
673 !EOF_CONFIG4
675 if [ "${BLD_FEATURE_SHARED}" = "1" ]
676 then
677 echo " BLD_LIB=${BLD_SHOBJ_FOR_HOST}" >>$NAME
678 elif [ "${BLD_FEATURE_STATIC}" = "1" ]
679 then
680 echo " BLD_LIB=Static${BLD_ARCHIVE_FOR_HOST}" >>$NAME
683 [ $NAME = config.make ] && echo -e 'endif\n' >>$NAME
684 [ $NAME = config.sh ] && echo -e 'fi\n' >>$NAME
687 echo -e "\n#\n# Ensure we run our build tools by preference\n#" >>$NAME
688 if [ "${NAME}" = "config.sh" ]
689 then
690 echo 'export PATH="${BLD_TOP}/bin:${BLD_TOP}/bin/${BLD_TYPE}:${PATH}"' >>$NAME
691 else
692 echo 'export PATH:=$(BLD_TOP)/bin:$(BLD_TOP)/bin/$(BLD_TYPE):$(PATH)' >>$NAME
694 echo >>$NAME
696 if [ "${BLD_HOST_OS}" = "WIN" ]
697 then
698 echo 'BLD_TOOLS_DIR="${BLD_TOP}/bin"' >>$NAME
699 echo 'BLD_BIN_DIR="${BLD_TOP}/bin/${BLD_TYPE}"' >>$NAME
700 echo 'BLD_INC_DIR="${BLD_TOP}/include"' >>$NAME
701 echo 'BLD_EXP_OBJ_DIR="${BLD_TOP}/obj/${BLD_TYPE}"' >>$NAME
702 else
703 echo 'BLD_TOOLS_DIR="${BLD_TOP}/bin"' >>$NAME
704 echo 'BLD_BIN_DIR="${BLD_TOP}/bin"' >>$NAME
705 echo 'BLD_INC_DIR="/usr/include/${BLD_PRODUCT}"' >>$NAME
706 echo 'BLD_EXP_OBJ_DIR="${BLD_TOP}/obj"' >>$NAME
708 echo >>$NAME
710 if [ $NAME = config.make ]
711 then
712 echo 'ifeq ($(EXPORT_OBJECTS),yes)' >>$NAME
713 echo ' BLD_OBJ_DIR=$(BLD_EXP_OBJ_DIR)' >>$NAME
714 echo 'else' >>$NAME
715 echo ' BLD_OBJ_DIR=.' >>$NAME
716 echo 'endif' >>$NAME
717 echo '' >>$NAME
720 for p in $BLD_PACKAGES
722 p=`echo ${p} | tr '[a-z]' '[A-Z]'`
723 eval module=$`echo BLD_FEATURE_${p}_MODULE`
724 eval moduleLoadable=$`echo BLD_FEATURE_${p}_MODULE_LOADABLE`
725 eval moduleBuiltin=$`echo BLD_FEATURE_${p}_MODULE_BUILTIN`
726 eval dir=$`echo BLD_${p}_DIR`
727 eval libs=$`echo BLD_${p}_LIBS`
728 eval iflags=$`echo BLD_${p}_IFLAGS`
729 eval cflags=$`echo BLD_${p}_CFLAGS`
730 eval ldflags=$`echo BLD_${p}_LDFLAGS`
732 if [ "$module" = "" ]
733 then
734 module=0
735 moduleBuiltin=0
736 moduleLoadable=0
737 else
738 if [ "$module" = "1" ]
739 then
740 if [ "$dir" = "" ]
741 then
742 echo "WARNING: BLD_${p}_DIR is not set."
743 echo "Use ./configure --with-${p}-dir=path"
745 if [ "$libs" = "" ]
746 then
747 echo "WARNING: BLD_${p}_LIBS is not set."
748 echo "Use ./configure --with-${p}-libs=libraries"
752 echo -e "#\n# ${p}\n#" >>$NAME
753 echo BLD_FEATURE_${p}_MODULE=${module} >>$NAME
754 echo BLD_FEATURE_${p}_MODULE_LOADABLE=${moduleLoadable} >>$NAME
755 echo BLD_FEATURE_${p}_MODULE_BUILTIN=${moduleBuiltin} >>$NAME
756 echo BLD_${p}_DIR=\'${dir}\' >>$NAME
757 echo BLD_${p}_LIBS=\'${libs}\' >>$NAME
758 echo BLD_${p}_IFLAGS=\'${iflags}\' >>$NAME
759 echo BLD_${p}_CFLAGS=\'${cflags}\' >>$NAME
760 echo BLD_${p}_LDFLAGS=\'${ldflags}\' >>$NAME
761 echo >>$NAME
762 done
766 ###############################################################################
768 help()
770 cat <<!EOF_HELP
772 usage: configure [OPTIONS]...
774 Installation directories:
775 When doing a "make install" the --prefix and --sbinDir are used. The other
776 directory options are not yet fully supported.
778 --prefix=PATH Set the default base installation directory for
779 the product.
780 Default is /etc/${BLD_PRODUCT} on Unix, /${BLD_PRODUCT} on Windows.
781 --sbinDir=PATH Set the directory for appWeb binaries.
782 "make install" will install to this location.
784 Not fully supported options:
785 --docDir=PATH Set the installation directory for the documentation.
786 --incDir=PATH Set the directory for include headers.
787 --libDir=PATH Set the directory for development libraries.
788 --srcDir=PATH Set the directory for source files.
789 --webDir=PATH Set the directory for web documents (DocumentRoot).
791 System types:
792 --build=BULID Configure for building on BUILD [Default is guessed].
793 BUILD format is cpu-vendor-os.
794 --host=HOST Cross-compile for ${BLD_PRODUCT} to run on HOST
795 [Default is set to BUILD]. HOST format is
796 cpu-vendor-os.
798 General:
799 --buildNumber=NUMBER Set the build number part of the version (1.0.0.X).
800 --defaults=FILE Set the file name of the defaults master in
801 conf/${BLD_PRODUCT}.
802 --help Display this message.
803 --name=NAME Set the full product name (BLD_NAME define).
804 --numType=TYPE Set the default number type for JavaScript.
805 (int|int64|float).
806 --port=PORT Set the default HTTP port to use for the product.
807 --product=NAME Set the one word (no spaces) name of the product.
808 --quiet, -q, --silent Run quietly.
809 --reset Reset all values to their defaults.
810 --setLibVersion=X.X.X Set the shared library version number.
811 --setVersion=X.X.X Set the product version number.
812 --sslPort=PORT Set the default SSL port to use for the product.
813 --type=BUILD Set the build type (DEBUG|RELEASE).
815 Optional Features:
816 --disable-FEATURE Do not include the FEATURE.
817 --enable-FEATURE Include the FEATURE.
819 --enable-access-log Enable logging of requests to the AppWeb access log.
820 --disable-access-log Do not log requests to the AppWeb access log.
822 --enable-assert Build with assert checking.
823 --disable-assert Do not build with assert checking.
825 --enable-c-api-client Build with the C API http client.
826 --disable-c-api-client Do not include the C API http client.
828 --enable-config-parse Build with the ability to parse Apache-style config
829 files to configure AppWeb.
830 --disable-config-parse Do not include the config file parser. AppWeb must
831 be configured programatically if this is disabled.
833 --enable-config-save Build with the ability to save AppWeb config files.
834 --disable-config-save Do not include the ability to save config files.
836 --enable-cookie Build with cookie handling support.
837 --disable-cookie Do not include cookie handling.
839 --enable-digest-auth Build with digest authentication support.
840 --disable-digest-auth Do not build with digest authentication.
842 --enable-ejs Include the EJS support for ESP.
843 --disable-ejs Do not include the EJS support for ESP.
845 --enable-fast-malloc Build with the Mbedthis fast malloc.
846 --disable-fast-malloc Do not include the fast malloc.
848 --enable-floating-point Build with floating point support in JavaScript.
849 --disable-floating-point Do not include floating point support.
851 --enable-if-modified Build with HTTP If-Modified checking.
852 --disable-if-modified Do not include HTTP If-Modified checking.
854 --enable-int64 Build with 64-bit integer support in JavaScript.
855 --disable-int64 Do not include 64-bit integer support.
857 --enable-keep-alive Build with HTTP Keep-Alive support.
858 --disable-keep-alive Do not include HTTP Keep-Alive handling.
860 --enable-legacy-api Build with legacy API support for backwards
861 compatibility.
862 --disable-legacy-api Do not build with legacy API support.
864 --enable-log Build with the AppWeb trace log facility.
865 --disable-log Do not build with the AppWeb trace log facility.
867 --enable-modules Build with the dynamically loaded modules capability.
868 --disable-modules Do not include the ability to load modules.
870 --enable-multi-thread Build AppWeb multi-threaded.
871 --disable-multi-thread Build AppWeb single threaded.
873 --enable-rom-fs Build with the ability to load web pages from ROM.
874 --disable-rom-fs Do not build the ability to load web pages from ROM.
876 --enable-run-as-service Build with the ability to run as a service/daemon.
877 --disable-run-as-service Do not include the ability to run as a service.
879 --enable-safe-strings Enforce safe string handling.
880 --disable-safe-strings Do not enforce safe string handling.
882 --enable-samples Build the samples
883 --disable-samples Do not build the samples
885 --enable-session Build with HTTP session support.
886 --disable-session Do not build with HTTP session support.
888 --enable-shared Build an ${BLD_PRODUCT} shared library and program. [default]
889 --disable-shared Do not build an ${BLD_PRODUCT} shared library and program.
891 --enable-shared-libc Link with the shared versions of libc.
892 --disable-shared-libc Link with the static versions of libc.
894 --enable-squeeze Build in squeeze mode for minimal memory footprint.
895 --disable-squeeze Build for speed.
897 --enable-static Build a static ${BLD_PRODUCT} library and program. [default]
898 --disable-static Do not build a static ${BLD_PRODUCT} library and program.
900 --enable-test Build with test framework.
901 --disable-test Do not build with test framework.
903 Optional Modules:
904 --with-admin Include the admin handler.
905 --without-admin Do not include the admin handler.
907 --with-aspnet Include the ASP.NET handler.
908 --without-aspnet Do not include the ASP.NET handler.
910 --with-auth Include the authorization handler.
911 --without-auth Do not include the authorization handler.
913 --with-c-api Include the C API.
914 --without-c-api Do not include the C API.
916 --with-cgi Include the CGI handler.
917 --without-cgi Do not include the CGI handler.
919 --with-gacompat Include GoAhead WebServer API compatibility.
920 --without-gacompat Do not include GoAhead WebServer API compatibility.
922 --with-copy Build support for the copy handler.
923 --without-copy Do not include support for the copy handler.
925 --with-egi Include the EGI handler.
926 --without-egi Do not include the EGI handler.
928 --with-esp Include the ESP V2 handler.
929 --without-esp Do not include the ESP V2 handler.
931 --with-esp3 Include the ESP V3 handler.
932 --without-esp3 Do not include the ESP V3 handler.
934 --with-ssl Build support for the SSL protocol.
935 --without-ssl Do not include support for the SSL protocol.
937 --with-upload Build with the file upload handler
938 --without-upload Do not include the upload handler
940 --with-xdb Build with XDB
941 --without-xdb Do not include XDB
943 Optional Packages:
944 Supported PACKAGE names: matrixssl, openssl, php5
946 --with-PACKAGE=[builtin|, module]
947 Include support for the PACKAGE. Link into ${BLD_PRODUCT}
948 statically and/or build as a module
949 --with-PACKAGE-dir=DIR Set the source directory of the package
950 --with-PACKAGE-libs=libs Set a list of libraries to use when linking with
951 the PACKAGE
952 --with-PACKAGE-cflags=FLAGS Set the compiler flags for the PACKAGE
953 --with-PACKAGE-iflags=FLAGS Set the compiler include flags for the PACKAGE
954 --with-PACKAGE-ldflags=FLAGS Set the linker flags for the PACKAGE
955 --without-PACKAGE Do not include support for the PACKAGE
957 Some important environment variables that may be defined to control
958 building for the destination host. Note that environment variables will have
959 no effect when passed into makefiles, they must be passed via configure.
961 AR Archiver command
962 CC C/C++ compiler command.
963 LD Linker command.
964 RANLIB The ranlib command.
965 NM The nm command.
966 CFLAGS Compiler flags for compilation
967 IFLAGS Preprocessor and include flags.
968 LDFLAGS Linker flags. For example: use -L<dir> to specify
969 where to find libraries in non-standard directories.
971 These variables are for native compilation of tools needed by the build
972 process.
973 CC_FOR_BUILD C/C++ compiler to use for native /local compilation
974 and linking on the build system.
975 LD_FOR_BUILD Linker to use for native /local linking on the
976 build system.
977 !EOF_HELP
980 ###############################################################################
982 # Some shells don't have a standard getopts. Must supply our own.
984 # Spec chars: ';' == no arg, ':' required arg, '.' optional arg
987 getoptex()
989 let $# || return 1
990 local optlist="${1#;}"
991 let OPTIND || OPTIND=1
992 [ $OPTIND -lt $# ] || return 1
993 shift $OPTIND
994 if [ "$1" != "-" -a "$1" != "${1#-}" ]
995 then OPTIND=$[OPTIND+1]; if [ "$1" != "--" ]
996 then
997 local o
998 o="-${1#-$OPTOFS}"
999 for opt in ${optlist#;}
1001 OPTOPT="${opt%[;.:]}"
1002 unset OPTARG
1003 local opttype="${opt##*[^;:.]}"
1004 [ -z "$opttype" ] && opttype=";"
1005 if [ ${#OPTOPT} -gt 1 ]
1006 then # long-named option
1007 case $o in
1008 "--$OPTOPT")
1009 if [ "$opttype" != ":" ]; then return 0; fi
1010 OPTARG="$2"
1011 if [ "$OPTARG" != "${OPTARG#-}" ];
1012 then # error: must have an agrument
1013 let OPTERR && \
1014 echo "$0: error: $OPTOPT must have an argument" >&2
1015 OPTARG="$OPTOPT";
1016 OPTOPT="?"
1017 return 0;
1019 OPTIND=$[OPTIND+1] # skip option's argument
1020 return 0
1022 "--$OPTOPT="*)
1023 if [ "$opttype" = ";" ];
1024 then # error: must not have arguments
1025 let OPTERR && \
1026 echo "$0: error: $OPTOPT must not have arguments" >&2
1027 OPTARG="$OPTOPT"
1028 OPTOPT="?"
1029 return 0
1031 OPTARG=${o#"--$OPTOPT="}
1032 return 0
1034 esac
1035 else # short-named option
1036 case "$o" in
1037 "-$OPTOPT")
1038 unset OPTOFS
1039 [ "$opttype" != ":" ] && return 0
1040 OPTARG="$2"
1041 if [ -z "$OPTARG" ]
1042 then
1043 echo "$0: error: -$OPTOPT must have an argument" >&2
1044 OPTARG="$OPTOPT"
1045 OPTOPT="?"
1046 return 0
1048 OPTIND=$[OPTIND+1] # skip option's argument
1049 return 0
1051 "-$OPTOPT"*)
1052 if [ $opttype = ";" ]
1053 then
1054 # option with no argument is in a chain of options
1055 # move to the next option in the chain
1056 # the chain still has other options
1057 OPTOFS="$OPTOFS?"
1058 OPTIND=$[OPTIND-1]
1059 return 0
1060 else
1061 unset OPTOFS
1062 OPTARG="${o#-$OPTOPT}"
1063 return 0
1066 esac
1068 done
1069 echo "$0: error: Invalid option: $o"
1070 exit 255
1071 break
1072 fi; fi
1073 OPTOPT="?"
1074 unset OPTARG
1075 return 1
1078 ###############################################################################
1080 # Usage: parseSystem in-String out-cpu out-vendor out-os
1083 parseSystem() {
1084 cpu=${1%%-*}
1085 vendor=${1##${cpu}-}
1086 vendor=${vendor%%-*}
1087 kernel=${1##${cpu}-${vendor}-}
1088 os=${kernel##*-}
1089 kernel=${kernel%%-*}
1091 if [ "$kernel" != "" ]
1092 then
1093 os=$kernel
1096 os=`echo $os | tr '[:lower:]' '[:upper:]'`
1098 # if [ "${cpu}" = "i386" -o "${cpu}" = "i386" -o "${cpu}" = "i486" -o \
1099 # "${cpu}" = "i586" -o "${cpu}" = "i686" -o "${cpu}" = "i786" ]
1100 # then
1101 # cpu=i386
1102 # fi
1104 case "${os}" in
1105 CYGWIN*)
1106 os=WIN
1108 SOLARIS*)
1109 os=SOLARIS
1111 esac
1113 eval ${2}=$cpu
1114 eval ${3}=$vendor
1115 eval ${4}=$os
1118 ###############################################################################
1120 # Convert a path to a canonical form (Windows: with drive spec)
1123 canonPath() {
1125 dir="$1"
1126 type cygpath >/dev/null 2>&1
1127 if [ $? = 0 ]
1128 then
1129 if [ "${dir/:}" = "${dir}" ]
1130 then
1131 # Add a drive spec and convert to use forward slashes
1132 root=`cygpath -m / | sed -e 's/:.*//'`
1133 echo "${root}:${dir}"
1134 else
1135 # Convert to use forward slashes
1136 cygpath -m "${dir}"
1138 else
1139 echo "$dir"
1143 ###############################################################################
1145 # Remove an old prefix from a path and prepend a new prefix
1148 remapDir() {
1150 dir="$1"
1151 oldPath="$2"
1152 newPath="$3"
1154 type cygpath >/dev/null 2>&1
1155 if [ $? = 0 ]
1156 then
1157 dir=`cygpath -m "$dir"`
1158 oldPath=`cygpath -m "$oldPath"`
1159 newPath=`cygpath -m "$newPath"`
1162 if [ "${dir##$oldPath}" != "$dir" ]
1163 then
1164 echo "${newPath}${dir##$oldPath}"
1165 else
1166 echo "${dir}"
1170 ###############################################################################
1172 # Main
1174 quiet=0
1175 help=0
1177 checkSetup
1180 # Pre-parse the build and host settings
1182 CMD_LINE="$@"
1183 ARGS="\
1184 build: \
1185 buildNumber: \
1186 defaults: \
1187 disable-access-log \
1188 disable-assert \
1189 disable-c-api-client \
1190 disable-config-parse \
1191 disable-config-save \
1192 disable-cookie \
1193 disable-digest-auth \
1194 disable-ejs \
1195 disable-fast-malloc \
1196 disable-floating-point \
1197 disable-if-modified \
1198 disable-int64 \
1199 disable-keep-alive \
1200 disable-legacy-api \
1201 disable-log \
1202 disable-modules \
1203 disable-multi-thread \
1204 disable-multithread \
1205 disable-rom-fs \
1206 disable-run-as-service \
1207 disable-safe-strings \
1208 disable-samples \
1209 disable-session \
1210 disable-shared \
1211 disable-shared-libc \
1212 disable-squeeze \
1213 disable-static \
1214 disable-test \
1215 docDir: \
1216 enable-access-log \
1217 enable-assert \
1218 enable-c-api-client \
1219 enable-cookie \
1220 enable-config-parse \
1221 enable-config-save \
1222 enable-digest-auth \
1223 enable-ejs \
1224 enable-fast-malloc \
1225 enable-floating-point \
1226 enable-if-modified \
1227 enable-int64 \
1228 enable-keep-alive \
1229 enable-legacy-api \
1230 enable-log \
1231 enable-modules \
1232 enable-multi-thread \
1233 enable-multithread \
1234 enable-rom-fs \
1235 enable-run-as-service \
1236 enable-samples \
1237 enable-safe-strings \
1238 enable-session \
1239 enable-shared \
1240 enable-squeeze \
1241 enable-static \
1242 enable-shared-libc \
1243 enable-test \
1244 help \
1245 host: \
1246 incDir: \
1247 libDir: \
1248 name: \
1249 numType: \
1250 port: \
1251 prefix: \
1252 product: \
1253 quiet \
1254 reset \
1255 sbinDir: \
1256 setLibVersion: \
1257 setVersion: \
1258 silent \
1259 srcDir: \
1260 sslPort: \
1261 type: \
1262 version \
1263 webDir: \
1264 with-admin: \
1265 with-aspnet: \
1266 with-auth: \
1267 with-c-api: \
1268 with-c_api: \
1269 with-cgi: \
1270 with-gacompat: \
1271 with-copy: \
1272 with-egi: \
1273 with-esp: \
1274 with-esp3: \
1275 with-matrixssl: \
1276 with-matrixssl-dir: \
1277 with-matrixssl-libs: \
1278 with-matrixssl-cflags: \
1279 with-matrixssl-iflags: \
1280 with-matrixssl-ldflags: \
1281 with-openssl: \
1282 with-openssl-dir: \
1283 with-openssl-libs: \
1284 with-openssl-cflags: \
1285 with-openssl-iflags: \
1286 with-openssl-ldflags: \
1287 with-php4: \
1288 with-php4-dir: \
1289 with-php4-libs: \
1290 with-php4-cflags: \
1291 with-php4-iflags: \
1292 with-php4-ldflags: \
1293 with-php5: \
1294 with-php5-dir: \
1295 with-php5-libs: \
1296 with-php5-cflags: \
1297 with-php5-iflags: \
1298 with-php5-ldflags: \
1299 with-upload: \
1300 with-ssl: \
1301 with-xdb: \
1302 without-admin \
1303 without-aspnet \
1304 without-auth \
1305 without-c-api \
1306 without-c_api \
1307 without-cgi \
1308 without-gacompat \
1309 without-copy \
1310 without-egi \
1311 without-esp \
1312 without-esp3 \
1313 without-matrixssl \
1314 without-openssl \
1315 without-php4 \
1316 without-php5 \
1317 without-ssl \
1318 without-upload \
1319 without-xdb."
1322 # Clear out cached configuration if user specifies any major options:
1323 # build/defaults/host/products
1325 unset OPTIND
1326 while getoptex "$ARGS" "$@"
1328 case "$OPTOPT" in
1329 build)
1330 system=`conf/config.sub ${OPTARG}`
1331 if [ $? != 0 -o "$system" = "" ]
1332 then
1333 echo "configure: Can't recognize build system: $OPTARG"
1334 exit 2
1336 BLD_BUILD_SYSTEM=${system}
1337 rm -f conf/config.cache
1339 defaults)
1340 BLD_DEFAULTS=${OPTARG}
1341 if [ "${BLD_PRODUCT}" = "" ]
1342 then
1343 echo "configure: must specify --product before --defaults"
1344 exit 2
1346 if [ ! -f "conf/${BLD_PRODUCT}/${BLD_DEFAULTS}.defaults" ]
1347 then
1348 echo "configure: Can't find conf/${BLD_PRODUCT}/${BLD_DEFAULTS}.defaults"
1349 exit 2
1351 rm -f conf/config.defaults
1352 rm -f conf/config.cache
1353 linkFile "conf/${BLD_PRODUCT}/${BLD_DEFAULTS}.defaults" \
1354 conf/config.defaults
1355 unset BLD_AR BLD_CC BLD_CC_FOR_BUILD BLD_LD BLD_LD_FOR_BUILD BLD_RANLIB
1356 unset BLD_CFLAGS BLD_IFLAGS BLD_LDFLAGS BLD_NM
1358 host)
1359 system=`conf/config.sub ${OPTARG}`
1360 if [ $? != 0 -o "$system" = "" ]
1361 then
1362 echo "configure: Can't recognize host system configuration: $OPTARG"
1363 exit 2
1365 BLD_HOST_SYSTEM=${system}
1366 rm -f conf/config.cache
1368 product)
1369 BLD_PRODUCT=${OPTARG}
1370 rm -f conf/config.defaults
1371 rm -f conf/config.cache
1374 quiet=1
1376 quiet)
1377 quiet=1
1379 reset)
1380 rm -f conf/config.cache
1381 unset BLD_AR BLD_CC BLD_CC_FOR_BUILD BLD_LD BLD_LD_FOR_BUILD BLD_RANLIB
1382 unset BLD_CFLAGS BLD_IFLAGS BLD_LDFLAGS BLD_NM
1385 echo -e "\nTry: ./configure --help"
1386 exit 255
1390 esac
1391 done
1394 # Get the product and configuration defaults file
1396 firstTimeBuild
1399 # Read in past cached settings (or initial defaults)
1401 if [ -f conf/config.cache ]
1402 then
1404 # Cache files save the host and build system details. Must save here
1405 # if they have been specified by the user's command line
1407 [ "$BLD_HOST_SYSTEM" ] && saveHostSystem=$BLD_HOST_SYSTEM
1408 [ "$BLD_BUILD_SYSTEM" ] && saveBuildSystem=$BLD_BUILD_SYSTEM
1409 BASE="conf/config.cache"
1410 [ "$saveHostSystem" ] && BLD_HOST_SYSTEM=$saveHostSystem
1411 [ "$saveBuildSystem" ] && BLD_BUILD_SYSTEM=$saveBuildSystem
1412 else
1414 # Defaults files do not specify the build and host system configurations.
1415 # If the user has not specified the system configurations on the command
1416 # line, we guess here.
1418 [ "$BLD_HOST_SYSTEM" = "" ] && BLD_HOST_SYSTEM=`conf/config.guess`
1419 [ "$BLD_BUILD_SYSTEM" = "" ] && BLD_BUILD_SYSTEM=`conf/config.guess`
1420 setSystemConfiguration ${BLD_HOST_SYSTEM} \
1421 BLD_HOST_OS BLD_HOST_UNIX BLD_HOST_CPU BLD_HOST_CPU_ARCH
1422 setSystemConfiguration ${BLD_BUILD_SYSTEM} BLD_BUILD_OS BLD_BUILD_UNIX \
1423 BLD_BUILD_CPU BLD_BUILD_CPU_ARCH
1424 BASE="conf/config.defaults"
1428 # Read the base configuration (either config.cache or config.defaults)
1430 . $BASE
1433 # Re-parse the build and host system configurations. We do this if the
1434 # user has modified the system configuration via the command line.
1436 setSystemConfiguration ${BLD_HOST_SYSTEM} \
1437 BLD_HOST_OS BLD_HOST_UNIX BLD_HOST_CPU BLD_HOST_CPU_ARCH
1438 setSystemConfiguration ${BLD_BUILD_SYSTEM} BLD_BUILD_OS BLD_BUILD_UNIX \
1439 BLD_BUILD_CPU BLD_BUILD_CPU_ARCH
1441 if [ $BLD_DEFAULTS = release -a -f ${BLD_TOP}/mbedthis ]
1442 then
1443 if [ $BLD_HOST_CPU != i386 ]
1444 then
1445 echo
1446 echo "configure: WARNING: You are doing a non-generic i386 build."
1447 echo " You are building for $BLD_BUILD_SYSTEM instead of i386. "
1451 if [ $quiet = 0 ]
1452 then
1453 echo
1454 echo " # Configuring ${BLD_PRODUCT}"
1455 echo " # Base configuration: conf/${BLD_PRODUCT}/${BLD_DEFAULTS}.defaults"
1456 echo " # Host system: ${BLD_HOST_SYSTEM}"
1457 echo " # Build system: ${BLD_BUILD_SYSTEM}"
1460 unset OPTIND
1461 while getoptex "$ARGS" "$@"
1464 # Peek at the args to do some prep work
1466 case "$OPTOPT" in
1467 without*)
1469 with*-dir)
1471 with*-libs)
1473 with*-cflags)
1475 with*-iflags)
1477 with*-ldflags)
1479 with*)
1480 BUILTIN=0
1481 LOADABLE=0
1482 MODULE=`echo ${OPTOPT#with-} | tr '[:lower:]' '[:upper:]'`
1483 MODULE=`echo $MODULE | sed 's/-/_/g'`
1484 [ "${OPTARG/builtin/}" != "${OPTARG}" ] && BUILTIN=1
1485 [ "${OPTARG/loadable/}" != "${OPTARG}" ] && LOADABLE=1
1486 if [ $BUILTIN = 0 -a $LOADABLE = 0 ]
1487 then
1488 echo "configure: missing parameter for: $OPTOPT=$OPTARG"
1489 echo ' Must supply either "loadable" or "builtin"'
1490 echo " E.g: configure $OPTOPT=loadable"
1491 exit 2
1493 eval BLD_FEATURE_${MODULE}_MODULE_BUILTIN=$BUILTIN
1494 eval BLD_FEATURE_${MODULE}_MODULE_LOADABLE=$LOADABLE
1496 esac
1499 # Parse the args
1501 case "$OPTOPT" in
1502 build)
1503 # Done above
1506 buildNumber)
1507 BLD_NUMBER=${OPTARG}
1509 defaults)
1510 # Done above
1512 disable-access-log)
1513 BLD_FEATURE_ACCESS_LOG=0
1515 disable-assert)
1516 BLD_FEATURE_ASSERT=0
1518 disable-c-api-client)
1519 BLD_FEATURE_C_API_CLIENT=0
1521 disable-config-save)
1522 BLD_FEATURE_CONFIG_SAVE=0
1524 disable-config-parse)
1525 BLD_FEATURE_CONFIG_PARSE=0
1527 disable-cookie)
1528 BLD_FEATURE_COOKIE=0
1530 disable-digest-auth)
1531 BLD_FEATURE_DIGEST=0
1533 disable-ejs)
1534 BLD_FEATURE_EJS=0
1536 disable-fast-malloc)
1537 BLD_FEATURE_MALLOC=0
1538 BLD_FEATURE_MALLOC_STATS=0
1539 BLD_FEATURE_MALLOC_LEAK=0
1540 BLD_FEATURE_MALLOC_HOOK=0
1542 disable-floating-point)
1543 BLD_FEATURE_FLOATING_POINT=0
1545 disable-if-modified)
1546 BLD_FEATURE_IF_MODIFIED=0
1548 disable-int64)
1549 BLD_FEATURE_INT64=0
1551 disable-keep-alive)
1552 BLD_FEATURE_KEEP_ALIVE=0
1554 disable-legacy-api)
1555 BLD_FEATURE_LEGACY_API=0
1557 disable-log)
1558 BLD_FEATURE_LOG=0
1560 disable-modules)
1561 BLD_FEATURE_DLL=0
1562 if [ $quiet = 0 ]
1563 then
1564 echo " #"
1565 echo -e " # WARNING: Making all modules builtin."
1566 echo " #"
1568 BLD_FEATURE_ADMIN_MODULE_BUILTIN=${BLD_FEATURE_ADMIN_MODULE}
1569 BLD_FEATURE_ASPNET_MODULE_BUILTIN=${BLD_FEATURE_ASPNET_MODULE}
1570 BLD_FEATURE_AUTH_MODULE_BUILTIN=${BLD_FEATURE_AUTH_MODULE}
1571 BLD_FEATURE_CGI_MODULE_BUILTIN=${BLD_FEATURE_CGI_MODULE}
1572 BLD_FEATURE_C_API_MODULE_BUILTIN=${BLD_FEATURE_C_API_MODULE}
1573 BLD_FEATURE_COMPAT_MODULE_BUILTIN=${BLD_FEATURE_COMPAT_MODULE}
1574 BLD_FEATURE_COPY_MODULE_BUILTIN=${BLD_FEATURE_COPY_MODULE}
1575 BLD_FEATURE_EGI_MODULE_BUILTIN=${BLD_FEATURE_EGI_MODULE}
1576 BLD_FEATURE_ESP_MODULE_BUILTIN=${BLD_FEATURE_ESP_MODULE}
1577 BLD_FEATURE_ESP3_MODULE_BUILTIN=${BLD_FEATURE_ESP3_MODULE}
1578 BLD_FEATURE_MATRIXSSL_MODULE_BUILTIN=${BLD_FEATURE_MATRIXSSL_MODULE}
1579 BLD_FEATURE_OPENSSL_MODULE_BUILTIN=${BLD_FEATURE_OPENSSL_MODULE}
1580 BLD_FEATURE_PHP4_MODULE_BUILTIN=${BLD_FEATURE_PHP4_MODULE}
1581 BLD_FEATURE_PHP5_MODULE_BUILTIN=${BLD_FEATURE_PHP5_MODULE}
1582 BLD_FEATURE_SSL_MODULE_BUILTIN=${BLD_FEATURE_SSL_MODULE}
1583 BLD_FEATURE_UPLOAD_MODULE_BUILTIN=${BLD_FEATURE_UPLOAD_MODULE}
1584 BLD_FEATURE_XDB_MODULE_BUILTIN=${BLD_FEATURE_XDB_MODULE}
1586 BLD_FEATURE_ADMIN_MODULE_LOADABLE=0
1587 BLD_FEATURE_ASPNET_MODULE_LOADABLE=0
1588 BLD_FEATURE_AUTH_MODULE_LOADABLE=0
1589 BLD_FEATURE_CGI_MODULE_LOADABLE=0
1590 BLD_FEATURE_C_API_MODULE_LOADABLE=0
1591 BLD_FEATURE_COMPAT_MODULE_LOADABLE=0
1592 BLD_FEATURE_COPY_MODULE_LOADABLE=0
1593 BLD_FEATURE_EGI_MODULE_LOADABLE=0
1594 BLD_FEATURE_ESP_MODULE_LOADABLE=0
1595 BLD_FEATURE_ESP3_MODULE_LOADABLE=0
1596 BLD_FEATURE_MATRIXSSL_MODULE_LOADABLE=0
1597 BLD_FEATURE_OPENSSL_MODULE_LOADABLE=0
1598 BLD_FEATURE_PHP4_MODULE_LOADABLE=0
1599 BLD_FEATURE_PHP5_MODULE_LOADABLE=0
1600 BLD_FEATURE_SSL_MODULE_LOADABLE=0
1601 BLD_FEATURE_UPLOAD_MODULE_LOADABLE=0
1602 BLD_FEATURE_XDB_MODULE_LOADABLE=0
1604 disable-multi-thread|disable-multithread)
1605 BLD_FEATURE_MULTITHREAD=0
1607 disable-rom-fs)
1608 BLD_FEATURE_ROMFS=0
1610 disable-run-as-service)
1611 BLD_FEATURE_RUN_AS_SERVICE=0
1613 disable-safe-strings)
1614 BLD_FEATURE_SAFE_STRINGS=0
1616 disable-samples)
1617 BLD_FEATURE_SAMPLES=0
1619 disable-session)
1620 BLD_FEATURE_SESSION=0
1622 disable-shared)
1623 BLD_FEATURE_SHARED=0
1625 disable-shared-libc)
1626 BLD_FEATURE_STATIC_LINK_LIBC=1
1628 disable-squeeze)
1629 BLD_FEATURE_SQUEEZE=0
1631 disable-static)
1632 BLD_FEATURE_STATIC=0
1634 disable-test)
1635 BLD_FEATURE_TEST=0
1637 enable-access-log)
1638 BLD_FEATURE_ACCESS_LOG=1
1640 enable-assert)
1641 BLD_FEATURE_ASSERT=1
1643 enable-c-api-client)
1644 BLD_FEATURE_C_API_CLIENT=1
1646 enable-config-parse)
1647 BLD_FEATURE_CONFIG_PARSE=1
1649 enable-config-save)
1650 BLD_FEATURE_CONFIG_SAVE=1
1652 enable-cookie)
1653 BLD_FEATURE_COOKIE=1
1655 enable-digest-auth)
1656 BLD_FEATURE_DIGEST=1
1658 enable-ejs)
1659 BLD_FEATURE_EJS=1
1661 enable-modules)
1662 BLD_FEATURE_DLL=1
1664 enable-shared)
1665 BLD_FEATURE_SHARED=1
1667 enable-shared-libc)
1668 BLD_FEATURE_STATIC_LINK_LIBC=0
1670 enable-fast-malloc)
1671 BLD_FEATURE_MALLOC=1
1672 BLD_FEATURE_MALLOC_STATS=1
1673 BLD_FEATURE_MALLOC_LEAK=1
1674 BLD_FEATURE_MALLOC_HOOK=0
1676 enable-floating-point)
1677 BLD_FEATURE_FLOATING_POINT=1
1679 enable-if-modified)
1680 BLD_FEATURE_IF_MODIFIED=1
1682 enable-int64)
1683 BLD_FEATURE_INT64=1
1685 enable-keep-alive)
1686 BLD_FEATURE_KEEP_ALIVE=1
1688 enable-legacy-api)
1689 BLD_FEATURE_LEGACY_API=1
1691 enable-log)
1692 BLD_FEATURE_LOG=1
1694 enable-multi-thread|enable-multithread)
1695 BLD_FEATURE_MULTITHREAD=1
1697 enable-rom-fs)
1698 BLD_FEATURE_ROMFS=1
1700 enable-run-as-service)
1701 BLD_FEATURE_RUN_AS_SERVICE=1
1703 enable-safe-strings)
1704 BLD_FEATURE_SAFE_STRINGS=1
1706 enable-samples)
1707 BLD_FEATURE_SAMPLES=1
1709 enable-session)
1710 BLD_FEATURE_COOKIE=1
1711 BLD_FEATURE_SESSION=1
1713 enable-squeeze)
1714 BLD_FEATURE_SQUEEZE=1
1716 enable-static)
1717 BLD_FEATURE_STATIC=1
1719 enable-test)
1720 BLD_FEATURE_TEST=1
1722 help)
1723 help=1
1725 host)
1726 # Done above
1729 docDir)
1730 BLD_DOC_PREFIX=`canonPath ${OPTARG}`
1732 incDir)
1733 BLD_INC_PREFIX=`canonPath ${OPTARG}`
1735 libDir)
1736 BLD_LIB_PREFIX=`canonPath ${OPTARG}`
1738 name)
1739 BLD_NAME=${OPTARG}
1741 numType)
1742 BLD_FEATURE_NUM_TYPE=${OPTARG}
1743 if [ "${OPTARG}" = "int" ]
1744 then
1745 BLD_FEATURE_NUM_TYPE_ID=MPR_INT
1746 elif [ "${OPTARG}" = "int64" ]
1747 then
1748 BLD_FEATURE_NUM_TYPE_ID=MPR_INT64
1749 elif [ "${OPTARG}" = "float" ]
1750 then
1751 BLD_FEATURE_NUM_TYPE_ID=MPR_FLOAT
1752 else
1753 echo "configure: bad number type for --numType: ${OPTARG}"
1754 exit 2
1757 port)
1758 BLD_HTTP_PORT=${OPTARG}
1760 prefix)
1761 BLD_DOC_PREFIX=`remapDir "$BLD_DOC_PREFIX" "$BLD_PREFIX" "$OPTARG"`
1762 BLD_INC_PREFIX=`remapDir "$BLD_INC_PREFIX" "$BLD_PREFIX" "$OPTARG"`
1763 BLD_LIB_PREFIX=`remapDir "$BLD_LIB_PREFIX" "$BLD_PREFIX" "$OPTARG"`
1764 BLD_ROOT_PREFIX=`remapDir "$BLD_ROOT_PREFIX" "$BLD_PREFIX" "$OPTARG"`
1765 BLD_SBIN_PREFIX=`remapDir "$BLD_SBIN_PREFIX" "$BLD_PREFIX" "$OPTARG"`
1766 BLD_SRC_PREFIX=`remapDir "$BLD_SRC_PREFIX" "$BLD_PREFIX" "$OPTARG"`
1767 BLD_WEB_PREFIX=`remapDir "$BLD_WEB_PREFIX" "$BLD_PREFIX" "$OPTARG"`
1768 BLD_PREFIX=`canonPath "${OPTARG}"`
1770 product)
1771 # Done above
1774 # Done above
1776 quiet)
1777 # Done above
1779 reset)
1780 # Done above
1782 sbinDir)
1783 BLD_SBIN_PREFIX=`canonPath ${OPTARG}`
1785 setLibVersion)
1786 BLD_LIB_VERSION=${OPTARG}
1788 setVersion)
1789 BLD_VERSION=${OPTARG}
1791 silent)
1792 quiet=1
1794 srcDir)
1795 BLD_SRC_PREFIX=`canonPath ${OPTARG}`
1797 sslPort)
1798 BLD_SSL_PORT=${OPTARG}
1800 type)
1801 BLD_TYPE=${OPTARG}
1802 [ $BLD_TYPE = "debug" ] && BLD_TYPE=DEBUG
1803 [ $BLD_TYPE = "release" ] && BLD_TYPE=RELEASE
1804 if [ $BLD_TYPE = "DEBUG" ]
1805 then
1806 BLD_DEBUG=1
1807 else
1808 BLD_DEBUG=0
1812 echo $CONFIG_VERSION
1813 exit 0
1815 version)
1816 echo $CONFIG_VERSION
1817 exit 0
1819 webDir)
1820 BLD_WEB_PREFIX=`canonPath ${OPTARG}`
1822 with-admin)
1823 BLD_FEATURE_ADMIN_MODULE=1
1825 with-aspnet)
1826 BLD_FEATURE_ASPNET_MODULE=1
1828 with-auth)
1829 BLD_FEATURE_AUTH_MODULE=1
1831 with-c-api|with-c_api)
1832 BLD_FEATURE_C_API_MODULE=1
1834 with-cgi)
1835 BLD_FEATURE_CGI_MODULE=1
1837 with-gacompat)
1838 BLD_FEATURE_COMPAT_MODULE=1
1839 BLD_FEATURE_EJS=1
1840 BLD_FEATURE_ESP_MODULE=1
1841 BLD_FEATURE_EGI_MODULE=1
1842 BLD_FEATURE_C_API_MODULE=1
1844 with-copy)
1845 BLD_FEATURE_COPY_MODULE=1
1847 with-egi)
1848 BLD_FEATURE_EGI_MODULE=1
1849 BLD_FEATURE_C_API_MODULE=1
1851 with-esp)
1852 BLD_FEATURE_EJS=1
1853 BLD_FEATURE_ESP_MODULE=1
1854 BLD_FEATURE_ESP_MODULE_BUILTIN=$BUILTIN
1855 BLD_FEATURE_ESP_MODULE_LOADABLE=$LOADABLE
1857 with-esp3)
1858 BLD_FEATURE_EJS=1
1859 BLD_FEATURE_ESP3_MODULE=1
1860 BLD_FEATURE_ESP3_MODULE_BUILTIN=$BUILTIN
1861 BLD_FEATURE_ESP3_MODULE_LOADABLE=$LOADABLE
1863 with-matrixssl)
1864 BLD_FEATURE_MATRIXSSL_MODULE=1
1865 BLD_FEATURE_SSL_MODULE=1
1866 BLD_FEATURE_SSL_MODULE_BUILTIN=$BUILTIN
1867 BLD_FEATURE_SSL_MODULE_LOADABLE=$LOADABLE
1869 with-matrixssl-dir)
1870 BLD_MATRIXSSL_DIR=`canonPath ${OPTARG}`
1872 with-matrixssl-libs)
1873 BLD_MATRIXSSL_LIBS=${OPTARG}
1875 with-matrixssl-cflags)
1876 BLD_MATRIXSSL_CFLAGS=${OPTARG}
1878 with-matrixssl-iflags)
1879 BLD_MATRIXSSL_IFLAGS=${OPTARG}
1881 with-matrixssl-ldflags)
1882 BLD_MATRIXSSL_LDFLAGS=${OPTARG}
1884 with-openssl)
1885 BLD_FEATURE_OPENSSL_MODULE=1
1886 BLD_FEATURE_SSL_MODULE=1
1887 BLD_FEATURE_SSL_MODULE_BUILTIN=$BUILTIN
1888 BLD_FEATURE_SSL_MODULE_LOADABLE=$LOADABLE
1890 with-openssl-dir)
1891 BLD_OPENSSL_DIR=`canonPath ${OPTARG}`
1893 with-openssl-libs)
1894 BLD_OPENSSL_LIBS=${OPTARG}
1896 with-openssl-cflags)
1897 BLD_OPENSSL_CFLAGS=${OPTARG}
1899 with-openssl-iflags)
1900 BLD_OPENSSL_IFLAGS=${OPTARG}
1902 with-openssl-ldflags)
1903 BLD_OPENSSL_LDFLAGS=${OPTARG}
1905 with-php4)
1906 BLD_FEATURE_PHP4_MODULE=1
1908 with-php4-dir)
1909 BLD_PHP4_DIR=`canonPath ${OPTARG}`
1911 with-php4-libs)
1912 BLD_PHP4_LIBS=${OPTARG}
1914 with-php4-cflags)
1915 BLD_PHP4_CFLAGS=${OPTARG}
1917 with-php4-iflags)
1918 BLD_PHP4_IFLAGS=${OPTARG}
1920 with-php4-ldflags)
1921 BLD_PHP4_LDFLAGS=${OPTARG}
1923 with-php5)
1924 BLD_FEATURE_PHP5_MODULE=1
1926 with-php5-dir)
1927 BLD_PHP5_DIR=`canonPath ${OPTARG}`
1929 with-php5-libs)
1930 BLD_PHP5_LIBS=${OPTARG}
1932 with-php5-cflags)
1933 BLD_PHP5_CFLAGS=${OPTARG}
1935 with-php5-iflags)
1936 BLD_PHP5_IFLAGS=${OPTARG}
1938 with-php5-ldflags)
1939 BLD_PHP5_LDFLAGS=${OPTARG}
1941 with-ssl)
1942 BLD_FEATURE_SSL_MODULE=1
1944 with-upload)
1945 BLD_FEATURE_UPLOAD_MODULE=1
1947 with-xdb)
1948 BLD_FEATURE_XDB_MODULE=1
1950 without-admin)
1951 BLD_FEATURE_ADMIN_MODULE=0
1952 BLD_FEATURE_ADMIN_MODULE_BUILTIN=0
1953 BLD_FEATURE_ADMIN_MODULE_LOADABLE=0
1955 without-aspnet)
1956 BLD_FEATURE_ASPNET_MODULE=0
1957 BLD_FEATURE_ASPNET_MODULE_BUILTIN=0
1958 BLD_FEATURE_ASPNET_MODULE_LOADABLE=0
1960 without-auth)
1961 BLD_FEATURE_AUTH_MODULE=0
1962 BLD_FEATURE_AUTH_MODULE_BUILTIN=0
1963 BLD_FEATURE_AUTH_MODULE_LOADABLE=0
1965 without-c-api|without-c_api)
1966 BLD_FEATURE_C_API_MODULE=0
1967 BLD_FEATURE_C_API_MODULE_BUILTIN=0
1968 BLD_FEATURE_C_API_MODULE_LOADABLE=0
1969 BLD_FEATURE_C_API_CLIENT=0
1971 without-cgi)
1972 BLD_FEATURE_CGI_MODULE=0
1973 BLD_FEATURE_CGI_MODULE_BUILTIN=0
1974 BLD_FEATURE_CGI_MODULE_LOADABLE=0
1976 without-gacompat)
1977 BLD_FEATURE_COMPAT_MODULE=0
1978 BLD_FEATURE_COMPAT_MODULE_BUILTIN=0
1979 BLD_FEATURE_COMPAT_MODULE_LOADABLE=0
1981 without-copy)
1982 BLD_FEATURE_COPY_MODULE=0
1983 BLD_FEATURE_COPY_MODULE_BUILTIN=0
1984 BLD_FEATURE_COPY_MODULE_LOADABLE=0
1986 without-egi)
1987 BLD_FEATURE_EGI_MODULE=0
1988 BLD_FEATURE_EGI_MODULE_BUILTIN=0
1989 BLD_FEATURE_EGI_MODULE_LOADABLE=0
1991 without-esp)
1992 BLD_FEATURE_EJS=0
1993 BLD_FEATURE_ESP_MODULE=0
1994 BLD_FEATURE_ESP_MODULE_BUILTIN=0
1995 BLD_FEATURE_ESP_MODULE_LOADABLE=0
1997 without-esp3)
1998 # BLD_FEATURE_EJS=0
1999 BLD_FEATURE_ESP3_MODULE=0
2000 BLD_FEATURE_ESP3_MODULE_BUILTIN=0
2001 BLD_FEATURE_ESP3_MODULE_LOADABLE=0
2003 without-matrixssl)
2004 BLD_FEATURE_MATRIXSSL_MODULE=0
2005 BLD_FEATURE_MATRIXSSL_MODULE_BUILTIN=0
2006 BLD_FEATURE_MATRIXSSL_MODULE_LOADABLE=0
2008 without-openssl)
2009 BLD_FEATURE_OPENSSL_MODULE=0
2010 BLD_FEATURE_OPENSSL_MODULE_BUILTIN=0
2011 BLD_FEATURE_OPENSSL_MODULE_LOADABLE=0
2013 without-php4)
2014 BLD_FEATURE_PHP4_MODULE=0
2015 BLD_FEATURE_PHP4_MODULE_BUILTIN=0
2016 BLD_FEATURE_PHP4_MODULE_LOADABLE=0
2018 without-php5)
2019 BLD_FEATURE_PHP5_MODULE=0
2020 BLD_FEATURE_PHP5_MODULE_BUILTIN=0
2021 BLD_FEATURE_PHP5_MODULE_LOADABLE=0
2023 without-ssl)
2024 BLD_FEATURE_SSL_MODULE=0
2025 BLD_FEATURE_SSL_MODULE_BUILTIN=0
2026 BLD_FEATURE_SSL_MODULE_LOADABLE=0
2027 BLD_FEATURE_OPENSSL_MODULE=0
2028 BLD_FEATURE_OPENSSL_MODULE_BUILTIN=0
2029 BLD_FEATURE_OPENSSL_MODULE_LOADABLE=0
2030 BLD_FEATURE_MATRIXSSL_MODULE=0
2031 BLD_FEATURE_MATRIXSSL_MODULE_BUILTIN=0
2032 BLD_FEATURE_MATRIXSSL_MODULE_LOADABLE=0
2034 without-upload)
2035 BLD_FEATURE_UPLOAD_MODULE=0
2036 BLD_FEATURE_UPLOAD_MODULE_BUILTIN=0
2037 BLD_FEATURE_UPLOAD_MODULE_LOADABLE=0
2039 without-xdb)
2040 BLD_FEATURE_XDB_MODULE=0
2041 BLD_FEATURE_XDB_MODULE_BUILTIN=0
2042 BLD_FEATURE_XDB_MODULE_LOADABLE=0
2044 *) echo "configure: bad option: $OPTOPT"
2045 exit 2
2047 esac
2048 done
2049 shift $[OPTIND-1]
2051 if [ "$BLD_FEATURE_SHARED" = "0" -a "$BLD_FEATURE_STATIC" = "0" ]
2052 then
2053 echo "configure: bad usage: Either --shared or --static must be used."
2054 exit 2
2057 if [ "$*" != "" ]
2058 then
2059 echo "configure: bad usage: unknown option: $*"
2060 exit 2
2062 if [ "$help" = 1 ]
2063 then
2064 help
2065 exit 0
2068 checkEnv
2070 if [ ! -f appWeb/conf/${BLD_APPWEB_CONFIG} ]
2071 then
2072 echo "configure: Can't locate the product web configuration file ${BLD_PRODUCT}/conf/${BLD_APPWEB_CONFIG}"
2073 exit 2
2077 # Overwrite if key environment variables are defined
2079 BLD_AR_FOR_HOST="${AR:-$BLD_AR_FOR_HOST}"
2080 BLD_CC_FOR_HOST="${CC:-$BLD_CC_FOR_HOST}"
2081 BLD_LD_FOR_HOST="${LD:-$BLD_LD_FOR_HOST}"
2082 BLD_RANLIB_FOR_HOST="${RANLIB:-$BLD_RANLIB_FOR_HOST}"
2083 BLD_NM_FOR_HOST="${RANLIB:-$BLD_NM_FOR_HOST}"
2084 BLD_CFLAGS_FOR_HOST="${CFLAGS:-$BLD_CFLAGS_FOR_HOST}"
2085 BLD_IFLAGS_FOR_HOST="${IFLAGS:-$BLD_IFLAGS_FOR_HOST}"
2086 BLD_LDFLAGS_FOR_HOST="${LDFLAGS:-$BLD_LDFLAGS_FOR_HOST}"
2088 BLD_AR_FOR_BUILD="${AR_FOR_BUILD:-$BLD_AR_FOR_BUILD}"
2089 BLD_CC_FOR_BUILD="${CC_FOR_BUILD:-$BLD_CC_FOR_BUILD}"
2090 BLD_LD_FOR_BUILD="${LD_FOR_BUILD:-$BLD_LD_FOR_BUILD}"
2091 BLD_RANLIB_FOR_BUILD="${RANLIB_FOR_BUILD:-$BLD_RANLIB_FOR_BUILD}"
2092 BLD_NM_FOR_BUILD="${RANLIB_FOR_BUILD:-$BLD_NM_FOR_BUILD}"
2093 BLD_CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD:-$BLD_CFLAGS_FOR_BUILD}"
2094 BLD_IFLAGS_FOR_BUILD="${IFLAGS_FOR_BUILD:-$BLD_IFLAGS_FOR_BUILD}"
2095 BLD_LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD:-$BLD_LDFLAGS_FOR_BUILD}"
2098 # Fix some dependencies
2100 fixDependencies
2103 # Create the config.sh and config.make files
2105 rm -f config.sh config.make config.h
2106 for f in config.sh config.make config.h
2108 createConfig $f
2109 done
2111 cp config.make config.tmp
2112 sed 's/'\''//g' < config.tmp | sed -e 's/""//g' >config.make
2113 sed 's/'\''//g' < config.tmp | sed 's/"//g' >config.make
2114 rm -f config.tmp
2117 # Create the config.h file. Do the following edits:
2118 # - Convert '#' to '//' comments
2119 # - Convert X=Y to #define X Y
2120 # - Convert all "'" to '"'
2121 # - Prepend an "eval" to the package directory settings
2123 cp config.h config.sav
2125 createConfigHeader config.h config.tmp
2126 sed 's/# /\/\/ /g' < config.tmp | sed 's/#/\//g' >config.h
2128 grep = config.sav | grep -v PATH | sed 's/\([^=]*\)=\(.*\)/#define \1 \2/' | \
2129 sed 's/'\''/"/g' >>config.h
2130 chmod 444 config.sh config.make config.h
2131 rm -f config.sav config.tmp
2133 echo -e "#\n# config.cache -- Saved Build Configuration.\n#\n" \
2134 >conf/config.cache
2135 cat config.sh >>conf/config.cache
2136 [ $quiet = 0 ] && echo " # Creating config.cache ..."
2138 echo -e "#!/bin/bash\n\nconfigure $CMD_LINE" >conf/config.args
2140 [ $quiet = 0 ] && echo " # Creating config.args ..."
2143 # Incase a user changes the host, we must allow make to re-create
2144 # the make.os file
2146 touch conf/make.os.$BLD_HOST_OS
2149 # Stop make regenerating dependencies if Mbedthis debug build
2151 if [ -f ${BLD_TOP}/mbedthis -a $BLD_TYPE = "DEBUG" ]
2152 then
2153 touch mpr/make.dep
2156 exit 0
2159 # vim600: sw=4 ts=4 fdm=marker
2160 # vim<600: sw=4 ts=4