View | Details | Raw Unified | Return to bug 250824
Collapse All | Expand All

(-)databases/postgresql13-server/Makefile (-26 / +31 lines)
Lines 234-272 Link Here
234
# For testing files in FILESDIR
234
# For testing files in FILESDIR
235
.include <bsd.port.pre.mk>
235
.include <bsd.port.pre.mk>
236
236
237
.if ${PORT_OPTIONS:MLLVM}
237
.if ${PORT_OPTIONS:MLLVM} && defined(SERVER_ONLY) && ${DISTVERSION:C/([0-9]*).*/\1/} >= 11
238
CONFIGURE_ARGS+=	--with-llvm
238
239
BUILD_DEPENDS+=		llvm${PG_LLVM_VERSION}>0:devel/llvm${PG_LLVM_VERSION}
239
# - Use default LLVM.
240
BUILD_DEPENDS+=		llvm-config${PG_LLVM_VERSION}:devel/llvm${PG_LLVM_VERSION}
240
# - Use a version lower or equal to MAX_ALLOWED_MAJOR (compatibility).
241
RUN_DEPENDS+=		llvm-config${PG_LLVM_VERSION}:devel/llvm${PG_LLVM_VERSION}
241
MAX_ALLOWED_MAJOR:=11 # LLVM versions < 10 not supported in this var
242
CONFIGURE_ENV+=		LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${PG_LLVM_VERSION}
242
243
.if ${LLVM_DEFAULT} < 60
244
LLVM_DEFAULT_MAJOR:=${LLVM_DEFAULT}
245
.else
246
LLVM_DEFAULT_MAJOR:=${LLVM_DEFAULT:C/^([0-9]).*/\1/}
243
.endif
247
.endif
244
248
245
# sync LLVM to the preferred compiler if possible
249
.if ${LLVM_DEFAULT_MAJOR} > ${MAX_ALLOWED_MAJOR}
246
# or else use a lower version compiler that is compatible
250
CHOSEN_MAJOR:=${MAX_ALLOWED_MAJOR}
247
.if ${COMPILER_VERSION} > ${LLVM_DEFAULT}
248
# Highest LLVM version in ports:
249
.  if ${COMPILER_VERSION} <= 11
250
PG_LLVM_VERSION=${COMPILER_VERSION}
251
PG_COMPILER_VERSION=${COMPILER_VERSION}
252
.  else
253
PG_LLVM_VERSION=11
254
PG_COMPILER_VERSION=11
255
.  endif
256
.else
251
.else
257
PG_COMPILER_VERSION=${COMPILER_VERSION}
252
CHOSEN_MAJOR:=${LLVM_DEFAULT_MAJOR}
258
PG_LLVM_VERSION=${LLVM_DEFAULT}
259
.endif
253
.endif
260
254
261
.if ${DISTVERSION:C/([0-9]*).*/\1/} >= 11
255
.if ${CHOSEN_MAJOR} == ${LLVM_DEFAULT_MAJOR}
262
.  if defined(SERVER_ONLY) && ${PORT_OPTIONS:MLLVM}
256
PG_LLVM_VERSION?=${LLVM_DEFAULT}
263
INSTALL_DIRS+=		src/backend/jit/llvm
257
.else
264
.    if ${COMPILER_VERSION} != ${PG_COMPILER_VERSION}
258
# Forcing from max allowed version
265
LLVM_CONFIGURE_ARGS?=	CC=${LOCALBASE}/bin/clang${PG_COMPILER_VERSION}
259
PG_LLVM_VERSION?==${MAX_ALLOWED_MAJOR}
266
.    endif
267
.  endif
268
.endif
260
.endif
269
261
262
CONFIGURE_ARGS+=	--with-llvm
263
264
BUILD_DEPENDS+=		llvm${PG_LLVM_VERSION}>0:devel/llvm${PG_LLVM_VERSION}
265
BUILD_DEPENDS+=		llvm-config${PG_LLVM_VERSION}:devel/llvm${PG_LLVM_VERSION}
266
RUN_DEPENDS+=		llvm-config${PG_LLVM_VERSION}:devel/llvm${PG_LLVM_VERSION}
267
CONFIGURE_ENV+=		LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${PG_LLVM_VERSION} \
268
			CC=${LOCALBASE}/bin/clang${PG_LLVM_VERSION} \
269
			CXX=${LOCALBASE}/bin/clang++${PG_LLVM_VERSION} \
270
			CLANG=${LOCALBASE}/bin/clang${PG_LLVM_VERSION}
271
INSTALL_DIRS+=		src/backend/jit/llvm
272
273
.endif # LLVM && SERVER_ONLY
274
270
.if defined(SERVER_ONLY)
275
.if defined(SERVER_ONLY)
271
pre-build:
276
pre-build:
272
	@${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
277
	@${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL

Return to bug 250824