bug-make
[Top][All Lists]
Advanced

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

make 3.79.1: should have "--no-builtin-includes" option


From: Jonathan Kamens
Subject: make 3.79.1: should have "--no-builtin-includes" option
Date: Wed, 28 Feb 2001 12:03:49 -0500

There should be a "--no-builtin-includes" option, corresponding to
"--no-builtin-rules" and "--no-builtin-variables", telling Make not to
look in any of the default directories for included Makefiles.

This option is necessary for two reasons:

1) To allow people to limit accidental dependencies on the default
includes.

2) To improve performance on OSes where the operations to check if
these directories exist are not cheap (in particular, Cygwin).

The patch below adds this option.

  jik

--- main.c.orig Tue Jun 13 10:24:45 2000
+++ main.c      Wed Feb 28 11:39:51 2001
@@ -170,10 +170,12 @@
 
 int question_flag = 0;
 
-/* Nonzero means do not use any of the builtin rules (-r) / variables (-R).  */
+/* Nonzero means do not use any of the builtin rules (-r) / variables (-R) /
+   include directories (--no-builtin-includes).  */
 
 int no_builtin_rules_flag = 0;
 int no_builtin_variables_flag = 0;
+int no_builtin_includes_flag = 0;
 
 /* Nonzero means keep going even if remaking some file fails (-k).  */
 
@@ -331,6 +333,9 @@
     { 'R', flag, (char *) &no_builtin_variables_flag, 1, 1, 0, 0, 0,
        "no-builtin-variables", 0,
        N_("Disable the built-in variable settings") },
+    { CHAR_MAX+3, flag, (char *) &no_builtin_includes_flag, 1, 1, 0, 0, 0,
+       "no-builtin-includes", 0,
+       N_("Disable the built-in search path for included makefiles") },
     { 's', flag, (char *) &silent_flag, 1, 1, 0, 0, 0,
        "silent", 0,
        N_("Don't echo commands") },
@@ -347,13 +352,13 @@
     { 'w', flag, (char *) &print_directory_flag, 1, 1, 0, 0, 0,
        "print-directory", 0,
        N_("Print the current directory") },
-    { CHAR_MAX+3, flag, (char *) &inhibit_print_directory_flag, 1, 1, 0, 0, 0,
+    { CHAR_MAX+4, flag, (char *) &inhibit_print_directory_flag, 1, 1, 0, 0, 0,
        "no-print-directory", 0,
        N_("Turn off -w, even if it was turned on implicitly") },
     { 'W', string, (char *) &new_files, 0, 0, 0, 0, 0,
        "what-if", N_("FILE"),
        N_("Consider FILE to be infinitely new") },
-    { CHAR_MAX+4, flag, (char *) &warn_undefined_variables_flag, 1, 1, 0, 0, 0,
+    { CHAR_MAX+5, flag, (char *) &warn_undefined_variables_flag, 1, 1, 0, 0, 0,
        "warn-undefined-variables", 0,
        N_("Warn when an undefined variable is referenced") },
     { '\0', }
--- make.h.orig Thu Jun 15 01:25:37 2000
+++ make.h      Wed Feb 28 11:39:11 2001
@@ -498,6 +498,7 @@
 extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
 extern int print_data_base_flag, question_flag, touch_flag;
 extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
+extern int no_builtin_includes_flag;
 extern int print_version_flag, print_directory_flag;
 extern int warn_undefined_variables_flag, posix_pedantic, not_parallel;
 extern int clock_skew_detected;
--- read.c.orig Wed Jun 21 15:33:30 2000
+++ read.c      Wed Feb 28 11:39:11 2001
@@ -2480,28 +2480,31 @@
 
   /* Now add at the end the standard default dirs.  */
 
-#ifdef  __MSDOS__
+  if (! no_builtin_includes_flag)
   {
-    /* The environment variable $DJDIR holds the root of the
-       DJGPP directory tree; add ${DJDIR}/include.  */
-    struct variable *djdir = lookup_variable ("DJDIR", 5);
+#ifdef  __MSDOS__
+    {
+      /* The environment variable $DJDIR holds the root of the
+         DJGPP directory tree; add ${DJDIR}/include.  */
+      struct variable *djdir = lookup_variable ("DJDIR", 5);
 
-    if (djdir)
+      if (djdir)
       {
        char *defdir = (char *) xmalloc (strlen (djdir->value) + 8 + 1);
 
        strcat (strcpy (defdir, djdir->value), "/include");
        dirs[idx++] = defdir;
       }
-  }
+    }
 #endif
 
-  for (i = 0; default_include_directories[i] != 0; ++i)
-    if (stat (default_include_directories[i], &stbuf) == 0
-       && S_ISDIR (stbuf.st_mode))
-      dirs[idx++] = default_include_directories[i];
+    for (i = 0; default_include_directories[i] != 0; ++i)
+      if (stat (default_include_directories[i], &stbuf) == 0
+          && S_ISDIR (stbuf.st_mode))
+        dirs[idx++] = default_include_directories[i];
 
-  dirs[idx] = 0;
+    dirs[idx] = 0;
+  }
 
   /* Now compute the maximum length of any name in it.  */
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]