Commit a673c79fae for perl
commit a673c79fae615ca6438c82c701af15b7965159ea
Author: Karl Williamson <khw@cpan.org>
Date: Tue Nov 17 09:14:31 2026 -0700
makedependfile.SH: Use dummy git_version.h if doesn't exist
This header may not exist in a given build directory. And it can be
included by files which later have that #include skipped, but not at
this point in the build process. So create an empty one in the
temporary UU directory, and point the cpp command to use that directory
after looking in the normal place.
On my Linux box, this caused a couple more dependencies to be generated
for perl.c and perlmini.c
diff --git a/makedependfile.SH b/makedependfile.SH
index befb283a02..e6ba2fd93a 100644
--- a/makedependfile.SH
+++ b/makedependfile.SH
@@ -150,8 +150,14 @@ $echo "Finding dependencies for $filebase$_o"
| $grep -v ":" \
) >UU/$file.c
+# Some files include this header, which may not be present on this system.
+# Some preprocessors abort at the point an #included file isn't found, giving
+# incomplete results. Make sure a file with this name does exist. The cpp
+# command looks in this directory..
+touch UU/git_version.h
+
# Run the preprocess, and remove all the following irrelevant lines
-$cppstdin -DPERL_CORE $finc -I. $cppflags $cppminus <UU/$file.c >$$.cout 2>$$.cerr
+$cppstdin -DPERL_CORE $finc -I. -IUU $cppflags $cppminus <UU/$file.c >$$.cout 2>$$.cerr
$sed -e '1d' \
-e '/^#.*<stdin>/d' \
-e '/^#.*<builtin>/d' \
@@ -162,7 +168,11 @@ $sed -e '1d' \
-e '/^#.*"-"/d' \
-e '/^#.*"\/.*\/"/d' \
-e '/: file path prefix .* never used$/d' \
+ \
+ -e '# This will be in the form of an #include, which isnt really a' \
+ -e '# dependency' \
-e '/^#.*git_version\.h/d' \
+ \
-e 's#\.[0-9][0-9]*\.c#'"$file.c#" \
-e 's/^[ ]*#[ ]*line/#/' \
-e '/^# *[0-9][0-9]* *[".\/]/!d' \