On Thu, Oct 17, 2019 at 4:05 PM Riccardo Mottola <
address@hidden> wrote:
Hi Stefan,
Stefan Bidigaray wrote:
> The issue is with the test command, not necessarily sh. All borne
> shells I've ever used provide a built-in for test, though.
>
> I looked this command up... Both dash and Ash provide the -nt command
> to compare the date of two files. Can you do a 'man sh' to double
> check that the Solaris sh also have this command for the test built-in?
>
> By the way, this would be a GNU autoconf bug.
Ok, first let's see, on Linux I have "man test":
FILE1 -nt FILE2
FILE1 is newer (modification date) than FILE2
So this is I suppose the test intended.
However I do not find this in "man test" in solaris... and inside "sh"
is there a specific section for it?
It's under "Special Commands" in the man page. I usually just search for "test [" when I'm trying to find that particular built-in.
with --trace was able to see the culprit:
Makefile.postamble:105: update target 'base.make' due to: config.status
Version
if [ Version -nt base.make ]; then ./configure; else ./config.status
base.make; fi
so this code is actually in our Makefile.postamble, it is not a GNU
autoconf bug, but a check we add to rerun configure.
Ah... Sorry about that. When I looked at your original email this morning I saw the config.status line and just assumed that's where the error was coming from.
So it looks like the file comparison options of test are not portable. The Heirloom project's sh, for example, does not provide it. [1]
The code in line 105 is quite old, so I'm surprised you haven't run into this problem before. Git blame says it's 5 years old [2].
I wonder how it can be made more portable. Or, having bash, if I can run
Maybe the solution is to simply revert this particular change? The old code in this section of the Makefile looks reasonable. Honestly, I do not understand why we would use the "-nt" options in a Makefile, to begin with. The purpose of the make utility is exactly to run commands based on the age of the files' dependencies, so why would we do this manually with shell commands?
Riccardo
Stefan