File: pg10-makefile

package info (click to toggle)
postgresql-multicorn 1.3.4-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,428 kB
  • sloc: ansic: 3,252; python: 2,227; sql: 755; makefile: 282; sh: 35
file content (17 lines) | stat: -rw-r--r-- 769 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
expr doesn't properly compare floats, use PG_VERSION_NUM instead

--- a/Makefile
+++ b/Makefile
@@ -87,9 +87,9 @@ ifeq ($(PORTNAME),darwin)
 endif
 
 PYTHON_TEST_VERSION ?= $(python_version)
-PG_TEST_VERSION ?= $(MAJORVERSION)
-SUPPORTS_WRITE=$(shell expr ${PG_TEST_VERSION} \>= 9.3)
-SUPPORTS_IMPORT=$(shell expr ${PG_TEST_VERSION} \>= 9.5)
+PG_VERSION_NUM = $(shell awk '/PG_VERSION_NUM/ { print $$3 }' $(shell $(PG_CONFIG) --includedir-server)/pg_config.h)
+SUPPORTS_WRITE=$(shell expr ${PG_VERSION_NUM} \>= 90300)
+SUPPORTS_IMPORT=$(shell expr ${PG_VERSION_NUM} \>= 90500)
 UNSUPPORTS_SQLALCHEMY=$(shell python -c "import sqlalchemy;import psycopg2"  1> /dev/null 2>&1; echo $$?)
 
 TESTS        = test-$(PYTHON_TEST_VERSION)/sql/multicorn_cache_invalidation.sql \