Re:Show HN: Minimal build system using just /bin/sh
by jperkin on Friday August 18, 2017 @08:05AM
(#15045382)
Any OS which use the Korn shell as /bin/sh, for example Solaris 10, 11, and illumos:
$ /bin/sh -c "fail() { local f; }; fail"
/bin/sh[1]: local: not found [No such file or directory]
$ /bin/sh --version
version sh (AT&T Research) 93t+ 2010-03-05
$ uname -rsv
SunOS 5.11 joyent_20160721T174127Z
It wouldn't work on Solaris 9 and older either as the original /bin/sh also doesn't support "local", but as those releases are EOL it's fine to discount them.Whether you regard these platforms as extant depends on your point of view. Most people wouldn't, and that's fine. We'd naturally disagree ;)
Re:Show HN: Minimal build system using just /bin/sh
by akkartik on Friday August 18, 2017 @12:41PM
(#15047701)
That's good to know, actually. Thanks! Sorry about my tone before. Are there any other platforms that actually benefit from autotools, that you're aware of?
Re:Show HN: Minimal build system using just /bin/sh
by JdeBP on Friday August 18, 2017 @02:17PM
(#15048493)
OpenBSD uses the Korn shell for /bin/sh and this is not true there.
$/bin/sh -c "fail() { local f; }; fail"
$
OpenBSD's /bin/sh defines several aliases as standard. $alias local
local=typeset
$
M. Agaram has stated elsewhere that xe was using OpenBSD sh as a poor man's POSIX conformance test.
Debian dash deems 3 POSIX extensions basic enough to be in /bin/sh -- including `local`. https://www.debian.org/doc/debian-policy/ch-files.html#s-scr...
I don't care about some spherical-cow ideal of portability. It has its own costs -- like autotools. This is why OP makes no mention of POSIX or portability.
(This exchange regurgitates https://www.reddit.com/r/tinycode/comments/6md2l8/make_gmake..., albeit with more mutual sneering.)