Always include afsconfig.h in autogenerated files
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Thu, 6 May 2010 13:58:52 +0000 (14:58 +0100)
committerDerrick Brashear <shadow@dementia.org>
Thu, 6 May 2010 19:22:31 +0000 (12:22 -0700)
Modify rxgen and compile_et so that the files they output always
contain afsconfig.h before afs/param.h. This avoids problems where
afs/param.h, or headers included from it, rely on having the results
of configure tests available.

Change-Id: I0198500a17abd31ee1057d6780cbe5a5e1bc8c59
Reviewed-on: http://gerrit.openafs.org/1913
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/comerr/compile_et.c
src/rxgen/rpc_main.c

index 1cd46d2..37df6b6 100644 (file)
@@ -92,6 +92,7 @@ static const char *const language_names[] = {
 };
 
 static const char *const c_src_prolog[] = {
+    "#include <afsconfig.h>\n",
     "#include <afs/param.h>\n",
     "#include <afs/error_table.h>\n",
     "static const char * const text[] = {\n",
index cccc754..5c02c16 100644 (file)
@@ -355,8 +355,10 @@ c_output(char *infile, char *define, int extend, char *outfile, int append)
     f_print(fout, "/* Machine generated file -- Do NOT edit */\n\n");
     if (xflag) {
        if (kflag) {
+           f_print(fout, "#include \"afsconfig.h\"\n");
            f_print(fout, "#include \"afs/param.h\"\n");
        } else {
+           f_print(fout, "#include <afsconfig.h>\n");
            f_print(fout, "#include <afs/param.h>\n");
        }
        f_print(fout, "#ifdef AFS_NT40_ENV\n");
@@ -506,6 +508,7 @@ h_output(char *infile, char *define, int extend, char *outfile, int append)
        f_print(fout, "#include \"rx/rx_globals.h\"\n");
     }
     f_print(fout, "#else       /* KERNEL */\n");
+    f_print(fout, "#include <afsconfig.h>\n");
     f_print(fout, "#include <afs/param.h>\n");
     f_print(fout, "#include <afs/stds.h>\n");
     f_print(fout, "#include <sys/types.h>\n");