Skip to content

Commit b190c1c

Browse files
committed
Solaris/SPARC port.
1 parent bd8bba1 commit b190c1c

12 files changed

+388
-111
lines changed

Makefile

+23-3
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,33 @@
33
#DEBUG_FLAGS := -O0 -D DEBUG
44
ASSERT_FLAGS := -D NDEBUG
55
LFS_FLAGS := $(shell getconf LFS_CFLAGS)
6+
#M64FLAG := -m64
67

8+
UNAME := $(shell uname)
79
CC := gcc
810
export CC
9-
CFLAGS := -Wall -O3 -g $(GCOV_FLAGS) $(DEBUG_FLAGS)
10-
CPPFLAGS := -D _GNU_SOURCE $(ASSERT_FLAGS) $(LFS_FLAGS)
11+
CFLAGS := $(M64FLAG) -Wall -O2 -g $(GCOV_FLAGS) $(DEBUG_FLAGS)
12+
ifeq ($(UNAME),Linux)
13+
CPPFLAGS := -D _GNU_SOURCE $(LFS_FLAGS)
14+
else
15+
CPPFLAGS := -D _XOPEN_SOURCE=500
16+
endif
17+
CPPFLAGS += $(ASSERT_FLAGS)
1118

1219
LD := gcc
13-
LDFLAGS := $(GCOV_FLAGS)
20+
LDFLAGS := $(M64FLAG) $(GCOV_FLAGS)
21+
ifneq ($(UNAME),Linux)
22+
LDLIBS := -lrt -lsocket -lnsl
23+
endif
1424

1525
progs := test_mmpi test_fdproxy test_driller test_dlmalloc test_spinlock
1626
libobjs := fdproxy.o driller.o dlmalloc.o map_cache.o
27+
ifeq ($(UNAME),Linux)
28+
libobjs += linux.o
29+
else
30+
libobjs += solaris.o hsearch_r.o
31+
endif
32+
1733
objs := $(progs:%=%.o) mmpi.o $(libobjs)
1834
deps := $(objs:%.o=%.d)
1935

@@ -37,6 +53,10 @@ test_%.o: CPPFLAGS += -U NDEBUG
3753
test_dlmalloc.o: CPPFLAGS += -D NODRILL
3854
dlmalloc.o: CPPFLAGS += -D DEFAULT_GRANULARITY='((size_t)1U<<20)'
3955
dlmalloc.o driller.o: CPPFLAGS += -D MSPACES
56+
ifneq ($(UNAME),Linux)
57+
dlmalloc.o driller.o: CPPFLAGS += -D USE_DL_PREFIX
58+
endif
59+
solaris.o: CPPFLAGS += -U _XOPEN_SOURCE
4060

4161
test_dlmalloc.c:
4262
ln -s test_driller.c $@

0 commit comments

Comments
 (0)