# translate the version string, so it can be used on DJGPP, where only
# one dot in filename is allowed

SYSTEM_HEADER_DIR=$(DJDIR)/include

# when building a native compiler for DJGPP, make the target_alias
# a shorter name, since otherwise it will produce some problems, when
# using the same gcc once with long filenames and once with short (8+3)
# filenames
ifeq ($(findstring -pc-msdosdjgpp,$(target_alias)),-pc-msdosdjgpp)
target_alias=djgpp
endif

# on DJGPP the 'ln -s' does not work correctly
LN = cp -p
LN_S = cp -p

EXTRA_GCC_OBJS += djgppchk.o
#
#   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)
#
djgppchk.o: $(srcdir)/config/i386/djgppchk.c $(CONFIG_H) 
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  -I$(DJDIR)/include \
  $(INCLUDES) \
  $(DRIVER_DEFINES) \
  -o djgppchk.o -c $(srcdir)/config/i386/djgppchk.c

#
#   Fixes problem that broken stdlib.h is installed in build.djg/gcc/include.
#   Lets take file from $DJDIR/include	
#
USER_H += $(srcdir)/ginclude/stdlib.h

