252 if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : |
252 if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : |
253 else return 1 ; fi |
253 else return 1 ; fi |
254 return 0 |
254 return 0 |
255 } |
255 } |
256 |
256 |
|
257 print_check_msg() |
|
258 { |
|
259 if [ -z "$1" ]; then |
|
260 shift |
|
261 printf "$@" |
|
262 fi |
|
263 } |
|
264 |
257 dependency_error_cpp() |
265 dependency_error_cpp() |
258 { |
266 { |
259 printf "checking for cpp... " |
267 print_check_msg "$dep_checked_cpp" "checking for cpp... " |
260 # dependency cpp |
268 # dependency cpp |
261 while true |
269 while true |
262 do |
270 do |
263 if [ -z "$lang_cpp" ] ; then |
271 if [ -z "$lang_cpp" ] ; then |
264 break |
272 break |
265 fi |
273 fi |
266 echo yes |
274 print_check_msg "$dep_checked_cpp" "yes\n" |
|
275 dep_checked_cpp=1 |
267 return 1 |
276 return 1 |
268 done |
277 done |
269 |
278 |
270 echo no |
279 print_check_msg "$dep_checked_cpp" "no\n" |
|
280 dep_checked_cpp=1 |
271 return 0 |
281 return 0 |
272 } |
282 } |
273 dependency_error_libpq() |
283 dependency_error_libpq() |
274 { |
284 { |
275 printf "checking for libpq... " |
285 print_check_msg "$dep_checked_libpq" "checking for libpq... " |
276 # dependency libpq |
286 # dependency libpq |
277 while true |
287 while true |
278 do |
288 do |
279 if [ -z "$PKG_CONFIG" ]; then |
289 if [ -z "$PKG_CONFIG" ]; then |
280 break |
290 break |
283 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libpq`" |
293 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libpq`" |
284 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libpq`" |
294 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libpq`" |
285 else |
295 else |
286 break |
296 break |
287 fi |
297 fi |
288 echo yes |
298 print_check_msg "$dep_checked_libpq" "yes\n" |
|
299 dep_checked_libpq=1 |
289 return 1 |
300 return 1 |
290 done |
301 done |
291 |
302 |
292 echo no |
303 print_check_msg "$dep_checked_libpq" "no\n" |
|
304 dep_checked_libpq=1 |
293 return 0 |
305 return 0 |
294 } |
306 } |
295 dependency_error_openssl() |
307 dependency_error_openssl() |
296 { |
308 { |
297 printf "checking for openssl... " |
309 print_check_msg "$dep_checked_openssl" "checking for openssl... " |
298 # dependency openssl |
310 # dependency openssl |
299 while true |
311 while true |
300 do |
312 do |
301 if [ -z "$lang_c" ] ; then |
313 if [ -z "$lang_c" ] ; then |
302 break |
314 break |
308 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" |
320 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" |
309 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`" |
321 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`" |
310 else |
322 else |
311 break |
323 break |
312 fi |
324 fi |
313 echo yes |
325 print_check_msg "$dep_checked_openssl" "yes\n" |
|
326 dep_checked_openssl=1 |
314 return 1 |
327 return 1 |
315 done |
328 done |
316 |
329 |
317 # dependency openssl platform="bsd" |
330 # dependency openssl platform="bsd" |
318 while true |
331 while true |
319 do |
332 do |
320 if notisplatform "bsd"; then |
333 if notisplatform "bsd"; then |
321 break |
334 break |
322 fi |
335 fi |
323 TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" |
336 TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" |
324 echo yes |
337 print_check_msg "$dep_checked_openssl" "yes\n" |
|
338 dep_checked_openssl=1 |
325 return 1 |
339 return 1 |
326 done |
340 done |
327 |
341 |
328 echo no |
342 print_check_msg "$dep_checked_openssl" "no\n" |
|
343 dep_checked_openssl=1 |
329 return 0 |
344 return 0 |
330 } |
345 } |
331 dependency_error_libxml2() |
346 dependency_error_libxml2() |
332 { |
347 { |
333 printf "checking for libxml2... " |
348 print_check_msg "$dep_checked_libxml2" "checking for libxml2... " |
334 # dependency libxml2 platform="macos" |
349 # dependency libxml2 platform="macos" |
335 while true |
350 while true |
336 do |
351 do |
337 if notisplatform "macos"; then |
352 if notisplatform "macos"; then |
338 break |
353 break |
361 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`" |
377 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`" |
362 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`" |
378 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`" |
363 else |
379 else |
364 break |
380 break |
365 fi |
381 fi |
366 echo yes |
382 print_check_msg "$dep_checked_libxml2" "yes\n" |
|
383 dep_checked_libxml2=1 |
367 return 1 |
384 return 1 |
368 done |
385 done |
369 |
386 |
370 echo no |
387 print_check_msg "$dep_checked_libxml2" "no\n" |
|
388 dep_checked_libxml2=1 |
371 return 0 |
389 return 0 |
372 } |
390 } |
373 |
|
374 |
|
375 |
|
376 |
391 |
377 # start collecting dependency information |
392 # start collecting dependency information |
378 echo > "$TEMP_DIR/flags.mk" |
393 echo > "$TEMP_DIR/flags.mk" |
379 |
394 |
380 DEPENDENCIES_FAILED= |
395 DEPENDENCIES_FAILED= |
397 break |
412 break |
398 done |
413 done |
399 |
414 |
400 # add general dependency flags to flags.mk |
415 # add general dependency flags to flags.mk |
401 echo "# general flags" >> "$TEMP_DIR/flags.mk" |
416 echo "# general flags" >> "$TEMP_DIR/flags.mk" |
402 if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then |
417 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
403 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
418 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
404 fi |
419 fi |
405 if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then |
420 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
406 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
421 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
407 fi |
422 fi |
408 if [ -n "${TEMP_LDFLAGS}" ]; then |
423 if [ -n "${TEMP_LDFLAGS}" ]; then |
409 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
424 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
410 fi |
425 fi |
459 unset FEATURE_PG |
474 unset FEATURE_PG |
460 fi |
475 fi |
461 fi |
476 fi |
462 |
477 |
463 |
478 |
464 if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then |
479 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
465 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
480 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
466 fi |
481 fi |
467 if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then |
482 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
468 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
483 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
469 fi |
484 fi |
470 if [ "$BUILD_TYPE" = "debug" ]; then |
485 if [ "$BUILD_TYPE" = "debug" ]; then |
471 if [ -n "$lang_c" ]; then |
486 if [ -n "$lang_c" ]; then |
472 echo 'CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
487 echo 'CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |