Skip to content

Commit

Permalink
Merge pull request dlang#877 from dawgfoto/PICFlag
Browse files Browse the repository at this point in the history
allow to enable -fPIC by passing PIC=true to make
  • Loading branch information
Alex Rønne Petersen committed Oct 16, 2012
2 parents 4ee6bdc + cffe229 commit 17609c0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions posix.mak
Original file line number Diff line number Diff line change
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 All @@ -71,10 +73,6 @@ STDDOC = $(DOCSRC)/std.ddoc
BIGSTDDOC = $(DOCSRC)/std_consolidated.ddoc
DDOCFLAGS=-m$(MODEL) -d -c -o- -version=StdDdoc -I$(DRUNTIME_PATH)/import $(DMDEXTRAFLAGS)

# Variable defined in an OS-dependent manner (see below)
CFLAGS =
DFLAGS =

# BUILD can be debug or release, but is unset by default; recursive
# invocation will set it. See the debug and release targets below.
BUILD =
Expand Down Expand Up @@ -110,8 +108,9 @@ else
endif

# Set CFLAGS
ifeq ($(CC),cc)
CFLAGS += -m$(MODEL)
CFLAGS :=
ifneq (,$(filter cc% gcc% clang% icc% egcc%, $(CC)))
CFLAGS += -m$(MODEL) $(PIC)
ifeq ($(BUILD),debug)
CFLAGS += -g
else
Expand All @@ -120,7 +119,7 @@ ifeq ($(CC),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 17609c0

Please sign in to comment.