1 # Build a shared libgcc library for PECOFF with a DEF file
4 # mkmap-flat.awk is used with the pe_dll option to produce a DEF instead
7 # Warning: If SHLIB_SOVERSION or SHLIB_SONAME are updated, LIBGCC_SONAME
8 # in mingw32.h and SHLIB_MKMAP_OPTS below must be updated also.
11 SHLIB_IMPLIB = @shlib_base_name@.a
13 SHLIB_SONAME = @shlib_base_name@_$(EH_MODEL)-$(SHLIB_SOVERSION)$(SHLIB_EXT)
14 SHLIB_MAP = @shlib_map_file@
15 SHLIB_OBJS = @shlib_objs@
16 SHLIB_DIR = @multilib_dir@/shlib
17 SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
18 # SHLIB_DLLDIR is defined by including one of either t-dlldir or t-dlldir-x
19 # (native/cross build respectively) in the tmake_file list in
22 $(error SHLIB_DLLDIR must be defined)
24 ifndef SHLIB_PTHREAD_CFLAG
27 ifndef SHLIB_PTHREAD_LDFLAG
28 SHLIB_PTHREAD_LDFLAG =
31 SHLIB_LINK = $(LN_S) -f $(SHLIB_MAP) $(SHLIB_MAP).def && \
32 if [ ! -d $(SHLIB_DIR) ]; then \
35 $(CC) $(LIBGCC2_CFLAGS) $(SHLIB_PTHREAD_CFLAG) \
36 -shared -nodefaultlibs \
38 -Wl,--out-implib,$(SHLIB_DIR)/$(SHLIB_IMPLIB).tmp \
39 -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
40 $(SHLIB_OBJS) ${SHLIB_PTHREAD_LDFLAG} $(SHLIB_LC) && \
41 if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \
42 mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \
43 $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \
45 mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \
46 mv $(SHLIB_DIR)/$(SHLIB_IMPLIB).tmp $(SHLIB_DIR)/$(SHLIB_IMPLIB)
48 $(mkinstalldirs) $(DESTDIR)$(SHLIB_DLLDIR) \
49 $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
50 $(INSTALL) $(SHLIB_DIR)/$(SHLIB_SONAME) \
51 $(DESTDIR)$(SHLIB_DLLDIR)/$(SHLIB_SONAME); \
52 $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_IMPLIB) \
53 $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_IMPLIB)
54 SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
55 # We'd like to use SHLIB_SONAME here too, but shlib_base_name
56 # does not get substituted before mkmap-flat.awk is run.
57 SHLIB_MKMAP_OPTS = -v pe_dll=libgcc_s_$(EH_MODEL)-$(SHLIB_SOVERSION)$(SHLIB_EXT)
58 SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-cygming.ver