summaryrefslogtreecommitdiff
path: root/python/config/Make.rules.Darwin
blob: f75dd9632782b16dacfe3298c427dbc7742351ab (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
# **********************************************************************
#
# Copyright (c) 2003-2016 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.
#

include $(top_srcdir)/../cpp/config/Make.rules.$(UNAME)

shlibldflags    += $(LDEXEFLAGS)

mksoname	= $(if $(2),lib$(1).$(2).so,lib$(1).so)
mklibname	= lib$(1).so

mkshlib		= $(CXX) -dynamiclib $(shlibldflags) -o $(1) -install_name @rpath/$(2) $(3) $(4)

ifneq ($(STATICLIBS),yes)
    #
    # Set RPATH to the cpp/lib directory or Ice installation lib directory. Note that unlike Linux
    # platforms, we always set the RPATH for source builds on OS X. This is required because we
    # can no longer rely on DYLD_LIBRARY_PATH on El Capitan. The RPATH is updated when the library
    # is installed (see cpp/config/Make.rules.Darwin).
    #
    ifdef ice_src_dist
        RPATH_DIR = @loader_path/../../cpp/$(libsubdir)
    else
        RPATH_DIR = $(ice_dir)/$(libsubdir)
    endif

    #
    # Update the RPATH to the installation lib directory when installing a library instead
    # of relying on the RPATH set during the build (which isn't correct anymore for the
    # installation directly layout).
    #
    ifneq ($(embedded_runpath_prefix),)
        installlib += ; install_name_tool -rpath $(RPATH_DIR) $(embedded_runpath_prefix)/lib $(1)/$(3)
    else ifdef usr_dir_install
        installlib += ; install_name_tool -delete_rpath $(RPATH_DIR) $(1)/$(3)
    else ifdef ice_src_dist
        installlib += ; install_name_tool -rpath $(RPATH_DIR) @loader_path/../$(libsubdir) $(1)/$(3)
    endif
endif