public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC 3.3 for OS/2
@ 2003-02-06 15:01 Mikulas Patocka
  2003-02-06 22:53 ` Neil Booth
  0 siblings, 1 reply; 9+ messages in thread
From: Mikulas Patocka @ 2003-02-06 15:01 UTC (permalink / raw)
  To: gcc; +Cc: gcc-patches

[-- Attachment #1: Type: TEXT/PLAIN, Size: 354 bytes --]

Hi

I have ported Gcc 3.3 to operating system OS/2 (currently only C compiler
works). Are you going to accept the patch? If yes, whom should I send
further patches to?

I want to make it option-compatible with EMX (there are many makefiles for
EMX), so I had to modify some gcc source files too --- but I placed all
modifications in #ifdef EMX.

Mikulas

[-- Attachment #2: GCC for OS/2 --]
[-- Type: TEXT/PLAIN, Size: 36992 bytes --]

diff -r -N -u gcc-20030120-orig/configure.in gcc-20030120/configure.in
--- gcc-20030120-orig/configure.in	Thu Nov 28 21:27:44 2002
+++ gcc-20030120/configure.in	Sun Jan 26 18:03:50 2003
@@ -229,6 +229,9 @@
   *-*-cygwin*)
      noconfigdirs="autoconf automake send-pr rcs guile perl"
     ;;
+  i[3456]86-*-emx*)
+     noconfigdirs="$noconfigdirs zlib"
+     ;;
   *-*-netbsd*)
     noconfigdirs="rcs"
     ;;
@@ -486,6 +489,9 @@
     ;;
   i[3456]86-*-beos*)
      noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
+     ;;
+  i[3456]86-*-emx*)
+     noconfigdirs="$noconfigdirs target-zlib"
      ;;
   m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
     noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
diff -r -N -u gcc-20030120-orig/gcc/aclocal.m4 gcc-20030120/gcc/aclocal.m4
--- gcc-20030120-orig/gcc/aclocal.m4	Mon Jan 13 18:23:58 2003
+++ gcc-20030120/gcc/aclocal.m4	Sun Jan 26 18:03:50 2003
@@ -662,7 +662,7 @@
  # on the host, let alone whether mmap will work on it.
  [case "$host_os" in
    cygwin* | win32 | pe | mingw* ) ac_cv_func_mmap_dev_zero=buggy ;;
-   darwin* ) ac_cv_func_mmap_dev_zero=no ;;
+   darwin* | os2* ) ac_cv_func_mmap_dev_zero=no ;;
    * ) ac_cv_func_mmap_dev_zero=yes ;;
   esac])
 ])
diff -r -N -u gcc-20030120-orig/gcc/config/emx-install gcc-20030120/gcc/config/emx-install
--- gcc-20030120-orig/gcc/config/emx-install	Thu Jan  1 00:00:00 1970
+++ gcc-20030120/gcc/config/emx-install	Fri Nov 15 18:09:14 2002
@@ -0,0 +1,10 @@
+#!bash.exe
+emxload -qw
+./../install-sh -c $@
+ret=$?
+while [ -n "$1" ]; do
+	exename="$1"
+	shift
+done
+emxbind -s "$exename"
+exit $ret
diff -r -N -u gcc-20030120-orig/gcc/config/os2-mlib.h gcc-20030120/gcc/config/os2-mlib.h
--- gcc-20030120-orig/gcc/config/os2-mlib.h	Thu Jan  1 00:00:00 1970
+++ gcc-20030120/gcc/config/os2-mlib.h	Sat Nov 16 12:18:00 2002
@@ -0,0 +1,21 @@
+static const char *const multilib_raw[] = {
+"st !Zmt;",
+"mt Zmt;",
+NULL
+};
+
+static const char *const multilib_matches_raw[] = {
+"Zmtd Zmt;",
+"Zmts Zmt;",
+"Zmt Zmt;",
+NULL
+};
+
+static const char *multilib_extra = "";
+
+static const char *const multilib_exclusions_raw[] = {
+NULL
+};
+
+static const char *multilib_options = "";
+
diff -r -N -u gcc-20030120-orig/gcc/config/os2.asm gcc-20030120/gcc/config/os2.asm
--- gcc-20030120-orig/gcc/config/os2.asm	Thu Jan  1 00:00:00 1970
+++ gcc-20030120/gcc/config/os2.asm	Fri Nov 15 18:09:16 2002
@@ -0,0 +1,71 @@
+/* stuff needed for libgcc1 on os2. */
+
+#include <emx/asm386.h>
+
+	.global	__alloca
+__alloca:
+	pushl  %ecx		/* save temp */
+	movl   %esp,%ecx	/* get sp */
+	addl   $0x8,%ecx	/* and point to return addr */
+
+probe: 	cmpl   $0x1000,%eax	/* > 4k ?*/
+	jb    done		
+
+	subl   $0x1000,%ecx  		/* yes, move pointer down 4k*/
+	orl    $0x0,(%ecx)   		/* probe there */
+	subl   $0x1000,%eax  	 	/* decrement count */
+	jmp    probe           	 	/* and do it again */
+
+done: 	subl   %eax,%ecx	   
+	orl    $0x0,(%ecx)	/* less that 4k, just peek here */
+
+	movl   %esp,%eax
+	movl   %ecx,%esp	/* decrement stack */
+
+	movl   (%eax),%ecx	/* recover saved temp */
+	movl   4(%eax),%eax	/* get return address */
+	jmp    *%eax	
+
+
+        .globl ___probe
+
+/ void __probe (size_t n)
+
+/ Note: this function does not modify any registers and removes
+/       its argument from the stack.
+/       Do not call this function from a C program!
+
+        .text
+        ALIGN
+___probe:
+        xchgl   1*4(%esp), %ebx         /* save %ebx, put n into %ebx */
+        pushl   %eax                    /* save %eax */
+        movl    %esp, %eax
+        subl    %ebx, %eax              /* low address -> %eax */
+        andl    $-4, %eax               /* round down */
+        movl    %esp, %ebx              /* high address -> %ebx */
+        ALIGN
+1:      subl    $0x1000, %ebx           /* move down */
+        cmpl    %eax, %ebx              /* low address reached? */
+        jb      2f
+        testl   %eax, (%ebx)            /* reference the page */
+        jmp     1b                      /* repeat */
+
+        ALIGN
+2:      testl   %eax, (%eax)            /* reference last page */
+        popl    %eax                    /* restore %eax */
+        movl    1*4(%esp), %ebx         /* restore %ebx */
+        EPILOGUE_NO_RET(__probe)
+        ret     $4                      /* return, remove arg from stack */
+
+        .globl  ___eh_frame_init
+	.text
+	ALIGN
+___eh_frame_init:
+	ret
+
+        .globl  ___eh_frame_term
+	.text
+	ALIGN
+___eh_frame_term:
+	ret
diff -r -N -u gcc-20030120-orig/gcc/config/os2.c gcc-20030120/gcc/config/os2.c
--- gcc-20030120-orig/gcc/config/os2.c	Thu Jan  1 00:00:00 1970
+++ gcc-20030120/gcc/config/os2.c	Fri Nov 15 18:09:16 2002
@@ -0,0 +1 @@
+/* nothing */
diff -r -N -u gcc-20030120-orig/gcc/config/os2.h gcc-20030120/gcc/config/os2.h
--- gcc-20030120-orig/gcc/config/os2.h	Thu Jan  1 00:00:00 1970
+++ gcc-20030120/gcc/config/os2.h	Fri Jan 24 17:03:54 2003
@@ -0,0 +1,275 @@
+/* Definitions of target machine for GNU compiler
+   for an Intel i386 or later processor running OS/2 2.x.
+   Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+   Contributed by Samuel Figueroa (figueroa@cs.nyu.edu)
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include "i386/i386.h"
+#include "i386/unix.h"
+#include "i386/bsd.h"
+#include "i386/gas.h"
+
+#ifndef __EMX__
+#ifndef DEFAULT_TARGET_MACHINE
+#define DEFAULT_TARGET_MACHINE "i386-os2"
+#endif
+#ifndef LINK_SPEC
+#define LINK_SPEC "/st:1048576/pm:vio/noi/a:16/e/bas:65536/nol"
+#endif
+#ifndef LIB_SPEC
+#define LIB_SPEC "libgcc libc"
+#endif
+#ifndef STARTFILE_SPEC
+#define STARTFILE_SPEC "libcrt.lib"
+#endif
+#ifndef MD_EXEC_PREFIX
+#define MD_EXEC_PREFIX "\\gcc\\bin\\"
+#endif
+#ifndef STANDARD_STARTFILE_PREFIX
+#define STANDARD_STARTFILE_PREFIX "\\gcc\\lib\\"
+#endif
+#ifndef LOCAL_INCLUDE_DIR
+#define LOCAL_INCLUDE_DIR "\\gcc\\include"
+#endif
+#endif
+
+/* do not automatically add .exe suffix; be compatible with EMX */
+/*
+#undef NO_AUTO_EXE_SUFFIX
+#define NO_AUTO_EXE_SUFFIX
+*/
+
+#define TARGET_EXECUTABLE_SUFFIX ".exe"
+
+/* The EMX compiler uses regular .o files */
+#ifndef __EMX__
+#define TARGET_OBJECT_SUFFIX ".obj"
+#else
+extern int omf;
+#define TARGET_OBJECT_SUFFIX (!omf ? ".o" : ".obj")
+#endif
+
+#define YES_UNDERSCORES
+#include "i386/gstabs.h"
+#define NO_IMPLICIT_EXTERN_C
+
+/* Enable #pragma pack. */
+#define HANDLE_SYSV_PRAGMA
+
+/* wchar_t is unsigned short. */
+#define WCHAR_TYPE              "short unsigned int"
+#define WCHAR_TYPE_SIZE         16
+
+/* Bitfields may cross alignment boundaries. */
+#undef PCC_BITFIELD_TYPE_MATTERS
+#define PCC_BITFIELD_TYPE_MATTERS 0
+
+/* By default, return short structures in registers. */
+#define DEFAULT_PCC_STRUCT_RETURN 0
+
+
+#define USE_COLLECT
+
+#ifndef __EMX__
+
+#define BIGGEST_FIELD_ALIGNMENT \
+  (maximum_field_alignment ? maximum_field_alignment : 32)
+
+extern int maximum_field_alignment;
+
+#undef PCC_BITFIELD_TYPE_MATTERS
+#define PCC_BITFIELD_TYPE_MATTERS (maximum_field_alignment == 0)
+
+#endif
+
+/* Define this macro if it is advisable to hold scalars in registers
+   in a wider mode than that declared by the program.  In such cases,
+   the value is constrained to be within the bounds of the declared
+   type, but kept valid in the wider mode.  The signedness of the
+   extension may differ from that of the type.  */
+
+/*
+#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)  \
+  if (GET_MODE_CLASS (MODE) == MODE_INT         \
+      && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
+      (MODE) = SImode;
+*/
+
+/* Define this if function arguments should also be promoted using the above
+   procedure.  */
+
+/*
+#define PROMOTE_FUNCTION_ARGS
+*/
+
+/* Likewise, if the function return value is promoted.  */
+
+/*
+#define PROMOTE_FUNCTION_RETURN
+*/
+
+#define DBX_CONTIN_LENGTH 0
+
+#ifdef __EMX__
+/*
+#define GCC_INCLUDE_DIR            "/emx/include"
+#define GPLUSPLUS_INCLUDE_DIR      "/emx/include.gpp"
+#define LOCAL_INCLUDE_DIR          "/usr/local/include"
+#define CROSS_INCLUDE_DIR          "/emx/include.sys"
+#define STANDARD_EXEC_PREFIX       "/emx/bin/"
+#define STANDARD_STARTFILE_PREFIX  "/emx/lib/"
+*/
+
+/* The -Zstack option takes an argument. */
+#define WORD_SWITCH_TAKES_ARG(STR) (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
+                                    || !strcmp (STR, "Zstack"))
+
+/* Predefine symbols `__32BIT__', `__EMX__', and `i386'. */
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "-D__32BIT__ -D__EMX__ -Di386\
+  -Asystem(unix) -Asystem(emx)"
+
+/* Predefine the symbol `__MT__' for multi-threaded programs (-Zmt).
+   Pass -Zc++-comments and -ZC++-comments to the preprocessor. */
+#undef CPP_SPEC
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{Zmt:-D__MT__} \
+%{Zomf} %{ZC++-comments} %{Zc++-comments} %{pg:-D__GPROF__} \
+%{mepilogue:-D__EPILOGUE__}"
+
+/* Pass -Zomf and -s (as -Zstrip) to the assembler. */
+#define ASM_SPEC "%{Zomf} %{s:-Zstrip}"
+
+#define LINK_SPEC \
+  "%{Zexe} %{Zstack*} %{Zmap*} %{Zomf:%{Zdll}}" \
+  "%{!o*:-o %b.%{Zdll:dll}%{!Zdll:exe}} " \
+  "%{static:%{Zcrtdll=*:%e-static and -Zcrtdll are incompatible}}" \
+  "%{Zdll:%{Zexe:%e-Zdll and -Zexe are incompatible}}" \
+  "%{Zso:%{!Zsys:%e-Zso requires -Zsys}}" \
+  "%{Zso:%{!Zdll:%e-Zso requires -Zdll}}" \
+  "%{Zno-rte:%{!Zdll:%e-Zno-rte requires -Zdll}}" \
+  "%{Zno-rte:%{!Zomf:%e-Zno-rte requires -Zomf}}" \
+  "%{Zno-rte:%{Zsys:%e-Zno-rte and -Zsys are incompatible}}" \
+  "%{Zno-rte:%{Zso:%e-Zno-rte and -Zso are incompatible}}" \
+  "%{Zno-rte:%{Zcrtdll=*:%e-Zcrtdll and -Zno-rte are incompatible}}" \
+  "%{Zno-rte:%{Zmt:%e-Zmt and -Zno-rte are incompatible}}" \
+  "%{Zsys:%{Zcrtdll=*:%e-Zcrtdll and -Zsys are incompatible}}" \
+  "%{Zsys:%{!Zomf:%e-Zsys requires -Zomf}}" \
+  "%{Zsys:%{Zbsd-signals:%e-Zbsd-signals and -Zsys are incompatible}}" \
+  "%{Zsys:%{Zsysv-signals:%e-Zsysv-signals and -Zsys are incompatible}}" \
+  "%{Zbsd-signals:%{Zsysv-signals:%e-Zbsd-signals and -Zsysv-signals are incompatible}}" \
+  "%{Zsmall-conv:%{Zcrtdll=*:%e-Zsmall-conv and -Zcrtdll are incompatible}}"
+
+#define LIBGCC_SPEC "-lgcc%{pg:_p}"
+
+#define LIB_SPEC \
+  "%{g*:-lg} " \
+  "%{p:-lc_p}%{pg:-lc_p} -lc " \
+  "%{Zdll:%{Zso:-lc_dllso}%{Zno-rte:-lc_dllnrt}" \
+         "%{!Zso:%{!Zno-rte:-lc_dllrt}}}" \
+  "%{!Zdll:-lc_app%{pg:_p}} %{p:-lc_p}%{pg:-lc_p} -lc"
+
+#define STARTFILE_SPEC \
+  "%{Zdll:dll0%O%s}" \
+  "%{!Zdll:%{pg:gcrt0%O%s}" \
+         "%{!pg:%{pn:gcrt0%O%s}%{!pn:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}" \
+         " %{Zsysv-signals:sigsysv%O%s} %{Zbsd-signals:sigbsd%O%s}" \
+         " %{Zbin-files:binmode%O%s}%{Zsmall-conv:smallcnv%O%s}}"
+
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT \
+   (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS /*| MASK_STACK_PROBE*/) 
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+   for profiling a function entry.  */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO)  \
+{									\
+  fprintf (FILE, "\tcall __mcount\n");					\
+}
+
+/* Calling conventions */
+
+/*
+
+I haven't seen these anywhere in EMX source files, so I just don't implement
+them	-- mikulas
+
+#undef VALID_MACHINE_TYPE_ATTRIBUTE
+#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS)	\
+  ((TREE_CODE ((TYPE)) == FUNCTION_TYPE					\
+   || TREE_CODE ((TYPE)) == METHOD_TYPE					\
+   || TREE_CODE ((TYPE)) == FIELD_DECL					\
+   || TREE_CODE ((TYPE)) == TYPE_DECL)					\
+  && (is_attribute_p ("emxcall", (NAME))				\
+   || is_attribute_p ("system", (NAME))) ? (ARGS) == NULL_TREE :	\
+   ix86_valid_type_attribute_p ((TYPE), (ATTRIBUTES), (NAME), (ARGS)))
+
+#undef RETURN_POPS_ARGS
+#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
+  (emx_return_pops_args (FUNDECL, FUNTYPE, SIZE))
+*/
+
+#define LINK_COMMAND_SPEC "\
+%{!fsyntax-only: \
+ %{!c:%{!M:%{!MM:%{!E:%{!S:%{!Zomf:ld}%{Zomf:emxomfld}\
+			%l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
+			%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
+			%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
+			%{static:} %{L*} %D %{T*} %o\
+                        %{fbounds-checking:-lcheck} \
+			%{!nostdlib:%{!nodefaultlibs:\
+			  -lc_alias \
+			  %{Zcrtdll=*:-lc_static -l%* -los2%{pg:_p} -lemx2}\
+			  %{!Zcrtdll:%{!Zcrtdll=*:%G %L %G\
+			     %{Zno-rte:-los2%{pg:_p}}\
+			     %{!Zno-rte:%{Zsys:-lsys -los2}\
+					%{!Zsys:-lemx -los2%{pg:_p} -lemx2}}}}\
+			  %{Zomf:-lend}}}\
+			%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\n }}}}}}"
+
+#define TARGET_CPP_OPTIONS 					\
+	DEF_OPT("ZC++-comments", 0, OPT_ZCpp_comments)		\
+	DEF_OPT("Zc++-comments", 0, OPT_Zcpp_comments)		\
+	DEF_OPT("Zomf", 0, OPT_Zomf)
+
+#define TARGET_CPP_PROCESS_OPTIONS 					\
+	case OPT_Zomf: omf = 1;						\
+		       break;						\
+        case OPT_ZCpp_comments:						\
+        case OPT_Zcpp_comments: CPP_OPTION (pfile, cplusplus_comments) = 1;\
+				break;
+
+#undef DO_GLOBAL_DTORS_BODY
+#define DO_GLOBAL_DTORS_BODY					\
+do {								\
+	extern void __ctordtorTerm (void);			\
+	__ctordtorTerm ();					\
+} while(0);
+
+#undef DO_GLOBAL_CTORS_BODY
+#define DO_GLOBAL_CTORS_BODY					\
+do {								\
+	extern void __ctordtorInit (void);			\
+	__ctordtorInit ();					\
+} while(0);
+
+#endif
+
diff -r -N -u gcc-20030120-orig/gcc/config/t-os2 gcc-20030120/gcc/config/t-os2
--- gcc-20030120-orig/gcc/config/t-os2	Thu Jan  1 00:00:00 1970
+++ gcc-20030120/gcc/config/t-os2	Fri Nov 15 18:09:24 2002
@@ -0,0 +1,23 @@
+DUMMY_ := $(shell emxload -qw)
+
+LIBGCC1 = libgcc1-asm.a
+CROSS_LIBGCC1 = libgcc1-asm.a
+LIB1ASMSRC = i386/os2.asm
+LIB1ASMFUNCS = __probe
+
+os2.o: $(srcdir)/config/i386/os2.c
+	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/os2.c
+
+RANLIB_TEST_FOR_TARGET = true
+RANLIB_FOR_TARGET = true
+
+INSTALL_LIBGCC = install-os2-libgcc
+
+install-os2-libgcc : install-libgcc
+	mv $(libsubdir)/st/libgcc.a $(libsubdir)/st/gcc.a
+	mv $(libsubdir)/mt/libgcc.a $(libsubdir)/mt/gcc.a
+	emxomf -s $(libsubdir)/st/gcc.a
+	emxomf -s $(libsubdir)/mt/gcc.a
+	cp $(libsubdir)/st/gcc.a $(libsubdir)/st/gcc_p.a
+
+override INSTALL_PROGRAM = sh ./config/i386/emx-install
diff -r -N -u gcc-20030120-orig/gcc/config/x-os2 gcc-20030120/gcc/config/x-os2
--- gcc-20030120-orig/gcc/config/x-os2	Thu Jan  1 00:00:00 1970
+++ gcc-20030120/gcc/config/x-os2	Fri Nov 15 18:09:24 2002
@@ -0,0 +1,7 @@
+# Location of EMX header directory.
+SYSTEM_HEADER_DIR=$(C_INCLUDE)
+
+# on OS/2 the 'ln -s' does not work correctly
+LN = cp -p
+LN_S = cp -p
+
diff -r -N -u gcc-20030120-orig/gcc/config/xm-os2.h gcc-20030120/gcc/config/xm-os2.h
--- gcc-20030120-orig/gcc/config/xm-os2.h	Thu Jan  1 00:00:00 1970
+++ gcc-20030120/gcc/config/xm-os2.h	Sat Nov 16 13:47:00 2002
@@ -0,0 +1,125 @@
+/* Configuration for GNU compiler
+   for an Intel i386 or later processor running OS/2 2.x.
+   Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Contributed by Samuel Figueroa (figueroa@apple.com)
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#ifndef OS2
+#define OS2
+#endif
+
+#ifdef __IBMC__
+#include <stdlib.h> /* this defines alloca */
+#define USG
+#define ONLY_INT_FIELDS
+#define USE_PROTOTYPES 1
+#define strcasecmp stricmp
+#define kill(a,b) raise(b)
+#define mktemp tmpnam
+#else
+#ifdef __EMX__
+#include <sys/emxload.h>
+#define EMX
+#define USG
+#ifndef HAVE_PUTENV
+#define HAVE_PUTENV 1
+#endif
+#ifndef HAVE_VPRINTF
+#define HAVE_VPRINTF 1
+#endif
+#ifndef HAVE_STRERROR
+#define HAVE_STRERROR 1
+#endif
+#define strcasecmp stricmp
+#ifndef HAVE_STRCASECMP
+#define HAVE_STRCASECMP 1
+#endif
+#ifndef HAVE_SYS_STAT_H
+#define HAVE_SYS_STAT_H	1
+#endif
+#ifndef HAVE_PRINTF_PTR
+#define HAVE_PRINTF_PTR	1
+#endif
+#ifndef S_ISBLK
+#define S_ISBLK(x) 0
+#endif
+#else
+#define ____386BSD____
+int spawnv (int modeflag, char *path, char *argv[]);
+int spawnvp (int modeflag, char *path, char *argv[]);
+#endif /* __EMX__ */
+#endif /* __IBMC__ */
+
+#ifndef PATH_SEPARATOR
+#define PATH_SEPARATOR ';'
+#endif
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '\\'
+#endif
+#ifndef DIR_SEPARATOR_2
+#define DIR_SEPARATOR_2 '/'
+#endif
+
+/* Allow handling of drive names. */
+#define HAVE_DOS_BASED_FILE_SYSTEM
+
+#define HOST_EXECUTABLE_SUFFIX ".exe"
+
+/* The EMX compiler uses regular .o files */
+#ifndef __EMX__
+#define HOST_OBJECT_SUFFIX ".obj"
+#else
+#define HOST_OBJECT_SUFFIX ".o"
+#endif
+
+/* Tell GCC about OS/2's bit bucket. */
+
+#define HOST_BIT_BUCKET "NUL"
+
+/*#include "i386/xm-i386.h"*/
+
+#ifdef __EMX__
+
+#undef GCC_DRIVER_HOST_INITIALIZATION
+#define GCC_DRIVER_HOST_INITIALIZATION					\
+  _emxload_env ("GCCLOAD");						\
+  _envargs (&argc, (char ***)&argv, "GCCOPT");				\
+  _response (&argc, (char ***)&argv);					\
+  _wildcard (&argc, (char ***)&argv);					\
+									\
+  /* pipe() is supported under OS/2 and by RSX.  */			\
+  pipes_supported = _osmode != DOS_MODE || (_emx_env & 0x1000);
+
+#undef CC_HOST_INITIALIZATION
+#define CC_HOST_INITIALIZATION						\
+  _emxload_env ("GCCLOAD");
+
+#undef COLLECT2_HOST_INITIALIZATION
+#define COLLECT2_HOST_INITIALIZATION					\
+  _emxload_env ("GCCLOAD");
+
+#undef CPP_HOST_INITIALIZATION
+#define CPP_HOST_INITIALIZATION						\
+  _emxload_env ("GCCLOAD");
+
+#undef TRADCPP_HOST_INITIALIZATION
+#define TRADCPP_HOST_INITIALIZATION					\
+  _emxload_env ("GCCLOAD");
+
+#endif /* __EMX__ */
diff -r -N -u gcc-20030120-orig/gcc/config.gcc gcc-20030120/gcc/config.gcc
--- gcc-20030120-orig/gcc/config.gcc	Sat Jan  4 22:28:54 2003
+++ gcc-20030120/gcc/config.gcc	Sun Jan 26 18:03:50 2003
@@ -1160,6 +1160,17 @@
 		tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h lynx-ng.h i386/lynx-ng.h"
 	fi
 	;;
+i[34567]86-*-os2*)
+	xm_file=i386/xm-os2.h
+	tm_file=i386/os2.h
+	tmake_file=i386/t-os2
+	xmake_file=i386/x-os2
+	extra_objs=os2.o
+	gnu_ld=yes
+	gas=yes
+	exeext=.exe
+	float_format=none
+	;;
 i[34567]86-*-mach*)
 	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h i386/mach.h"
 #	tmake_file=t-libc-ok
diff -r -N -u gcc-20030120-orig/gcc/configure gcc-20030120/gcc/configure
--- gcc-20030120-orig/gcc/configure	Wed Jan 15 11:50:18 2003
+++ gcc-20030120/gcc/configure	Sun Jan 26 18:03:52 2003
@@ -2984,6 +2984,10 @@
 
 fi
 fi
+if test -n "$OS2_SHELL"; then
+    ac_cv_c_compile_endian=little-endian
+    ac_cv_c_float_format='IEEE (little-endian)'
+fi
 echo $ac_n "checking byte ordering""... $ac_c" 1>&6
 echo "configure:2989: checking byte ordering" >&5
 if eval "test \"`echo '$''{'ac_cv_c_compile_endian'+set}'`\" = set"; then
@@ -4389,7 +4393,7 @@
  # on the host, let alone whether mmap will work on it.
  case "$host_os" in
    cygwin* | win32 | pe | mingw* ) ac_cv_func_mmap_dev_zero=buggy ;;
-   darwin* ) ac_cv_func_mmap_dev_zero=no ;;
+   darwin* | os2* ) ac_cv_func_mmap_dev_zero=no ;;
    * ) ac_cv_func_mmap_dev_zero=yes ;;
   esac
 else
diff -r -N -u gcc-20030120-orig/gcc/configure.in gcc-20030120/gcc/configure.in
--- gcc-20030120-orig/gcc/configure.in	Wed Jan 15 11:50:18 2003
+++ gcc-20030120/gcc/configure.in	Sun Jan 26 18:03:52 2003
@@ -558,6 +558,12 @@
 
 # These tests can't be done till we know if we have limits.h.
 gcc_AC_C_CHAR_BIT
+
+# gcc_AC_C_COMPILE_ENDIAN fails on OS/2, so I hardcoded little endian -- mikulas
+if test -n "$OS2_SHELL"; then
+    ac_cv_c_compile_endian=little-endian
+    ac_cv_c_float_format='IEEE (little-endian)'
+fi
 gcc_AC_C_COMPILE_ENDIAN
 gcc_AC_C_FLOAT_FORMAT
 
diff -r -N -u gcc-20030120-orig/gcc/cppfiles.c gcc-20030120/gcc/cppfiles.c
--- gcc-20030120-orig/gcc/cppfiles.c	Wed Nov 20 20:49:52 2002
+++ gcc-20030120/gcc/cppfiles.c	Sun Jan 26 18:03:52 2003
@@ -490,6 +490,10 @@
       inc->st.st_size = offset;
     }
 
+  /* 26 is used as file-termination character on OS/2 and DOS -- mikulas */
+#ifdef EMX
+  if (inc->st.st_size > 0 && buf[inc->st.st_size - 1] == 26) inc->st.st_size--;
+#endif
   inc->buffer = buf;
   return 0;
 
diff -r -N -u gcc-20030120-orig/gcc/cppinit.c gcc-20030120/gcc/cppinit.c
--- gcc-20030120-orig/gcc/cppinit.c	Sun Oct  6 12:21:08 2002
+++ gcc-20030120/gcc/cppinit.c	Sun Jan 26 18:03:52 2003
@@ -43,6 +43,11 @@
 # define INO_T_COPY(DEST, SRC) (DEST) = (SRC)
 #endif
 
+  /* use extension .obj instead of .o when printing depencies  -- mikulas */
+#ifdef EMX
+int omf = 0;
+#endif
+
 /* Internal structures and prototypes.  */
 
 /* A `struct pending_option' remembers one -D, -A, -U, -include, or
@@ -1165,6 +1170,10 @@
 #define no_mac N_("macro name missing after %s")
 #define no_pth N_("path name missing after %s")
 
+#ifndef TARGET_CPP_OPTIONS
+#define TARGET_CPP_OPTIONS
+#endif
+
 /* This is the list of all command line options, with the leading
    "-" removed.  It must be sorted in ASCII collating order.  */
 #define COMMAND_LINE_OPTIONS                                                  \
@@ -1172,6 +1181,7 @@
   DEF_OPT("D",                        no_mac, OPT_D)                          \
   DEF_OPT("I",                        no_dir, OPT_I)                          \
   DEF_OPT("U",                        no_mac, OPT_U)                          \
+  TARGET_CPP_OPTIONS							      \
   DEF_OPT("idirafter",                no_dir, OPT_idirafter)                  \
   DEF_OPT("imacros",                  no_fil, OPT_imacros)                    \
   DEF_OPT("include",                  no_fil, OPT_include)                    \
@@ -1428,6 +1438,9 @@
 	  /* Add directory to end of path for includes.  */
 	  append_include_chain (pfile, xstrdup (arg), AFTER, 0);
 	  break;
+#ifdef TARGET_CPP_PROCESS_OPTIONS
+	TARGET_CPP_PROCESS_OPTIONS;
+#endif
 	}
     }
   return i + 1;
diff -r -N -u gcc-20030120-orig/gcc/gcc.c gcc-20030120/gcc/gcc.c
--- gcc-20030120-orig/gcc/gcc.c	Fri Dec 13 01:17:18 2002
+++ gcc-20030120/gcc/gcc.c	Sun Jan 26 18:03:52 2003
@@ -266,6 +266,17 @@
 /* Forward declaration for prototypes.  */
 struct path_prefix;
 
+#ifdef EMX
+/* Nonzero means create .obj files instead of .o files.  */
+int omf;
+
+/* Nonzero means pipes are supported.  */
+static int pipes_supported;
+
+/* Name of first input file, for defaulting the output file. */
+static char *first_infile;
+#endif /* EMX */
+
 static void init_spec		PARAMS ((void));
 static void store_arg		PARAMS ((const char *, int, int));
 static char *load_specs		PARAMS ((const char *));
@@ -737,6 +748,7 @@
 static const char *multilib_matches;
 static const char *multilib_defaults;
 static const char *multilib_exclusions;
+
 #include "multilib.h"
 
 /* Check whether a particular argument is a default argument.  */
@@ -1197,6 +1209,38 @@
 	  i++;
 	}
 
+#ifdef EMX
+      /* Handle abbreviations.  Note that no abbreviation must expand
+         to more than two options.  */
+      else if (!strcmp (argv[i], "-Zmts"))
+	{
+	  newv[newindex++] = "-Zmt";
+	  newv[newindex++] = "-static";
+	  i++;
+	}
+      else if (!strcmp (argv[i], "-Zmtd"))
+	{
+	  newv[newindex++] = "-Zmt";
+	  newv[newindex++] = "-Zcrtdll=c_import";
+	  i++;
+	}
+      else if (!strcmp (argv[i], "-Zcrtdll"))
+	{
+	  newv[newindex++] = "-Zcrtdll=c_import";
+	  i++;
+	}
+      else if (!strcmp (argv[i], "-mprobe"))
+	{
+	  newv[newindex++] = "-mstack-arg-probe";
+	  i++;
+	}
+      else if (!strcmp (argv[i], "-mno-probe"))
+	{
+	  newv[newindex++] = "-mno-stack-arg-probe";
+	  i++;
+	}
+#endif /* EMX */
+
       /* Handle old-fashioned options--just copy them through,
 	 with their arguments.  */
       else if (argv[i][0] == '-')
@@ -1214,6 +1258,10 @@
 	    nskip += 1;
 	  else if (! strcmp (p, "Xlinker"))
 	    nskip += 1;
+#ifdef EMX
+	  else if (! strcmp (p, "Zlinker"))
+	    nskip += 1;
+#endif /* EMX */
 
 	  /* Watch out for an option at the end of the command line that
 	     is missing arguments, and avoid skipping past the end of the
@@ -2463,7 +2511,8 @@
 enum path_prefix_priority
 {
   PREFIX_PRIORITY_B_OPT,
-  PREFIX_PRIORITY_LAST
+  PREFIX_PRIORITY_LAST,
+  PREFIX_PRIORITY_REALLY_LAST
 };
 
 /* Add an entry for PREFIX in PLIST.  The PLIST is kept in assending
@@ -2566,9 +2615,13 @@
   for (n_commands = 1, i = 0; i < argbuf_index; i++)
     if (strcmp (argbuf[i], "|") == 0)
       {				/* each command.  */
-#if defined (__MSDOS__) || defined (OS2) || defined (VMS)
+#if defined (__MSDOS__) || (defined (OS2) && !defined(__EMX__)) || defined (VMS)
 	fatal ("-pipe not supported");
 #endif
+#ifdef __EMX__
+        if (!pipes_supported)
+          fatal ("-pipe not supported");
+#endif /* __EMX__ */
 	argbuf[i] = 0;	/* termination of command args.  */
 	commands[n_commands].prog = argbuf[i + 1];
 	commands[n_commands].argv = &argbuf[i + 1];
@@ -3229,8 +3282,13 @@
 		}
 	      else
 		nstore[endp - startp] = 0;
+#ifndef EMX		/* on EMX we must search first gcc-lib/... -- mikulas */
 	      add_prefix (&startfile_prefixes, nstore, NULL,
 			  PREFIX_PRIORITY_LAST, 0, NULL, 1);
+#else
+	      add_prefix (&startfile_prefixes, nstore, NULL,
+			  PREFIX_PRIORITY_REALLY_LAST, 0, NULL, 1);
+#endif
 	      if (*endp == 0)
 		break;
 	      endp = startp = endp + 1;
@@ -3392,6 +3450,16 @@
 	  n_infiles++;
 	  i++;
 	}
+#ifdef EMX
+      else if (strcmp (argv[i], "-Zlinker") == 0)
+	{
+	  if (i + 1 == argc)
+	    fatal ("argument to `-Zlinker' is missing");
+
+	  n_infiles += 2;
+	  i++;
+	}
+#endif /* EMX */
       else if (strncmp (argv[i], "-l", 2) == 0)
 	n_infiles++;
       else if (strcmp (argv[i], "-save-temps") == 0)
@@ -3621,6 +3689,10 @@
 		i += SWITCH_TAKES_ARG (c) - (p[1] != 0);
 	      else if (WORD_SWITCH_TAKES_ARG (p))
 		i += WORD_SWITCH_TAKES_ARG (p);
+#ifdef EMX
+	      if (!strcmp (p, "Zomf"))
+		omf = 1;
+#endif /* EMX */
 	    }
 	}
       else
@@ -3788,6 +3860,15 @@
 	  infiles[n_infiles].language = "*";
 	  infiles[n_infiles++].name = concat ("-l", argv[++i], NULL);
 	}
+#ifdef EMX
+      else if (strcmp (argv[i], "-Zlinker") == 0)
+	{
+	  infiles[n_infiles].language = "*";
+	  infiles[n_infiles++].name = "-O";
+	  infiles[n_infiles].language = "*";
+	  infiles[n_infiles++].name = argv[++i];
+	}
+#endif /* EMX */
       else if (strncmp (argv[i], "-l", 2) == 0)
 	{
 	  infiles[n_infiles].language = "*";
@@ -3904,6 +3985,10 @@
 	    {
 	      infiles[n_infiles].language = spec_lang;
 	      infiles[n_infiles++].name = argv[i];
+#ifdef EMX
+	      if (!first_infile)
+		first_infile = argv[i];
+#endif /* EMX */
 	    }
 	}
     }
@@ -6310,6 +6395,24 @@
 	 for collect.  */
       putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH");
       putenv_from_prefixes (&startfile_prefixes, LIBRARY_PATH_ENV);
+
+#ifdef EMX
+      /* Substitute the basename of the first input file for %b in
+	 link_command_spec. */
+
+      input_basename = first_infile;
+      for (p = input_basename; *p; p++)
+	if (*p == '/')
+	  input_basename = p + 1;
+
+      /* Find a suffix starting with the last period,
+	 and set basename_length to exclude that suffix.  */
+      basename_length = strlen (input_basename);
+      p = input_basename + basename_length;
+      while (p != input_basename && *p != '.') --p;
+      if (*p == '.' && p != input_basename)
+	basename_length = p - input_basename;
+#endif /* EMX */
 
       value = do_spec (link_command_spec);
       if (value < 0)
diff -r -N -u gcc-20030120-orig/gcc/genmultilib gcc-20030120/gcc/genmultilib
--- gcc-20030120-orig/gcc/genmultilib	Sat Oct  5 19:55:54 2002
+++ gcc-20030120/gcc/genmultilib	Sun Jan 26 18:03:52 2003
@@ -108,6 +108,17 @@
 # would be ignored (not generated, nor used) since the exclusion also
 # matches the multilib_default args.
 
+# OS/2 multilib: when -Zmt, -Zmts or -Zmtd is used, search in mt/
+#		otherwise, search in st/
+#	(OS/2 system libraries are dependent on this, so do not change it!)
+# I didn't find how to specify it with multilib macros, so I had to patch this
+# script			-- mikulas
+
+if test -n "$OS2_SHELL"; then
+	cat config/i386/os2-mlib.h
+	exit
+fi
+
 # Copy the positional parameters into variables.
 options=$1
 dirnames=$2
diff -r -N -u gcc-20030120-orig/gcc/mkinstalldirs gcc-20030120/gcc/mkinstalldirs
--- gcc-20030120-orig/gcc/mkinstalldirs	Sat Sep  4 16:08:54 1999
+++ gcc-20030120/gcc/mkinstalldirs	Sun Jan 26 18:03:52 2003
@@ -10,6 +10,11 @@
 
 for file
 do
+   if test -n "$OS2_SHELL" ; then
+   	mkdir -p "$file"
+	continue
+   fi
+
    set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
    shift
 
diff -r -N -u gcc-20030120-orig/gcc/toplev.c gcc-20030120/gcc/toplev.c
--- gcc-20030120-orig/gcc/toplev.c	Mon Dec  9 21:49:32 2002
+++ gcc-20030120/gcc/toplev.c	Sun Jan 26 18:03:54 2003
@@ -4716,6 +4716,11 @@
 
   xmalloc_set_program_name (progname);
 
+#ifdef CC_HOST_INITIALIZATION
+  /* Perform host dependant initialization when needed.  */
+  CC_HOST_INITIALIZATION;
+#endif
+
   hex_init ();
 
   gcc_init_libintl ();
diff -r -N -u gcc-20030120-orig/libiberty/getpwd.c gcc-20030120/libiberty/getpwd.c
--- gcc-20030120-orig/libiberty/getpwd.c	Sun Oct  7 22:53:30 2001
+++ gcc-20030120/libiberty/getpwd.c	Sun Jan 26 18:03:54 2003
@@ -32,7 +32,7 @@
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
-#if HAVE_SYS_STAT_H
+#if defined(HAVE_SYS_STAT_H) || defined(__EMX__)
 #include <sys/stat.h>
 #endif
 
diff -r -N -u gcc-20030120-orig/libiberty/pexecute.c gcc-20030120/libiberty/pexecute.c
--- gcc-20030120-orig/libiberty/pexecute.c	Wed Oct 17 22:15:40 2001
+++ gcc-20030120/libiberty/pexecute.c	Sun Jan 26 18:03:54 2003
@@ -45,6 +45,10 @@
 #include <sys/wait.h>
 #endif
 
+#ifdef __EMX__
+#define OS2
+#endif
+
 #include "libiberty.h"
 #include "safe-ctype.h"
 
@@ -483,9 +487,9 @@
 
 #ifdef OS2
 
-/* ??? Does OS2 have process.h?  */
-extern int spawnv ();
-extern int spawnvp ();
+#include <process.h>
+#include <io.h>
+#include <fcntl.h>
 
 int
 pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
@@ -497,11 +501,71 @@
      int flags;
 {
   int pid;
+  int pdes[2], org_stdin, org_stdout;
+  int input_desc, output_desc;
+  int retries, sleep_interval;
+
+  /* Pipe waiting from last process, to be used as input for the next one.
+     Value is STDIN_FILE_NO if no pipe is waiting
+     (i.e. the next command is the first of a group).  */
+  static int last_pipe_input;
+
+  /* If this is the first process, initialize.  */
+  if (flags & PEXECUTE_FIRST)
+    last_pipe_input = STDIN_FILE_NO;
+
+  input_desc = last_pipe_input;
+
+  /* If this isn't the last process, make a pipe for its output,
+     and record it as waiting to be the input to the next process.  */
+  if (! (flags & PEXECUTE_LAST))
+    {
+      if (pipe (pdes) < 0)
+	{
+	  *errmsg_fmt = "pipe";
+	  *errmsg_arg = NULL;
+	  return -1;
+	}
+      output_desc = pdes[WRITE_PORT];
+      last_pipe_input = pdes[READ_PORT];
+      setmode(output_desc, O_BINARY);
+      setmode(last_pipe_input, O_BINARY);
+    }
+  else
+    {
+      /* Last process.  */
+      output_desc = STDOUT_FILE_NO;
+      last_pipe_input = STDIN_FILE_NO;
+    }
+
+  if (input_desc != STDIN_FILE_NO)
+    {
+      org_stdin = dup (STDIN_FILE_NO);
+      dup2 (input_desc, STDIN_FILE_NO);
+      close (input_desc); 
+    }
+
+  if (output_desc != STDOUT_FILE_NO)
+    {
+      org_stdout = dup (STDOUT_FILE_NO);
+      dup2 (output_desc, STDOUT_FILE_NO);
+      close (output_desc);
+    }
+
+  pid = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (P_NOWAIT, program, argv);
+
+  if (input_desc != STDIN_FILE_NO)
+    {
+      dup2 (org_stdin, STDIN_FILE_NO);
+      close (org_stdin);
+    }
+
+  if (output_desc != STDOUT_FILE_NO)
+    {
+      dup2 (org_stdout, STDOUT_FILE_NO);
+      close (org_stdout);
+    }
 
-  if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
-    abort ();
-  /* ??? Presumably 1 == _P_NOWAIT.  */
-  pid = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv);
   if (pid == -1)
     {
       *errmsg_fmt = install_error_msg;
diff -r -N -u gcc-20030120-orig/libiberty/strerror.c gcc-20030120/libiberty/strerror.c
--- gcc-20030120-orig/libiberty/strerror.c	Tue Oct 16 03:50:12 2001
+++ gcc-20030120/libiberty/strerror.c	Sun Jan 26 18:03:54 2003
@@ -467,8 +467,10 @@
 
 #else
 
+#ifndef __EMX__
 extern int sys_nerr;
 extern char *sys_errlist[];
+#endif
 
 #endif
 
diff -r -N -u gcc-20030120-orig/ltmain.sh gcc-20030120/ltmain.sh
--- gcc-20030120-orig/ltmain.sh	Wed Nov 20 16:59:02 2002
+++ gcc-20030120/ltmain.sh	Sun Jan 26 18:03:54 2003
@@ -2508,9 +2508,11 @@
       else
 
 	# Parse the version information argument.
-	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=':'
-	set dummy $vinfo 0 0 0
-	IFS="$save_ifs"
+#	NOTE !!! IFS containing ':' doesn't work on OS/2
+#	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=':'
+#	set dummy $vinfo 0 0 0
+#	IFS="$save_ifs"
+	set dummy `echo $vinfo|sed 's/:/ /g'` 0 0 0
 
 	if test -n "$8"; then
 	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
diff -r -N -u gcc-20030120-orig/Makefile.in gcc-20030120/Makefile.in
--- gcc-20030120-orig/Makefile.in	Tue Dec 31 21:07:32 2002
+++ gcc-20030120/Makefile.in	Sun Jan 26 18:03:54 2003
@@ -265,6 +265,8 @@
 LD_FOR_TARGET = ` \
   if [ -f $$r/ld/ld-new ] ; then \
     echo $$r/ld/ld-new ; \
+  elif [ -n "$OS2_SHELL" ] && [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
+    echo $(LD_FOR_BUILD) ; \
   elif [ -f $$r/gcc/xgcc ]; then \
     $(CC_FOR_TARGET) -print-prog-name=ld ; \
   else \
diff -r -N -u gcc-20030120-orig/Makefile.tpl gcc-20030120/Makefile.tpl
--- gcc-20030120-orig/Makefile.tpl	Tue Dec 31 21:06:52 2002
+++ gcc-20030120/Makefile.tpl	Sun Jan 26 18:03:54 2003
@@ -268,6 +268,8 @@
 LD_FOR_TARGET = ` \
   if [ -f $$r/ld/ld-new ] ; then \
     echo $$r/ld/ld-new ; \
+  elif [ -n "$OS2_SHELL" ] && [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
+    echo $(LD_FOR_BUILD) ; \
   elif [ -f $$r/gcc/xgcc ]; then \
     $(CC_FOR_TARGET) -print-prog-name=ld ; \
   else \
diff -r -N -u gcc-20030120-orig/mkinstalldirs gcc-20030120/mkinstalldirs
--- gcc-20030120-orig/mkinstalldirs	Fri Apr  3 17:22:04 1998
+++ gcc-20030120/mkinstalldirs	Sun Jan 26 18:03:54 2003
@@ -8,6 +8,11 @@
 errstatus=0
 
 for file in ${1+"$@"} ; do 
+   if test -n "$OS2_SHELL" ; then
+   	mkdir -p "$file"
+	continue
+   fi
+
    set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
    shift
 
diff -r -N -u gcc-20030120-orig/symlink-tree gcc-20030120/symlink-tree
--- gcc-20030120-orig/symlink-tree	Sat Dec  9 17:06:18 2000
+++ gcc-20030120/symlink-tree	Sun Jan 26 18:03:54 2003
@@ -46,7 +46,11 @@
   else
     echo "$f		..linked"
     rm -f $f
-    ln -s ${srcdir}/$f .
+    if test -z "$OS2_SHELL"; then
+      ln -s ${srcdir}/$f .
+    else
+      cp ${srcdir}/$f .
+    fi
   fi
 done
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-02-08 19:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-06 15:01 GCC 3.3 for OS/2 Mikulas Patocka
2003-02-06 22:53 ` Neil Booth
2003-02-07  9:03   ` Mikulas Patocka
2003-02-07 21:51     ` Neil Booth
2003-02-07 22:26       ` Jan Hubicka
2003-02-08 18:29         ` Mikulas Patocka
2003-02-08 19:31           ` Jan Hubicka
2003-02-07 22:27     ` Joe Buck
2003-02-07 22:41       ` Gerald Pfeifer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).