ICE 3.4.2
[php5-ice-freebsdport.git] / cpp / config / Make.rules.Darwin
blob16a0af80cb59b4ce6b7b3ee1461642e617772655
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.
14 CXX                     = c++
16 CXXFLAGS                = -Wall -D_REENTRANT
18 ifeq ($(OPTIMIZE),yes)
19      CXXFLAGS           := $(CXXARCHFLAGS) -O2 -DNDEBUG $(CXXFLAGS)
20 else
21      CXXFLAGS           := $(CXXARCHFLAGS) -g $(CXXFLAGS)
22 endif
26 # C++ run-time libraries, necessary for linking some shared libraries.
28 CXXLIBS                 =
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)
35     endif
36 endif
38 LDPLATFORMFLAGS         += -rdynamic
41 # Needed to link IcePHP extension.
43 ifeq ($(ice_language), php)
44     shlibldflags = ${wl}-flat_namespace ${wl}-undefined ${wl}suppress
45 else
46     ifdef ice_src_dist
47         shlibldflags    = $(CXXFLAGS) -L$(libdir)
48     else
49         shlibldflags    = $(CXXFLAGS) -L$(ice_dir)/$(libsubdir)
50     endif
51 endif
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
57 curdir                  = $(shell pwd)
59 ifneq ($(embedded_runpath_prefix),)
60    mkshlib                 = $(CXX)  -dynamiclib $(shlibldflags) -o $(1) -install_name $(runpath_libdir)/$(2) $(3) $(4)
61 else
62    mkshlib                 = $(CXX)  -dynamiclib $(shlibldflags) -o $(1) -install_name $(2) $(3) $(4)
63 endif
65 ifeq ($(DB_HOME),)
66    #
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 
69    # to find it.
70    #
71    ifndef ice_src_dist
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))
76            endif
77        endif
78    endif
79 endif
81 ifneq ($(QT_HOME),)
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
86    endif
87    QT_LIBS := $(QT_LIBS) -framework QtCore -framework QtSql
88 endif
90 BASELIBS                = -lIceUtil -lpthread 
91 LIBS                    = -lIce $(BASELIBS)
93 ICONV_LIB               = -liconv
95 ICEUTIL_OS_LIBS         = -lpthread
96 ICE_OS_LIBS             = -ldl
98 PLATFORM_HAS_READLINE   := no