compile_libpq.sh 553 B

123456789101112131415161718
  1. #! /bin/sh
  2. # Compile libpq
  3. commit=b787d4ce6d910080065025bcd5f968544997271f
  4. wget -nv https://github.com/postgres/postgres/archive/$commit.zip
  5. unzip -q $commit.zip
  6. cd postgres-$commit
  7. if [ "$1" = "batchmode" ]; then
  8. wget -nv https://www.postgresql.org/message-id/attachment/115223/v22-0001-libpq-batch.patch
  9. git apply ./v22-0001-libpq-batch.patch
  10. fi
  11. ./configure --prefix=/usr CFLAGS='-O3 -march=native -flto'
  12. cd src/interfaces/libpq
  13. make all install -j4
  14. cp ../../../src/include/postgres_ext.h ../../../src/include/pg_config_ext.h /usr/include
  15. cd /