OSDN Git Service

* config/i386/cygwin.h (CPP_SPEC): Reorganize YA to better handle cross
authorcgf <cgf@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 3 Feb 2001 04:17:58 +0000 (04:17 +0000)
committercgf <cgf@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 3 Feb 2001 04:17:58 +0000 (04:17 +0000)
compilation environment.
* config/i386/t-cygwin (T_CPPFLAGS): Define CYGWIN_CROSS_DIR to allow control
over location of cygwin includes and libs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39426 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/cygwin.h
gcc/config/i386/t-cygwin

index 1e3dbca..cb97f08 100644 (file)
@@ -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.
index 335504e..32fa987 100644 (file)
@@ -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
index 1e74ff0..9f77143 100644 (file)
@@ -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.