For what it is worth, the POSIX test on Solaris has things you would expect.
Most of my scripts on Solaris will exec KSH if not running in a POSIX she’ll,
but for minor thing like this you could consider conditionally defining a
function to override the built in:
$$ /bin/sh
$$ if [ www -nt jar_resigning ]; then echo newer ; else echo older ; fi
test: unknown operator -nt
$$ if test www -nt jar_resigning; then echo newer ; else echo older ; fi
test: unknown operator -nt
$$ [ SunOS = `uname -s` ] && [ xy != `IFS=''; set x y; echo "$*"` ] && test ()
{ env -i PATH=/usr/xpg4/bin:$PATH test "$@" ; }
$$ if test www -nt jar_resigning; then echo newer ; else echo older ; fi
older
$$
Ignore any stupid email line-wrapping. Sending from my phone. Function above
should be all on one line.
With other shells on solaris you can put a backslash in front of the command to
get the actual command rather than the built-in, but that doesn’t work for
Solaris /bin/sh, in its misfit glory.
The above first tests that it is Solaris, then whether the /bin/sh is the
broken one (among its many bugs, it doesn’t handle IFS correctly), before
overriding the test built-in.
HTH
—Robert
>> On Oct 17, 2019, at 17:28, Riccardo Mottola via Gnustep-dev
>> <[email protected]> wrote:
> Stefan Bidigaray wrote:
>> 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.
>
> --trace was of help
>
>>
>> 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].
>
> It is! to be honest, I remember to have seen this problem before, but I never
> experienced it "hard blocking" like today.
> I think I was used to always to a clean build or run configure manually, in
> that case it disappears.
>
> Your cited manpages shows the options I have on Solaris, apparently.
>
>> 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?
>
> Exactly - the goal of make is itself timestamp dependency, so I don't get
> that part of the patch, maybe it can be partially reverted. Or it was some
> strange kind of workaround?
>
> It is of Yavor, but Richard applied, maybe he can chime in to the discussion.
>
> Riccardo
>
> _______________________________________________
> Gnustep-dev mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/gnustep-dev
_______________________________________________
Gnustep-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnustep-dev