From a4561d2faefa329087ec37dc9c27ee7eb6b6aa47 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Fri, 15 Jul 2016 21:44:22 +0300 Subject: [PATCH] Make static compilation of ORCA work. Reorder -lgpopt, -lnaucrates, -lgpdbcost, -lgpos, to make static compilation of ORCA to work. When linking with dynamic libraries, the order doesn't matter, but with static libraries, the options need to be given in dependency order. This doesn't change the way those libraries are actually linked. Whether we link with static or shared versions depends on which ones are found at link time. --- src/backend/Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/backend/Makefile b/src/backend/Makefile index 64466f3ab2..8fc1168278 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -67,13 +67,18 @@ LIBS := $(filter-out -lpgport, $(LIBS)) $(LDAP_LIBS_BE) $(CONNECTEMCLIB) # The backend doesn't need everything that's in LIBS, however LIBS := $(filter-out -lreadline -ledit -ltermcap -lncurses -lcurses, $(LIBS)) -# adding orca libraries +# Add ORCA libraries ifeq ($(enable_orca),yes) -LIBS := $(LIBS) -L$(LIBGPOS)/$(OBJDIR_DEFAULT) -lgpos -LIBS := $(LIBS) -L$(XERCES_LIBDIR) -lxerces-c-3.1 -LIBS := $(LIBS) -L$(OPTIMIZER)/libnaucrates/$(OBJDIR_DEFAULT) -lnaucrates -LIBS := $(LIBS) -L$(OPTIMIZER)/libgpdbcost/$(OBJDIR_DEFAULT) -lgpdbcost -LIBS := $(LIBS) -L$(OPTIMIZER)/libgpopt/$(OBJDIR_DEFAULT) -lgpopt +LIBS := $(LIBS) -L$(LIBGPOS)/$(OBJDIR_DEFAULT) +LIBS := $(LIBS) -L$(OPTIMIZER)/libnaucrates/$(OBJDIR_DEFAULT) +LIBS := $(LIBS) -L$(OPTIMIZER)/libgpdbcost/$(OBJDIR_DEFAULT) +LIBS := $(LIBS) -L$(OPTIMIZER)/libgpopt/$(OBJDIR_DEFAULT) +LIBS := $(LIBS) -L$(XERCES_LIBDIR) + +# The order of the libraries is significant, when building against static +# ORCA libraries. +LIBS := $(LIBS) -lgpopt -lnaucrates -lgpdbcost -lgpos +LIBS := $(LIBS) -lxerces-c-3.1 endif # adding codegen libraries -- GitLab