Index: ChangeLog =================================================================== RCS file: /cvsroot/xsrc/external/mit/makedepend/dist/ChangeLog,v retrieving revision 1.1.1.7 retrieving revision 1.1.1.8 diff -p -u -r1.1.1.7 -r1.1.1.8 --- ChangeLog 11 Nov 2022 07:52:27 -0000 1.1.1.7 +++ ChangeLog 19 Dec 2022 00:54:12 -0000 1.1.1.8 @@ -1,3 +1,35 @@ +commit f7ad4c3164cf673bc30a2a038beb7cdb45ee3e94 +Author: Alan Coopersmith +Date: Mon Dec 12 11:07:08 2022 -0800 + + makedepend 1.0.8 + + Signed-off-by: Alan Coopersmith + +commit 654f6355d501153fe1fbdbc073cb72fd6355e194 +Author: Alan Coopersmith +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 + +commit a17093a3f99f21bb999f3e0f9a45340eeed98da8 +Author: Alan Coopersmith +Date: Mon Dec 5 10:44:51 2022 -0800 + + man page: add line breaks in Synopsis section + + Signed-off-by: Alan Coopersmith + commit d62a9e49c6b83f05c5692bbe4b80c485d08ecfd3 Author: Alan Coopersmith Date: Fri Oct 28 19:28:57 2022 -0700 Index: README =================================================================== RCS file: README diff -N README --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ README 31 May 2013 05:00:37 -0000 1.1.1.1 @@ -0,0 +1,25 @@ +makedepend - create dependencies in makefiles + +All questions regarding this software should be directed at the +Xorg mailing list: + + http://lists.freedesktop.org/mailman/listinfo/xorg + +Please submit bug reports to the Xorg bugzilla: + + https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +The master development code repository can be found at: + + git://anongit.freedesktop.org/git/xorg/util/makedepend + + http://cgit.freedesktop.org/xorg/util/makedepend + +For patch submission instructions, see: + + http://www.x.org/wiki/Development/Documentation/SubmittingPatches + +For more information on the git code manager, see: + + http://wiki.x.org/wiki/GitPage + Index: aclocal.m4 =================================================================== RCS file: /cvsroot/xsrc/external/mit/makedepend/dist/aclocal.m4,v retrieving revision 1.1.1.7 retrieving revision 1.1.1.8 diff -p -u -r1.1.1.7 -r1.1.1.8 --- aclocal.m4 11 Nov 2022 07:52:27 -0000 1.1.1.7 +++ aclocal.m4 19 Dec 2022 00:54:12 -0000 1.1.1.8 @@ -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: configure =================================================================== RCS file: /cvsroot/xsrc/external/mit/makedepend/dist/configure,v retrieving revision 1.1.1.7 retrieving revision 1.1.1.8 diff -p -u -r1.1.1.7 -r1.1.1.8 --- configure 11 Nov 2022 07:52:27 -0000 1.1.1.7 +++ configure 19 Dec 2022 00:54:12 -0000 1.1.1.8 @@ -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 . # @@ -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: configure.ac =================================================================== RCS file: /cvsroot/xsrc/external/mit/makedepend/dist/configure.ac,v retrieving revision 1.1.1.7 retrieving revision 1.1.1.8 diff -p -u -r1.1.1.7 -r1.1.1.8 --- configure.ac 11 Nov 2022 07:52:27 -0000 1.1.1.7 +++ configure.ac 19 Dec 2022 00:54:12 -0000 1.1.1.8 @@ -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: def.h =================================================================== RCS file: /cvsroot/xsrc/external/mit/makedepend/dist/def.h,v retrieving revision 1.2 retrieving revision 1.1.1.6 diff -p -u -r1.2 -r1.1.1.6 --- def.h 16 Dec 2022 05:18:45 -0000 1.2 +++ def.h 11 Nov 2022 07:52:27 -0000 1.1.1.6 @@ -39,7 +39,7 @@ in this Software without prior written a #include #define MAXDEFINES 512 -#define MAXFILES 4096 +#define MAXFILES 2048 #define MAXINCFILES 128 /* "-include" files */ #define MAXDIRS 512 /* -I flags */ #define PATHMAX 4096 /* realpath */ Index: include.c =================================================================== RCS file: /cvsroot/xsrc/external/mit/makedepend/dist/include.c,v retrieving revision 1.1.1.6 retrieving revision 1.1.1.7 diff -p -u -r1.1.1.6 -r1.1.1.7 --- include.c 11 Nov 2022 07:52:27 -0000 1.1.1.6 +++ include.c 19 Dec 2022 00:54:12 -0000 1.1.1.7 @@ -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: makedepend.man =================================================================== RCS file: /cvsroot/xsrc/external/mit/makedepend/dist/makedepend.man,v retrieving revision 1.1.1.3 retrieving revision 1.1.1.4 diff -p -u -r1.1.1.3 -r1.1.1.4 --- makedepend.man 31 May 2013 05:00:36 -0000 1.1.1.3 +++ makedepend.man 19 Dec 2022 00:54:12 -0000 1.1.1.4 @@ -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