Fri, 20 Sep 2024 20:04:35 +0200
fix trace log use after free
40 | 1 | #!/bin/sh |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
2 | |
515 | 3 | # create temporary directory |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
4 | TEMP_DIR=".tmp-`uname -n`" |
515 | 5 | rm -Rf "$TEMP_DIR" |
6 | if mkdir -p "$TEMP_DIR"; then | |
7 | : | |
8 | else | |
9 | echo "Cannot create tmp dir $TEMP_DIR" | |
511 | 10 | echo "Abort" |
515 | 11 | exit 1 |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
12 | fi |
511 | 13 | touch "$TEMP_DIR/options" |
14 | touch "$TEMP_DIR/features" | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
15 | |
515 | 16 | # define standard variables |
17 | # also define standard prefix (this is where we will search for config.site) | |
18 | prefix=/usr | |
19 | exec_prefix= | |
20 | bindir= | |
21 | sbindir= | |
22 | libdir= | |
23 | libexecdir= | |
24 | datarootdir= | |
25 | datadir= | |
26 | sysconfdir= | |
27 | sharedstatedir= | |
28 | localstatedir= | |
29 | runstatedir= | |
30 | includedir= | |
31 | infodir= | |
32 | localedir= | |
33 | mandir= | |
34 | ||
35 | # custom variables | |
36 | HOST=`uname -n` | |
37 | PREFIX="`pwd`/work" | |
38 | INSTALL_DIR="$PREFIX" | |
39 | ||
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
40 | # features |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
41 | |
515 | 42 | # clean abort |
43 | abort_configure() | |
44 | { | |
45 | rm -Rf "$TEMP_DIR" | |
46 | exit 1 | |
47 | } | |
48 | ||
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
49 | # help text |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
50 | printhelp() |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
51 | { |
511 | 52 | echo "Usage: $0 [OPTIONS]..." |
53 | cat << __EOF__ | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
54 | Installation directories: |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
55 | --prefix=PREFIX path prefix for architecture-independent files |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
56 | [/usr] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
57 | --exec-prefix=EPREFIX path prefix for architecture-dependent files |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
58 | [PREFIX] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
59 | |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
60 | --bindir=DIR user executables [EPREFIX/bin] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
61 | --sbindir=DIR system admin executables [EPREFIX/sbin] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
62 | --libexecdir=DIR program executables [EPREFIX/libexec] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
63 | --sysconfdir=DIR system configuration files [PREFIX/etc] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
64 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
65 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
515 | 66 | --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
67 | --libdir=DIR object code libraries [EPREFIX/lib] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
68 | --includedir=DIR C header files [PREFIX/include] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
69 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
70 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
71 | --infodir=DIR info documentation [DATAROOTDIR/info] |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
72 | --mandir=DIR man documentation [DATAROOTDIR/man] |
515 | 73 | --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
74 | |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
75 | Optional Features: |
250
f4d93355b054
update configure script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
210
diff
changeset
|
76 | --enable-postgresql |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
77 | |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
78 | __EOF__ |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
79 | } |
40 | 80 | |
81 | # | |
511 | 82 | # parse arguments |
40 | 83 | # |
515 | 84 | BUILD_TYPE="default" |
511 | 85 | for ARG in "$@" |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
86 | do |
267
4ded424f4a5f
update configure script / fix configure on freebsd
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
260
diff
changeset
|
87 | case "$ARG" in |
515 | 88 | "--prefix="*) prefix=${ARG#--prefix=} ;; |
89 | "--exec-prefix="*) exec_prefix=${ARG#--exec-prefix=} ;; | |
90 | "--bindir="*) bindir=${ARG#----bindir=} ;; | |
91 | "--sbindir="*) sbindir=${ARG#--sbindir=} ;; | |
92 | "--libdir="*) libdir=${ARG#--libdir=} ;; | |
93 | "--libexecdir="*) libexecdir=${ARG#--libexecdir=} ;; | |
94 | "--datarootdir="*) datarootdir=${ARG#--datarootdir=} ;; | |
95 | "--datadir="*) datadir=${ARG#--datadir=} ;; | |
96 | "--sysconfdir="*) sysconfdir=${ARG#--sysconfdir=} ;; | |
97 | "--sharedstatedir="*) sharedstatedir=${ARG#--sharedstatedir=} ;; | |
98 | "--localstatedir="*) localstatedir=${ARG#--localstatedir=} ;; | |
99 | "--includedir="*) includedir=${ARG#--includedir=} ;; | |
100 | "--infodir="*) infodir=${ARG#--infodir=} ;; | |
101 | "--mandir"*) mandir=${ARG#--mandir} ;; | |
102 | "--localedir"*) localedir=${ARG#--localedir} ;; | |
103 | "--help"*) printhelp; abort_configure ;; | |
104 | "--debug") BUILD_TYPE="debug" ;; | |
105 | "--release") BUILD_TYPE="release" ;; | |
511 | 106 | "--enable-postgresql") FEATURE_POSTGRESQL=on ;; |
107 | "--disable-postgresql") unset FEATURE_POSTGRESQL ;; | |
515 | 108 | "-"*) echo "unknown option: $ARG"; abort_configure ;; |
511 | 109 | esac |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
110 | done |
40 | 111 | |
515 | 112 | |
113 | ||
114 | # set defaults for dir variables | |
115 | : ${exec_prefix:="$prefix"} | |
116 | : ${bindir:='${exec_prefix}/bin'} | |
117 | : ${sbindir:='${exec_prefix}/sbin'} | |
118 | : ${libdir:='${exec_prefix}/lib'} | |
119 | : ${libexecdir:='${exec_prefix}/libexec'} | |
120 | : ${datarootdir:='${prefix}/share'} | |
121 | : ${datadir:='${datarootdir}'} | |
122 | : ${sysconfdir:='${prefix}/etc'} | |
123 | : ${sharedstatedir:='${prefix}/com'} | |
124 | : ${localstatedir:='${prefix}/var'} | |
125 | : ${runstatedir:='${localstatedir}/run'} | |
126 | : ${includedir:='${prefix}/include'} | |
127 | : ${infodir:='${datarootdir}/info'} | |
128 | : ${mandir:='${datarootdir}/man'} | |
129 | : ${localedir:='${datarootdir}/locale'} | |
130 | ||
131 | # check if a config.site exists and load it | |
132 | if [ -n "$CONFIG_SITE" ]; then | |
133 | # CONFIG_SITE may contain space separated file names | |
134 | for cs in $CONFIG_SITE; do | |
135 | printf "loading defaults from $cs... " | |
136 | . "$cs" | |
137 | echo ok | |
138 | done | |
139 | elif [ -f "$prefix/share/config.site" ]; then | |
140 | printf "loading site defaults... " | |
141 | . "$prefix/share/config.site" | |
142 | echo ok | |
143 | elif [ -f "$prefix/etc/config.site" ]; then | |
144 | printf "loading site defaults... " | |
145 | . "$prefix/etc/config.site" | |
146 | echo ok | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
147 | fi |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
148 | |
515 | 149 | # Test for availability of pkg-config |
150 | PKG_CONFIG=`command -v pkg-config` | |
151 | : ${PKG_CONFIG:="false"} | |
62
c47e081b6c0f
added keyfile based authentication
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
44
diff
changeset
|
152 | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
153 | # Simple uname based platform detection |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
154 | # $PLATFORM is used for platform dependent dependency selection |
515 | 155 | OS=`uname -s` |
156 | OS_VERSION=`uname -r` | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
157 | printf "detect platform... " |
511 | 158 | if [ "$OS" = "SunOS" ]; then |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
159 | PLATFORM="solaris sunos unix svr4" |
515 | 160 | elif [ "$OS" = "Linux" ]; then |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
161 | PLATFORM="linux unix" |
515 | 162 | elif [ "$OS" = "FreeBSD" ]; then |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
163 | PLATFORM="freebsd bsd unix" |
515 | 164 | elif [ "$OS" = "OpenBSD" ]; then |
165 | PLATFORM="openbsd bsd unix" | |
166 | elif [ "$OS" = "NetBSD" ]; then | |
167 | PLATFORM="netbsd bsd unix" | |
168 | elif [ "$OS" = "Darwin" ]; then | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
169 | PLATFORM="macos osx bsd unix" |
515 | 170 | elif echo "$OS" | grep -i "MINGW" > /dev/null; then |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
171 | PLATFORM="windows mingw" |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
172 | fi |
515 | 173 | : ${PLATFORM:="unix"} |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
174 | |
515 | 175 | PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` |
176 | echo "$PLATFORM_NAME" | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
177 | |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
178 | isplatform() |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
179 | { |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
180 | for p in $PLATFORM |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
181 | do |
511 | 182 | if [ "$p" = "$1" ]; then |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
183 | return 0 |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
184 | fi |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
185 | done |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
186 | return 1 |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
187 | } |
515 | 188 | notisplatform() |
207
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
189 | { |
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
190 | for p in $PLATFORM |
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
191 | do |
511 | 192 | if [ "$p" = "$1" ]; then |
207
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
193 | return 1 |
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
194 | fi |
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
195 | done |
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
196 | return 0 |
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
197 | } |
515 | 198 | istoolchain() |
199 | { | |
200 | for t in $TOOLCHAIN | |
201 | do | |
202 | if [ "$t" = "$1" ]; then | |
203 | return 0 | |
204 | fi | |
205 | done | |
206 | return 1 | |
207 | } | |
208 | notistoolchain() | |
209 | { | |
210 | for t in $TOOLCHAIN | |
211 | do | |
212 | if [ "$t" = "$1" ]; then | |
213 | return 1 | |
214 | fi | |
215 | done | |
216 | return 0 | |
217 | } | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
218 | |
40 | 219 | |
515 | 220 | # generate vars.mk |
221 | cat > "$TEMP_DIR/vars.mk" << __EOF__ | |
222 | prefix=$prefix | |
223 | exec_prefix=$exec_prefix | |
224 | bindir=$bindir | |
225 | sbindir=$sbindir | |
226 | libdir=$libdir | |
227 | libexecdir=$libexecdir | |
228 | datarootdir=$datarootdir | |
229 | datadir=$datadir | |
230 | sysconfdir=$sysconfdir | |
231 | sharedstatedir=$sharedstatedir | |
232 | localstatedir=$localstatedir | |
233 | runstatedir=$runstatedir | |
234 | includedir=$includedir | |
235 | infodir=$infodir | |
236 | mandir=$mandir | |
237 | localedir=$localedir | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
238 | HOST=$HOST |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
239 | PREFIX=$PREFIX |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
240 | INSTALL_DIR=$INSTALL_DIR |
40 | 241 | __EOF__ |
242 | ||
515 | 243 | # toolchain detection utilities |
209
a6d8181a8127
replace source with . in configure script and fix toolchain detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
208
diff
changeset
|
244 | . make/toolchain.sh |
40 | 245 | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
246 | # |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
247 | # DEPENDENCIES |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
248 | # |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
249 | |
515 | 250 | # check languages |
251 | lang_c= | |
252 | lang_cpp= | |
253 | if detect_c_compiler ; then | |
254 | lang_c=1 | |
255 | fi | |
256 | ||
257 | # create buffer for make variables required by dependencies | |
258 | echo > "$TEMP_DIR/make.mk" | |
259 | ||
260 | test_pkg_config() | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
261 | { |
515 | 262 | if "$PKG_CONFIG" --exists "$1" ; then : |
263 | else return 1 ; fi | |
264 | if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then : | |
265 | else return 1 ; fi | |
266 | if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then : | |
267 | else return 1 ; fi | |
268 | if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : | |
269 | else return 1 ; fi | |
270 | return 0 | |
271 | } | |
272 | ||
273 | print_check_msg() | |
274 | { | |
275 | if [ -z "$1" ]; then | |
276 | shift | |
277 | printf "$@" | |
278 | fi | |
279 | } | |
280 | ||
281 | dependency_error_libpq() | |
282 | { | |
283 | print_check_msg "$dep_checked_libpq" "checking for libpq... " | |
511 | 284 | # dependency libpq |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
285 | while true |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
286 | do |
206
f5bdca63bbe7
fix some incompabilities in configure
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
204
diff
changeset
|
287 | if [ -z "$PKG_CONFIG" ]; then |
511 | 288 | break |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
289 | fi |
515 | 290 | if test_pkg_config "libpq" "" "" "" ; then |
291 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libpq`" | |
292 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libpq`" | |
293 | else | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
294 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
295 | fi |
511 | 296 | cat >> $TEMP_DIR/make.mk << __EOF__ |
297 | # Dependency: libpq | |
287
a171da778817
prepare build system for postgresql plugin tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
270
diff
changeset
|
298 | CFLAGS += -DENABLE_POSTGRESQL |
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
299 | PLUGINS += postgresql |
287
a171da778817
prepare build system for postgresql plugin tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
270
diff
changeset
|
300 | TEST_PLUGIN_LDFLAGS += -lwspgtest |
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
301 | __EOF__ |
515 | 302 | print_check_msg "$dep_checked_libpq" "yes\n" |
303 | dep_checked_libpq=1 | |
304 | return 1 | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
305 | done |
511 | 306 | |
515 | 307 | print_check_msg "$dep_checked_libpq" "no\n" |
308 | dep_checked_libpq=1 | |
309 | return 0 | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
310 | } |
515 | 311 | dependency_error_openssl() |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
312 | { |
515 | 313 | print_check_msg "$dep_checked_openssl" "checking for openssl... " |
511 | 314 | # dependency openssl |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
315 | while true |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
316 | do |
206
f5bdca63bbe7
fix some incompabilities in configure
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
204
diff
changeset
|
317 | if [ -z "$PKG_CONFIG" ]; then |
511 | 318 | break |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
319 | fi |
515 | 320 | if test_pkg_config "openssl" "" "" "" ; then |
321 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" | |
322 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`" | |
323 | else | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
324 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
325 | fi |
515 | 326 | print_check_msg "$dep_checked_openssl" "yes\n" |
327 | dep_checked_openssl=1 | |
328 | return 1 | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
329 | done |
511 | 330 | |
331 | # dependency openssl | |
458
15bf3c1796f2
fix openssl dependency resolution on bsd
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
453
diff
changeset
|
332 | while true |
15bf3c1796f2
fix openssl dependency resolution on bsd
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
453
diff
changeset
|
333 | do |
511 | 334 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" |
515 | 335 | print_check_msg "$dep_checked_openssl" "yes\n" |
336 | dep_checked_openssl=1 | |
337 | return 1 | |
458
15bf3c1796f2
fix openssl dependency resolution on bsd
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
453
diff
changeset
|
338 | done |
511 | 339 | |
515 | 340 | print_check_msg "$dep_checked_openssl" "no\n" |
341 | dep_checked_openssl=1 | |
342 | return 0 | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
343 | } |
515 | 344 | dependency_error_libxml2() |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
345 | { |
515 | 346 | print_check_msg "$dep_checked_libxml2" "checking for libxml2... " |
511 | 347 | # dependency libxml2 |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
348 | while true |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
349 | do |
206
f5bdca63bbe7
fix some incompabilities in configure
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
204
diff
changeset
|
350 | if [ -z "$PKG_CONFIG" ]; then |
511 | 351 | break |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
352 | fi |
515 | 353 | if test_pkg_config "libxml-2.0" "" "" "" ; then |
354 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`" | |
355 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`" | |
356 | else | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
357 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
358 | fi |
515 | 359 | print_check_msg "$dep_checked_libxml2" "yes\n" |
360 | dep_checked_libxml2=1 | |
361 | return 1 | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
362 | done |
511 | 363 | |
364 | # dependency libxml2 | |
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
365 | while true |
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
366 | do |
515 | 367 | if tmp_flags=`xml2-config --cflags` ; then |
368 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | |
369 | else | |
370 | break | |
371 | fi | |
372 | if tmp_flags=`xml2-config --libs` ; then | |
373 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | |
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
374 | else |
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
375 | break |
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
376 | fi |
515 | 377 | print_check_msg "$dep_checked_libxml2" "yes\n" |
378 | dep_checked_libxml2=1 | |
379 | return 1 | |
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
380 | done |
511 | 381 | |
515 | 382 | print_check_msg "$dep_checked_libxml2" "no\n" |
383 | dep_checked_libxml2=1 | |
384 | return 0 | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
385 | } |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
386 | |
515 | 387 | # start collecting dependency information |
388 | echo > "$TEMP_DIR/flags.mk" | |
389 | ||
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
390 | DEPENDENCIES_FAILED= |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
391 | ERROR=0 |
515 | 392 | # unnamed dependencies |
511 | 393 | TEMP_CFLAGS= |
515 | 394 | TEMP_CXXFLAGS= |
511 | 395 | TEMP_LDFLAGS= |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
396 | while true |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
397 | do |
515 | 398 | while true |
399 | do | |
400 | if [ -z "$lang_c" ] ; then | |
401 | ERROR=1 | |
402 | break | |
403 | fi | |
404 | ||
405 | break | |
406 | done | |
407 | break | |
408 | done | |
409 | while true | |
410 | do | |
411 | if notisplatform "linux"; then | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
412 | break |
109
8a0a7754f123
experimental BSD support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
413 | fi |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
414 | while true |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
415 | do |
511 | 416 | |
417 | TEMP_CFLAGS="$TEMP_CFLAGS -DLINUX" | |
418 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread -ldl -lm -lldap -llber" | |
419 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
420 | # platform dependend source files |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
421 | PLATFORM_DAEMONOBJ = event_linux.o |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
422 | |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
423 | # platform dependend vars |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
424 | OBJ_EXT = .o |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
425 | LIB_EXT = .so |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
426 | APP_EXT = |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
427 | |
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
428 | # ld flags |
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
429 | UCX_SO_NAME = |
485
222557f4f595
fix configure script: escape $$ORIGIN
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
464
diff
changeset
|
430 | RPATH_WS_LIB_FLAG = -Wl,-rpath,'\$\$ORIGIN/../lib' |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
431 | __EOF__ |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
432 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
433 | done |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
434 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
435 | done |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
436 | while true |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
437 | do |
515 | 438 | if notisplatform "bsd"; then |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
439 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
440 | fi |
515 | 441 | if isplatform "macos" || istoolchain "macos"; then |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
442 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
443 | fi |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
444 | while true |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
445 | do |
511 | 446 | |
447 | TEMP_CFLAGS="$TEMP_CFLAGS -DBSD -I/usr/local/include" | |
448 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread -lm -lldap -llber" | |
449 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
450 | # platform dependend source files |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
451 | PLATFORM_DAEMONOBJ = event_bsd.o |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
452 | |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
453 | # platform dependend vars |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
454 | OBJ_EXT = .o |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
455 | LIB_EXT = .so |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
456 | APP_EXT = |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
457 | |
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
458 | # ld flags |
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
459 | UCX_SO_NAME = |
485
222557f4f595
fix configure script: escape $$ORIGIN
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
464
diff
changeset
|
460 | RPATH_WS_LIB_FLAG = -Wl,-rpath,'\$\$ORIGIN/../lib' |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
461 | __EOF__ |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
462 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
463 | done |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
464 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
465 | done |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
466 | while true |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
467 | do |
515 | 468 | if notisplatform "macos"; then |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
469 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
470 | fi |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
471 | while true |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
472 | do |
511 | 473 | |
474 | TEMP_CFLAGS="$TEMP_CFLAGS -DBSD -DOSX" | |
475 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread -ldl -lm -lldap -llber" | |
476 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
477 | # platform dependend source files |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
478 | PLATFORM_DAEMONOBJ = event_bsd.o |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
479 | |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
480 | # platform dependend vars |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
481 | OBJ_EXT = .o |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
482 | LIB_EXT = .dylib |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
483 | APP_EXT = |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
484 | |
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
485 | # ld flags |
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
486 | UCX_SO_NAME = -install_name @rpath/libucx.dylib |
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
487 | RPATH_WS_LIB_FLAG = -rpath @loader_path/../lib |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
488 | __EOF__ |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
489 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
490 | done |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
491 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
492 | done |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
493 | while true |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
494 | do |
515 | 495 | if notisplatform "solaris"; then |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
496 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
497 | fi |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
498 | while true |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
499 | do |
511 | 500 | |
501 | TEMP_CFLAGS="$TEMP_CFLAGS -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" | |
502 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap" | |
503 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
504 | # platform dependend source files |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
505 | PLATFORM_DAEMONOBJ = event_solaris.o |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
506 | |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
507 | # platform dependend vars |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
508 | OBJ_EXT = .o |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
509 | LIB_EXT = .so |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
510 | APP_EXT = |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
511 | __EOF__ |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
512 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
513 | done |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
514 | break |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
515 | done |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
516 | |
515 | 517 | # add general dependency flags to flags.mk |
518 | echo "# general flags" >> "$TEMP_DIR/flags.mk" | |
519 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then | |
520 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
521 | fi |
515 | 522 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
523 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
524 | fi |
511 | 525 | if [ -n "${TEMP_LDFLAGS}" ]; then |
515 | 526 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
109
8a0a7754f123
experimental BSD support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
527 | fi |
8a0a7754f123
experimental BSD support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
528 | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
529 | # |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
530 | # OPTION VALUES |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
531 | # |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
532 | |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
533 | # |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
534 | # TARGETS |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
535 | # |
515 | 536 | |
537 | echo >> "$TEMP_DIR/flags.mk" | |
538 | echo "configuring global target" | |
539 | echo "# flags for unnamed target" >> "$TEMP_DIR/flags.mk" | |
511 | 540 | TEMP_CFLAGS= |
541 | TEMP_CXXFLAGS= | |
542 | TEMP_LDFLAGS= | |
62
c47e081b6c0f
added keyfile based authentication
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
44
diff
changeset
|
543 | |
515 | 544 | if dependency_error_libxml2; then |
511 | 545 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " |
546 | ERROR=1 | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
547 | fi |
515 | 548 | if dependency_error_openssl; then |
511 | 549 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " |
550 | ERROR=1 | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
551 | fi |
41
bb7a1f5a8b48
added Linux support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
40
diff
changeset
|
552 | |
250
f4d93355b054
update configure script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
210
diff
changeset
|
553 | # Features |
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
554 | |
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
555 | |
515 | 556 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
557 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
558 | fi | |
559 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then | |
560 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
561 | fi |
515 | 562 | if [ "$BUILD_TYPE" = "debug" ]; then |
563 | if [ -n "$lang_c" ]; then | |
564 | echo 'CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
565 | fi | |
566 | if [ -n "$lang_cpp" ]; then | |
567 | echo 'CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
568 | fi | |
569 | fi | |
570 | if [ "$BUILD_TYPE" = "release" ]; then | |
571 | if [ -n "$lang_c" ]; then | |
572 | echo 'CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
573 | fi | |
574 | if [ -n "$lang_cpp" ]; then | |
575 | echo 'CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
576 | fi | |
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
577 | fi |
511 | 578 | if [ -n "${TEMP_LDFLAGS}" ]; then |
515 | 579 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
580 | fi |
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
581 | |
515 | 582 | echo >> "$TEMP_DIR/flags.mk" |
583 | echo "configuring target: postgresql" | |
584 | echo "# flags for target postgresql" >> "$TEMP_DIR/flags.mk" | |
511 | 585 | TEMP_CFLAGS= |
515 | 586 | TEMP_CXXFLAGS= |
511 | 587 | TEMP_LDFLAGS= |
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
588 | |
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
589 | |
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
590 | # Features |
511 | 591 | if [ -n "$FEATURE_POSTGRESQL" ]; then |
592 | # check dependency | |
515 | 593 | if dependency_error_libpq ; then |
511 | 594 | # "auto" features can fail and are just disabled in this case |
515 | 595 | if [ "$FEATURE_POSTGRESQL" = "auto" ]; then |
596 | DISABLE_FEATURE_POSTGRESQL=1 | |
597 | else | |
511 | 598 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq " |
599 | ERROR=1 | |
600 | fi | |
601 | fi | |
515 | 602 | if [ -n "$DISABLE_FEATURE_POSTGRESQL" ]; then |
603 | unset FEATURE_POSTGRESQL | |
604 | fi | |
250
f4d93355b054
update configure script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
210
diff
changeset
|
605 | fi |
f4d93355b054
update configure script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
210
diff
changeset
|
606 | |
40 | 607 | |
515 | 608 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
609 | echo "POSTGRESQL_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
610 | fi | |
611 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then | |
612 | echo "POSTGRESQL_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
613 | fi |
515 | 614 | if [ "$BUILD_TYPE" = "debug" ]; then |
615 | if [ -n "$lang_c" ]; then | |
616 | echo 'POSTGRESQL_CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
617 | fi | |
618 | if [ -n "$lang_cpp" ]; then | |
619 | echo 'POSTGRESQL_CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
620 | fi | |
621 | fi | |
622 | if [ "$BUILD_TYPE" = "release" ]; then | |
623 | if [ -n "$lang_c" ]; then | |
624 | echo 'POSTGRESQL_CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
625 | fi | |
626 | if [ -n "$lang_cpp" ]; then | |
627 | echo 'POSTGRESQL_CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
628 | fi | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
629 | fi |
511 | 630 | if [ -n "${TEMP_LDFLAGS}" ]; then |
515 | 631 | echo "POSTGRESQL_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
632 | fi |
40 | 633 | |
515 | 634 | |
635 | # final result | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
636 | if [ $ERROR -ne 0 ]; then |
511 | 637 | echo |
638 | echo "Error: Unresolved dependencies" | |
639 | echo "$DEPENDENCIES_FAILED" | |
515 | 640 | abort_configure |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
641 | fi |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
642 | |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
643 | echo "configure finished" |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
644 | echo |
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
645 | echo "Build Config:" |
515 | 646 | echo " PREFIX: $prefix" |
647 | echo " TOOLCHAIN: $TOOLCHAIN_NAME" | |
648 | echo "Features:" | |
649 | if [ -n "$FEATURE_POSTGRESQL" ]; then | |
650 | echo " postgresql: on" | |
651 | else | |
652 | echo " postgresql: off" | |
653 | fi | |
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
654 | echo |
515 | 655 | |
656 | # generate the config.mk file | |
657 | cat > "$TEMP_DIR/config.mk" << __EOF__ | |
658 | # | |
659 | # config.mk generated by configure | |
660 | # | |
661 | ||
662 | __EOF__ | |
663 | write_toolchain_defaults "$TEMP_DIR/toolchain.mk" | |
664 | cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk | |
511 | 665 | rm -Rf "$TEMP_DIR" |