Commit 70e5e841 by Christopher Faylor Committed by Danny Smith

config.gcc (i[34567]86-*-cygwin*): Use new common makefile stub t-cygming.

2003-03-21  Christopher Faylor  <cgf@redhat.com>

	* config.gcc (i[34567]86-*-cygwin*): Use new common makefile
	stub t-cygming. Use common target header cygming.h. Add extra
	c_target_obj and cxx_target_obj file. Default cygwin to posix
	threading. Enforce i386 as float format.
	(i[34567]86-*-mingw*): Use new common makefile stub t-cygming.
	Remove cygwin.h as target header. Use common target header
	cygming.h  Enforce i386 as float format. Correct typo.
	* config/i386/cygming.h: New file, containing definitions
	common to mingw32 and cygwin.
	* config/i386/cygwin.h: Remove definitions common to cygwin and
	mingw.	Simplify special spec logic.  Define "wrappers" around
	certain include path defines to accommodate -mno-cygwin.
	Remove some #if 0'ed code.
	(STANDARD_INCLUDE_DIR) Always define when not cross-compiling.
	(LINK_SPEC): Don't use cyg search prefix when -mno-cygwin.
	(GCC_DRIVER_HOST_INITIALIZATION): Define as call to mingw_scan.
	* config/i386/mingw32.h: Remove definitions common to cygwin and
	mingw.
	(EXTRA_OS_CPP_BUILTINS): Adjust.
	(TARGET_VERSION): Define.
	* config/i386/crtdll.h (EXTRA_OS_CPP_BUILTINS): Override
	mingw32.h definitions.
	(LIBGCC_SPEC): Add libmingwex.a as in mingw32.h.
	* config/i386/t-cygwin (EXTRA_GCC_OBJS): Define as cygwin1.o.
	Add compilation rules for cygwin1.o cygwin2.o.
	* config/i386/cygwin1.c: New file.
	* config/i386/cygwin2.c: New file.
	* config/i386/t-cygming: New makefile stub.

From-SVN: r64643
parent 03c1f6a3
2003-03-21 Christopher Faylor <cgf@redhat.com>
* config.gcc (i[34567]86-*-cygwin*): Use new common makefile
stub t-cygming. Use common target header cygming.h. Add extra
c_target_obj and cxx_target_obj file. Default cygwin to posix
threading. Enforce i386 as float format.
(i[34567]86-*-mingw*): Use new common makefile stub t-cygming.
Remove cygwin.h as target header. Use common target header
cygming.h Enforce i386 as float format. Correct typo.
* config/i386/cygming.h: New file, containing definitions
common to mingw32 and cygwin.
* config/i386/cygwin.h: Remove definitions common to cygwin and
mingw. Simplify special spec logic. Define "wrappers" around
certain include path defines to accommodate -mno-cygwin.
Remove some #if 0'ed code.
(STANDARD_INCLUDE_DIR) Always define when not cross-compiling.
(LINK_SPEC): Don't use cyg search prefix when -mno-cygwin.
(GCC_DRIVER_HOST_INITIALIZATION): Define as call to mingw_scan.
* config/i386/mingw32.h: Remove definitions common to cygwin and
mingw.
(EXTRA_OS_CPP_BUILTINS): Adjust.
(TARGET_VERSION): Define.
* config/i386/crtdll.h (EXTRA_OS_CPP_BUILTINS): Override
mingw32.h definitions.
(LIBGCC_SPEC): Add libmingwex.a as in mingw32.h.
* config/i386/t-cygwin (EXTRA_GCC_OBJS): Define as cygwin1.o.
Add compilation rules for cygwin1.o cygwin2.o.
* config/i386/cygwin1.c: New file.
* config/i386/cygwin2.c: New file.
* config/i386/t-cygming: New makefile stub.
2003-03-20 Richard Henderson <rth@redhat.com> 2003-03-20 Richard Henderson <rth@redhat.com>
* fold-const.c (extract_muldiv_1): Revert changing order of * fold-const.c (extract_muldiv_1): Revert changing order of
......
...@@ -1320,21 +1320,25 @@ i[34567]86-*-win32) ...@@ -1320,21 +1320,25 @@ i[34567]86-*-win32)
exeext=.exe exeext=.exe
;; ;;
i[34567]86-*-pe | i[34567]86-*-cygwin*) i[34567]86-*-pe | i[34567]86-*-cygwin*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h"
xm_defines=POSIX xm_defines=POSIX
xm_file=i386/xm-cygwin.h xm_file=i386/xm-cygwin.h
tmake_file=i386/t-cygwin tmake_file="i386/t-cygming i386/t-cygwin"
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygwin.h" float_format=i386
extra_objs=winnt.o extra_objs=winnt.o
c_target_objs=cygwin2.o
cxx_target_objs=cygwin2.o
if test x$enable_threads = xyes; then if test x$enable_threads = xyes; then
thread_file='win32' thread_file='posix'
fi fi
exeext=.exe exeext=.exe
;; ;;
i[34567]86-*-mingw32*) i[34567]86-*-mingw32*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygwin.h i386/mingw32.h" tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/mingw32.h"
xm_defines=POSIX xm_defines=POSIX
xm_file=i386/xm-mingw32.h xm_file=i386/xm-mingw32.h
tmake_file="i386/t-cygwin i386/t-mingw32" tmake_file="i386/t-cygming i386/t-mingw32"
float_format=i386
extra_objs=winnt.o extra_objs=winnt.o
if test x$enable_threads = xyes; then if test x$enable_threads = xyes; then
thread_file='win32' thread_file='win32'
...@@ -1344,7 +1348,7 @@ i[34567]86-*-mingw32*) ...@@ -1344,7 +1348,7 @@ i[34567]86-*-mingw32*)
*mingw32crt*) *mingw32crt*)
tm_file="${tm_file} i386/crtdll.h" tm_file="${tm_file} i386/crtdll.h"
;; ;;
*minwg32msv* | *mingw32*) *mingw32msv* | *mingw32*)
;; ;;
esac esac
;; ;;
......
...@@ -21,14 +21,23 @@ the Free Software Foundation, 59 Temple Place - Suite 330, ...@@ -21,14 +21,23 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#undef EXTRA_OS_CPP_BUILTINS #undef EXTRA_OS_CPP_BUILTINS
#define EXTRA_OS_CPP_BUILTINS() \ #define EXTRA_OS_CPP_BUILTINS() \
do { builtin_define ("__MINGW32__=0.2"); } while (0) do \
{ \
builtin_define ("__CRTDLL__"); \
builtin_define ("__MINGW32__"); \
builtin_define ("_WIN32"); \
builtin_define_std ("WIN32"); \
builtin_define_std ("WINNT"); \
} \
while (0)
#undef LIBGCC_SPEC #undef LIBGCC_SPEC
#define LIBGCC_SPEC \ #define LIBGCC_SPEC \
"%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lcrtdll" "%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lcoldname -libmingwex -lcrtdll"
/* Specify a different entry point when linking a DLL */ /* Specify a different entry point when linking a DLL */
#undef STARTFILE_SPEC #undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{mdll:dllcrt1%O%s} %{!mdll:crt1%O%s} %{pg:gcrt1%O%s}" #define STARTFILE_SPEC "%{shared|mdll:dllcrt1%O%s} \
%{!shared:%{!mdll:crt1%O%s}} %{pg:gcrt1%O%s}"
/* Helper routines for cygwin-specific command-line parsing.
Contributed by Christopher Faylor (cgf@redhat.com)
Copyright 2003 Free Software Foundation, Inc.
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 "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include <string.h>
void
mingw_scan (argc, argv, spec_machine)
int argc ATTRIBUTE_UNUSED;
const char *const *argv;
char **spec_machine;
{
putenv ("GCC_CYGWIN_MINGW=0");
while (*++argv)
if (strcmp (*argv, "-mno-win32") == 0)
putenv ("GCC_CYGWIN_WIN32=0");
else if (strcmp (*argv, "-mwin32") == 0)
putenv ("GCC_CYGWIN_WIN32=1");
else if (strcmp (*argv, "-mno-cygwin") == 0)
{
char *p = strstr (*spec_machine, "-cygwin");
if (p)
{
int len = p - *spec_machine;
char *s = xmalloc (strlen (*spec_machine) + 3);
memcpy (s, *spec_machine, len);
strcpy (s + len, "-mingw32");
*spec_machine = s;
}
putenv ("GCC_CYGWIN_MINGW=1");
}
return;
}
/* Helper routines for cygwin-specific command-line parsing.
Contributed by Christopher Faylor (cgf@redhat.com)
Copyright 2003 Free Software Foundation, Inc.
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 "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "safe-ctype.h"
#include <string.h>
/*
static void remove_w32api PARAMS ((void));
*/
static void add_mingw PARAMS ((void));
static void set_mingw PARAMS((void)) __attribute__ ((constructor));
static void
add_mingw ()
{
char **av;
char *p;
for (av = cvt_to_mingw; *av; av++)
{
int sawcygwin = 0;
while ((p = strstr (*av, "-cygwin")))
{
char *over = p + sizeof ("-cygwin") - 1;
memmove (over + 1, over, strlen (over));
memcpy (p, "-mingw32", sizeof("-mingw32") - 1);
p = ++over;
while (ISALNUM (*p))
p++;
strcpy (over, p);
sawcygwin = 1;
}
if (!sawcygwin && !strstr (*av, "mingw"))
strcat (*av, CYGWIN_MINGW_SUBDIR);
}
}
static void
set_mingw ()
{
char *env = getenv ("GCC_CYGWIN_MINGW");
if (env && *env == '1')
add_mingw ();
}
...@@ -20,16 +20,8 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -20,16 +20,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
/* Most of this is the same as for cygwin, except for changing some #undef TARGET_VERSION
specs. */ #define TARGET_VERSION fprintf (stderr, " (x86 MinGW)");
/* Mingw GCC, unlike Cygwin's, must be relocatable. This macro must
be defined before any other files are included. */
#ifndef WIN32_NO_ABSOLUTE_INST_DIRS
#define WIN32_NO_ABSOLUTE_INST_DIRS 1
#endif
#define TARGET_EXECUTABLE_SUFFIX ".exe"
/* See i386/crtdll.h for an alternative definition. */ /* See i386/crtdll.h for an alternative definition. */
#define EXTRA_OS_CPP_BUILTINS() \ #define EXTRA_OS_CPP_BUILTINS() \
...@@ -37,32 +29,12 @@ Boston, MA 02111-1307, USA. */ ...@@ -37,32 +29,12 @@ Boston, MA 02111-1307, USA. */
{ \ { \
builtin_define ("__MSVCRT__"); \ builtin_define ("__MSVCRT__"); \
builtin_define ("__MINGW32__"); \ builtin_define ("__MINGW32__"); \
builtin_define ("_WIN32"); \
builtin_define_std ("WIN32"); \
builtin_define_std ("WINNT"); \
} \ } \
while (0) while (0)
#undef TARGET_OS_CPP_BUILTINS /* From cygwin.h. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("_WIN32"); \
builtin_define_std ("WIN32"); \
builtin_define_std ("WINNT"); \
builtin_define ("_X86_=1"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__fastcall=__attribute__((__fastcall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_define ("__declspec(x)=__attribute__((x))"); \
if (!flag_iso) \
{ \
builtin_define ("_stdcall=__attribute__((__stdcall__))"); \
builtin_define ("_fastcall=__attribute__((__fastcall__))"); \
builtin_define ("_cdecl=__attribute__((__cdecl__))"); \
} \
EXTRA_OS_CPP_BUILTINS (); \
builtin_assert ("system=winnt"); \
} \
while (0)
/* Specific a different directory for the standard include files. */ /* Specific a different directory for the standard include files. */
#undef STANDARD_INCLUDE_DIR #undef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR "/usr/local/mingw32/include" #define STANDARD_INCLUDE_DIR "/usr/local/mingw32/include"
...@@ -96,10 +68,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -96,10 +68,6 @@ Boston, MA 02111-1307, USA. */
#define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \ #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
%{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s}" %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s}"
/* MS runtime does not need a separate math library. */
#undef MATH_LIBRARY
#define MATH_LIBRARY ""
/* Output STRING, a string representing a filename, to FILE. /* Output STRING, a string representing a filename, to FILE.
We canonicalize it to be in Unix format (backslashes are replaced We canonicalize it to be in Unix format (backslashes are replaced
forward slashes. */ forward slashes. */
......
LIB1ASMSRC = i386/cygwin.asm
LIB1ASMFUNCS = _chkstk
# cygwin and mingw always have a limits.h, but, depending upon how we are
# doing the build, it may not be installed yet.
LIMITS_H_TEST = true
# If we are building next to winsup, this will let us find the real
# limits.h when building libgcc2. Otherwise, winsup must be installed
# first.
LIBGCC2_INCLUDES = -I$(srcdir)/../winsup/w32api/include
winnt.o: $(srcdir)/config/i386/winnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \
$(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/i386/winnt.c
# Don't run fixproto
STMP_FIXPROTO=
STMP_FIXINC=stmp-fixinc
LIB1ASMSRC = i386/cygwin.asm EXTRA_GCC_OBJS = cygwin1.o
LIB1ASMFUNCS = _chkstk
# cygwin always has a limits.h, but, depending upon how we are doing
# the build, it may not be installed yet.
LIMITS_H_TEST = true
T_CPPFLAGS=-DCYGWIN_CROSS_DIR=\"$(build_tooldir)\"
# If we are building next to winsup, this will let us find the real # If we are building next to winsup, this will let us find the real
# limits.h when building libgcc2. Otherwise, winsup must be installed # limits.h when building libgcc2. Otherwise, winsup must be installed
# first. # first.
LIBGCC2_INCLUDES = -I$(srcdir)/../winsup/include \ LIBGCC2_INCLUDES += -I$(srcdir)/../winsup/include \
-I$(srcdir)/../winsup/cygwin/include \ -I$(srcdir)/../winsup/cygwin/include
-I$(srcdir)/../winsup/w32api/include
cygwin1.o: $(srcdir)/config/i386/cygwin1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TM_P_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/i386/cygwin1.c
winnt.o: $(srcdir)/config/i386/winnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ cygwin2.o: $(srcdir)/config/i386/cygwin2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ $(TM_H) $(TM_P_H)
$(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/winnt.c $(srcdir)/config/i386/cygwin2.c
# Don't run fixproto
STMP_FIXPROTO =
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment