61 |
61 |
62 __EOF__ |
62 __EOF__ |
63 } |
63 } |
64 |
64 |
65 # |
65 # |
66 # parse arguments |
66 # parse arguments |
67 # |
67 # |
68 for ARG in $@ |
68 for ARG in "$@" |
69 do |
69 do |
70 case "$ARG" in |
70 case "$ARG" in |
71 "--prefix="*) PREFIX=${ARG#--prefix=} ;; |
71 "--prefix="*) PREFIX=${ARG#--prefix=} ;; |
72 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;; |
72 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;; |
73 "--bindir="*) BINDIR=${ARG#----bindir=} ;; |
73 "--bindir="*) BINDIR=${ARG#----bindir=} ;; |
74 "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;; |
74 "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;; |
75 "--libdir="*) LIBDIR=${ARG#--libdir=} ;; |
75 "--libdir="*) LIBDIR=${ARG#--libdir=} ;; |
76 "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;; |
76 "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;; |
77 "--datadir="*) DATADIR=${ARG#--datadir=} ;; |
77 "--datadir="*) DATADIR=${ARG#--datadir=} ;; |
78 "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;; |
78 "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;; |
79 "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;; |
79 "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;; |
80 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;; |
80 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;; |
81 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;; |
81 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;; |
82 "--infodir="*) INFODIR=${ARG#--infodir=} ;; |
82 "--infodir="*) INFODIR=${ARG#--infodir=} ;; |
83 "--mandir"*) MANDIR=${ARG#--mandir} ;; |
83 "--mandir"*) MANDIR=${ARG#--mandir} ;; |
84 "--help"*) printhelp; exit 1 ;; |
84 "--help"*) printhelp; rm -Rf "$TEMP_DIR"; exit 1 ;; |
85 "--enable-postgresql") FEATURE_POSTGRESQL=on ;; |
85 "--enable-postgresql") FEATURE_POSTGRESQL=on ;; |
86 "--disable-postgresql") unset FEATURE_POSTGRESQL ;; |
86 "--disable-postgresql") unset FEATURE_POSTGRESQL ;; |
87 "-"*) echo "unknown option: $ARG"; exit 1 ;; |
87 "-"*) echo "unknown option: $ARG"; rm -Rf "$TEMP_DIR"; exit 1 ;; |
88 esac |
88 esac |
89 done |
89 done |
90 |
90 |
91 # set dir variables |
91 # set dir variables |
92 if [ -z "$BINDIR" ]; then |
92 if [ -z "$BINDIR" ]; then |
93 BINDIR=$EPREFIX/bin |
93 BINDIR=$EPREFIX/bin |
94 fi |
94 fi |
95 if [ -z "$SBINDIR" ]; then |
95 if [ -z "$SBINDIR" ]; then |
96 SBINDIR=$EPREFIX/sbin |
96 SBINDIR=$EPREFIX/sbin |
97 fi |
97 fi |
98 if [ -z "$LIBDIR" ]; then |
98 if [ -z "$LIBDIR" ]; then |
99 LIBDIR=$EPREFIX/lib |
99 LIBDIR=$EPREFIX/lib |
100 fi |
100 fi |
101 if [ -z "$LIBEXEC" ]; then |
101 if [ -z "$LIBEXEC" ]; then |
102 LIBEXECDIR=$EPREFIX/libexec |
102 LIBEXECDIR=$EPREFIX/libexec |
103 fi |
103 fi |
104 if [ -z "$DATADIR" ]; then |
104 if [ -z "$DATADIR" ]; then |
105 DATADIR=$PREFIX/share |
105 DATADIR=$PREFIX/share |
106 fi |
106 fi |
107 if [ -z "$SYSCONFDIR" ]; then |
107 if [ -z "$SYSCONFDIR" ]; then |
108 SYSCONFDIR=$PREFIX/etc |
108 SYSCONFDIR=$PREFIX/etc |
109 fi |
109 fi |
110 if [ -z "$SHAREDSTATEDIR" ]; then |
110 if [ -z "$SHAREDSTATEDIR" ]; then |
111 SHAREDSTATEDIR=$PREFIX/com |
111 SHAREDSTATEDIR=$PREFIX/com |
112 fi |
112 fi |
113 if [ -z "$LOCALSTATEDIR" ]; then |
113 if [ -z "$LOCALSTATEDIR" ]; then |
114 LOCALSTATEDIR=$PREFIX/var |
114 LOCALSTATEDIR=$PREFIX/var |
115 fi |
115 fi |
116 if [ -z "$INCLUDEDIR" ]; then |
116 if [ -z "$INCLUDEDIR" ]; then |
117 INCLUDEDIR=$PREFIX/include |
117 INCLUDEDIR=$PREFIX/include |
118 fi |
118 fi |
119 if [ -z "$INFODIR" ]; then |
119 if [ -z "$INFODIR" ]; then |
120 INFODIR=$PREFIX/info |
120 INFODIR=$PREFIX/info |
121 fi |
121 fi |
122 if [ -z "$MANDIR" ]; then |
122 if [ -z "$MANDIR" ]; then |
123 MANDIR=$PREFIX/man |
123 MANDIR=$PREFIX/man |
124 fi |
124 fi |
125 |
125 |
126 which pkg-config > /dev/null |
126 which pkg-config > /dev/null |
127 if [ $? -eq 0 ]; then |
127 if [ $? -eq 0 ]; then |
128 PKG_CONFIG=pkg-config |
128 PKG_CONFIG=pkg-config |
131 fi |
131 fi |
132 |
132 |
133 # Simple uname based platform detection |
133 # Simple uname based platform detection |
134 # $PLATFORM is used for platform dependent dependency selection |
134 # $PLATFORM is used for platform dependent dependency selection |
135 printf "detect platform... " |
135 printf "detect platform... " |
136 if [ $OS = SunOS ]; then |
136 if [ "$OS" = "SunOS" ]; then |
137 PLATFORM="solaris sunos unix svr4" |
137 PLATFORM="solaris sunos unix svr4" |
138 fi |
138 fi |
139 if [ $OS = Linux ]; then |
139 if [ "$OS" = "Linux" ]; then |
140 PLATFORM="linux unix" |
140 PLATFORM="linux unix" |
141 fi |
141 fi |
142 if [ $OS = FreeBSD ]; then |
142 if [ "$OS" = "FreeBSD" ]; then |
143 PLATFORM="freebsd bsd unix" |
143 PLATFORM="freebsd bsd unix" |
144 fi |
144 fi |
145 if [ $OS = Darwin ]; then |
145 if [ "$OS" = "Darwin" ]; then |
146 PLATFORM="macos osx bsd unix" |
146 PLATFORM="macos osx bsd unix" |
147 fi |
147 fi |
148 echo $OS | grep "MINGW" > /dev/null |
148 echo "$OS" | grep -i "MINGW" > /dev/null |
149 if [ $? -eq 0 ]; then |
149 if [ $? -eq 0 ]; then |
150 PLATFORM="windows mingw" |
150 PLATFORM="windows mingw" |
151 fi |
151 fi |
152 |
152 |
153 if [ -z "$PLATFORM" ]; then |
153 if [ -z "$PLATFORM" ]; then |
154 PLATFORM="unix" |
154 PLATFORM="unix" |
155 fi |
155 fi |
156 |
156 |
157 for p in $PLATFORM |
157 for p in $PLATFORM |
158 do |
158 do |
159 PLATFORM_NAME=$p |
159 PLATFORM_NAME=$p |
160 break |
160 break |
161 done |
161 done |
162 echo $PLATFORM_NAME |
162 echo $PLATFORM_NAME |
163 |
163 |
164 isplatform() |
164 isplatform() |
165 { |
165 { |
166 for p in $PLATFORM |
166 for p in $PLATFORM |
167 do |
167 do |
168 if [ $p = $1 ]; then |
168 if [ "$p" = "$1" ]; then |
169 return 0 |
169 return 0 |
170 fi |
170 fi |
171 done |
171 done |
172 return 1 |
172 return 1 |
173 } |
173 } |
174 isnotplatform() |
174 isnotplatform() |
175 { |
175 { |
176 for p in $PLATFORM |
176 for p in $PLATFORM |
177 do |
177 do |
178 if [ $p = $1 ]; then |
178 if [ "$p" = "$1" ]; then |
179 return 1 |
179 return 1 |
180 fi |
180 fi |
181 done |
181 done |
182 return 0 |
182 return 0 |
183 } |
183 } |
184 |
184 |
185 # generate config.mk and config.h |
185 # generate config.mk and config.h |
186 cat > $TEMP_DIR/config.mk << __EOF__ |
186 cat > "$TEMP_DIR/config.mk" << __EOF__ |
187 # |
187 # |
188 # config.mk generated by configure |
188 # config.mk generated by configure |
189 # |
189 # |
190 |
190 |
191 # general vars |
191 # general vars |
207 INFODIR=$INFODIR |
207 INFODIR=$INFODIR |
208 MANDIR=$MANDIR |
208 MANDIR=$MANDIR |
209 |
209 |
210 __EOF__ |
210 __EOF__ |
211 |
211 |
212 echo > $TEMP_DIR/make.mk |
212 echo > "$TEMP_DIR/make.mk" |
213 |
213 |
214 ENV_CFLAGS=$CFLAGS |
214 ENV_CFLAGS=$CFLAGS |
215 ENV_LDFLAGS=$LDFLAGS |
215 ENV_LDFLAGS=$LDFLAGS |
216 ENV_CXXFLAGS=$CXXFLAGS |
216 ENV_CXXFLAGS=$CXXFLAGS |
217 |
217 |
218 # Toolchain detection |
218 # Toolchain detection |
219 # this will insert make vars to config.mk |
219 # this will insert make vars to config.mk |
220 . make/toolchain.sh |
220 . make/toolchain.sh |
221 |
221 |
222 # add user specified flags to config.mk |
222 # add user specified flags to config.mk |
223 echo >> $TEMP_DIR/config.mk |
223 echo "# project specific flags" >> "$TEMP_DIR/config.mk" |
224 if [ ! -z "${ENV_CFLAGS}" ]; then |
224 if [ -n "${ENV_CFLAGS}" ]; then |
225 echo "CFLAGS += $ENV_CFLAGS" >> $TEMP_DIR/config.mk |
225 echo "CFLAGS += $ENV_CFLAGS" >> "$TEMP_DIR/config.mk" |
226 fi |
226 fi |
227 if [ ! -z "${ENV_CXXFLAGS}" ]; then |
227 if [ -n "${ENV_CXXFLAGS}" ]; then |
228 echo "CXXFLAGS += $ENV_CXXFLAGS" >> $TEMP_DIR/config.mk |
228 echo "CXXFLAGS += $ENV_CXXFLAGS" >> "$TEMP_DIR/config.mk" |
229 fi |
229 fi |
230 if [ ! -z "${ENV_LDFLAGS}" ]; then |
230 if [ -n "${ENV_LDFLAGS}" ]; then |
231 echo "LDFLAGS += $ENV_LDFLAGS" >> $TEMP_DIR/config.mk |
231 echo "LDFLAGS += $ENV_LDFLAGS" >> "$TEMP_DIR/config.mk" |
232 fi |
232 fi |
233 |
233 |
234 # |
234 # |
235 # DEPENDENCIES |
235 # DEPENDENCIES |
236 # |
236 # |
237 |
237 |
238 dependency_libpq() |
238 dependency_libpq() |
239 { |
239 { |
240 printf "checking for libpq... " |
240 printf "checking for libpq... " |
241 # dependency libpq |
241 # dependency libpq |
242 while true |
242 while true |
243 do |
243 do |
244 if [ -z "$PKG_CONFIG" ]; then |
244 if [ -z "$PKG_CONFIG" ]; then |
245 break |
245 break |
246 fi |
246 fi |
247 $PKG_CONFIG libpq |
247 $PKG_CONFIG libpq |
248 if [ $? -ne 0 ] ; then |
248 if [ $? -ne 0 ] ; then |
249 break |
249 break |
250 fi |
250 fi |
251 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libpq`" |
251 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags libpq`" |
252 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs libpq`" |
252 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs libpq`" |
253 cat >> $TEMP_DIR/make.mk << __EOF__ |
253 cat >> $TEMP_DIR/make.mk << __EOF__ |
254 # Dependency: libpq |
254 # Dependency: libpq |
255 CFLAGS += -DENABLE_POSTGRESQL |
255 CFLAGS += -DENABLE_POSTGRESQL |
256 PLUGINS += postgresql |
256 PLUGINS += postgresql |
257 TEST_PLUGIN_LDFLAGS += -lwspgtest |
257 TEST_PLUGIN_LDFLAGS += -lwspgtest |
258 |
258 |
259 __EOF__ |
259 __EOF__ |
260 echo yes |
260 echo yes |
261 return 0 |
261 return 0 |
262 done |
262 done |
263 |
263 |
264 echo no |
264 echo no |
265 return 1 |
265 return 1 |
266 } |
266 } |
267 dependency_openssl() |
267 dependency_openssl() |
268 { |
268 { |
269 printf "checking for openssl... " |
269 printf "checking for openssl... " |
270 # dependency openssl |
270 # dependency openssl |
271 while true |
271 while true |
272 do |
272 do |
273 if [ -z "$PKG_CONFIG" ]; then |
273 if [ -z "$PKG_CONFIG" ]; then |
274 break |
274 break |
275 fi |
275 fi |
276 $PKG_CONFIG openssl |
276 $PKG_CONFIG openssl |
277 if [ $? -ne 0 ] ; then |
277 if [ $? -ne 0 ] ; then |
278 break |
278 break |
279 fi |
279 fi |
280 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags openssl`" |
280 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags openssl`" |
281 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs openssl`" |
281 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs openssl`" |
282 echo yes |
282 echo yes |
283 return 0 |
283 return 0 |
284 done |
284 done |
285 |
285 |
286 # dependency openssl |
286 # dependency openssl |
287 while true |
287 while true |
288 do |
288 do |
289 LDFLAGS="$LDFLAGS -lssl -lcrypto" |
289 TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" |
290 echo yes |
290 echo yes |
291 return 0 |
291 return 0 |
292 done |
292 done |
293 |
293 |
294 echo no |
294 echo no |
295 return 1 |
295 return 1 |
296 } |
296 } |
297 dependency_libxml2() |
297 dependency_libxml2() |
298 { |
298 { |
299 printf "checking for libxml2... " |
299 printf "checking for libxml2... " |
300 # dependency libxml2 |
300 # dependency libxml2 |
301 while true |
301 while true |
302 do |
302 do |
303 if [ -z "$PKG_CONFIG" ]; then |
303 if [ -z "$PKG_CONFIG" ]; then |
304 break |
304 break |
305 fi |
305 fi |
306 $PKG_CONFIG libxml-2.0 |
306 $PKG_CONFIG libxml-2.0 |
307 if [ $? -ne 0 ] ; then |
307 if [ $? -ne 0 ] ; then |
308 break |
308 break |
309 fi |
309 fi |
310 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libxml-2.0`" |
310 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags libxml-2.0`" |
311 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs libxml-2.0`" |
311 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs libxml-2.0`" |
312 echo yes |
312 echo yes |
313 return 0 |
313 return 0 |
314 done |
314 done |
315 |
315 |
316 # dependency libxml2 |
316 # dependency libxml2 |
317 while true |
317 while true |
318 do |
318 do |
319 xml2-config --cflags > /dev/null |
319 xml2-config --cflags > /dev/null |
320 if [ $? -eq 0 ]; then |
320 if [ $? -eq 0 ]; then |
321 CFLAGS="$CFLAGS `xml2-config --cflags`" |
321 TEMP_CFLAGS="$TEMP_CFLAGS `xml2-config --cflags`" |
322 else |
322 else |
323 break |
323 break |
324 fi |
324 fi |
325 echo yes |
325 echo yes |
326 return 0 |
326 return 0 |
327 done |
327 done |
328 |
328 |
329 echo no |
329 echo no |
330 return 1 |
330 return 1 |
331 } |
331 } |
332 |
332 |
333 DEPENDENCIES_FAILED= |
333 DEPENDENCIES_FAILED= |
334 ERROR=0 |
334 ERROR=0 |
335 # general dependencies |
335 # general dependencies |
336 CFLAGS= |
336 TEMP_CFLAGS= |
337 LDFLAGS= |
337 TEMP_LDFLAGS= |
338 while true |
338 while true |
339 do |
339 do |
340 if isnotplatform "linux"; then |
340 if isnotplatform "linux"; then |
341 break |
341 break |
342 fi |
342 fi |
343 while true |
343 while true |
344 do |
344 do |
345 |
345 |
346 CFLAGS="$CFLAGS -DLINUX" |
346 TEMP_CFLAGS="$TEMP_CFLAGS -DLINUX" |
347 LDFLAGS="$LDFLAGS -lpthread -ldl -lm -lldap -llber" |
347 TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread -ldl -lm -lldap -llber" |
348 cat >> $TEMP_DIR/make.mk << __EOF__ |
348 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
349 # platform dependend source files |
349 # platform dependend source files |
350 PLATFORM_DAEMONOBJ = event_linux.o |
350 PLATFORM_DAEMONOBJ = event_linux.o |
351 |
351 |
352 # platform dependend vars |
352 # platform dependend vars |
353 OBJ_EXT = .o |
353 OBJ_EXT = .o |
420 # ld flags |
420 # ld flags |
421 UCX_SO_NAME = -install_name @rpath/libucx.dylib |
421 UCX_SO_NAME = -install_name @rpath/libucx.dylib |
422 RPATH_WS_LIB_FLAG = -rpath @loader_path/../lib |
422 RPATH_WS_LIB_FLAG = -rpath @loader_path/../lib |
423 |
423 |
424 __EOF__ |
424 __EOF__ |
425 |
425 |
426 break |
426 break |
427 done |
427 done |
428 |
428 |
429 break |
429 break |
430 done |
430 done |
431 while true |
431 while true |
432 do |
432 do |
433 if isnotplatform "solaris"; then |
433 if isnotplatform "solaris"; then |
434 break |
434 break |
435 fi |
435 fi |
436 while true |
436 while true |
437 do |
437 do |
438 |
438 |
439 CFLAGS="$CFLAGS -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" |
439 TEMP_CFLAGS="$TEMP_CFLAGS -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" |
440 LDFLAGS="$LDFLAGS -lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap" |
440 TEMP_LDFLAGS="$TEMP_LDFLAGS -lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap" |
441 cat >> $TEMP_DIR/make.mk << __EOF__ |
441 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
442 # platform dependend source files |
442 # platform dependend source files |
443 PLATFORM_DAEMONOBJ = event_solaris.o |
443 PLATFORM_DAEMONOBJ = event_solaris.o |
444 |
444 |
445 # platform dependend vars |
445 # platform dependend vars |
446 OBJ_EXT = .o |
446 OBJ_EXT = .o |
447 LIB_EXT = .so |
447 LIB_EXT = .so |
448 APP_EXT = |
448 APP_EXT = |
449 |
449 |
450 __EOF__ |
450 __EOF__ |
451 |
451 |
452 break |
452 break |
453 done |
453 done |
454 |
454 |
455 break |
455 break |
456 done |
456 done |
457 |
457 |
458 # add general dependency flags to config.mk |
458 # add general dependency flags to config.mk |
459 echo >> $TEMP_DIR/config.mk |
459 echo >> "$TEMP_DIR/config.mk" |
460 if [ ! -z "${CFLAGS}" ]; then |
460 if [ -n "${TEMP_CFLAGS}" ]; then |
461 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk |
461 echo "CFLAGS += $TEMP_CFLAGS" >> $TEMP_DIR/config.mk |
462 fi |
462 fi |
463 if [ ! -z "${CXXFLAGS}" ]; then |
463 if [ -n "${TEMP_CXXFLAGS}" ]; then |
464 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk |
464 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> $TEMP_DIR/config.mk |
465 fi |
465 fi |
466 if [ ! -z "${LDFLAGS}" ]; then |
466 if [ -n "${TEMP_LDFLAGS}" ]; then |
467 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk |
467 echo "LDFLAGS += $TEMP_LDFLAGS" >> $TEMP_DIR/config.mk |
468 fi |
468 fi |
469 |
469 |
470 # |
470 # |
471 # OPTION VALUES |
471 # OPTION VALUES |
472 # |
472 # |
473 |
473 |
474 # |
474 # |
475 # TARGETS |
475 # TARGETS |
476 # |
476 # |
477 CFLAGS= |
477 TEMP_CFLAGS= |
478 CXXFLAGS= |
478 TEMP_CXXFLAGS= |
479 LDFLAGS= |
479 TEMP_LDFLAGS= |
480 |
480 |
481 # Target |
481 # Target |
482 CFLAGS= |
482 TEMP_CFLAGS= |
483 LDFLAGS= |
483 TEMP_LDFLAGS= |
484 CXXFLAGS= |
484 TEMP_CXXFLAGS= |
485 |
485 |
486 dependency_libxml2 |
486 dependency_libxml2 |
487 if [ $? -ne 0 ]; then |
487 if [ $? -ne 0 ]; then |
488 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " |
488 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " |
489 ERROR=1 |
489 ERROR=1 |
490 fi |
490 fi |
491 dependency_openssl |
491 dependency_openssl |
492 if [ $? -ne 0 ]; then |
492 if [ $? -ne 0 ]; then |
493 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " |
493 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " |
494 ERROR=1 |
494 ERROR=1 |
495 fi |
495 fi |
496 |
496 |
497 # Features |
497 # Features |
498 |
498 |
499 |
499 |
500 echo >> $TEMP_DIR/config.mk |
500 echo >> "$TEMP_DIR/config.mk" |
501 if [ ! -z "${CFLAGS}" ]; then |
501 if [ -n "${TEMP_CFLAGS}" ]; then |
502 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk |
502 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk" |
503 fi |
503 fi |
504 if [ ! -z "${CXXFLAGS}" ]; then |
504 if [ -n "${TEMP_CXXFLAGS}" ]; then |
505 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk |
505 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk" |
506 fi |
506 fi |
507 if [ ! -z "${LDFLAGS}" ]; then |
507 if [ -n "${TEMP_LDFLAGS}" ]; then |
508 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk |
508 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk" |
509 fi |
509 fi |
510 |
510 |
511 # Target: postgresql |
511 # Target: postgresql |
512 CFLAGS= |
512 TEMP_CFLAGS= |
513 LDFLAGS= |
513 TEMP_LDFLAGS= |
514 CXXFLAGS= |
514 TEMP_CXXFLAGS= |
515 |
515 |
516 |
516 |
517 # Features |
517 # Features |
518 if [ ! -z "$FEATURE_POSTGRESQL" ]; then |
518 if [ -n "$FEATURE_POSTGRESQL" ]; then |
519 # check dependency |
519 # check dependency |
520 dependency_libpq |
520 dependency_libpq |
521 if [ $? -ne 0 ]; then |
521 if [ $? -ne 0 ]; then |
522 # "auto" features can fail and are just disabled in this case |
522 # "auto" features can fail and are just disabled in this case |
523 if [ $FEATURE_POSTGRESQL != "auto" ]; then |
523 if [ "$FEATURE_POSTGRESQL" != "auto" ]; then |
524 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq " |
524 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq " |
525 ERROR=1 |
525 ERROR=1 |
526 fi |
526 fi |
527 fi |
527 fi |
528 fi |
528 fi |
529 |
529 |
530 |
530 |
531 echo >> $TEMP_DIR/config.mk |
531 echo >> "$TEMP_DIR/config.mk" |
532 if [ ! -z "${CFLAGS}" ]; then |
532 if [ -n "${TEMP_CFLAGS}" ]; then |
533 echo "POSTGRESQL_CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk |
533 echo "POSTGRESQL_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk" |
534 fi |
534 fi |
535 if [ ! -z "${CXXFLAGS}" ]; then |
535 if [ -n "${TEMP_CXXFLAGS}" ]; then |
536 echo "POSTGRESQL_CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk |
536 echo "POSTGRESQL_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk" |
537 fi |
537 fi |
538 if [ ! -z "${LDFLAGS}" ]; then |
538 if [ -n "${TEMP_LDFLAGS}" ]; then |
539 echo "POSTGRESQL_LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk |
539 echo "POSTGRESQL_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk" |
540 fi |
540 fi |
541 |
541 |
542 if [ $ERROR -ne 0 ]; then |
542 if [ $ERROR -ne 0 ]; then |
543 echo |
543 echo |
544 echo "Error: Unresolved dependencies" |
544 echo "Error: Unresolved dependencies" |
545 echo $DEPENDENCIES_FAILED |
545 echo "$DEPENDENCIES_FAILED" |
546 rm -Rf $TEMP_DIR |
546 rm -Rf "$TEMP_DIR" |
547 exit 1 |
547 exit 1 |
548 fi |
548 fi |
549 |
549 |
550 echo "configure finished" |
550 echo "configure finished" |
551 echo |
551 echo |
552 echo "Build Config:" |
552 echo "Build Config:" |
553 echo " PREFIX: $PREFIX" |
553 echo " PREFIX: $PREFIX" |
554 echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
554 echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
555 echo |
555 echo |
556 cat $TEMP_DIR/config.mk $TEMP_DIR/make.mk > config.mk |
556 cat "$TEMP_DIR/config.mk" "$TEMP_DIR/make.mk" > config.mk |
557 rm -Rf $TEMP_DIR |
557 rm -Rf "$TEMP_DIR" |
558 |
558 |
559 |
559 |