1
1
PGSPHERE_VERSION = 1.2.2
2
+ EXTENSION = pg_sphere
3
+ RELEASE_SQL = $(EXTENSION ) --$(PGSPHERE_VERSION ) .sql
4
+ USE_PGXS = 1
5
+ USE_HEALPIX =? 1
2
6
3
7
# the base dir name may be changed depending on git clone command
4
8
SRC_DIR = $(shell basename $(shell pwd) )
@@ -7,11 +11,13 @@ MODULE_big = pg_sphere
7
11
OBJS = src/sscan.o src/sparse.o src/sbuffer.o src/vector3d.o src/point.o \
8
12
src/euler.o src/circle.o src/line.o src/ellipse.o src/polygon.o \
9
13
src/path.o src/box.o src/output.o src/gq_cache.o src/gist.o \
10
- src/key.o src/gnomo.o src/healpix.o src/moc.o src/process_moc.o \
11
- healpix_bare/healpix_bare.o src/epochprop.o
14
+ src/key.o src/gnomo.o src/epochprop.o
15
+
16
+ ifneq ($(USE_HEALPIX ) ,0)
17
+ OBJS += src/healpix.o src/moc.o src/process_moc.o \
18
+ healpix_bare/healpix_bare.o
19
+ endif
12
20
13
- EXTENSION = pg_sphere
14
- RELEASE_SQL = $(EXTENSION ) --$(PGSPHERE_VERSION ) .sql
15
21
DATA_built = $(RELEASE_SQL ) \
16
22
pg_sphere--unpackaged--1.1.5beta0gavo.sql \
17
23
pg_sphere--1.0--1.0_gavo.sql \
@@ -24,14 +30,21 @@ DATA_built = $(RELEASE_SQL) \
24
30
25
31
DOCS = README.pg_sphere COPYRIGHT.pg_sphere
26
32
REGRESS = init tables points euler circle line ellipse poly path box index \
27
- contains_ops contains_ops_compat bounding_box_gist gnomo healpix \
28
- moc mocautocast epochprop
33
+ contains_ops contains_ops_compat bounding_box_gist gnomo epochprop
34
+
35
+ ifneq ($(USE_HEALPIX ) ,0)
36
+ REGRESS += healpix moc mocautocast
37
+ endif
29
38
30
39
REGRESS_9_5 = index_9.5 # experimental for spoint3
31
40
32
- TESTS = init_test tables points euler circle line ellipse poly path box index \
33
- contains_ops contains_ops_compat bounding_box_gist gnomo healpix \
34
- moc mocautocast epochprop
41
+ TESTS = init_test tables points euler circle line ellipse poly path box \
42
+ index contains_ops contains_ops_compat bounding_box_gist gnomo \
43
+ epochprop
44
+
45
+ ifneq ($(USE_HEALPIX ) ,0)
46
+ TESTS += healpix moc mocautocast
47
+ endif
35
48
36
49
PG_CFLAGS += -DPGSPHERE_VERSION=$(PGSPHERE_VERSION )
37
50
PG_CPPFLAGS += -DPGSPHERE_VERSION=$(PGSPHERE_VERSION )
@@ -48,17 +61,28 @@ CRUSH_TESTS = init_extended circle_extended
48
61
49
62
# order of sql files is important
50
63
PGS_SQL = pgs_types.sql pgs_point.sql pgs_euler.sql pgs_circle.sql \
51
- pgs_line.sql pgs_ellipse.sql pgs_polygon.sql pgs_path.sql \
52
- pgs_box.sql pgs_contains_ops.sql pgs_contains_ops_compat.sql \
53
- pgs_gist.sql gnomo.sql \
54
- healpix.sql pgs_gist_spoint3.sql pgs_moc_type.sql pgs_moc_compat.sql pgs_moc_ops.sql \
55
- pgs_moc_geo_casts.sql pgs_epochprop.sql
64
+ pgs_line.sql pgs_ellipse.sql pgs_polygon.sql pgs_path.sql \
65
+ pgs_box.sql pgs_contains_ops.sql pgs_contains_ops_compat.sql \
66
+ pgs_gist.sql gnomo.sql
67
+
68
+ ifneq ($(USE_HEALPIX ) ,0)
69
+ PGS_SQL += healpix.sql
70
+ endif
71
+
72
+ PGS_SQL += pgs_gist_spoint3.sql
73
+
74
+ ifneq ($(USE_HEALPIX ) ,0)
75
+ PGS_SQL += pgs_moc_type.sql pgs_moc_compat.sql pgs_moc_ops.sql \
76
+ pgs_moc_geo_casts.sql
77
+ endif
78
+
79
+ PGS_SQL += pgs_epochprop.sql
80
+
56
81
PGS_SQL_9_5 = pgs_9.5.sql # experimental for spoint3
57
82
58
- USE_PGXS = 1
59
83
ifdef USE_PGXS
60
84
ifndef PG_CONFIG
61
- PG_CONFIG : = pg_config
85
+ PG_CONFIG = pg_config
62
86
endif
63
87
PGXS := $(shell $(PG_CONFIG ) --pgxs)
64
88
include $(PGXS )
70
94
include $(top_srcdir ) /contrib/contrib-global.mk
71
95
endif
72
96
73
- # compiler settings
74
- PKG_CONFIG = pkg-config
97
+ ifneq ($(USE_HEALPIX ) ,0)
98
+ # compiler settings for linking with libhealpix_cxx
99
+ PKG_CONFIG ?= pkg-config
75
100
override CPPFLAGS += $(shell $(PKG_CONFIG ) --cflags healpix_cxx)
76
101
SHLIB_LINK += $(shell $(PKG_CONFIG ) --libs healpix_cxx)
77
102
LINK.shared = g++ -shared
103
+ endif
78
104
79
105
# healpix_bare.c isn't ours so we refrain from fixing the warnings in there
80
106
healpix_bare/healpix_bare.o : healpix_bare/healpix_bare.c
@@ -84,7 +110,6 @@ healpix_bare/healpix_bare.o : healpix_bare/healpix_bare.c
84
110
pg_version := $(word 2,$(shell $(PG_CONFIG ) --version) )
85
111
pg_version_9_5_plus = $(if $(filter-out 9.1% 9.2% 9.3% 9.4% ,$(pg_version ) ) ,y,n)
86
112
has_explain_summary = $(if $(filter-out 9.% ,$(pg_version ) ) ,y,n)
87
- #
88
113
89
114
# # the use of spoint 3 is too experimental and preliminary:
90
115
# ifeq ($(pg_version_9_5_plus),y)
@@ -96,9 +121,11 @@ has_explain_summary = $(if $(filter-out 9.%,$(pg_version)),y,n)
96
121
crushtest : REGRESS += $(CRUSH_TESTS )
97
122
crushtest : installcheck
98
123
124
+ ifneq ($(USE_HEALPIX ) ,0)
99
125
ifeq ($(has_explain_summary ) ,y)
100
126
REGRESS += moc1 moc100
101
127
endif
128
+ endif
102
129
103
130
ifeq ($(pg_version_9_5_plus ) ,y)
104
131
PGS_TMP_DIR = --temp-instance=tmp_check
@@ -107,6 +134,10 @@ else
107
134
endif
108
135
109
136
test : pg_sphere.test.sql sql/init_test.sql
137
+ cp expected/init_test.out.in expected/init_test.out
138
+ ifneq ($(USE_HEALPIX ) ,0)
139
+ cat expected/init_test_healpix.out.in >> expected/init_test.out
140
+ endif
110
141
$(pg_regress_installcheck) $(PGS_TMP_DIR) $(REGRESS_OPTS) $(TESTS)
111
142
112
143
pg_sphere.test.sql : $(RELEASE_SQL ) $(shlib )
@@ -118,14 +149,14 @@ $(RELEASE_SQL): $(addsuffix .in, $(RELEASE_SQL) $(PGS_SQL))
118
149
119
150
# for "create extension from unpacked*":
120
151
121
- UPGRADE_UNP_COMMON = pgs_types.sql pgs_point.sql pgs_euler.sql pgs_circle.sql \
152
+ UPGRADE_UNP_COMMON = pgs_types.sql pgs_point.sql pgs_euler.sql pgs_circle.sql \
122
153
pgs_line.sql pgs_ellipse.sql pgs_polygon.sql pgs_path.sql \
123
154
pgs_box.sql pgs_contains_ops_compat.sql pgs_gist.sql \
124
155
pgs_gist_contains_ops.sql contains-ops-fixes-1.sql
125
156
126
157
AUGMENT_UNP_COMMON = upgrade_scripts/pgs_pre111.sql pgs_contains_ops.sql \
127
158
gnomo.sql
128
- # for vanilla 1.1.1 users
159
+ # for vanilla 1.1.1 users:
129
160
AUGMENT_UNP_111 = $(AUGMENT_UNP_COMMON ) pgs_gist_pointkey.sql
130
161
131
162
# for 1.1.2+ users: 'from unpacked_1.1.2plus'
@@ -159,12 +190,17 @@ else
159
190
endif
160
191
161
192
# local stuff follows here
162
-
163
- AUGMENT_GAVO_111 = $(AUGMENT_UNP_111 ) healpix.sql # for vanilla 1.1.1 users
193
+ AUGMENT_GAVO_111 = $(AUGMENT_UNP_111 ) # for vanilla 1.1.1 users
194
+ ifneq ($(USE_HEALPIX ) ,0)
195
+ AUGMENT_GAVO_111 += healpix.sql
196
+ endif
164
197
UPGRADE_GAVO_111 = $(UPGRADE_UNP_COMMON )
165
198
166
- # add new Healpix functions and experimental spoint3
167
- AUGMENT_FROM_GAVO = healpix.sql pgs_gist_spoint3.sql
199
+ # add new HEALPix functions and experimental spoint3
200
+ ifneq ($(USE_HEALPIX ) ,0)
201
+ AUGMENT_FROM_GAVO = healpix.sql
202
+ endif
203
+ AUGMENT_FROM_GAVO += pgs_gist_spoint3.sql
168
204
169
205
AUGMENT_UNP_115B0G = $(AUGMENT_UNP_111 ) $(AUGMENT_FROM_GAVO )
170
206
UPGRADE_UNP_115B0G = $(UPGRADE_UNP_COMMON )
@@ -188,20 +224,37 @@ pg_sphere--1.0_gavo--1.1.5beta0gavo.sql: $(addsuffix .in, \
188
224
$(addprefix upgrade_scripts/, $(UPGRADE_1_0_115B0G ) ) )
189
225
cat upgrade_scripts/$@ .in $^ > $@
190
226
227
+ ifneq ($(USE_HEALPIX ) ,0)
191
228
pg_sphere--1.1.5beta0gavo--1.1.5beta2gavo.sql : pgs_moc_type.sql.in
192
229
cat upgrade_scripts/$@ .in $^ > $@
193
230
194
231
pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql : pgs_moc_compat.sql.in
195
232
cat upgrade_scripts/$@ .in $^ > $@
196
233
197
234
pg_sphere--1.1.5beta4gavo--1.2.0.sql : pgs_moc_ops.sql.in
198
- cat $^ > $@
235
+ cat upgrade_scripts/ $@ .in $^ > $@
199
236
200
237
pg_sphere--1.2.0--1.2.1.sql : pgs_moc_geo_casts.sql.in pgs_epochprop.sql.in
201
- cat $^ > $@
238
+ cat upgrade_scripts/ $@ .in $^ > $@
202
239
203
- pg_sphere--1.2.1--1.2.2.sql : upgrade_scripts/pg_sphere--1.2.1--1.2.2.sql.in
204
- cat $^ > $@
240
+ pg_sphere--1.2.1--1.2.2.sql : upgrade_scripts/pg_sphere--1.2.1--1.2.2-healpix.sql.in
241
+ cat upgrade_scripts/$@ .in $^ > $@
242
+ else
243
+ pg_sphere--1.1.5beta0gavo--1.1.5beta2gavo.sql :
244
+ cat upgrade_scripts/$@ .in > $@
245
+
246
+ pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql :
247
+ cat upgrade_scripts/$@ .in > $@
248
+
249
+ pg_sphere--1.1.5beta4gavo--1.2.0.sql :
250
+ cat upgrade_scripts/$@ .in > $@
251
+
252
+ pg_sphere--1.2.0--1.2.1.sql : pgs_epochprop.sql.in
253
+ cat upgrade_scripts/$@ .in $^ > $@
254
+
255
+ pg_sphere--1.2.1--1.2.2.sql :
256
+ cat upgrade_scripts/$@ .in > $@
257
+ endif
205
258
206
259
# end of local stuff
207
260
0 commit comments