[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting compiler options?



>  It does not give the flags example but I think it would look like this.
> MY_FLAGS="-g -I-"$CPATHS
> ...
> CMPFLAGS=$(MY_FLAGS)

Found the problem.  The code makes the stupid assumption that all variable
names are alphanumeric.  So the parsing code gives up on the '_'.
Included below is a quick patch for '_'.

In looking over the parsing code I learned how project files are read:
1) Open file.
2) Read all variables ("FOO=BAR").
3) Close file.
4) Use variables to set compiler settings.
5) Open file.
6) Read "install:" section.
7) Close file.

Well come to Inefficient Design 101.

Dennis Payne
dulsi@identicalsoftware.com


--- we_prog.c.orig	Sun Feb  6 10:51:55 2000
+++ we_prog.c	Sun Feb  6 10:53:13 2000
@@ -1777,7 +1777,7 @@
 	 continue;
       }
       sp1 = str+i;
-      for(i = 0; isalnum(sp1[i]); i++);
+      for(i = 0; (isalnum(sp1[i])) || (sp1[i] == '_'); i++);
       for(j = i; isspace(sp1[j]); j++);
       if(str[j] != '=') continue;
       for(j++; isspace(sp1[j]) && sp1[j] != '\n'; j++);