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 ###############################################################################
23 PRODUCTS
="appWeb appWebDeviceManager myAppWeb"
25 ###############################################################################
30 # Ensure we can write to key directories
32 for d
in . conf bin obj
34 echo >$d/.
test 2>/dev
/null
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."
45 if [ ! -f .
/configure
-o ! -d mpr
]
47 echo "configure: You must be in the top source directory."
51 BLD_TOOLS_DIR
=${BLD_TOP}/bin
52 BLD_BIN_DIR
=${BLD_TOP}/bin
55 ###############################################################################
64 if [ "$base" != "$2" ]
66 source=`echo $source | sed -e "s^${dir}/^^"`
68 ln -s $source $2 2>/dev
/null
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
() {
92 # Parse the host system configuration
94 parseSystem
$system $cpu unused
$os
119 # Determine the CPU family
123 eval ${cpuArch}=MPR_CPU_ARM
126 eval ${cpuArch}=MPR_CPU_68K
129 eval ${cpuArch}=MPR_CPU_MIPS
132 eval ${cpuArch}=MPR_CPU_PPC
135 eval ${cpuArch}=MPR_CPU_SPARC
138 eval ${cpuArch}=MPR_CPU_IX86
141 eval ${cpuArch}=MPR_CPU_XSCALE
144 eval ${cpuArch}=MPR_CPU_SIMNT
147 eval ${cpuArch}=MPR_CPU_SIMSPARC
150 eval ${cpuArch}=MPR_CPU_UNKNOWN
151 echo "configure: CPU architecture unknown. Porting $BLD_PRODUCT is required. "
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
165 echo -e "\n${1}:" 1>&2 ; shift
171 echo " $count. $o" 1>&2
172 [ "$o" = "$default" ] && index
=$count
173 eval option_
${count}=$o
174 count
=`expr $count + 1`
176 echo -n "Enter selection [$index] : " 1>&2
181 eval echo $
`echo option_${ans}`
185 ###############################################################################
189 if [ ! -f conf
/config.defaults
-a "${BLD_PRODUCT}" = "" ]
191 BLD_PRODUCT
=`prompt "Select your product" appWeb ${PRODUCTS}`
193 if [ ! -f conf
/config.defaults
]
195 cd conf
/${BLD_PRODUCT} >/dev
/null
196 DEFAULTS
=`echo *.defaults`
197 file=`prompt "Select your ${BLD_PRODUCT} configuration defaults" \
198 release.defaults ${DEFAULTS}`
202 echo " # Link conf/${BLD_PRODUCT}/${file} to conf/config.defaults"
203 linkFile conf
/${BLD_PRODUCT}/${file} conf
/config.defaults
208 ###############################################################################
210 # Ensure users have set required environment variables
215 if [ $BLD_HOST_OS = "LINUX" -o $BLD_HOST_OS = "SOLARIS" ]
217 if [ "`echo $LD_LIBRARY_PATH | grep bin`" = "" ]
219 # Only warn first time
220 if [ ! -f conf
/config.cache
-a $quiet = 0 \
221 -a ! -f ${BLD_TOP}/mbedthis
]
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."
236 ###############################################################################
244 if [ "$NAME" = config.h
]
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".
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 ################################################################################
274 ###############################################################################
276 # Fix module dependencies
282 [ BLD_FEATURE_DLL
= 1 ] && BUILTIN
=1
283 [ BLD_FEATURE_DLL
= 0 ] && LOADABLE
=1
285 if [ "$BLD_FEATURE_C_API_CLIENT" = 1 ]
287 if [ $BLD_FEATURE_C_API_MODULE = 0 ]
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 ]
298 if [ $BLD_FEATURE_EGI_MODULE = 0 ]
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 ]
309 echo "configure: --with-gacompat requires --with-esp. Enabling ESP."
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 ]
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 ]
330 if [ $BLD_FEATURE_SSL_MODULE = 0 ]
333 echo "configure: --with-matrixssl requires --with-ssl. Enabling SSL."
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 ]
343 if [ $BLD_FEATURE_SSL_MODULE = 0 ]
346 echo "configure: --with-matrixssl requires --with-ssl. Enabling SSL."
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 ]
359 if [ $BLD_HOST_OS = VXWORKS
-a $BLD_FEATURE_CGI_MODULE = 1 \
360 -a $BLD_FEATURE_MULTITHREAD = 0 ]
363 echo "configure: --with-cgi requires --enable-multi-thread. Enabling multithreading."
364 BLD_FEATURE_MULTITHREAD
=1
368 ###############################################################################
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"
385 BLD_VERSION
="$BLD_VERSION"
386 BLD_NUMBER
="$BLD_NUMBER"
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"
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
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"
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
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
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"
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"
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
]
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"
612 BLD_CFLAGS
="$BLD_CFLAGS_FOR_BUILD"
613 BLD_IFLAGS
="$BLD_IFLAGS_FOR_BUILD"
614 BLD_LDFLAGS
="$BLD_LDFLAGS_FOR_BUILD"
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
629 if [ $NAME != config.h
]
631 if [ "${BLD_FEATURE_SHARED}" = "1" ]
633 echo " BLD_LIB=${BLD_SHOBJ_FOR_BUILD}" >>$NAME
634 elif [ "${BLD_FEATURE_STATIC}" = "1" ]
636 echo " BLD_LIB=Static${BLD_ARCHIVE}" >>$NAME
638 echo "Static or Shared must be defined"
642 cat >>$NAME <<!EOF_CONFIG4
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"
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
675 if [ "${BLD_FEATURE_SHARED}" = "1" ]
677 echo " BLD_LIB=${BLD_SHOBJ_FOR_HOST}" >>$NAME
678 elif [ "${BLD_FEATURE_STATIC}" = "1" ]
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" ]
690 echo 'export PATH="${BLD_TOP}/bin:${BLD_TOP}/bin/${BLD_TYPE}:${PATH}"' >>$NAME
692 echo 'export PATH:=$(BLD_TOP)/bin:$(BLD_TOP)/bin/$(BLD_TYPE):$(PATH)' >>$NAME
696 if [ "${BLD_HOST_OS}" = "WIN" ]
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
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
710 if [ $NAME = config.
make ]
712 echo 'ifeq ($(EXPORT_OBJECTS),yes)' >>$NAME
713 echo ' BLD_OBJ_DIR=$(BLD_EXP_OBJ_DIR)' >>$NAME
715 echo ' BLD_OBJ_DIR=.' >>$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" = "" ]
738 if [ "$module" = "1" ]
742 echo "WARNING: BLD_${p}_DIR is not set."
743 echo "Use ./configure --with-${p}-dir=path"
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
766 ###############################################################################
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
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
).
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
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
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.
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
).
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
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.
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
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
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.
962 CC C
/C
++ compiler
command.
964 RANLIB The ranlib
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
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
980 ###############################################################################
982 # Some shells don't have a standard getopts. Must supply our own.
984 # Spec chars: ';' == no arg, ':' required arg, '.' optional arg
990 local optlist
="${1#;}"
991 let OPTIND || OPTIND
=1
992 [ $OPTIND -lt $# ] ||
return 1
994 if [ "$1" != "-" -a "$1" != "${1#-}" ]
995 then OPTIND
=$
[OPTIND
+1]; if [ "$1" != "--" ]
999 for opt
in ${optlist#;}
1001 OPTOPT
="${opt%[;.:]}"
1003 local opttype
="${opt##*[^;:.]}"
1004 [ -z "$opttype" ] && opttype
=";"
1005 if [ ${#OPTOPT} -gt 1 ]
1006 then # long-named option
1009 if [ "$opttype" != ":" ]; then return 0; fi
1011 if [ "$OPTARG" != "${OPTARG#-}" ];
1012 then # error: must have an agrument
1014 echo "$0: error: $OPTOPT must have an argument" >&2
1019 OPTIND
=$
[OPTIND
+1] # skip option's argument
1023 if [ "$opttype" = ";" ];
1024 then # error: must not have arguments
1026 echo "$0: error: $OPTOPT must not have arguments" >&2
1031 OPTARG
=${o#"--$OPTOPT="}
1035 else # short-named option
1039 [ "$opttype" != ":" ] && return 0
1043 echo "$0: error: -$OPTOPT must have an argument" >&2
1048 OPTIND
=$
[OPTIND
+1] # skip option's argument
1052 if [ $opttype = ";" ]
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
1062 OPTARG
="${o#-$OPTOPT}"
1069 echo "$0: error: Invalid option: $o"
1078 ###############################################################################
1080 # Usage: parseSystem in-String out-cpu out-vendor out-os
1085 vendor
=${1##${cpu}-}
1086 vendor
=${vendor%%-*}
1087 kernel
=${1##${cpu}-${vendor}-}
1089 kernel
=${kernel%%-*}
1091 if [ "$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" ]
1118 ###############################################################################
1120 # Convert a path to a canonical form (Windows: with drive spec)
1126 type cygpath
>/dev
/null
2>&1
1129 if [ "${dir/:}" = "${dir}" ]
1131 # Add a drive spec and convert to use forward slashes
1132 root
=`cygpath -m / | sed -e 's/:.*//'`
1133 echo "${root}:${dir}"
1135 # Convert to use forward slashes
1143 ###############################################################################
1145 # Remove an old prefix from a path and prepend a new prefix
1154 type cygpath
>/dev
/null
2>&1
1157 dir
=`cygpath -m "$dir"`
1158 oldPath
=`cygpath -m "$oldPath"`
1159 newPath
=`cygpath -m "$newPath"`
1162 if [ "${dir##$oldPath}" != "$dir" ]
1164 echo "${newPath}${dir##$oldPath}"
1170 ###############################################################################
1180 # Pre-parse the build and host settings
1187 disable-access-log \
1189 disable-c-api-client \
1190 disable-config-parse \
1191 disable-config-save \
1193 disable-digest-auth \
1195 disable-fast-malloc \
1196 disable-floating-point \
1197 disable-if-modified \
1199 disable-keep-alive \
1200 disable-legacy-api \
1203 disable-multi-thread \
1204 disable-multithread \
1206 disable-run-as-service \
1207 disable-safe-strings \
1211 disable-shared-libc \
1218 enable-c-api-client \
1220 enable-config-parse \
1221 enable-config-save \
1222 enable-digest-auth \
1224 enable-fast-malloc \
1225 enable-floating-point \
1226 enable-if-modified \
1232 enable-multi-thread \
1233 enable-multithread \
1235 enable-run-as-service \
1237 enable-safe-strings \
1242 enable-shared-libc \
1276 with-matrixssl-dir: \
1277 with-matrixssl-libs: \
1278 with-matrixssl-cflags: \
1279 with-matrixssl-iflags: \
1280 with-matrixssl-ldflags: \
1283 with-openssl-libs: \
1284 with-openssl-cflags: \
1285 with-openssl-iflags: \
1286 with-openssl-ldflags: \
1292 with-php4-ldflags: \
1298 with-php5-ldflags: \
1322 # Clear out cached configuration if user specifies any major options:
1323 # build/defaults/host/products
1326 while getoptex
"$ARGS" "$@"
1330 system
=`conf/config.sub ${OPTARG}`
1331 if [ $?
!= 0 -o "$system" = "" ]
1333 echo "configure: Can't recognize build system: $OPTARG"
1336 BLD_BUILD_SYSTEM
=${system}
1337 rm -f conf
/config.cache
1340 BLD_DEFAULTS
=${OPTARG}
1341 if [ "${BLD_PRODUCT}" = "" ]
1343 echo "configure: must specify --product before --defaults"
1346 if [ ! -f "conf/${BLD_PRODUCT}/${BLD_DEFAULTS}.defaults" ]
1348 echo "configure: Can't find conf/${BLD_PRODUCT}/${BLD_DEFAULTS}.defaults"
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
1359 system
=`conf/config.sub ${OPTARG}`
1360 if [ $?
!= 0 -o "$system" = "" ]
1362 echo "configure: Can't recognize host system configuration: $OPTARG"
1365 BLD_HOST_SYSTEM
=${system}
1366 rm -f conf
/config.cache
1369 BLD_PRODUCT
=${OPTARG}
1370 rm -f conf
/config.defaults
1371 rm -f conf
/config.cache
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"
1394 # Get the product and configuration defaults file
1399 # Read in past cached settings (or initial defaults)
1401 if [ -f conf
/config.cache
]
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
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)
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
]
1443 if [ $BLD_HOST_CPU != i386
]
1446 echo "configure: WARNING: You are doing a non-generic i386 build."
1447 echo " You are building for $BLD_BUILD_SYSTEM instead of i386. "
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}"
1461 while getoptex
"$ARGS" "$@"
1464 # Peek at the args to do some prep work
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 ]
1488 echo "configure: missing parameter for: $OPTOPT=$OPTARG"
1489 echo ' Must supply either "loadable" or "builtin"'
1490 echo " E.g: configure $OPTOPT=loadable"
1493 eval BLD_FEATURE_
${MODULE}_MODULE_BUILTIN
=$BUILTIN
1494 eval BLD_FEATURE_
${MODULE}_MODULE_LOADABLE
=$LOADABLE
1507 BLD_NUMBER
=${OPTARG}
1513 BLD_FEATURE_ACCESS_LOG
=0
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
1528 BLD_FEATURE_COOKIE
=0
1530 disable-digest-auth
)
1531 BLD_FEATURE_DIGEST
=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
1552 BLD_FEATURE_KEEP_ALIVE
=0
1555 BLD_FEATURE_LEGACY_API
=0
1565 echo -e " # WARNING: Making all modules builtin."
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
1610 disable-run-as-service
)
1611 BLD_FEATURE_RUN_AS_SERVICE
=0
1613 disable-safe-strings
)
1614 BLD_FEATURE_SAFE_STRINGS
=0
1617 BLD_FEATURE_SAMPLES
=0
1620 BLD_FEATURE_SESSION
=0
1623 BLD_FEATURE_SHARED
=0
1625 disable-shared-libc
)
1626 BLD_FEATURE_STATIC_LINK_LIBC
=1
1629 BLD_FEATURE_SQUEEZE
=0
1632 BLD_FEATURE_STATIC
=0
1638 BLD_FEATURE_ACCESS_LOG
=1
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
1650 BLD_FEATURE_CONFIG_SAVE
=1
1653 BLD_FEATURE_COOKIE
=1
1656 BLD_FEATURE_DIGEST
=1
1665 BLD_FEATURE_SHARED
=1
1668 BLD_FEATURE_STATIC_LINK_LIBC
=0
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
1680 BLD_FEATURE_IF_MODIFIED
=1
1686 BLD_FEATURE_KEEP_ALIVE
=1
1689 BLD_FEATURE_LEGACY_API
=1
1694 enable-multi-thread|enable-multithread
)
1695 BLD_FEATURE_MULTITHREAD
=1
1700 enable-run-as-service
)
1701 BLD_FEATURE_RUN_AS_SERVICE
=1
1703 enable-safe-strings
)
1704 BLD_FEATURE_SAFE_STRINGS
=1
1707 BLD_FEATURE_SAMPLES
=1
1710 BLD_FEATURE_COOKIE
=1
1711 BLD_FEATURE_SESSION
=1
1714 BLD_FEATURE_SQUEEZE
=1
1717 BLD_FEATURE_STATIC
=1
1730 BLD_DOC_PREFIX
=`canonPath ${OPTARG}`
1733 BLD_INC_PREFIX
=`canonPath ${OPTARG}`
1736 BLD_LIB_PREFIX
=`canonPath ${OPTARG}`
1742 BLD_FEATURE_NUM_TYPE
=${OPTARG}
1743 if [ "${OPTARG}" = "int" ]
1745 BLD_FEATURE_NUM_TYPE_ID
=MPR_INT
1746 elif [ "${OPTARG}" = "int64" ]
1748 BLD_FEATURE_NUM_TYPE_ID
=MPR_INT64
1749 elif [ "${OPTARG}" = "float" ]
1751 BLD_FEATURE_NUM_TYPE_ID
=MPR_FLOAT
1753 echo "configure: bad number type for --numType: ${OPTARG}"
1758 BLD_HTTP_PORT
=${OPTARG}
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}"`
1783 BLD_SBIN_PREFIX
=`canonPath ${OPTARG}`
1786 BLD_LIB_VERSION
=${OPTARG}
1789 BLD_VERSION
=${OPTARG}
1795 BLD_SRC_PREFIX
=`canonPath ${OPTARG}`
1798 BLD_SSL_PORT
=${OPTARG}
1802 [ $BLD_TYPE = "debug" ] && BLD_TYPE
=DEBUG
1803 [ $BLD_TYPE = "release" ] && BLD_TYPE
=RELEASE
1804 if [ $BLD_TYPE = "DEBUG" ]
1812 echo $CONFIG_VERSION
1816 echo $CONFIG_VERSION
1820 BLD_WEB_PREFIX
=`canonPath ${OPTARG}`
1823 BLD_FEATURE_ADMIN_MODULE
=1
1826 BLD_FEATURE_ASPNET_MODULE
=1
1829 BLD_FEATURE_AUTH_MODULE
=1
1831 with-c-api|with-c_api
)
1832 BLD_FEATURE_C_API_MODULE
=1
1835 BLD_FEATURE_CGI_MODULE
=1
1838 BLD_FEATURE_COMPAT_MODULE
=1
1840 BLD_FEATURE_ESP_MODULE
=1
1841 BLD_FEATURE_EGI_MODULE
=1
1842 BLD_FEATURE_C_API_MODULE
=1
1845 BLD_FEATURE_COPY_MODULE
=1
1848 BLD_FEATURE_EGI_MODULE
=1
1849 BLD_FEATURE_C_API_MODULE
=1
1853 BLD_FEATURE_ESP_MODULE
=1
1854 BLD_FEATURE_ESP_MODULE_BUILTIN
=$BUILTIN
1855 BLD_FEATURE_ESP_MODULE_LOADABLE
=$LOADABLE
1859 BLD_FEATURE_ESP3_MODULE
=1
1860 BLD_FEATURE_ESP3_MODULE_BUILTIN
=$BUILTIN
1861 BLD_FEATURE_ESP3_MODULE_LOADABLE
=$LOADABLE
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
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}
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
1891 BLD_OPENSSL_DIR
=`canonPath ${OPTARG}`
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}
1906 BLD_FEATURE_PHP4_MODULE
=1
1909 BLD_PHP4_DIR
=`canonPath ${OPTARG}`
1912 BLD_PHP4_LIBS
=${OPTARG}
1915 BLD_PHP4_CFLAGS
=${OPTARG}
1918 BLD_PHP4_IFLAGS
=${OPTARG}
1921 BLD_PHP4_LDFLAGS
=${OPTARG}
1924 BLD_FEATURE_PHP5_MODULE
=1
1927 BLD_PHP5_DIR
=`canonPath ${OPTARG}`
1930 BLD_PHP5_LIBS
=${OPTARG}
1933 BLD_PHP5_CFLAGS
=${OPTARG}
1936 BLD_PHP5_IFLAGS
=${OPTARG}
1939 BLD_PHP5_LDFLAGS
=${OPTARG}
1942 BLD_FEATURE_SSL_MODULE
=1
1945 BLD_FEATURE_UPLOAD_MODULE
=1
1948 BLD_FEATURE_XDB_MODULE
=1
1951 BLD_FEATURE_ADMIN_MODULE
=0
1952 BLD_FEATURE_ADMIN_MODULE_BUILTIN
=0
1953 BLD_FEATURE_ADMIN_MODULE_LOADABLE
=0
1956 BLD_FEATURE_ASPNET_MODULE
=0
1957 BLD_FEATURE_ASPNET_MODULE_BUILTIN
=0
1958 BLD_FEATURE_ASPNET_MODULE_LOADABLE
=0
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
1972 BLD_FEATURE_CGI_MODULE
=0
1973 BLD_FEATURE_CGI_MODULE_BUILTIN
=0
1974 BLD_FEATURE_CGI_MODULE_LOADABLE
=0
1977 BLD_FEATURE_COMPAT_MODULE
=0
1978 BLD_FEATURE_COMPAT_MODULE_BUILTIN
=0
1979 BLD_FEATURE_COMPAT_MODULE_LOADABLE
=0
1982 BLD_FEATURE_COPY_MODULE
=0
1983 BLD_FEATURE_COPY_MODULE_BUILTIN
=0
1984 BLD_FEATURE_COPY_MODULE_LOADABLE
=0
1987 BLD_FEATURE_EGI_MODULE
=0
1988 BLD_FEATURE_EGI_MODULE_BUILTIN
=0
1989 BLD_FEATURE_EGI_MODULE_LOADABLE
=0
1993 BLD_FEATURE_ESP_MODULE
=0
1994 BLD_FEATURE_ESP_MODULE_BUILTIN
=0
1995 BLD_FEATURE_ESP_MODULE_LOADABLE
=0
1999 BLD_FEATURE_ESP3_MODULE
=0
2000 BLD_FEATURE_ESP3_MODULE_BUILTIN
=0
2001 BLD_FEATURE_ESP3_MODULE_LOADABLE
=0
2004 BLD_FEATURE_MATRIXSSL_MODULE
=0
2005 BLD_FEATURE_MATRIXSSL_MODULE_BUILTIN
=0
2006 BLD_FEATURE_MATRIXSSL_MODULE_LOADABLE
=0
2009 BLD_FEATURE_OPENSSL_MODULE
=0
2010 BLD_FEATURE_OPENSSL_MODULE_BUILTIN
=0
2011 BLD_FEATURE_OPENSSL_MODULE_LOADABLE
=0
2014 BLD_FEATURE_PHP4_MODULE
=0
2015 BLD_FEATURE_PHP4_MODULE_BUILTIN
=0
2016 BLD_FEATURE_PHP4_MODULE_LOADABLE
=0
2019 BLD_FEATURE_PHP5_MODULE
=0
2020 BLD_FEATURE_PHP5_MODULE_BUILTIN
=0
2021 BLD_FEATURE_PHP5_MODULE_LOADABLE
=0
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
2035 BLD_FEATURE_UPLOAD_MODULE
=0
2036 BLD_FEATURE_UPLOAD_MODULE_BUILTIN
=0
2037 BLD_FEATURE_UPLOAD_MODULE_LOADABLE
=0
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"
2051 if [ "$BLD_FEATURE_SHARED" = "0" -a "$BLD_FEATURE_STATIC" = "0" ]
2053 echo "configure: bad usage: Either --shared or --static must be used."
2059 echo "configure: bad usage: unknown option: $*"
2070 if [ ! -f appWeb
/conf
/${BLD_APPWEB_CONFIG} ]
2072 echo "configure: Can't locate the product web configuration file ${BLD_PRODUCT}/conf/${BLD_APPWEB_CONFIG}"
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
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
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
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" \
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
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" ]
2159 # vim600: sw=4 ts=4 fdm=marker
2160 # vim<600: sw=4 ts=4