1 # **********************************************************************
3 # Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
5 # This copy of Ice is licensed to you under the terms described in the
6 # ICE_LICENSE file included in this distribution.
8 # **********************************************************************
11 # This file is included by Make.rules when uname is Darwin.
16 CXXFLAGS = -Wall -D_REENTRANT
18 ifeq ($(OPTIMIZE),yes)
19 CXXFLAGS := $(CXXARCHFLAGS) -O2 -DNDEBUG $(CXXFLAGS)
21 CXXFLAGS := $(CXXARCHFLAGS) -g $(CXXFLAGS)
26 # C++ run-time libraries, necessary for linking some shared libraries.
30 ifneq ($(embedded_runpath_prefix),)
31 # Only use -rpath if Mac OS X >= 10.5
32 release = $(shell uname -r)
33 ifeq ($(shell test $(firstword $(subst ., ,$(release))) -ge 9 && echo 0),0)
34 LDPLATFORMFLAGS = -Wl,-rpath,$(runpath_libdir)
38 LDPLATFORMFLAGS += -rdynamic
41 # Needed to link IcePHP extension.
43 ifeq ($(ice_language), php)
44 shlibldflags = ${wl}-flat_namespace ${wl}-undefined ${wl}suppress
47 shlibldflags = $(CXXFLAGS) -L$(libdir)
49 shlibldflags = $(CXXFLAGS) -L$(ice_dir)/$(libsubdir)
53 mklibfilename = $(if $(2),lib$(1).$(2).dylib,lib$(1).dylib)
54 mksoname = $(if $(2),lib$(1).$(2).dylib,lib$(1).dylib)
56 mklibname = lib$(1).dylib
59 ifneq ($(embedded_runpath_prefix),)
60 mkshlib = $(CXX) -dynamiclib $(shlibldflags) -o $(1) -install_name $(runpath_libdir)/$(2) $(3) $(4)
62 mkshlib = $(CXX) -dynamiclib $(shlibldflags) -o $(1) -install_name $(2) $(3) $(4)
67 # If DB_HOME is not set and the BerkeleyDB library is not at the expected location
68 # but in the ICE_DIR/lib directory, we set DB_RPATH_LINK to tell the linker where
72 ifeq ($(shell test -f $(ice_dir)/$(libsubdir)/libFreeze.$(VERSION).dylib && echo 0),0)
73 dblib_install_name=$(firstword $(strip $(shell otool -L $(ice_dir)/$(libsubdir)/libFreeze.$(VERSION).dylib | grep libdb_cxx)))
74 ifeq ($(shell test ! -f $(dblib_install_name) -a -f $(ice_dir)/$(libsubdir)/$(notdir $(dblib_install_name)) && echo 0),0)
75 DB_RPATH_LINK=-dylib_file $(dblib_install_name):$(ice_dir)/$(libsubdir)/$(notdir $(dblib_install_name))
82 ifneq ($(QT_HOME), /Library/Frameworks)
83 # Frameworks are installed in the lib directory
84 QT_FLAGS = -F$(QT_HOME)/lib
85 QT_LIBS = -F$(QT_HOME)/lib
87 QT_LIBS := $(QT_LIBS) -framework QtCore -framework QtSql
90 BASELIBS = -lIceUtil -lpthread
91 LIBS = -lIce $(BASELIBS)
95 ICEUTIL_OS_LIBS = -lpthread
98 PLATFORM_HAS_READLINE := no