poco/configure
Chris Johnson def90185aa Added build support for stock MinGW/MSYS build of POCO.
Components now supported by default:
 Foundation {including internal PCRE lib}
 Util
 Net
 XML
 SQL
 SQL/ODBC
 SQL/SQLite
 samples/{all components supported}

Components supported with additional 3rd party MinGW/MSYS libs:
 NetSSL w/OpenSSH

Components unsupported at this time:
 testsuite: Fails to build due to TupleTest - needs slight code change MinGW can't deal with currently.  Only thing causing failure.
 CppUnit: Unable to support this due to WIN32 version of this functionality relying on MFC which does not ship with MinGW/MSYS.
 --no-wstring support due libstdc++ - will require STLPort {support coming soon}


:build/config/MinGW
 +Fixed compiler environment flags and switches
 +Linkage build supports:  SHARED, STATIC, or BOTH
 +Fixed duplicate symbol/unresolved symbol during compile
 +Added PCRE build flag for internal library build/eliminate link errors
 +Disable support of UTF-8 by default, MinGW will require STLPort 
 +Corrected system link libs for MinGW "dumb" linker

:build/rules/global
 +Added MinGW environment deduction logic

:configure
 +Fine tuned environment deduction recognizing MinGW as valid

:Data/ODBC/Makefile
 +Fixed correct ODBC libs to link

:Foundation/Makefile
 +Added logic for building correct subsystem dependency

:Util/Makefile
 +Added logic for building correct subsystem dependency
2008-02-21 09:08:44 +00:00

123 lines
2.6 KiB
Bash
Executable File

#! /bin/sh
#
# configure
#
# $Id: //poco/Main/dist/configure#8 $
#
# Configuration script for POCO.
#
# Usage:
# configure [<options>...]
#
# Options:
# --config=<config_name>
# Use the given build configuration
# See $POCO_BASE/build/config for possible configs
#
# --prefix=<install_prefix>
# Use the given install directory for make install.
# Default is /usr/local
#
# --no-tests
# Do not build testsuites.
#
# --no-samples
# Do not build samples.
#
# --no-wstring
# Compile with -DPOCO_NO_WSTRING.
#
# --no-fpenvironment
# Compile with -DPOCO_NO_FPENVIRONMENT
#
# save cwd
build=`pwd`
# get directory where we are located
cd `dirname $0`
base=`pwd`
cd $build
tests="tests"
samples="samples"
flags=""
# 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
if [ "$1" = "--no-samples" ] ; then
samples=""
fi
if [ "$1" = "--no-tests" ] ; then
tests=""
fi
if [ "$1" = "--no-wstring" ] ; then
flags="$flags -DPOCO_NO_WSTRING"
fi
if [ "$1" = "--no-fpenvironment" ] ; then
flags="$flags -DPOCO_NO_FPENVIRONMENT"
fi
shift
done
# autodetect build environment
# ...special cases for CYGWIN or MinGW
if [ "$config" = "" ] ; then
config=`uname`
cyg=`expr $config : '\(CYGWIN\).*'`
if [ "$cyg" = "CYGWIN" ] ; then
config=CYGWIN
else
ming=`expr $config : '\(MINGW\).*'`
if [ "$ming" = "MINGW" ] ; then
config=MinGW
fi
fi
fi
if [ ! -f "$base/build/config/$config" ] ; then
echo "Unknown configuration: $config"
echo "Please use the --config option to specify another build configuration"
exit 1
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
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 "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
echo ".PHONY: poco" >>$build/config.make
echo "poco: libexecs $tests $samples" >>$build/config.make
echo "Configured for $config"