Module Name:    xsrc
Committed By:   martin
Date:           Mon Dec 19 12:30:42 UTC 2022

Modified Files:
        xsrc/external/mit/makedepend/dist [netbsd-10]: ChangeLog aclocal.m4
            configure configure.ac def.h include.c makedepend.man

Log Message:
Update makedepend to 1.0.8, requested by mrg in ticket #6

xsrc/external/mit/makedepend/dist/ChangeLog                     apply patch
xsrc/external/mit/makedepend/dist/README                        apply patch
xsrc/external/mit/makedepend/dist/aclocal.m4                    apply patch
xsrc/external/mit/makedepend/dist/configure                     apply patch
xsrc/external/mit/makedepend/dist/configure.ac                  apply patch
xsrc/external/mit/makedepend/dist/include.c                     apply patch
xsrc/external/mit/makedepend/dist/makedepend.man                apply patch


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.1.1.7.2.1 \
    xsrc/external/mit/makedepend/dist/ChangeLog \
    xsrc/external/mit/makedepend/dist/aclocal.m4 \
    xsrc/external/mit/makedepend/dist/configure \
    xsrc/external/mit/makedepend/dist/configure.ac
cvs rdiff -u -r1.2 -r1.2.2.1 xsrc/external/mit/makedepend/dist/def.h
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.2.1 \
    xsrc/external/mit/makedepend/dist/include.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.14.1 \
    xsrc/external/mit/makedepend/dist/makedepend.man

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/makedepend/dist/ChangeLog
diff -u xsrc/external/mit/makedepend/dist/ChangeLog:1.1.1.7 xsrc/external/mit/makedepend/dist/ChangeLog:1.1.1.7.2.1
--- xsrc/external/mit/makedepend/dist/ChangeLog:1.1.1.7	Fri Nov 11 07:52:27 2022
+++ xsrc/external/mit/makedepend/dist/ChangeLog	Mon Dec 19 12:30:42 2022
@@ -1,3 +1,35 @@
+commit f7ad4c3164cf673bc30a2a038beb7cdb45ee3e94
+Author: Alan Coopersmith <[email protected]>
+Date:   Mon Dec 12 11:07:08 2022 -0800
+
+    makedepend 1.0.8
+    
+    Signed-off-by: Alan Coopersmith <[email protected]>
+
+commit 654f6355d501153fe1fbdbc073cb72fd6355e194
+Author: Alan Coopersmith <[email protected]>
+Date:   Mon Dec 5 15:48:17 2022 -0800
+
+    Bug #2: fix regression introduced by fix for bug #1
+    
+    Refactor code to find the full file path before comparing against
+    existing items in the list so that we stop adding duplicate entries
+    for all the files in the system include path and with larger amounts
+    of code hitting the MAXFILES limit.
+    
+    Fixes: 3dc64b0 ("Add test case for bug #1 + proposed fix.")
+    Closes: #2
+    
+    Signed-off-by: Alan Coopersmith <[email protected]>
+
+commit a17093a3f99f21bb999f3e0f9a45340eeed98da8
+Author: Alan Coopersmith <[email protected]>
+Date:   Mon Dec 5 10:44:51 2022 -0800
+
+    man page: add line breaks in Synopsis section
+    
+    Signed-off-by: Alan Coopersmith <[email protected]>
+
 commit d62a9e49c6b83f05c5692bbe4b80c485d08ecfd3
 Author: Alan Coopersmith <[email protected]>
 Date:   Fri Oct 28 19:28:57 2022 -0700
Index: xsrc/external/mit/makedepend/dist/aclocal.m4
diff -u xsrc/external/mit/makedepend/dist/aclocal.m4:1.1.1.7 xsrc/external/mit/makedepend/dist/aclocal.m4:1.1.1.7.2.1
--- xsrc/external/mit/makedepend/dist/aclocal.m4:1.1.1.7	Fri Nov 11 07:52:27 2022
+++ xsrc/external/mit/makedepend/dist/aclocal.m4	Mon Dec 19 12:30:42 2022
@@ -1793,7 +1793,7 @@ AC_SUBST(MAKE_HTML)
 # Documentation tools are not always available on all platforms and sometimes
 # not at the appropriate level. This macro enables a module to test for the
 # presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-xmlto option, it allows maximum flexibilty in making decisions
+# the --with-xmlto option, it allows maximum flexibility in making decisions
 # as whether or not to use the xmlto package. When DEFAULT is not specified,
 # --with-xmlto assumes 'auto'.
 #
@@ -2007,7 +2007,7 @@ AM_CONDITIONAL([HAVE_PERL], [test "$have
 # Documentation tools are not always available on all platforms and sometimes
 # not at the appropriate level. This macro enables a module to test for the
 # presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-asciidoc option, it allows maximum flexibilty in making decisions
+# the --with-asciidoc option, it allows maximum flexibility in making decisions
 # as whether or not to use the asciidoc package. When DEFAULT is not specified,
 # --with-asciidoc assumes 'auto'.
 #
@@ -2077,7 +2077,7 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$
 # Documentation tools are not always available on all platforms and sometimes
 # not at the appropriate level. This macro enables a module to test for the
 # presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-doxygen option, it allows maximum flexibilty in making decisions
+# the --with-doxygen option, it allows maximum flexibility in making decisions
 # as whether or not to use the doxygen package. When DEFAULT is not specified,
 # --with-doxygen assumes 'auto'.
 #
@@ -2161,7 +2161,7 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "$h
 # Documentation tools are not always available on all platforms and sometimes
 # not at the appropriate level. This macro enables a module to test for the
 # presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-groff option, it allows maximum flexibilty in making decisions
+# the --with-groff option, it allows maximum flexibility in making decisions
 # as whether or not to use the groff package. When DEFAULT is not specified,
 # --with-groff assumes 'auto'.
 #
@@ -2269,7 +2269,7 @@ AM_CONDITIONAL([HAVE_GROFF_HTML], [test 
 # Documentation tools are not always available on all platforms and sometimes
 # not at the appropriate level. This macro enables a module to test for the
 # presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-fop option, it allows maximum flexibilty in making decisions
+# the --with-fop option, it allows maximum flexibility in making decisions
 # as whether or not to use the fop package. When DEFAULT is not specified,
 # --with-fop assumes 'auto'.
 #
@@ -2363,7 +2363,7 @@ AC_SUBST([M4], [$ac_cv_path_M4])
 # Documentation tools are not always available on all platforms and sometimes
 # not at the appropriate level. This macro enables a module to test for the
 # presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
+# the --with-ps2pdf option, it allows maximum flexibility in making decisions
 # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
 # --with-ps2pdf assumes 'auto'.
 #
@@ -2418,7 +2418,7 @@ AM_CONDITIONAL([HAVE_PS2PDF], [test "$ha
 # not at the appropriate level. This macro enables a builder to skip all
 # documentation targets except traditional man pages.
 # Combined with the specific tool checking macros XORG_WITH_*, it provides
-# maximum flexibilty in controlling documentation building.
+# maximum flexibility in controlling documentation building.
 # Refer to:
 # XORG_WITH_XMLTO         --with-xmlto
 # XORG_WITH_ASCIIDOC      --with-asciidoc
@@ -2451,7 +2451,7 @@ AC_MSG_RESULT([$build_docs])
 #
 # This macro enables a builder to skip all developer documentation.
 # Combined with the specific tool checking macros XORG_WITH_*, it provides
-# maximum flexibilty in controlling documentation building.
+# maximum flexibility in controlling documentation building.
 # Refer to:
 # XORG_WITH_XMLTO         --with-xmlto
 # XORG_WITH_ASCIIDOC      --with-asciidoc
@@ -2484,7 +2484,7 @@ AC_MSG_RESULT([$build_devel_docs])
 #
 # This macro enables a builder to skip all functional specification targets.
 # Combined with the specific tool checking macros XORG_WITH_*, it provides
-# maximum flexibilty in controlling documentation building.
+# maximum flexibility in controlling documentation building.
 # Refer to:
 # XORG_WITH_XMLTO         --with-xmlto
 # XORG_WITH_ASCIIDOC      --with-asciidoc
@@ -2975,7 +2975,7 @@ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"
 # Minimum version: 1.16.0
 #
 # Test if the compiler works when passed the given flag as a command line argument.
-# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
+# If it succeeds, the flag is appended to the given variable.  If not, it tries the
 # next flag in the list until there are no more options.
 #
 # Note that this does not guarantee that the compiler supports the flag as some
@@ -3132,7 +3132,7 @@ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]
 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
 
-# Turn some warnings into errors, so we don't accidently get successful builds
+# Turn some warnings into errors, so we don't accidentally get successful builds
 # when there are problems that should be fixed.
 
 if test "x$SELECTIVE_WERROR" = "xyes" ; then
Index: xsrc/external/mit/makedepend/dist/configure
diff -u xsrc/external/mit/makedepend/dist/configure:1.1.1.7 xsrc/external/mit/makedepend/dist/configure:1.1.1.7.2.1
--- xsrc/external/mit/makedepend/dist/configure:1.1.1.7	Fri Nov 11 07:52:27 2022
+++ xsrc/external/mit/makedepend/dist/configure	Mon Dec 19 12:30:42 2022
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for makedepend 1.0.7.
+# Generated by GNU Autoconf 2.71 for makedepend 1.0.8.
 #
 # Report bugs to <https://gitlab.freedesktop.org/xorg/util/makedepend/-/issues>.
 #
@@ -612,8 +612,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='makedepend'
 PACKAGE_TARNAME='makedepend'
-PACKAGE_VERSION='1.0.7'
-PACKAGE_STRING='makedepend 1.0.7'
+PACKAGE_VERSION='1.0.8'
+PACKAGE_STRING='makedepend 1.0.8'
 PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/util/makedepend/-/issues'
 PACKAGE_URL=''
 
@@ -1350,7 +1350,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures makedepend 1.0.7 to adapt to many kinds of systems.
+\`configure' configures makedepend 1.0.8 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1421,7 +1421,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of makedepend 1.0.7:";;
+     short | recursive ) echo "Configuration of makedepend 1.0.8:";;
    esac
   cat <<\_ACEOF
 
@@ -1534,7 +1534,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-makedepend configure 1.0.7
+makedepend configure 1.0.8
 generated by GNU Autoconf 2.71
 
 Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1804,7 +1804,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by makedepend $as_me 1.0.7, which was
+It was created by makedepend $as_me 1.0.8, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -3078,7 +3078,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='makedepend'
- VERSION='1.0.7'
+ VERSION='1.0.8'
 
 
 printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -7110,7 +7110,7 @@ printf "%s\n" "$supported" >&6; }
 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
 
-# Turn some warnings into errors, so we don't accidently get successful builds
+# Turn some warnings into errors, so we don't accidentally get successful builds
 # when there are problems that should be fixed.
 
 if test "x$SELECTIVE_WERROR" = "xyes" ; then
@@ -12114,7 +12114,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by makedepend $as_me 1.0.7, which was
+This file was extended by makedepend $as_me 1.0.8, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -12182,7 +12182,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-makedepend config.status 1.0.7
+makedepend config.status 1.0.8
 configured by $0, generated by GNU Autoconf 2.71,
   with options \\"\$ac_cs_config\\"
 
Index: xsrc/external/mit/makedepend/dist/configure.ac
diff -u xsrc/external/mit/makedepend/dist/configure.ac:1.1.1.7 xsrc/external/mit/makedepend/dist/configure.ac:1.1.1.7.2.1
--- xsrc/external/mit/makedepend/dist/configure.ac:1.1.1.7	Fri Nov 11 07:52:27 2022
+++ xsrc/external/mit/makedepend/dist/configure.ac	Mon Dec 19 12:30:42 2022
@@ -3,7 +3,7 @@ dnl Process this file with autoconf to c
 
 # Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT([makedepend], [1.0.7],
+AC_INIT([makedepend], [1.0.8],
         [https://gitlab.freedesktop.org/xorg/util/makedepend/-/issues])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([makedepend-config.h])

Index: xsrc/external/mit/makedepend/dist/def.h
diff -u xsrc/external/mit/makedepend/dist/def.h:1.2 xsrc/external/mit/makedepend/dist/def.h:1.2.2.1
--- xsrc/external/mit/makedepend/dist/def.h:1.2	Fri Dec 16 05:18:45 2022
+++ xsrc/external/mit/makedepend/dist/def.h	Mon Dec 19 12:30:42 2022
@@ -39,7 +39,7 @@ in this Software without prior written a
 #include <sys/stat.h>
 
 #define MAXDEFINES	512
-#define MAXFILES	4096
+#define MAXFILES	2048
 #define MAXINCFILES	128	/* "-include" files */
 #define MAXDIRS		512	/* -I flags */
 #define PATHMAX		4096    /* realpath */

Index: xsrc/external/mit/makedepend/dist/include.c
diff -u xsrc/external/mit/makedepend/dist/include.c:1.1.1.6 xsrc/external/mit/makedepend/dist/include.c:1.1.1.6.2.1
--- xsrc/external/mit/makedepend/dist/include.c:1.1.1.6	Fri Nov 11 07:52:27 2022
+++ xsrc/external/mit/makedepend/dist/include.c	Mon Dec 19 12:30:42 2022
@@ -222,60 +222,17 @@ inc_clean (void)
 	}
 }
 
-struct inclist *
-inc_path(const char *file, const char *include, int type)
+/*
+ * Return full path for the "include" file of the given "type",
+ * which may be found relative to the source file "file".
+ */
+static const char *
+find_full_inc_path(const char *file, const char *include, int type)
 {
 	static char		path[ BUFSIZ ];
 	register const char	**pp, *p;
-	register struct inclist	*ip;
 	struct stat		st;
 
-	/*
-	 * Check all previously found include files for a path that
-	 * has already been expanded.
-	 */
-	if ((type == INCLUDE) || (type == INCLUDEDOT))
-		inclistnext = inclist;
-	ip = inclistnext;
-
-	for (; ip->i_file; ip++) {
-		if ((strcmp(ip->i_incstring, include) == 0) &&
-		    !(ip->i_flags & INCLUDED_SYM)) {
-			/*
-			 * Same filename but same file ?
-			 */
-			char r_include[PATHMAX+1];
-			char r_saved_path[PATHMAX+1];
-			char* ptr;
-			ptr = realpath(include, r_include);
-			ptr = realpath(ip->i_file, r_saved_path);
-			if (!strcmp(r_include, r_saved_path)) {
-				inclistnext = ip + 1;
-				return ip;
-			}
-
-			/*
-			 * Check if we have a header in the same dir
-			 */
-			for (p=file+strlen(file); p>file; p--)
-				if (*p == '/')
-					break;
-			if (p == file) {
-				strcpy(path, include);
-			} else {
-				strncpy(path, file, (p-file) + 1);
-				path[ (p-file) + 1 ] = '\0';
-				strcpy(path + (p-file) + 1, include);
-			}
-			remove_dotdot(path);
-			ptr = realpath(path, r_include);
-			if (!strcmp(r_include, r_saved_path)) {
-				inclistnext = ip + 1;
-				return ip;
-			}
-		}
-	}
-
 	if (inclistnext == inclist) {
 		/*
 		 * If the path was surrounded by "" or is an absolute path,
@@ -285,7 +242,7 @@ inc_path(const char *file, const char *i
 		    (type == INCLUDENEXTDOT) ||
 		    (*include == '/')) {
 			if (stat(include, &st) == 0 && !S_ISDIR(st.st_mode))
-				return newinclude(include, include);
+				return include;
 			if (show_where_not)
 				warning1("\tnot in %s\n", include);
 		}
@@ -307,7 +264,7 @@ inc_path(const char *file, const char *i
 			}
 			remove_dotdot(path);
 			if (stat(path, &st) == 0 && !S_ISDIR(st.st_mode))
-				return newinclude(path, include);
+				return path;
 			if (show_where_not)
 				warning1("\tnot in %s\n", path);
 		}
@@ -326,7 +283,7 @@ inc_path(const char *file, const char *i
 		remove_dotdot(path);
 		if (stat(path, &st) == 0 && !S_ISDIR(st.st_mode)) {
 			includedirsnext = pp + 1;
-			return newinclude(path, include);
+			return path;
 		}
 		if (show_where_not)
 			warning1("\tnot in %s\n", path);
@@ -334,3 +291,43 @@ inc_path(const char *file, const char *i
 
 	return NULL;
 }
+
+struct inclist *
+inc_path(const char *file, const char *include, int type)
+{
+	const char	*fp;
+	struct inclist	*ip;
+	char r_include[PATHMAX+1];
+
+	/*
+	 * Check all previously found include files for a path that
+	 * has already been expanded.
+	 */
+	if ((type == INCLUDE) || (type == INCLUDEDOT))
+		inclistnext = inclist;
+	ip = inclistnext;
+
+	fp = find_full_inc_path(file, include, type);
+	if (fp == NULL)
+		return NULL;
+	if (realpath(fp, r_include) == NULL)
+		return NULL;
+
+	for (; ip->i_file; ip++) {
+		if ((strcmp(ip->i_incstring, include) == 0) &&
+		    !(ip->i_flags & INCLUDED_SYM)) {
+			/*
+			 * Same filename but same file ?
+			 */
+			char r_saved_path[PATHMAX+1];
+			if (realpath(ip->i_file, r_saved_path) == NULL)
+				continue;
+			if (!strcmp(r_include, r_saved_path)) {
+				inclistnext = ip + 1;
+				return ip;
+			}
+		}
+	}
+
+	return newinclude(fp, include);
+}

Index: xsrc/external/mit/makedepend/dist/makedepend.man
diff -u xsrc/external/mit/makedepend/dist/makedepend.man:1.1.1.3 xsrc/external/mit/makedepend/dist/makedepend.man:1.1.1.3.14.1
--- xsrc/external/mit/makedepend/dist/makedepend.man:1.1.1.3	Fri May 31 05:00:36 2013
+++ xsrc/external/mit/makedepend/dist/makedepend.man	Mon Dec 19 12:30:42 2022
@@ -37,7 +37,9 @@ makedepend \- create dependencies in mak
 .BI \-I includedir
 ] [
 .BI \-Y includedir
-] [
+]
+.br
+    [
 .B \-a
 ] [
 .BI \-f makefile
@@ -45,7 +47,9 @@ makedepend \- create dependencies in mak
 .BI \-include \ file
 ] [
 .BI \-o objsuffix
-] [
+]
+.br
+    [
 .BI \-p objprefix
 ] [
 .BI \-s string
@@ -55,14 +59,15 @@ makedepend \- create dependencies in mak
 .B \-v
 ] [
 .B \-m
-] [
+]
+.br
+    [
 \-\^\-
 .I otheroptions
 \-\^\-
 ]
 .I sourcefile
 \&.\|.\|.
-.br
 .SH DESCRIPTION
 The
 .B makedepend

Reply via email to