forked from pocoproject/poco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·122 lines (106 loc) · 2.55 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#! /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"