diff options
Diffstat (limited to 'mk/lib.mk')
-rw-r--r-- | mk/lib.mk | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/mk/lib.mk b/mk/lib.mk index 56e162d5007c..4ad5c636c8d4 100644 --- a/mk/lib.mk +++ b/mk/lib.mk @@ -14,23 +14,51 @@ dist-files := OS = $(shell uname -s) +# Hack to define a literal space. +space := +space += + + +# Hack to define a literal newline. +define newline + + +endef + + # Default installation paths. prefix ?= /usr/local libdir ?= $(prefix)/lib bindir ?= $(prefix)/bin libexecdir ?= $(prefix)/libexec datadir ?= $(prefix)/share +jardir ?= $(datadir)/java localstatedir ?= $(prefix)/var sysconfdir ?= $(prefix)/etc mandir ?= $(prefix)/share/man +# Initialise support for build directories. +builddir ?= + +ifdef builddir + buildprefix = $(builddir)/ +else + buildprefix = +endif + + # Pass -fPIC if we're building dynamic libraries. BUILD_SHARED_LIBS ?= 1 ifeq ($(BUILD_SHARED_LIBS), 1) - GLOBAL_CFLAGS += -fPIC - GLOBAL_CXXFLAGS += -fPIC + ifeq (CYGWIN,$(findstring CYGWIN,$(OS))) + GLOBAL_CFLAGS += -U__STRICT_ANSI__ + GLOBAL_CXXFLAGS += -U__STRICT_ANSI__ + else + GLOBAL_CFLAGS += -fPIC + GLOBAL_CXXFLAGS += -fPIC + endif ifneq ($(OS), Darwin) ifneq ($(OS), SunOS) GLOBAL_LDFLAGS += -Wl,--no-copy-dt-needed-entries @@ -39,7 +67,6 @@ ifeq ($(BUILD_SHARED_LIBS), 1) SET_RPATH_TO_LIBS ?= 1 endif - # Pass -g if we want debug info. BUILD_DEBUG ?= 1 |