Skip to content

Commit 9e4d190

Browse files
authored
Merge pull request #1932 from martin-frbg/issue1915
Add -fPIC to provided CFLAGS/FFLAGS if required
2 parents 284fb00 + fe02ba8 commit 9e4d190

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)