Skip to content

Commit

Permalink
allow to enable -fPIC by passing PIC=true to make
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Oct 16, 2012
1 parent f856e61 commit cffe229
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions posix.mak
Expand Up @@ -56,6 +56,8 @@ ifeq (,$(MODEL))
MODEL:=32
endif

override PIC:=$(if $(PIC),-fPIC,)

# Configurable stuff that's rarely edited
DRUNTIME_PATH = ../druntime
ZIPFILE = phobos.zip
Expand Down Expand Up @@ -108,7 +110,7 @@ endif
# Set CFLAGS
CFLAGS :=
ifneq (,$(filter cc% gcc% clang% icc% egcc%, $(CC)))
CFLAGS += -m$(MODEL)
CFLAGS += -m$(MODEL) $(PIC)
ifeq ($(BUILD),debug)
CFLAGS += -g
else
Expand All @@ -117,7 +119,7 @@ ifneq (,$(filter cc% gcc% clang% icc% egcc%, $(CC)))
endif

# Set DFLAGS
DFLAGS := -I$(DRUNTIME_PATH)/import $(DMDEXTRAFLAGS) -w -d -property -m$(MODEL)
DFLAGS := -I$(DRUNTIME_PATH)/import $(DMDEXTRAFLAGS) -w -d -property -m$(MODEL) $(PIC)
ifeq ($(BUILD),debug)
DFLAGS += -g -debug
else
Expand Down

0 comments on commit cffe229

Please sign in to comment.