Skip to content

Commit 5bd21ab

Browse files
authored
Make sure that -fPIC is present when needed
override user-provided FFLAGS if necessary
1 parent a5a1118 commit 5bd21ab

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Makefile.system

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,15 +1154,19 @@ ifndef FCOMMON_OPT
11541154
FCOMMON_OPT = -O2 -frecursive
11551155
endif
11561156

1157-
1158-
11591157
override CFLAGS += $(COMMON_OPT) $(CCOMMON_OPT) -I$(TOPDIR)
11601158
override PFLAGS += $(COMMON_OPT) $(CCOMMON_OPT) -I$(TOPDIR) -DPROFILE $(COMMON_PROF)
11611159

11621160
override FFLAGS += $(COMMON_OPT) $(FCOMMON_OPT)
11631161
override FPFLAGS += $(FCOMMON_OPT) $(COMMON_PROF)
11641162
#MAKEOVERRIDES =
11651163

1164+
ifdef NEED_PIC
1165+
ifeq (,$(findstring PIC,$(FFLAGS)))
1166+
override FFLAGS += -fPIC
1167+
endif
1168+
endif
1169+
11661170
#For LAPACK Fortran codes.
11671171
#Disable -fopenmp for LAPACK Fortran codes on Windows.
11681172
ifdef OS_WINDOWS

0 commit comments

Comments
 (0)