LIBGCC1 = libgcc1.null
CROSS_LIBGCC1 = libgcc1.null

crtf.o:	$(srcdir)/config/i386/crtfgo32.c $(GCC_PASSES) $(CONFIG_H)
	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
	  -o crtf.o -c $(srcdir)/config/i386/crtfgo32.c 

#   Replacement for DJGPP libc.a function mktemp() that excludes 
#   possibility of filename conflicts between 2 or more copies of
#   gcc running simultanously. I added -I$(DJDIR)/include before
#   $(INCLUDES) to get DJGPP specific headers included before gcc
#   specific ones (the problem is with go32.h)
#
djgcc-mktemp.o: $(srcdir)/config/i386/djgcc-mktemp.c $(CONFIG_H) 
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  -I$(DJDIR)/include \
  $(INCLUDES) \
  $(DRIVER_DEFINES) \
  -o djgcc-mktemp.o -c $(srcdir)/config/i386/djgcc-mktemp.c


djgpp.djl: $(srcdir)/config/i386/djgpp.djl
	cp -p $(srcdir)/config/i386/djgpp.djl djgpp.djl

#  Fixes for some installation problems under DJGPP. 
#    - strips at least some executables and enlarges stack size of some of them
#    - removes some unneeded files that are being installed
#    - copies distribution versions of specs and djgpp.djl to installation
#      directory
install_extra_djgpp_files: crtf.o
	cp -p crtf.o $(prefix)/lib/gcc-lib/djgpp/$(version)/crtf.o
	cp -p $(srcdir)/config/i386/djgpp.specs $(prefix)/lib/gcc-lib/djgpp/$(version)/specs 	
	-cp -p $(srcdir)/config/i386/crtfgo32.c $(prefix)/lib/gcc-lib/djgpp/$(version)/crtf.c
	-rm -f $(prefix)/bin/c++.exe
	-rm -f $(prefix)/bin/djgpp-gcc.exe
	-ln -s $(prefix)/bin/gxx.exe $(prefix)/bin/g++.exe
	-for file in cc1.exe cc1plus.exe cc1obj.exe f771.exe; \
	 do \
	   if [ -f $(prefix)/lib/gcc-lib/djgpp/$(version)/$$file ]; then \
		strip $(prefix)/lib/gcc-lib/djgpp/$(version)/$$file; \
		stubedit $(prefix)/lib/gcc-lib/djgpp/$(version)/$$file minstack=1536k; \
	   else true; \
	   fi; \
	 done		
	-strip $(prefix)/lib/gcc-lib/djgpp/$(version)/cpp.exe
	-for file in gcc.exe gxx.exe g77.exe; \
	 do \
	   if [ -f $(prefix)/bin/$$file ]; then \
		strip $(prefix)/bin/$$file; \
	   else true; \
	   fi; \
	done
                                               