aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChristopher Faylor <cgf@cygnus.com>2001-02-03 04:17:58 +0000
committerChristopher Faylor <cgf@gcc.gnu.org>2001-02-03 04:17:58 +0000
commit4e190cf35ce351b8470aced608eebfba027c9564 (patch)
treed3fb4e9de1aebf90cf7d5746c0f035b9930a45ea /gcc
parentc98f0cdb547eb7608d3bb2ff4f3dbdfb829fd429 (diff)
downloadgcc-4e190cf35ce351b8470aced608eebfba027c9564.zip
gcc-4e190cf35ce351b8470aced608eebfba027c9564.tar.gz
gcc-4e190cf35ce351b8470aced608eebfba027c9564.tar.bz2
cygwin.h (CPP_SPEC): Reorganize YA to better handle cross compilation environment.
* config/i386/cygwin.h (CPP_SPEC): Reorganize YA to better handle cross compilation environment. * config/i386/t-cygwin (T_CPPFLAGS): Define CYGWIN_CROSS_DIR to allow control over location of cygwin includes and libs. From-SVN: r39426
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/cygwin.h60
-rw-r--r--gcc/config/i386/t-cygwin2
3 files changed, 29 insertions, 40 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1e3dbca..cb97f08 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Fri Feb 2 23:15:29 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * config/i386/cygwin.h (CPP_SPEC): Reorganize YA to better handle cross
+ compilation environment.
+ * config/i386/t-cygwin (T_CPPFLAGS): Define CYGWIN_CROSS_DIR to allow
+ control over location of cygwin includes and libs.
+
2001-02-03 Michael Hayes <m.hayes@elec.canterbury.ac.nz)
* c4x.h (HARD_REGNO_CALL_PART_CLOBBERED): Fix typo.
diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
index 335504e..32fa987 100644
--- a/gcc/config/i386/cygwin.h
+++ b/gcc/config/i386/cygwin.h
@@ -81,40 +81,26 @@ Boston, MA 02111-1307, USA. */
#undef LIBGCC_SPEC
#define LIBGCC_SPEC "%{mno-cygwin: %{mthreads:-lmingwthrd} -lmingw32} -lgcc %{mno-cygwin:-lmoldname -lmsvcrt}"
-#undef STARTFILE_SPEC
-
-#undef CPP_SPEC
#ifdef CROSS_COMPILE
-#define STARTFILE_SPEC "%{shared|mdll: %{mno-cygwin:dllcrt2%O%s}} \
- %{!shared: %{!mdll: %{!mno-cygwin:crt0%O%s} \
- %{mno-cygwin:-L../../../../i686-pc-cygwin/lib/mingw mingw/crt2%O%s} \
- %{pg:gcrt0%O%s}}}"
-#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
- -D__stdcall=__attribute__((__stdcall__)) \
- -D__cdecl=__attribute__((__cdecl__)) \
- %{!ansi:-D_stdcall=__attribute__((__stdcall__)) \
- -D_cdecl=__attribute__((__cdecl__))} \
- -D__declspec(x)=__attribute__((x)) \
- -D__i386__ -D__i386 \
- %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix \
- -isystem /usr/local/native-include \
- -idirafter /usr/native-include} \
- %{mno-win32: %{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \
- %{!mno-win32:-D_WIN32 -DWINNT -isystem /usr/include/w32api} \
- %{mno-cygwin:-DWIN32 -D__WIN32__ -D__MINGW32__=0.2 \
- %{mthreads:-D_MT} \
- -isystem /usr/local/native-include/mingw \
- -idirafter /usr/native-include/mingw \
- -iwithprefixbefore ../../../../mingw/include/g++-3 \
- -iwithprefixbefore ../../../../mingw/include \
- -iwithprefixbefore ../../../../mingw32/include/g++-3 \
- -iwithprefixbefore ../../../../mingw32/include } \
- %{!mno-win32:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -DWINNT \
- -idirafter /usr/include/w32api}"
+#define CYGWIN_INCLUDES "-idirafter" CYGWIN_CROSS_DIR "/include"
+#define CYGWIN_W32API "-I" CYGWIN_CROSS_DIR "/include/w32api"
+#define CYGWIN_LIB CYGWIN_CROSS_DIR "/lib"
+#define MINGW_LIBS "-L" CYGWIN_CROSS_DIR "/lib/mingw"
+#define MINGW_INCLUDES "-I" CYGWIN_CROSS_DIR "/include/mingw"
#else
+#define CYGWIN_INCLUDES "-isystem /usr/local/include -idirafter /usr/include"
+#define CYGWIN_W32API "-I/usr/include/w32api"
+#define CYGWIN_LIB "/usr/lib"
+#define MINGW_LIBS "-L/usr/local/lib/mingw -L/usr/lib/mingw"
+#define MINGW_INCLUDES "-isystem /usr/local/include/mingw -idirafter /usr/include/mingw"
+#endif
+
+#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{shared|mdll: %{mno-cygwin:dllcrt2%O%s}} \
- %{!shared: %{!mdll: %{!mno-cygwin:crt0%O%s} %{mno-cygwin:-L/usr/local/lib/mingw -L/usr/lib/mingw mingw/crt2%O%s} \
+ %{!shared: %{!mdll: %{!mno-cygwin:crt0%O%s} %{mno-cygwin:" MINGW_LIBS " mingw/crt2%O%s} \
%{pg:gcrt0%O%s}}}"
+
+#undef CPP_SPEC
#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
-D__stdcall=__attribute__((__stdcall__)) \
-D__cdecl=__attribute__((__cdecl__)) \
@@ -123,21 +109,15 @@ Boston, MA 02111-1307, USA. */
-D__declspec(x)=__attribute__((x)) \
-D__i386__ -D__i386 \
%{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix \
- -isystem /usr/local/include \
- -idirafter /usr/include} \
+ " CYGWIN_INCLUDES "} \
%{mno-win32: %{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \
- %{mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -DWINNT \
- -D__MINGW32__=0.3 -D__MSVCRT__ \
- %{mthreads:-D_MT} \
- -isystem /usr/local/include/mingw \
- -idirafter /usr/include/mingw \
+ %{mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -DWINNT -D__MSVCRT__ \
+ -D__MINGW32__=0.3 %{mthreads:-D_MT} " MINGW_INCLUDES CYGWIN_W32API "\
-iwithprefixbefore ../../../../mingw/include/g++-3 \
-iwithprefixbefore ../../../../mingw/include \
-iwithprefixbefore ../../../../mingw32/include/g++-3 \
-iwithprefixbefore ../../../../mingw32/include } \
- %{!mno-win32:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -DWINNT \
- -idirafter /usr/include/w32api}"
-#endif
+ %{!mno-win32:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -DWINNT " CYGWIN_W32API "}"
/* This macro defines names of additional specifications to put in the specs
that can be used in various specifications like CC1_SPEC. Its definition
diff --git a/gcc/config/i386/t-cygwin b/gcc/config/i386/t-cygwin
index 1e74ff0..9f77143 100644
--- a/gcc/config/i386/t-cygwin
+++ b/gcc/config/i386/t-cygwin
@@ -7,6 +7,8 @@ LIB1ASMFUNCS = _chkstk
# the build, it may not be installed yet.
LIMITS_H_TEST = true
+T_CPPFLAGS=-DCYGWIN_CROSS_DIR=\"$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`\"
+
# 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.