changeset 29:db08bdb5e9de

The poor design of the gcc command line never ceases to amaze. Notice how "-print-libgcc-file-name" and "--print-libgcc-file-name" are synonyms. The kernel uses the --print version, but uClibc uses the -print version. Wheee...
author Rob Landley <rob@landley.net>
date Sun, 10 Dec 2006 13:12:04 -0500
parents a6a06bf0c541
children 8cfc981a9b8e
files sources/toys/gcc-uClibc.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sources/toys/gcc-uClibc.c	Fri Dec 08 11:48:33 2006 -0500
+++ b/sources/toys/gcc-uClibc.c	Sun Dec 10 13:12:04 2006 -0500
@@ -273,6 +273,7 @@
 					break;
 
                 case 'p':
+wow_this_sucks:
 					if (!strncmp("-print-",argv[i],7)) {
 						char *temp, *temp2;
 						int itemp, showall = 0;
@@ -332,7 +333,10 @@
 				// --longopts
 
 				case '-':
-					if (strstr(argv[i]+1,static_linking) != NULL) {
+					if (!strncmp(argv[i],"--print-",8)) {
+						argv[i]++;
+						goto wow_this_sucks;
+					} else if (strstr(argv[i]+1,static_linking) != NULL) {
 						use_static_linking = 1;
 						argv[i]='\0';
 					} else if (!strcmp("--version",argv[i])) {
@@ -492,7 +496,7 @@
 
 	//no need to free memory from xstrcat because we never return... 
 //dprintf(2, "outgoing: ");
-//for(l=0; gcc_argv[l]; l++) dprintf(2, "%s ",gcc_argv[l]);
+//for(i=0; gcc_argv[i]; i++) dprintf(2, "%s ",gcc_argv[i]);
 //dprintf(2, "\n\n");
 
 	execvp(gcc_argv[0], gcc_argv);