summaryrefslogtreecommitdiff
path: root/cpp/config/Make.rules.Darwin
blob: 35b8c2cd92c0844ba706054a49b13f3d13aac9cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************

#
# This file is included by Make.rules when uname is Darwin.
#

OSX_TARGET_MIN_SDK_VERSION = 10.9

CXX			= xcrun clang++

CPPFLAGS		+= -pthread -fvisibility=hidden
CXXFLAGS		+= -Wall -Werror -mmacosx-version-min=$(OSX_TARGET_MIN_SDK_VERSION)

# If MAXWARN is set then enable extra warnings
ifeq ($(MAXWARN),yes)
    CXXFLAGS		+= -Wextra -Wshadow -Wredundant-decls
endif

#
# By default we build x86_64 binaries.
#
ifeq ($(CXXARCHFLAGS),)
    CXXARCHFLAGS    := -arch x86_64
endif

ifeq ($(OPTIMIZE),yes)
     CXXFLAGS		:= $(CXXARCHFLAGS) -O2 -DNDEBUG $(CXXFLAGS)
else
     CXXFLAGS		:= $(CXXARCHFLAGS) -g $(CXXFLAGS)
endif

#
# On OS X, always build with C++11 support enabled unless we
# explicitly set it to no (possibly to test binary compatibility).
#
ifneq ($(CPP11_MAPPING), no)
    CPPFLAGS += --std=c++11
endif

#
# C++ run-time libraries, necessary for linking some shared libraries.
#
CXXLIBS	=

clean::
	rm -f *.keychain *.fl*

LOADER_PATH = @loader_path

ifeq ($(RPATH_DIR),)
    ifdef ice_src_dist
        RPATH_DIR = @loader_path/$(libdir)
    else
        RPATH_DIR = $(ice_dir)/$(libsubdir)
    endif
endif

#
# Clear rpath setting when doing a system install
#
ifeq ($(ice_dir), $(usr_dir))
    RPATH_DIR =
endif

ifneq ($(RPATH_DIR),)
    LDEXEFLAGS = -Wl,-rpath,$(RPATH_DIR)
endif

LDTESTEXEFLAGS = $(LDEXEFLAGS)
ifndef ice_src_dist
    LDTESTEXEFLAGS += -Wl,-rpath,@loader_path/$(libdir)
endif

ifdef ice_src_dist
    rpathlink = -Wl,-rpath,$(1)
endif

mklib 			= libtool -static -o $(1) $(2)
mkshlib			= $(CXX)  -dynamiclib $(LDFLAGS) -o $(1) -install_name @rpath/$(2) $(3) $(4)

BASELIBS		= -lIceUtil
LIBS			= -lIce $(BASELIBS)

ICONV_LIB		= -liconv

ICEUTIL_OS_LIBS         =
ICE_OS_LIBS             = -ldl
CRYPT_OS_LIBS           = -framework Security -framework CoreFoundation
SSL_OS_LIBS             = $(CRYPT_OS_LIBS)

PLATFORM_HAS_READLINE   := yes

ifeq ($(DB_HOME),)
    ifneq ($(wildcard /usr/local/opt/berkeley-db53),)
        DB_HOME = /usr/local/opt/berkeley-db53
    endif
endif