delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/11/26/15:54:42

Date: Wed, 26 Nov 1997 12:53:50 -0800 (PST)
Message-Id: <199711262053.MAA16614@adit.ap.net>
Mime-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Problems with GCC building process
Cc: djgpp AT delorie DOT com, djgpp-workers AT delorie DOT com

Thanks everyone who helped with this. I have attached a patch which fixes
these, despite the fact that it will apparently be moot in the next version...
Also it fixes the irritating "`echo" in the cp/makefile, which caused some
shells to bomb out.
At 01:25  11/24/1997 +0200, Eli Zaretskii wrote:
>All of this isn't required anymore, so just use redirection, like
>this: "echo $(OBJS) > s-objlist".
Done.
>
>Btw, in practice, this problem is mostly harmless: if your `echo' is
>from Textutils, it will output the list to the screen, and you will
>use the file s-objlist which comes with the GCC distribution.  You
>shouldn't see any problems unless you change the list of object
>files.
I think I had done `make distclean' or something of the sort.
>The simplest way to change that is to have mklibgcc put CFLAGS into a
>file, call it `cflags', and append "@cflags" to the gcc commands it
>writes to the batch file instead of putting the contents of CFLAGS
>verbatim.  Since the rest of the gcc command line is fixed, this
>should never risk overflowing the 126-char limit.
Done.
*** config/msdos/top.se~	Wed Jul 24 19:01:36 1996
--- config/msdos/top.sed	Mon Nov 24 21:32:24 1997
***************
*** 31,34 ****
--- 31,35 ----
  s/`echo \$(srcdir)\///g
  s/ | sed 's,\^\\\.\/,,'`//g
+ s/`echo \$(PARSE_C)/\$(PARSE_C)/g
  s/^	cd \$(srcdir)[ 	]*;/	/
  /^# USE_HOST_OBSTACK/ i\
***************
*** 49,53 ****
  s/tmp-/t-/g
  /> *s-objlist/ c\
! 	echo.exe -o s-objlist $(addprefix ../,$(OBJS) $(BC_OBJS))
  /^OBJS.*s-objlist/ s?`cat ../s-objlist`?@../s-objlist?
  s/^\(SUBDIR_OBSTACK *=\).*$/\1 ..\/obstack.o/
--- 49,53 ----
  s/tmp-/t-/g
  /> *s-objlist/ c\
! 	echo $(addprefix ../,$(OBJS) $(BC_OBJS)) > s-objlist
  /^OBJS.*s-objlist/ s?`cat ../s-objlist`?@../s-objlist?
  s/^\(SUBDIR_OBSTACK *=\).*$/\1 ..\/obstack.o/
*** config/msdos/mklibgcc.c	Mon Nov 24 21:35:06 1997
--- config/msdos/mlgcnew.c	Mon Nov 24 21:31:00 1997
***************
*** 3,6 ****
--- 3,8 ----
  #include <dirent.h>
  
+ #define OPTION_FILE_NAME "lgccflag.opt"
+ 
  char *skips[] = {
    "__main",
***************
*** 39,45 ****
--- 41,49 ----
    char *cc = argv[1];
    char *csrc=argv[2];
+   int p;
    int i;
    FILE *batfile;
    FILE *cfile;
+   FILE *optfile; /* holds the CC flags */
  
    if (argc > 1 && strcmp(argv[1], "-c")==0)
***************
*** 56,59 ****
--- 60,77 ----
    fprintf(batfile, "@echo off\n");
  
+   /* FIXME: If they use mklibgcc more than once, the old response file
+      will get overwritten. This currently isn't a problem since the
+      Makefile calls them with the same CFLAGS. */
+   optfile = fopen(OPTION_FILE_NAME, "w"); /* people might delete a tmpnam */
+   if (!optfile)
+     {
+       perror(OPTION_FILE_NAME);
+       return 1;
+     }
+   /* Parse the compiler name from its options. */
+   p = strcspn(cc, " \n\t"); /* strcspn returns index */
+   fputs(&(cc[p]), optfile); /* leading whitespace doesn't matter */
+   cc[p] = '\0'; /* cut off the options */
+ 
    for (i=3; i<argc; i++)
    {
***************
*** 81,85 ****
      }
      bp = basename + strlen(basename);
!     fprintf(batfile, "%s -c %s.c -o %s.o\n", cc, basename, basename);
      strcpy(bp, ".c");
      cfile = fopen(basename, "w");
--- 99,104 ----
      }
      bp = basename + strlen(basename);
!     fprintf(batfile, "%s @%s -c %s.c -o %s.o\n", cc, OPTION_FILE_NAME, 
! 	    basename, basename);
      strcpy(bp, ".c");
      cfile = fopen(basename, "w");
***************
*** 95,98 ****
--- 114,119 ----
  
    fclose(batfile);
+   fclose(optfile);
    return 0;
  }
+ 

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019