confdata.c (0608182ad54293f6f617c1cc9fb34467db5515c7) confdata.c (79123b1389cc775d8e60cb026256f79f0daef173)
1/*
2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
3 * Released under the terms of the GNU GPL v2.0.
4 */
5
6#include <sys/stat.h>
7#include <ctype.h>
8#include <errno.h>

--- 885 unchanged lines hidden (view full) ---

894 }
895 fprintf(out, "\n%s: \\\n"
896 "\t$(deps_config)\n\n", conf_get_autoconfig_name());
897
898 env_write_dep(out, conf_get_autoconfig_name());
899
900 fprintf(out, "\n$(deps_config): ;\n");
901 fclose(out);
1/*
2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
3 * Released under the terms of the GNU GPL v2.0.
4 */
5
6#include <sys/stat.h>
7#include <ctype.h>
8#include <errno.h>

--- 885 unchanged lines hidden (view full) ---

894 }
895 fprintf(out, "\n%s: \\\n"
896 "\t$(deps_config)\n\n", conf_get_autoconfig_name());
897
898 env_write_dep(out, conf_get_autoconfig_name());
899
900 fprintf(out, "\n$(deps_config): ;\n");
901 fclose(out);
902
903 if (make_parent_dir(name))
904 return 1;
902 rename("..config.tmp", name);
903 return 0;
904}
905
906static int conf_split_config(void)
907{
908 const char *name;
909 char path[PATH_MAX+1];
910 char *s, *d, c;
911 struct symbol *sym;
912 int res, i, fd;
913
914 name = conf_get_autoconfig_name();
915 conf_read_simple(name, S_DEF_AUTO);
916 sym_calc_value(modules_sym);
917
905 rename("..config.tmp", name);
906 return 0;
907}
908
909static int conf_split_config(void)
910{
911 const char *name;
912 char path[PATH_MAX+1];
913 char *s, *d, c;
914 struct symbol *sym;
915 int res, i, fd;
916
917 name = conf_get_autoconfig_name();
918 conf_read_simple(name, S_DEF_AUTO);
919 sym_calc_value(modules_sym);
920
921 if (make_parent_dir("include/config/foo.h"))
922 return 1;
918 if (chdir("include/config"))
919 return 1;
920
921 res = 0;
922 for_all_symbols(i, sym) {
923 sym_calc_value(sym);
924 if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name)
925 continue;

--- 60 unchanged lines hidden (view full) ---

986 res = 1;
987 break;
988 }
989
990 if (make_parent_dir(path)) {
991 res = 1;
992 goto out;
993 }
923 if (chdir("include/config"))
924 return 1;
925
926 res = 0;
927 for_all_symbols(i, sym) {
928 sym_calc_value(sym);
929 if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name)
930 continue;

--- 60 unchanged lines hidden (view full) ---

991 res = 1;
992 break;
993 }
994
995 if (make_parent_dir(path)) {
996 res = 1;
997 goto out;
998 }
999
994 /* Try it again. */
995 fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
996 if (fd == -1) {
997 res = 1;
998 break;
999 }
1000 }
1001 close(fd);

--- 56 unchanged lines hidden (view full) ---

1058 }
1059 fclose(out);
1060 fclose(tristate);
1061 fclose(out_h);
1062
1063 name = getenv("KCONFIG_AUTOHEADER");
1064 if (!name)
1065 name = "include/generated/autoconf.h";
1000 /* Try it again. */
1001 fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
1002 if (fd == -1) {
1003 res = 1;
1004 break;
1005 }
1006 }
1007 close(fd);

--- 56 unchanged lines hidden (view full) ---

1064 }
1065 fclose(out);
1066 fclose(tristate);
1067 fclose(out_h);
1068
1069 name = getenv("KCONFIG_AUTOHEADER");
1070 if (!name)
1071 name = "include/generated/autoconf.h";
1072 if (make_parent_dir(name))
1073 return 1;
1066 if (rename(".tmpconfig.h", name))
1067 return 1;
1074 if (rename(".tmpconfig.h", name))
1075 return 1;
1076
1068 name = getenv("KCONFIG_TRISTATE");
1069 if (!name)
1070 name = "include/config/tristate.conf";
1077 name = getenv("KCONFIG_TRISTATE");
1078 if (!name)
1079 name = "include/config/tristate.conf";
1080 if (make_parent_dir(name))
1081 return 1;
1071 if (rename(".tmpconfig_tristate", name))
1072 return 1;
1082 if (rename(".tmpconfig_tristate", name))
1083 return 1;
1084
1073 name = conf_get_autoconfig_name();
1085 name = conf_get_autoconfig_name();
1086 if (make_parent_dir(name))
1087 return 1;
1074 /*
1075 * This must be the last step, kbuild has a dependency on auto.conf
1076 * and this marks the successful completion of the previous steps.
1077 */
1078 if (rename(".tmpconfig", name))
1079 return 1;
1080
1081 return 0;

--- 224 unchanged lines hidden ---
1088 /*
1089 * This must be the last step, kbuild has a dependency on auto.conf
1090 * and this marks the successful completion of the previous steps.
1091 */
1092 if (rename(".tmpconfig", name))
1093 return 1;
1094
1095 return 0;

--- 224 unchanged lines hidden ---