2006-10-23 18:43:52 +02:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
|
|
|
# configure
|
|
|
|
#
|
2007-02-23 15:50:42 +01:00
|
|
|
# $Id: //poco/Main/dist/configure#8 $
|
2006-10-23 18:43:52 +02:00
|
|
|
#
|
|
|
|
# Configuration script for POCO.
|
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
# configure [<options>...]
|
|
|
|
#
|
2008-06-18 11:26:12 +02:00
|
|
|
# Specify --help to display supported options.
|
2007-02-23 15:50:42 +01:00
|
|
|
#
|
2006-10-23 18:43:52 +02:00
|
|
|
|
2008-06-19 02:57:42 +02:00
|
|
|
showhelp ()
|
|
|
|
{
|
|
|
|
cat << ENDHELP
|
2008-06-18 11:26:12 +02:00
|
|
|
usage: configure {options}
|
|
|
|
Configure the POCO C++ Libraries.
|
|
|
|
|
|
|
|
Options:
|
|
|
|
--help
|
|
|
|
Display this help screen.
|
|
|
|
|
|
|
|
--config=<config_name>
|
|
|
|
Use the given build configuration.
|
2008-06-19 03:36:45 +02:00
|
|
|
Available configurations are:
|
|
|
|
|
|
|
|
`ls -C $base/build/config/`
|
2008-06-18 11:26:12 +02:00
|
|
|
|
|
|
|
--prefix=<install_prefix>
|
|
|
|
Use the given install directory for make install.
|
|
|
|
Default is /usr/local.
|
|
|
|
|
|
|
|
--stdcxx-base=<apache_stdcxx_install_prefix>
|
2008-06-19 02:57:42 +02:00
|
|
|
If (and only if) the $base/build/config selected with --config
|
2008-06-18 11:26:12 +02:00
|
|
|
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).
|
2008-09-23 09:44:45 +02:00
|
|
|
|
|
|
|
--disable-NetSSL
|
|
|
|
Do not build NetSSL support
|
|
|
|
|
|
|
|
--disable-Data
|
|
|
|
Do not build Data support
|
|
|
|
|
|
|
|
--disable-ODBC
|
|
|
|
Do not build Data/ODBC support
|
|
|
|
|
|
|
|
--disable-SQLite
|
|
|
|
Do not build Data/SQLite support
|
|
|
|
|
|
|
|
--disable-MySQL
|
|
|
|
Do not build Data/MySQL support
|
2008-06-18 11:26:12 +02:00
|
|
|
|
|
|
|
ENDHELP
|
2008-06-19 02:57:42 +02:00
|
|
|
}
|
2006-10-23 18:43:52 +02:00
|
|
|
# save cwd
|
|
|
|
build=`pwd`
|
|
|
|
# get directory where we are located
|
|
|
|
cd `dirname $0`
|
|
|
|
base=`pwd`
|
|
|
|
cd $build
|
|
|
|
|
|
|
|
tests="tests"
|
|
|
|
samples="samples"
|
2007-02-23 15:50:42 +01:00
|
|
|
flags=""
|
2008-09-23 09:44:45 +02:00
|
|
|
poco_netssl_support="enable"
|
|
|
|
poco_data_support="enable"
|
|
|
|
poco_data_odbc_support="enable"
|
|
|
|
poco_data_sqlite_support="enable"
|
|
|
|
poco_data_mysql_support="enable"
|
2006-10-23 18:43:52 +02:00
|
|
|
# parse arguments
|
|
|
|
while [ "$1" != "" ] ; do
|
|
|
|
val=`expr $1 : '--config=\(.*\)'`
|
|
|
|
if [ "$val" != "" ] ; then
|
|
|
|
config=$val;
|
|
|
|
fi
|
|
|
|
|
|
|
|
val=`expr $1 : '--prefix=\(.*\)'`
|
|
|
|
if [ "$val" != "" ] ; then
|
|
|
|
prefix=$val
|
|
|
|
fi
|
|
|
|
|
2008-05-02 13:19:11 +02:00
|
|
|
val=`expr $1 : '--stdcxx-base=\(.*\)'`
|
|
|
|
if [ "$val" != "" ] ; then
|
|
|
|
stdcxx_base=$val
|
|
|
|
fi
|
|
|
|
|
2006-10-23 18:43:52 +02:00
|
|
|
if [ "$1" = "--no-samples" ] ; then
|
|
|
|
samples=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "--no-tests" ] ; then
|
|
|
|
tests=""
|
|
|
|
fi
|
2007-02-23 15:50:42 +01:00
|
|
|
|
|
|
|
if [ "$1" = "--no-wstring" ] ; then
|
|
|
|
flags="$flags -DPOCO_NO_WSTRING"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "--no-fpenvironment" ] ; then
|
|
|
|
flags="$flags -DPOCO_NO_FPENVIRONMENT"
|
|
|
|
fi
|
2008-09-23 09:44:45 +02:00
|
|
|
|
|
|
|
if [ "$1" = "--disable-NetSSL" ] ; then
|
|
|
|
poco_netssl_support="disable"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "--disable-Data" ] ; then
|
|
|
|
poco_data_support="disable"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "--disable-ODBC" ] ; then
|
|
|
|
poco_data_odbc_support="disable"
|
|
|
|
poco_data_support="enable"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "--disable-SQLite" ] ; then
|
|
|
|
poco_data_sqlite_support="disable"
|
|
|
|
poco_data_support="enable"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "--disable-MySQL" ] ; then
|
|
|
|
poco_data_mysql_support="disable"
|
|
|
|
poco_data_support="enable"
|
|
|
|
fi
|
2007-02-23 15:50:42 +01:00
|
|
|
|
2008-06-18 11:26:12 +02:00
|
|
|
if [ "$1" = "--help" ] ; then
|
2008-06-19 02:57:42 +02:00
|
|
|
showhelp
|
2008-06-18 11:26:12 +02:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2006-10-23 18:43:52 +02:00
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2008-02-21 10:08:44 +01:00
|
|
|
# autodetect build environment
|
|
|
|
# ...special cases for CYGWIN or MinGW
|
2006-10-23 18:43:52 +02:00
|
|
|
if [ "$config" = "" ] ; then
|
|
|
|
config=`uname`
|
|
|
|
cyg=`expr $config : '\(CYGWIN\).*'`
|
|
|
|
if [ "$cyg" = "CYGWIN" ] ; then
|
|
|
|
config=CYGWIN
|
2008-02-21 10:08:44 +01:00
|
|
|
else
|
|
|
|
ming=`expr $config : '\(MINGW\).*'`
|
|
|
|
if [ "$ming" = "MINGW" ] ; then
|
|
|
|
config=MinGW
|
|
|
|
fi
|
|
|
|
fi
|
2006-10-23 18:43:52 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "$base/build/config/$config" ] ; then
|
2008-06-19 03:36:45 +02:00
|
|
|
echo "Unknown configuration: $config"
|
|
|
|
echo "Please use the --config=<config_name> option."
|
|
|
|
echo "The <config_name> can be one of the following:"
|
|
|
|
echo ""
|
|
|
|
echo "`ls -C $base/build/config/`"
|
|
|
|
echo ""
|
|
|
|
exit 1
|
2006-10-23 18:43:52 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$prefix" = "" ] ; then
|
|
|
|
prefix=/usr/local
|
|
|
|
fi
|
|
|
|
|
|
|
|
# copy Makefile to build dir
|
|
|
|
if [ "$base" != "$build" ] ; then
|
|
|
|
cp $base/Makefile $build
|
|
|
|
fi
|
|
|
|
|
|
|
|
# create config.make
|
|
|
|
echo '# config.make generated by configure script' >$build/config.make
|
2007-02-23 15:50:42 +01:00
|
|
|
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
|
2008-09-23 09:44:45 +02:00
|
|
|
echo "POCO_NETSSL_SUPPORT = $poco_netssl_support" >>$build/config.make
|
|
|
|
echo "POCO_DATA_SUPPORT = $poco_data_support" >>$build/config.make
|
|
|
|
echo "POCO_DATA_ODBC_SUPPORT = $poco_data_odbc_support" >>$build/config.make
|
|
|
|
echo "POCO_DATA_SQLITE_SUPPORT = $poco_data_sqlite_support" >>$build/config.make
|
|
|
|
echo "POCO_DATA_MYSQL_SUPPORT = $poco_data_mysql_support" >>$build/config.make
|
2008-05-02 13:19:11 +02:00
|
|
|
if [ "$stdcxx_base" != "" ] ; then
|
|
|
|
echo "STDCXX_BASE = $stdcxx_base" >>$build/config.make
|
|
|
|
fi
|
2006-10-23 18:43:52 +02:00
|
|
|
|
2007-02-23 15:50:42 +01:00
|
|
|
echo "export POCO_CONFIG" >>$build/config.make
|
|
|
|
echo "export POCO_BASE" >>$build/config.make
|
|
|
|
echo "export POCO_BUILD" >>$build/config.make
|
|
|
|
echo "export POCO_PREFIX" >>$build/config.make
|
|
|
|
echo "export POCO_FLAGS" >>$build/config.make
|
2008-09-23 09:44:45 +02:00
|
|
|
echo "export POCO_NETSSL_SUPPORT = $poco_netssl_support" >>$build/config.make
|
|
|
|
echo "export POCO_DATA_SUPPORT = $poco_data_support" >>$build/config.make
|
|
|
|
echo "export POCO_DATA_ODBC_SUPPORT = $poco_data_odbc_support" >>$build/config.make
|
|
|
|
echo "export POCO_DATA_SQLITE_SUPPORT = $poco_data_sqlite_support" >>$build/config.make
|
|
|
|
echo "export POCO_DATA_MYSQL_SUPPORT = $poco_data_mysql_support" >>$build/config.make
|
2008-05-02 13:19:11 +02:00
|
|
|
if [ "$stdcxx_base" != "" ] ; then
|
|
|
|
echo "export STDCXX_BASE" >>$build/config.make
|
|
|
|
fi
|
2006-10-23 18:43:52 +02:00
|
|
|
|
2007-02-23 15:50:42 +01:00
|
|
|
echo ".PHONY: poco" >>$build/config.make
|
|
|
|
echo "poco: libexecs $tests $samples" >>$build/config.make
|
2006-10-23 18:43:52 +02:00
|
|
|
|
|
|
|
echo "Configured for $config"
|