compile_libpq.sh 736 B

123456789101112131415161718192021222324
  1. #! /bin/sh
  2. # Compile libpq
  3. if [ "$1" = "batchmode_patch" ]; then
  4. commit=b787d4ce6d910080065025bcd5f968544997271f
  5. wget -nv https://github.com/postgres/postgres/archive/$commit.zip
  6. unzip -q $commit.zip
  7. cd postgres-$commit
  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. else
  11. commit=7f7f25f15edb6eacec58179ef5285e874aa4435b
  12. wget -nv https://github.com/postgres/postgres/archive/$commit.zip
  13. unzip -q $commit.zip
  14. cd postgres-$commit
  15. fi
  16. ./configure --prefix=/usr CFLAGS='-O3 -march=native -flto'
  17. cd src/interfaces/libpq
  18. make all install -j4
  19. cp ../../../src/include/postgres_ext.h ../../../src/include/pg_config_ext.h /usr/include
  20. cd /