From 5bd21ab6e1e4da023185c1472877d9806b1d0c48 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 23 Dec 2018 23:46:48 +0100 Subject: [PATCH 1/3] Make sure that -fPIC is present when needed override user-provided FFLAGS if necessary --- Makefile.system | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile.system b/Makefile.system index 3987460ec..fb8e7ea41 100644 --- a/Makefile.system +++ b/Makefile.system @@ -1154,8 +1154,6 @@ ifndef FCOMMON_OPT FCOMMON_OPT = -O2 -frecursive endif - - override CFLAGS += $(COMMON_OPT) $(CCOMMON_OPT) -I$(TOPDIR) override PFLAGS += $(COMMON_OPT) $(CCOMMON_OPT) -I$(TOPDIR) -DPROFILE $(COMMON_PROF) @@ -1163,6 +1161,12 @@ override FFLAGS += $(COMMON_OPT) $(FCOMMON_OPT) override FPFLAGS += $(FCOMMON_OPT) $(COMMON_PROF) #MAKEOVERRIDES = +ifdef NEED_PIC +ifeq (,$(findstring PIC,$(FFLAGS))) +override FFLAGS += -fPIC +endif +endif + #For LAPACK Fortran codes. #Disable -fopenmp for LAPACK Fortran codes on Windows. ifdef OS_WINDOWS From d6818777d1ed7ead02c0d0b448b2d60e783c97f5 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 23 Dec 2018 23:47:37 +0100 Subject: [PATCH 2/3] Make sure that -fPIC is present if needed --- exports/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exports/Makefile b/exports/Makefile index 3a5f77db3..5628eacac 100644 --- a/exports/Makefile +++ b/exports/Makefile @@ -2,6 +2,12 @@ TOPDIR = .. include ../Makefile.system +ifdef NEED_PIC +ifeq (,$(findstring PIC,$(CFLAGS))) +CFLAGS+= -fPIC +endif +endif + ifndef EXPRECISION EXPRECISION = 0 endif From fe02ba86a46699f5bba3a403bbb1e513273bdd53 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 24 Dec 2018 20:46:04 +0100 Subject: [PATCH 3/3] Remove unnecessary change again --- exports/Makefile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/exports/Makefile b/exports/Makefile index 5628eacac..3a5f77db3 100644 --- a/exports/Makefile +++ b/exports/Makefile @@ -2,12 +2,6 @@ TOPDIR = .. include ../Makefile.system -ifdef NEED_PIC -ifeq (,$(findstring PIC,$(CFLAGS))) -CFLAGS+= -fPIC -endif -endif - ifndef EXPRECISION EXPRECISION = 0 endif