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