From 385f6f23fee37617e0148babdb00783775d04a70 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Mon, 11 Jun 2018 21:39:55 +0200 Subject: Initial port of PostgreSQL egg to CHICKEN 5 --- build-postgresql | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 build-postgresql (limited to 'build-postgresql') diff --git a/build-postgresql b/build-postgresql new file mode 100755 index 0000000..fb15976 --- /dev/null +++ b/build-postgresql @@ -0,0 +1,23 @@ +# -*- sh -*- + +# Determine if pkg-config exists and knows about libpq, otherwise +# fall back on pg_config to determine compiler and linker flags. +if pkg-config --exists libpq >/dev/null 2>/dev/null; then + CFLAGS="`pkg-config --cflags libpq`" + LDFLAGS="`pkg-config --libs libpq`" +else + CFLAGS="-I`pg_config --includedir`" + LDFLAGS="-L`pg_config --libdir` -Wl,-rpath `pg_config --libdir` -lpq" +fi + +known_features="escape-identifier connectdb-params diag-query-position diag-schema-info" + +feature_flags="" +for feature in $known_features; do + if "$CHICKEN_CSC" -C "$CFLAGS" -L "$LDFLAGS" "feature-tests/$feature.c" >/dev/null 2>/dev/null; then + feature_flags="$feature_flags -Dhas-$feature" + fi + rm -f feature-tests/$feature.o feature-tests/$feature +done + +"$CHICKEN_CSC" $feature_flags -C "$CFLAGS" -L "$LDFLAGS" "$@" -- cgit v1.2.3