Skip to content

Commit

Permalink
Update to support Vertica 23.3.0 (#23)
Browse files Browse the repository at this point in the history
This allows to compile v23.3.0 dblink.
  • Loading branch information
roypaulin authored Aug 7, 2023
1 parent 8027fca commit 1ddabaa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ VERPATH = /opt/vertica/sdk/include/Vertica.cpp
UDXLIBNAME = ldblink
UDXLIB = $(UDXLIBNAME).so
UDXSRC = $(UDXLIBNAME).cpp
COMPILE_VERSION_LE_12_0_4 = $(CXXDOCKER) $(CXXFLAGS) $(INCPATH) -o $@ $< $(VERPATH) -lodbc

CXXDOCKER_FOR_NEW_SDK = $(DOCKER) run --rm -u "$(shell id -u):$(shell id -g)" -w "$(PWD)" -v "$(PWD):$(PWD):rw" $(LOCAL_IMAGE) "$(PWD)"
CXXCMD = g++ $(CXXFLAGS)
COMPILE_VERSION_GREATER_THAN_12_0_4 = $(CXXDOCKER_FOR_NEW_SDK) "$(CXXCMD) $(INCPATH) -o $@ $< $(VERPATH) -lodbc"
OLD_SDK_MAX_VERSION = 12.0.4
GETMINVERSION = echo "$(VERTICA_VERSION) $(OLD_SDK_MAX_VERSION)" | tr " " "\n" | sort -V | head -n 1
MINVERSION=$(shell $(GETMINVERSION))

$(UDXLIB): $(UDXLIB).$(VERSION_TAG)
@ln -snf $< $@
Expand All @@ -43,7 +51,11 @@ $(UDXLIB).local: $(UDXSRC)

$(UDXLIB).$(OSTAG)-v$(VERTICA_VERSION): $(UDXSRC)
@$(MAKE) .container.$(OSTAG)-v$(VERTICA_VERSION)
$(CXXDOCKER) $(CXXFLAGS) $(INCPATH) -o $@ $< $(VERPATH) -lodbc
ifeq ($(MINVERSION), $(VERTICA_VERSION))
$(COMPILE_VERSION_LE_12_0_4)
else
$(COMPILE_VERSION_GREATER_THAN_12_0_4)
endif

.PHONY: check
check:
Expand Down

0 comments on commit 1ddabaa

Please sign in to comment.