NetBSD.mk (1296B)
1 # 2 # This Source Code Form is subject to the terms of the Mozilla Public 3 # License, v. 2.0. If a copy of the MPL was not distributed with this 4 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 6 include $(CORE_DEPTH)/coreconf/UNIX.mk 7 8 CC ?= gcc 9 CXX ?= g++ 10 DEFAULT_COMPILER = ${CC} 11 CCC = ${CXX} 12 RANLIB = ranlib 13 14 CPU_ARCH := $(shell uname -p) 15 ifeq ($(CPU_ARCH),i386) 16 OS_REL_CFLAGS = -Di386 17 CPU_ARCH = x86 18 endif 19 ifeq (,$(filter-out earm%,$(CPU_ARCH))) 20 CPU_ARCH = arm 21 endif 22 ifeq ($(CPU_ARCH),aarch64eb) 23 CPU_ARCH = aarch64 24 endif 25 26 DLL_SUFFIX = so 27 28 OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wall -Wno-switch -pipe -DNETBSD -Dunix -DHAVE_STRERROR -DHAVE_BSD_FLOCK 29 30 OS_LIBS = -lcompat 31 32 ARCH = netbsd 33 34 DSO_CFLAGS = -fPIC -DPIC 35 DSO_LDOPTS = -shared -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) 36 37 # 38 # The default implementation strategy for NetBSD is pthreads. 39 # 40 ifndef CLASSIC_NSPR 41 USE_PTHREADS = 1 42 DEFINES += -D_THREAD_SAFE -D_REENTRANT 43 OS_LIBS += -pthread 44 DSO_LDOPTS += -pthread 45 endif 46 47 ifdef LIBRUNPATH 48 DSO_LDOPTS += -Wl,-R$(LIBRUNPATH) 49 endif 50 51 MKSHLIB = $(CC) $(DSO_LDOPTS) 52 ifdef MAPFILE 53 MKSHLIB += -Wl,--version-script,$(MAPFILE) 54 endif 55 PROCESS_MAP_FILE = grep -v ';-' $< | \ 56 sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@