Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ INSTALL_DIR=../install
DOCDIR=doc
IMPDIR=import

OPTIONAL_PIC:=$(if $(PIC),-fPIC,)
# -fPIC is enabled by default and can be disabled with DISABLE_PIC=1
ifeq (,$(DISABLE_PIC))
PIC_FLAG:=-fPIC
else
PIC_FLAG:=
endif
OPTIONAL_COVERAGE:=$(if $(TEST_COVERAGE),-cov,)

ifeq (osx,$(OS))
Expand All @@ -55,7 +60,7 @@ ifeq (solaris,$(OS))
endif

# Set DFLAGS
UDFLAGS:=-conf= -Isrc -Iimport -w -dip1000 $(MODEL_FLAG) $(OPTIONAL_PIC) $(OPTIONAL_COVERAGE)
UDFLAGS:=-conf= -Isrc -Iimport -w -dip1000 $(MODEL_FLAG) $(PIC_FLAG) $(OPTIONAL_COVERAGE)
ifeq ($(BUILD),debug)
UDFLAGS += -g -debug
DFLAGS:=$(UDFLAGS)
Expand Down Expand Up @@ -181,7 +186,7 @@ $(ROOT)/threadasm.o : src/core/threadasm.S

######################## Create a shared library ##############################

$(DRUNTIMESO) $(DRUNTIMESOLIB) dll: DFLAGS+=-version=Shared -fPIC
$(DRUNTIMESO) $(DRUNTIMESOLIB) dll: DFLAGS+=-version=Shared
dll: $(DRUNTIMESOLIB)

$(DRUNTIMESO): $(OBJS) $(SRCS)
Expand Down
9 changes: 7 additions & 2 deletions test/common.mak
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ SRC:=src
GENERATED:=./generated
ROOT:=$(GENERATED)/$(OS)/$(BUILD)/$(MODEL)

OPTIONAL_PIC:=$(if $(PIC),-fPIC,)
# -fPIC is enabled by default and can be disabled with DISABLE_PIC=1
ifeq (,$(DISABLE_PIC))
PIC_FLAG:=-fPIC
else
PIC_FLAG:=
endif

ifneq (default,$(MODEL))
MODEL_FLAG:=-m$(MODEL)
endif
CFLAGS:=$(MODEL_FLAG) -Wall
DFLAGS:=$(MODEL_FLAG) -w -I../../src -I../../import -I$(SRC) -defaultlib= -debuglib= -dip1000 $(OPTIONAL_PIC)
DFLAGS:=$(MODEL_FLAG) -w -I../../src -I../../import -I$(SRC) -defaultlib= -debuglib= -dip1000 $(PIC_FLAG)
# LINK_SHARED may be set by importing makefile
DFLAGS+=$(if $(LINK_SHARED),-L$(DRUNTIMESO),-L$(DRUNTIME))
ifeq ($(BUILD),debug)
Expand Down