1 # Build a shared libgcc library with the darwin linker.
4 SHLIB_VERSTRING = -compatibility_version $(SHLIB_MINOR) -current_version $(SHLIB_MINOR).$(SHLIB_REVISION)
6 SHLIB_SUFFIX = `if test @multilib_dir@ != . ; then echo _@multilib_dir@ ; fi`
7 SHLIB_SOLINK = @shlib_base_name@$(SHLIB_SUFFIX)$(SHLIB_EXT)
8 SHLIB_SONAME = @shlib_base_name@$(SHLIB_SUFFIX).$(SHLIB_MINOR).$(SHLIB_REVISION)$(SHLIB_EXT)
9 SHLIB_MAP = @shlib_map_file@
10 SHLIB_OBJS = @shlib_objs@
11 SHLIB_DIR = @multilib_dir@
13 # Darwin only searches in /usr/lib for shared libraries, not in subdirectories,
14 # so the libgcc variants have different names not different locations.
16 SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \
17 -Wl,-install_name,$(slibdir)/$(SHLIB_SONAME) \
18 -Wl,-flat_namespace -o $(SHLIB_SONAME).tmp \
19 -Wl,-exported_symbols_list,$(SHLIB_MAP) \
21 @multilib_flags@ $(SHLIB_OBJS) -lc && \
22 rm -f $(SHLIB_SOLINK) $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
23 if [ -f $(SHLIB_SONAME) ]; then \
24 mv -f $(SHLIB_SONAME) $(SHLIB_SONAME).backup; \
26 mv $(SHLIB_SONAME).tmp $(SHLIB_SONAME) && \
27 $(LN_S) $(SHLIB_SONAME) $(SHLIB_SOLINK) && \
28 if [ $(SHLIB_DIR) != . ] ; then \
29 $(LN_S) `pwd`/$(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) ; \
31 # $(slibdir) double quoted to protect it from expansion while building
32 # libgcc.mk. We want this delayed until actual install time.
34 $$(mkinstalldirs) $$(DESTDIR)$$(slibdir); \
35 $(INSTALL_DATA) $(SHLIB_SONAME) \
36 $$(DESTDIR)$$(slibdir)/$(SHLIB_SONAME); \
37 rm -f $$(DESTDIR)$$(slibdir)/$(SHLIB_SOLINK); \
38 $(LN_S) $(SHLIB_SONAME) \
39 $$(DESTDIR)$$(slibdir)/$(SHLIB_SOLINK)
40 SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
41 SHLIB_MKMAP_OPTS = -v leading_underscore=1
42 SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
44 # Must use a different directive for hidden visibility in assembly sources.
45 ASM_HIDDEN_OP = .private_extern