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]
Other format: [Raw text]

[RFA]: contrib/i386/cygwin.h


Hi,

I would like to propose the following patch to config/i386/cygwin.h.

The reason for that patch is that when building a native Cygwin
toolchain which should install into a non-standard location (say,
/usr/local/...) the include and library paths for the w32api headers
and libs are unfortunately only set to the standard paths as
/usr/include/w32api and /usr/lib/w32api.  That's obviously not correct
when installing into some other location since that's mostly done to
not collide with the standard toolchain installation. 

For that reason, the patch adds the location of the installed w32api
paths even if not build as cross compiler.

Testing the installation requires to invalidate the system standard
include and lib paths (renaming).  After installing a natively build
toolchain including gcc into a non-standard location calling a
following `configure' fails with the error message

  <non-standard-path>/ld: cannot find -luser32
  collect2: ld returned 1 exit status
  *** The command 'gcc -o conftest -g   conftest.c' failed.
  *** You must set the environment variable CC to a working compiler.

if the below patch hasn't been applied.  The reason is that the Win32
link libraries aren't in the standard path which is only available.
Applying the below patch before building and installing the toolchain
results in a working configuration.

Please keep me Cc'd since I'm not subscribed.

Thanks,
Corinna

2001-11-17  Corinna Vinschen  <vinschen@redhat.com>

	* config/i386/cygwin.h: Change standard include and link path lists
	to contain the install path even if not build as cross comiler.

Index: config/i386/cygwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/cygwin.h,v
retrieving revision 1.57
diff -u -p -r1.57 cygwin.h
--- cygwin.h	2001/10/31 14:32:27	1.57
+++ cygwin.h	2001/11/17 17:04:15
@@ -78,8 +78,10 @@ Boston, MA 02111-1307, USA.  */
 #define CYGWIN_INCLUDES "%{!nostdinc:-isystem /usr/local/include "\
 		           "-idirafter " CYGWIN_CROSS_DIR "/include "\
 		           "-idirafter /usr/include}"
-#define W32API_INC "%{!nostdinc:-idirafter /usr/include/w32api}"
-#define W32API_LIB "-L/usr/lib/w32api/"
+#define W32API_INC "%{!nostdinc:"\
+		   "-idirafter " CYGWIN_CROSS_DIR "/include/w32api "\
+		   "-idirafter /usr/include/w32api}"
+#define W32API_LIB "-L" CYGWIN_CROSS_DIR "/lib/w32api/ -L/usr/lib/w32api/"
 #define CYGWIN_LIB "/usr/lib"
 #define MINGW_LIBS "-L/usr/local/lib/mingw -L/usr/lib/mingw"
 #define MINGW_INCLUDES "%{!nostdinc:-isystem /usr/include/mingw/g++-3 "\

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen@redhat.com


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