This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

DJGPP config patches


I sent these before, but got no response. These patches will bring egcs up-
to-date (except for one item) with the configuration settings that have been 
used to build egcs and probably gcc 2.8.1.  I make no copyright claims to 
these changes.

Apply the attached patch from the gcc directory and please use the -p0 
option if neccessary. Also the attached file x-go32 goes into the 
gcc/config/i386/ directory.

I'll save my collect2 patches until I'm sure the gansidecl.h is completed. I 
presume there's no hurry on the collect2 patches since my paperwork will 
need time to clear.

Mark

-- 
Mark Elbrecht snowball3@usa.net
http://members.xoom.com/snowball3/

*** gcc/configure.in.orig	Thu Nov  5 13:23:04 1998
--- gcc/configure.in	Thu Nov  5 13:28:24 1998
***************
*** 1193,1198 ****
--- 1193,1199 ----
  		xm_file=i386/xm-go32.h
  		tm_file=i386/go32.h
  		tmake_file=i386/t-go32
+                 xmake_file=i386/x-go32
  		gnu_ld=yes
  		gas=yes
  		exeext=.exe
*** gcc/cp/g++spec.c   1998/09/09 02:14:54     1.10
--- gcc/cp/g++spec.c   1998/11/02 21:25:45
***************
*** 237,243 ****
--- 237,247 ----
    /* Add `-lstdc++' if we haven't already done so.  */
    if (library)
      {
+ #ifndef __DJGPP__
        arglist[j++] = "-lstdc++";
+ #else /* Since '+' is an invalid character in DOS, DJGPP uses 'x' instead */
+       arglist[j++] = "-lstdcxx";
+ #endif
        added_libraries++;
      }
    if (saw_math)
*** gcc/config/i386/go32.h      1998/10/07 14:50:56     1.2
--- gcc/config/i386/go32.h      1998/11/02 21:19:15
***************
*** 2,24 ****
  
  #include "dbxcoff.h"
  
  /* Don't assume anything about the header files. */
  #define NO_IMPLICIT_EXTERN_C
  
  #define HANDLE_SYSV_PRAGMA
  
- /* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop).  */
- #define HANDLE_PRAGMA_PACK_PUSH_POP 1
- 
  #define YES_UNDERSCORES
  
  #include "i386/gas.h"
  
  #ifdef CPP_PREDEFINES
  #undef CPP_PREDEFINES
  #endif
! #define CPP_PREDEFINES "-Dunix -Di386 -DGO32 -DMSDOS \
    -Asystem(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386)"
  
  #undef EXTRA_SECTIONS
  #define EXTRA_SECTIONS in_ctor, in_dtor
--- 2,73 ----
  
  #include "dbxcoff.h"
  
+ #define NO_STAB_H /* DJGPP has no stab.h */
+ 
  /* Don't assume anything about the header files. */
+ 
  #define NO_IMPLICIT_EXTERN_C
  
  #define HANDLE_SYSV_PRAGMA
  
  #define YES_UNDERSCORES
  
  #include "i386/gas.h"
  
+ /* We should search $DJDIR/bin for executables before current directory 
+    and path for DJGPP. This is to avoid looking for as.exe and ld.exe
+    in current directory and on the path */
+ 
+ #define MD_EXEC_PREFIX "$DJDIR/bin/"
+ 
+ /* Define FILE_NAME_ABSOLUTE_P to handle correctly absolute filename
+    detection (eg. cp/xref.c) */
+    
+ #define FILE_NAME_ABSOLUTE_P(NAME) \
+         (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
+         (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
+ 
+ /* Override specs we need to do for DJGPP */
+ 
  #ifdef CPP_PREDEFINES
  #undef CPP_PREDEFINES
  #endif
! #define CPP_PREDEFINES "-Dunix -Di386 -DGO32 -DMSDOS -DDJGPP=2 \
    -Asystem(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386)"
+ 
+ #undef CPP_SPEC
+ #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
+ 
+ #undef LIB_SPEC
+ #define LIB_SPEC "-lc"
+ 
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s}"
+ 
+ /* We need to override link_command_spec in gcc.c (this also required
+    modification of gcc.c as such override were no supported before).
+    We need this to add command line option -Tdjgpp.djl. This cannot be done
+    in LINK_SPECS as that LINK_SPECS is processed before library search 
+    directories are known by linker. This is to avoid problems when specs
+    file is not available.
+    An alternate way without editting gcc.c is to use SUBTARGET_EXTRA_SPECS
+    suggested by Robert Hoehne.
+    */ 
+ #undef LINK_COMMAND_SPEC
+ #define LINK_COMMAND_SPEC \
+ "%{!fsyntax-only: \
+ %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
+ \t%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
+ \t%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
+ \t%{static:} %{L*} %D %o\
+ \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
+ \t%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\
+ \t-Tdjgpp.djl %{T*}}}}}}}\n\
+ %{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
+ 
+ /* make sure that gcc will not look for .h files in /usr/local/include 
+    (unless user explicitly requests it)  */
+ #undef LOCAL_INCLUDE_DIR
  
  #undef EXTRA_SECTIONS
  #define EXTRA_SECTIONS in_ctor, in_dtor
# translate the version string, so it can be used on DJGPP, where only
# one dot in filename is allowed

# to avoid recursion when redefining $(version)
_version:=$(version)
__version=$(subst ., ,$(_version))
version=$(word 1,$(__version))$(word 2,$(__version)).$(word 3,$(__version))

SYSTEM_HEADER_DIR=$(DJDIR)/include
X_CPPFLAGS=-DSTANDARD_INCLUDE_DIR=\"\$$DJDIR/include\" \
	   -DSTANDARD_INCLUDE_COMPONENT=\"\"
#Uncomment next line for DJGPP source distribution
#FIXINCLUDES=fixinc.djgpp

# 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

#Uncomment for DJGPP source distribution
#EXTRA_GCC_OBJS += djgcc-mktemp.o

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]