~ubuntu-branches/ubuntu/gutsy/poco/gutsy

« back to all changes in this revision

Viewing changes to configure

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Burghardt
  • Date: 2007-04-27 18:33:48 UTC
  • Revision ID: james.westby@ubuntu.com-20070427183348-xgnpct0qd6a2ip34
Tags: upstream-1.2.9
ImportĀ upstreamĀ versionĀ 1.2.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
#
 
3
# configure
 
4
#
 
5
# $Id: //poco/1.2/dist/configure#7 $
 
6
#
 
7
# Configuration script for POCO.
 
8
#
 
9
# Usage:
 
10
# configure [<options>...]
 
11
#
 
12
# Options:
 
13
#   --config=<config_name>   
 
14
#     Use the given build configuration
 
15
#     See $POCO_BASE/build/config for possible configs
 
16
#
 
17
#   --prefix=<install_prefix>
 
18
#     Use the given install directory for make install.
 
19
#     Default is /usr/local
 
20
#
 
21
#   --no-tests
 
22
#     Do not build testsuites.
 
23
#
 
24
#   --no-samples
 
25
#     Do not build samples.
 
26
#
 
27
#   --no-wstring
 
28
#     Compile with -DPOCO_NO_WSTRING.
 
29
#
 
30
#   --no-fpenvironment
 
31
#     Compile with -DPOCO_NO_FPENVIRONMENT
 
32
#
 
33
 
 
34
# save cwd
 
35
build=`pwd`
 
36
# get directory where we are located
 
37
cd `dirname $0`
 
38
base=`pwd`
 
39
cd $build
 
40
 
 
41
tests="tests"
 
42
samples="samples"
 
43
flags=""
 
44
# parse arguments
 
45
while [ "$1" != "" ] ; do
 
46
        val=`expr $1 : '--config=\(.*\)'`
 
47
        if [ "$val" != "" ] ; then
 
48
                config=$val;
 
49
        fi
 
50
        
 
51
        val=`expr $1 : '--prefix=\(.*\)'`
 
52
        if [ "$val" != "" ] ; then
 
53
                prefix=$val
 
54
        fi
 
55
        
 
56
        if [ "$1" = "--no-samples" ] ; then
 
57
                samples=""
 
58
        fi
 
59
        
 
60
        if [ "$1" = "--no-tests" ] ; then
 
61
                tests=""
 
62
        fi
 
63
        
 
64
        if [ "$1" = "--no-wstring" ] ; then
 
65
                flags="$flags -DPOCO_NO_WSTRING"
 
66
        fi
 
67
 
 
68
        if [ "$1" = "--no-fpenvironment" ] ; then
 
69
                flags="$flags -DPOCO_NO_FPENVIRONMENT"
 
70
        fi
 
71
        
 
72
        shift
 
73
done
 
74
 
 
75
if [ "$config" = "" ] ; then
 
76
        config=`uname`
 
77
        cyg=`expr $config : '\(CYGWIN\).*'`
 
78
        if [ "$cyg" = "CYGWIN" ] ; then
 
79
                config=CYGWIN
 
80
        fi
 
81
fi
 
82
 
 
83
if [ ! -f "$base/build/config/$config" ] ; then
 
84
        echo "Unknown configuration: $config"
 
85
        echo "Please use the --config option to specify another build configuration"
 
86
        exit 1
 
87
fi
 
88
 
 
89
if [ "$prefix" = "" ] ; then
 
90
        prefix=/usr/local
 
91
fi
 
92
 
 
93
# copy Makefile to build dir
 
94
if [ "$base" != "$build" ] ; then
 
95
        cp $base/Makefile $build
 
96
fi
 
97
 
 
98
# create config.make
 
99
echo '# config.make generated by configure script' >$build/config.make
 
100
echo "POCO_CONFIG = $config" >>$build/config.make
 
101
echo "POCO_BASE = $base" >>$build/config.make
 
102
echo "POCO_BUILD = $build" >>$build/config.make
 
103
echo "POCO_PREFIX = $prefix" >>$build/config.make
 
104
echo "POCO_FLAGS = $flags" >>$build/config.make
 
105
 
 
106
echo "export POCO_CONFIG" >>$build/config.make
 
107
echo "export POCO_BASE" >>$build/config.make
 
108
echo "export POCO_BUILD" >>$build/config.make
 
109
echo "export POCO_PREFIX" >>$build/config.make
 
110
echo "export POCO_FLAGS" >>$build/config.make
 
111
 
 
112
echo ".PHONY: poco" >>$build/config.make
 
113
echo "poco: libexecs $tests $samples" >>$build/config.make
 
114
 
 
115
echo "Configured for $config"