poco/configure
Guenter Obiltschnig 2d4078f392 submitted 1.2.0
2006-08-29 07:10:35 +00:00

92 lines
1.9 KiB
Bash

#! /bin/sh
#
# configure
#
# $Id: //poco/1.2/dist/configure#1 $
#
# 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.
#
# save cwd
build=`pwd`
# get directory where we are located
cd `dirname $0`
base=`pwd`
cd $build
tests="tests"
samples="samples"
# 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
shift
done
# copy Makefile to build dir
if [ "$base" != "$build" ] ; then
cp $base/Makefile $build
fi
if [ "$config" = "" ] ; then
config=`uname`
cyg=`expr $config : '\(CYGWIN\).*'`
if [ "$cyg" != "" ] ; then
config=CYGWIN
fi
fi
if [ "$prefix" = "" ] ; then
prefix=/usr/local
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 "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 ".PHONY: poco" >> $build/config.make
echo "poco: libs $tests $samples" >> $build/config.make
echo "Configured for $config"