MCPcopy Create free account
hub / github.com/apache/nuttx / check_configured

Function check_configured

tools/configure.c:865–915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

863}
864
865static void check_configured(void)
866{
867 /* If we are already configured then there will be a .config and
868 * a Make.defs file in the top-level directory.
869 */
870
871 snprintf(g_buffer, BUFFER_SIZE, "%s%c.config", g_topdir, g_delim);
872 debug("check_configured: Checking %s\n", g_buffer);
873
874 if (!verify_file(g_buffer))
875 {
876 return;
877 }
878
879 if (g_enforce)
880 {
881 run_make("distclean");
882 }
883 else
884 {
885 char *defcfgpath = NULL;
886
887 snprintf(g_buffer, BUFFER_SIZE, "%s%cdefconfig",
888 g_configpath, g_delim);
889 defcfgpath = strdup(g_buffer);
890
891 snprintf(g_buffer, BUFFER_SIZE, "%s%cdefconfig",
892 g_topdir, g_delim);
893
894 if (filecmp(g_buffer, defcfgpath))
895 {
896 fprintf(stderr, "No configuration change.\n");
897 free(defcfgpath);
898 exit(EXIT_SUCCESS);
899 }
900 else
901 {
902 free(defcfgpath);
903 if (g_distclean)
904 {
905 run_make("distclean");
906 }
907 else
908 {
909 fprintf(stderr, "Already configured!\n");
910 fprintf(stderr, "Please 'make distclean' and try again.\n");
911 exit(EXIT_FAILURE);
912 }
913 }
914 }
915}
916
917static void read_configfile(void)
918{

Callers 1

mainFunction · 0.85

Calls 9

verify_fileFunction · 0.85
run_makeFunction · 0.85
strdupFunction · 0.85
filecmpFunction · 0.85
fprintfFunction · 0.85
exitFunction · 0.85
debugFunction · 0.70
snprintfFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected