2012-04-23 03:14:34 +02:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
|
|
|
# configure
|
|
|
|
#
|
|
|
|
# $Id: //poco/1.4/dist/configure#2 $
|
|
|
|
#
|
|
|
|
# Configuration script for POCO.
|
|
|
|
#
|
|
|
|
# Invoke configure --help for help.
|
|
|
|
#
|
|
|
|
|
|
|
|
showhelp()
|
|
|
|
{
|
|
|
|
cat << ENDHELP
|
|
|
|
usage: configure {options}
|
|
|
|
Configure the POCO C++ Libraries.
|
|
|
|
|
|
|
|
Options:
|
|
|
|
--help
|
|
|
|
Display this help screen.
|
|
|
|
|
2012-07-07 18:03:21 +02:00
|
|
|
--config=<config_name>
|
2012-04-23 03:14:34 +02:00
|
|
|
Use the given build configuration.
|
|
|
|
Available configurations are:
|
|
|
|
|
|
|
|
`ls -C $base/build/config/`
|
|
|
|
|
|
|
|
--prefix=<install_prefix>
|
|
|
|
Use the given install directory for make install.
|
|
|
|
Default is /usr/local.
|
|
|
|
|
|
|
|
--stdcxx-base=<apache_stdcxx_install_prefix>
|
|
|
|
If (and only if) the $base/build/config selected with --config
|
|
|
|
uses the Apache stdcxx library, then apache_stdcxx_install_prefix
|
|
|
|
specifies the base directory where stdcxx is installed.
|
|
|
|
|
|
|
|
--no-tests
|
|
|
|
Do not build testsuites.
|
|
|
|
|
|
|
|
--no-samples
|
|
|
|
Do not build samples.
|
|
|
|
|
|
|
|
--no-wstring
|
|
|
|
Compile with -DPOCO_NO_WSTRING.
|
|
|
|
Useful if your C++ compiler does not support std::wstring
|
|
|
|
(such as uClibc-based systems).
|
|
|
|
|
|
|
|
--no-fpenvironment
|
|
|
|
Compile with -DPOCO_NO_FPENVIRONMENT.
|
|
|
|
Useful if your C++ compiler has incomplete floating-point support
|
|
|
|
(such as uClibc-based systems).
|
|
|
|
|
|
|
|
--no-sharedmemory
|
|
|
|
Compile with -DPOCO_NO_SHAREDMEMORY.
|
|
|
|
For systems that don't support shared memory API's,
|
|
|
|
like uClibc-based Linux systems.
|
|
|
|
|
|
|
|
--no-sharedlibs
|
|
|
|
Compile with -DPOCO_NO_SHAREDLIBS.
|
|
|
|
For systems that don't support shared library loading.
|
|
|
|
|
2012-08-20 02:57:17 +02:00
|
|
|
--no-ipv6
|
|
|
|
Compile with -DPOCO_NET_NO_IPv6.
|
|
|
|
For systems that don't support IPv6.
|
|
|
|
|
2012-04-23 03:14:34 +02:00
|
|
|
--omit=<component>{,<component>}
|
|
|
|
Do not build the specified component(s).
|
|
|
|
Example: --omit=Data/MySQL,Data/ODBC,Zip
|
2012-07-07 18:03:21 +02:00
|
|
|
|
2012-04-23 03:14:34 +02:00
|
|
|
--include-path=<path>
|
|
|
|
Add search path for header files.
|
2012-07-07 18:03:21 +02:00
|
|
|
|
2012-04-23 03:14:34 +02:00
|
|
|
--library-path=<path>
|
|
|
|
Add search path for library files.
|
|
|
|
|
2012-09-25 06:09:05 +02:00
|
|
|
--odbc-lib=<path>
|
2012-09-22 16:58:14 +02:00
|
|
|
Specify the directory where ODBC library is located.
|
|
|
|
|
2012-09-25 06:09:05 +02:00
|
|
|
--odbc-include=<path>
|
|
|
|
Specify the directory where ODBC header files are located.
|
|
|
|
|
2012-04-23 03:14:34 +02:00
|
|
|
--cflags=<flags>
|
|
|
|
Pass additional flags to compiler.
|
|
|
|
Example: --cflags=-wall
|
|
|
|
|
|
|
|
--poquito
|
|
|
|
Omit a few features for smaller codesize when linking
|
|
|
|
statically for embedded targets.
|
|
|
|
|
|
|
|
--unbundled
|
2012-07-07 18:03:21 +02:00
|
|
|
Use system-provided zlib, pcre, expat and sqlite instead of
|
2012-04-23 03:14:34 +02:00
|
|
|
bundled ones.
|
2012-07-07 18:03:21 +02:00
|
|
|
|
2012-04-23 03:14:34 +02:00
|
|
|
--static
|
|
|
|
Build static libraries. Overrides default mode, which
|
|
|
|
depends upon target. Can be specified together
|
|
|
|
with --shared to build both.
|
2012-07-07 18:03:21 +02:00
|
|
|
|
2012-04-23 03:14:34 +02:00
|
|
|
--shared
|
|
|
|
Build shared libraries. Overrides default mode, which
|
|
|
|
depends upon target. Can be specified together
|
|
|
|
with --static to build both.
|
|
|
|
|
|
|
|
ENDHELP
|
|
|
|
}
|
|
|
|
|
|
|
|
# save cwd
|
|
|
|
build=`pwd`
|
|
|
|
# get directory where we are located
|
|
|
|
cd `dirname $0`
|
|
|
|
base=`pwd`
|
|
|
|
cd $build
|
|
|
|
|
2012-08-20 02:57:17 +02:00
|
|
|
tests=1
|
|
|
|
samples=1
|
2012-04-23 03:14:34 +02:00
|
|
|
flags=""
|
|
|
|
omit=""
|
|
|
|
includepath=""
|
|
|
|
librarypath=""
|
2012-09-25 06:09:05 +02:00
|
|
|
odbclib=""
|
|
|
|
odbcinclude=""
|
2012-04-23 03:14:34 +02:00
|
|
|
unbundled=""
|
|
|
|
static=""
|
|
|
|
shared=""
|
|
|
|
# parse arguments
|
2012-07-07 18:03:21 +02:00
|
|
|
while [ $# -ge 1 ]; do
|
|
|
|
case "$1" in
|
|
|
|
--config=*)
|
2012-08-20 02:57:17 +02:00
|
|
|
config="`echo ${1} | awk '{print substr($0,10)}'`" ;;
|
2012-07-07 18:03:21 +02:00
|
|
|
|
|
|
|
--prefix=*)
|
2012-08-20 02:57:17 +02:00
|
|
|
prefix="`echo ${1} | awk '{print substr($0,10)}'`" ;;
|
2012-07-07 18:03:21 +02:00
|
|
|
|
|
|
|
--stdcxx-base=*)
|
2012-08-20 02:57:17 +02:00
|
|
|
stdcxx_base="`echo ${1} | awk '{print substr($0,15)}'`" ;;
|
2012-07-07 18:03:21 +02:00
|
|
|
|
|
|
|
--omit=*)
|
2012-08-20 02:57:17 +02:00
|
|
|
omit="`echo ${1} | awk '{print substr($0,8)}' | tr ',;' ' '`" ;;
|
2012-07-07 18:03:21 +02:00
|
|
|
|
|
|
|
--include-path=*)
|
2012-08-20 02:57:17 +02:00
|
|
|
includepath="`echo ${1} | awk '{print substr($0,16)}' | tr ',;' ' '`" ;;
|
2012-07-07 18:03:21 +02:00
|
|
|
|
|
|
|
--library-path=*)
|
2012-08-20 02:57:17 +02:00
|
|
|
librarypath="`echo ${1} | awk '{print substr($0,16)}' | tr ',;' ' '`" ;;
|
2012-07-07 18:03:21 +02:00
|
|
|
|
2012-09-25 06:09:05 +02:00
|
|
|
--odbc-lib=*)
|
|
|
|
odbclib="`echo ${1} | awk '{print substr($0,16)}'`" ;;
|
|
|
|
|
|
|
|
--odbc-include=*)
|
|
|
|
odbcinclude="`echo ${1} | awk '{print substr($0,16)}'`" ;;
|
2012-09-22 16:58:14 +02:00
|
|
|
|
2012-07-07 18:03:21 +02:00
|
|
|
--cflags=*)
|
2012-12-12 04:19:34 +01:00
|
|
|
flags="`echo ${1} | awk '{print substr($0,10)}'`" ;;
|
2012-07-07 18:03:21 +02:00
|
|
|
|
|
|
|
--no-samples)
|
|
|
|
samples="" ;;
|
|
|
|
|
|
|
|
--no-tests)
|
|
|
|
tests="" ;;
|
|
|
|
|
|
|
|
--no-wstring)
|
|
|
|
flags="$flags -DPOCO_NO_WSTRING" ;;
|
|
|
|
|
2012-07-10 02:51:54 +02:00
|
|
|
--no-fpenvironment)
|
|
|
|
flags="$flags -DPOCO_NO_FPENVIRONMENT" ;;
|
2012-07-07 18:03:21 +02:00
|
|
|
|
|
|
|
--no-sharedmemory)
|
|
|
|
flags="$flags -DPOCO_NO_SHAREDMEMORY" ;;
|
|
|
|
|
|
|
|
--no-sharedlibs)
|
|
|
|
flags="$flags -DPOCO_NO_SHAREDLIBS" ;;
|
2012-09-22 16:58:14 +02:00
|
|
|
|
2012-08-20 02:57:17 +02:00
|
|
|
--no-ipv6)
|
|
|
|
flags="$flags -DPOCO_NET_NO_IPv6" ;;
|
2012-07-07 18:03:21 +02:00
|
|
|
|
|
|
|
--poquito)
|
2012-11-14 17:31:52 +01:00
|
|
|
flags="$flags -DPOCO_NO_FILECHANNEL -DPOCO_NO_SPLITTERCHANNEL -DPOCO_NO_SYSLOGCHANNEL -DPOCO_UTIL_NO_INIFILECONFIGURATION -DPOCO_UTIL_NO_JSONCONFIGURATION -DPOCO_UTIL_NO_XMLCONFIGURATION" ;;
|
2012-07-07 18:03:21 +02:00
|
|
|
|
|
|
|
--unbundled)
|
|
|
|
flags="$flags -DPOCO_UNBUNDLED"
|
|
|
|
unbundled=1
|
|
|
|
;;
|
|
|
|
|
|
|
|
--static)
|
|
|
|
static=1 ;;
|
|
|
|
|
|
|
|
--shared)
|
|
|
|
shared=1 ;;
|
|
|
|
|
|
|
|
--help)
|
|
|
|
showhelp
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2012-04-23 03:14:34 +02:00
|
|
|
showhelp
|
2012-07-07 18:03:21 +02:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2012-04-23 03:14:34 +02:00
|
|
|
|
2012-07-07 18:03:21 +02:00
|
|
|
shift
|
2012-04-23 03:14:34 +02:00
|
|
|
done
|
|
|
|
# autodetect build environment
|
|
|
|
# ...special cases for CYGWIN or MinGW
|
|
|
|
if [ "$config" = "" ] ; then
|
2012-07-07 18:03:21 +02:00
|
|
|
config=`uname`
|
|
|
|
case "$config" in
|
|
|
|
CYGWIN*)
|
|
|
|
config=CYGWIN ;;
|
|
|
|
MINGW*)
|
|
|
|
config=MinGW ;;
|
|
|
|
esac
|
2012-04-23 03:14:34 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "$base/build/config/$config" ] ; then
|
|
|
|
echo "Unknown configuration: $config"
|
|
|
|
echo "Please use the --config option to specify another build configuration"
|
|
|
|
echo "The following configurations are available:"
|
|
|
|
ls $base/build/config
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2012-07-07 18:03:21 +02:00
|
|
|
if [ -z "$prefix" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
prefix=/usr/local
|
|
|
|
fi
|
|
|
|
|
|
|
|
# check for patches
|
|
|
|
if [ -d $base/patches/$config ] ; then
|
|
|
|
echo "NOTE: There are patches for your configuration available. Please apply them before compiling."
|
|
|
|
fi
|
|
|
|
|
|
|
|
# copy Makefile to build dir
|
|
|
|
if [ "$base" != "$build" ] ; then
|
|
|
|
cp $base/Makefile $build
|
|
|
|
fi
|
|
|
|
|
2012-07-07 18:03:21 +02:00
|
|
|
if [ -n "$static" -a -n "$shared" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
linkmode=BOTH
|
2012-07-07 18:03:21 +02:00
|
|
|
elif [ -n "$static" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
linkmode=STATIC
|
2012-07-07 18:03:21 +02:00
|
|
|
elif [ -n "$shared" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
linkmode=SHARED
|
|
|
|
else
|
|
|
|
linkmode=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
# create config.make
|
|
|
|
echo '# config.make generated by configure script' >$build/config.make
|
|
|
|
echo "POCO_CONFIG = $config" >>$build/config.make
|
|
|
|
echo "POCO_BASE = $base" >>$build/config.make
|
|
|
|
echo "POCO_BUILD = $build" >>$build/config.make
|
|
|
|
echo "POCO_PREFIX = $prefix" >>$build/config.make
|
|
|
|
echo "POCO_FLAGS = $flags" >>$build/config.make
|
|
|
|
echo "OMIT = $omit" >>$build/config.make
|
2012-07-07 18:03:21 +02:00
|
|
|
if [ -n "$stdcxx_base" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
echo "STDCXX_BASE = $stdcxx_base" >>$build/config.make
|
|
|
|
fi
|
2012-07-07 18:03:21 +02:00
|
|
|
if [ -n "$includepath" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
echo "POCO_ADD_INCLUDE = $includepath" >>$build/config.make
|
|
|
|
fi
|
2012-07-07 18:03:21 +02:00
|
|
|
if [ -n "$librarypath" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
echo "POCO_ADD_LIBRARY = $librarypath" >>$build/config.make
|
|
|
|
fi
|
2012-09-25 06:09:05 +02:00
|
|
|
if [ -n "$odbclib" ] ; then
|
|
|
|
echo "POCO_ODBC_LIB = $odbclib" >>$build/config.make
|
|
|
|
fi
|
|
|
|
if [ -n "$odbcinclude" ] ; then
|
|
|
|
echo "POCO_ODBC_INCLUDE = $odbcinclude" >>$build/config.make
|
2012-09-22 16:58:14 +02:00
|
|
|
fi
|
2012-07-07 18:03:21 +02:00
|
|
|
if [ -n "$unbundled" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
echo "POCO_UNBUNDLED = 1" >>$build/config.make
|
|
|
|
fi
|
2012-07-07 18:03:21 +02:00
|
|
|
if [ -n "$linkmode" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
echo "LINKMODE = $linkmode" >>$build/config.make
|
|
|
|
fi
|
2012-07-07 18:03:21 +02:00
|
|
|
|
|
|
|
cat <<__EOF__ >>$build/config.make
|
|
|
|
export POCO_CONFIG
|
|
|
|
export POCO_BASE
|
|
|
|
export POCO_BUILD
|
|
|
|
export POCO_PREFIX
|
|
|
|
export POCO_FLAGS
|
|
|
|
__EOF__
|
|
|
|
|
|
|
|
if [ -n "$stdcxx_base" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
echo "export STDCXX_BASE" >>$build/config.make
|
|
|
|
fi
|
2012-07-07 18:03:21 +02:00
|
|
|
if [ -n "$includepath" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
echo "export POCO_ADD_INCLUDE" >>$build/config.make
|
|
|
|
fi
|
2012-07-07 18:03:21 +02:00
|
|
|
if [ -n "$librarypath" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
echo "export POCO_ADD_LIBRARY" >>$build/config.make
|
|
|
|
fi
|
2012-09-25 06:09:05 +02:00
|
|
|
if [ -n "$odbclib" ] ; then
|
|
|
|
echo "export POCO_ODBC_LIB" >>$build/config.make
|
|
|
|
fi
|
|
|
|
if [ -n "$odbcinclude" ] ; then
|
|
|
|
echo "export POCO_ODBC_INCLUDE" >>$build/config.make
|
2012-09-22 16:58:14 +02:00
|
|
|
fi
|
2012-07-07 18:03:21 +02:00
|
|
|
if [ -n "$unbundled" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
echo "export POCO_UNBUNDLED" >>$build/config.make
|
|
|
|
fi
|
2012-07-07 18:03:21 +02:00
|
|
|
if [ -n "$linkmode" ] ; then
|
2012-04-23 03:14:34 +02:00
|
|
|
echo "export LINKMODE" >>$build/config.make
|
|
|
|
fi
|
2012-07-07 18:03:21 +02:00
|
|
|
|
2012-09-22 16:58:14 +02:00
|
|
|
# create config.build
|
2012-08-20 02:57:17 +02:00
|
|
|
echo '# config.build generated by configure script' >$build/config.build
|
|
|
|
cat <<__EOF__ >>$build/config.build
|
|
|
|
TESTS = $tests
|
|
|
|
SAMPLES = $samples
|
2012-07-07 18:03:21 +02:00
|
|
|
__EOF__
|
2012-04-23 03:14:34 +02:00
|
|
|
|
|
|
|
echo "Configured for $config"
|