linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / scripts / basic / fixdep.c
index 4cda24e..679124b 100644 (file)
 #include <stdio.h>
 #include <limits.h>
 #include <ctype.h>
-#include <netinet/in.h>
+#include <arpa/inet.h>
 
 #define INT_CONF ntohl(0x434f4e46)
 #define INT_ONFI ntohl(0x4f4e4649)
@@ -130,9 +130,22 @@ void usage(void)
        exit(1);
 }
 
+/*
+ * Print out the commandline prefixed with cmd_<target filename> :=
+ * If commandline contains '#' escape with '\' so make to not see
+ * the '#' as a start-of-comment symbol
+ **/
 void print_cmdline(void)
 {
-       printf("cmd_%s := %s\n\n", target, cmdline);
+       char *p = cmdline;
+
+       printf("cmd_%s := ", target);
+       for (; *p; p++) {
+               if (*p == '#')
+                       printf("\\");
+               printf("%c", *p);
+       }
+       printf("\n\n");
 }
 
 char * str_config  = NULL;
@@ -212,7 +225,7 @@ void use_config(char *m, int slen)
                if (*p == '_')
                        *p = '/';
                else
-                       *p = tolower((unsigned char)*p);
+                       *p = tolower((int)*p);
        }
        printf("    $(wildcard include/config/%s.h) \\\n", s);
 }