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]

PATCH: compiler driver fix for DJGPP


Hello,

previously if user specified `gcc foo.c -o foo' on DJGPP,
it used to make both foo and foo.exe. This is very convienent
for autoconf, makefiles of unix origin etc. But recently gcc
compiler driver became cleverer and silently appends .exe
to output file name. Maybe this is OK for other platforms with
executable suffixes, but DJGPP handles this differently. This
patch fixes it.

gcc/ChangeLog:

2001-01-13  Laurynas Biveinis  <lauras@softhome.net>

	* gcc.c (convert_filename): append executable suffix
	if NO_AUTO_EXE_SUFFIX is not defined.
	* gcc.texi: document NO_AUTO_EXE_SUFFIX.
	* config/i386/djgpp.h: define NO_AUTO_EXE_SUFFIX.

Index: gcc/gcc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.199
diff -u -u -r1.199 gcc.c
--- gcc.c	2001/01/10 21:32:15	1.199
+++ gcc.c	2001/01/13 16:28:12
@@ -2808,7 +2808,7 @@
     }
 #endif
 
-#ifdef HAVE_EXECUTABLE_SUFFIX
+#if defined(HAVE_EXECUTABLE_SUFFIX) && !defined(NO_AUTO_EXE_SUFFIX)
   /* If there is no filetype, make it the executable suffix (which includes
      the ".").  But don't get confused if we have just "-o".  */
   if (! do_exe || EXECUTABLE_SUFFIX[0] == 0 || (len == 2 && name[0] == '-'))
Index: gcc/gcc.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.texi,v
retrieving revision 1.69
diff -u -u -r1.69 gcc.texi
--- gcc.texi	2001/01/12 18:51:26	1.69
+++ gcc.texi	2001/01/13 16:28:31
@@ -4136,6 +4133,12 @@
 Define this macro to be a C string representing the suffix for executable
 files on your machine.  If you do not define this macro, GCC will use
 the null string as the suffix for object files.
+
+@findex NO_AUTO_EXE_SUFFIX
+@item NO_AUTO_EXE_SUFFIX
+Define this macro if executable files on your machine have a suffix, but 
+the compiler driver should not automatically append it to the output file
+name, if user hasn't specified one.
 
 @findex HOST_BIT_BUCKET
 @item HOST_BIT_BUCKET
Index: gcc/config/i386/djgpp.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/djgpp.h,v
retrieving revision 1.21
diff -u -u -r1.21 djgpp.h
--- djgpp.h	2001/01/03 04:04:56	1.21
+++ djgpp.h	2001/01/13 16:28:52
@@ -141,6 +141,11 @@
    unless user explicitly requests it.  */
 #undef LOCAL_INCLUDE_DIR
 
+/* Do not make only .exe if no executable file suffix was specified.  */
+/* Let the linker handle that.  */
+#undef NO_AUTO_EXE_SUFFIX
+#define NO_AUTO_EXE_SUFFIX
+
 #undef EXTRA_SECTIONS
 #define EXTRA_SECTIONS in_ctor, in_dtor
 


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