added --help option to configure script

This commit is contained in:
Guenter Obiltschnig 2008-06-18 09:26:12 +00:00
parent d9c505331d
commit b40e8df4f2
2 changed files with 121 additions and 50 deletions

74
configure vendored
View File

@ -9,33 +9,49 @@
# 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
#
# --stdcxx-base=<apache_stdcxx_install_prefix>
# If (and only if) the $POCO_BASE/build/config selected with --config
# uses the Apache stdcxx library, then apache_stdcxx_install_prefix
# specifies the base directory of where stdcxx is installed.
#
# --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
# Specify --help to display supported options.
#
helpfile=/tmp/config.help
cat <<ENDHELP >$helpfile
usage: configure {options}
Configure the POCO C++ Libraries.
Options:
--help
Display this help screen.
--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.
--stdcxx-base=<apache_stdcxx_install_prefix>
If (and only if) the $POCO_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).
ENDHELP
# save cwd
build=`pwd`
# get directory where we are located
@ -79,9 +95,17 @@ while [ "$1" != "" ] ; do
flags="$flags -DPOCO_NO_FPENVIRONMENT"
fi
if [ "$1" = "--help" ] ; then
cat $helpfile
rm -f $helpfile
exit 0
fi
shift
done
rm -f $helpfile
# autodetect build environment
# ...special cases for CYGWIN or MinGW
if [ "$config" = "" ] ; then

97
dist/configure vendored
View File

@ -2,35 +2,56 @@
#
# configure
#
# $Id: //poco/1.3/dist/configure#3 $
# $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
# Specify --help to display supported options.
#
helpfile=/tmp/config.help
cat <<ENDHELP >$helpfile
usage: configure {options}
Configure the POCO C++ Libraries.
Options:
--help
Display this help screen.
--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.
--stdcxx-base=<apache_stdcxx_install_prefix>
If (and only if) the $POCO_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).
ENDHELP
# save cwd
build=`pwd`
# get directory where we are located
@ -43,16 +64,21 @@ samples="samples"
flags=""
# parse arguments
while [ "$1" != "" ] ; do
val=`expr -- $1 : '--config=\(.*\)'`
val=`expr $1 : '--config=\(.*\)'`
if [ "$val" != "" ] ; then
config=$val;
fi
val=`expr -- $1 : '--prefix=\(.*\)'`
val=`expr $1 : '--prefix=\(.*\)'`
if [ "$val" != "" ] ; then
prefix=$val
fi
val=`expr $1 : '--stdcxx-base=\(.*\)'`
if [ "$val" != "" ] ; then
stdcxx_base=$val
fi
if [ "$1" = "--no-samples" ] ; then
samples=""
fi
@ -69,15 +95,30 @@ while [ "$1" != "" ] ; do
flags="$flags -DPOCO_NO_FPENVIRONMENT"
fi
if [ "$1" = "--help" ] ; then
cat $helpfile
rm -f $helpfile
exit 0
fi
shift
done
rm -f $helpfile
# autodetect build environment
# ...special cases for CYGWIN or MinGW
if [ "$config" = "" ] ; then
config=`uname`
cyg=`expr -- $config : '\(CYGWIN\).*'`
cyg=`expr $config : '\(CYGWIN\).*'`
if [ "$cyg" = "CYGWIN" ] ; then
config=CYGWIN
fi
else
ming=`expr $config : '\(MINGW\).*'`
if [ "$ming" = "MINGW" ] ; then
config=MinGW
fi
fi
fi
if [ ! -f "$base/build/config/$config" ] ; then
@ -102,12 +143,18 @@ 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
if [ "$stdcxx_base" != "" ] ; then
echo "STDCXX_BASE = $stdcxx_base" >>$build/config.make
fi
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
if [ "$stdcxx_base" != "" ] ; then
echo "export STDCXX_BASE" >>$build/config.make
fi
echo ".PHONY: poco" >>$build/config.make
echo "poco: libexecs $tests $samples" >>$build/config.make