Commit Graph

505 Commits

Author SHA1 Message Date
tg 37b1260d13 unbreak test.sh in some cases 2009-12-05 16:19:59 +00:00
tg dc98ec23a6 do not use PATH_MAX on GNU/Hurd (even if it *was* defined), but use
some glibc-only functions that don’t require its use instead

tested on gnubber, where (admittedly) sysconf(_PC_PATH_MAX) == 1024…
2009-10-27 17:00:02 +00:00
tg 9f4376d2ad GNU make needs VPATH with the for-all-make(1)s thing (at least if
the sources are in different directories, despite being listed in
${SRCS_FP} with full paths) - XXX can this work with nmake or so?
2009-10-16 18:51:30 +00:00
tg 990c9eaf0c tentatively add new -M option to generate a "Makefrag.inc" instead
of doing the actual compile (along with the usual Rebuild.sh, test.sh
and, if necessary, things such as signames.inc) for Android integration
2009-10-16 18:45:31 +00:00
tg 18c470fb3b since mksh uses /* comments with apo'strophes */ both in the copyright
and code, we MUST check if they work, since C99 apparently forbids it…
2009-10-15 16:50:21 +00:00
tg 8f3f520725 AIX {,/usr}/bin/bsh is an SVR3 Bourne Shell, according to Sven Mascheck,
so I must not use foo="…`…"…"…`…" at all
2009-10-15 12:58:34 +00:00
tg 1dfb13b603 change undef/def MKSH_NOVI into 0/1 MKSH_S_NOVI flag (with more to come:
MKSH_S_EDIT for small (Emacs) editing mode, MKSH_S_FEAT for all the dis-
abled language features), which can be set to 0 despite MKSH_SMALL being
defined to re-enable the Vi command line editing mode (which I wouldn't,
but fits into the general mastermind scheme)
2009-09-24 17:15:33 +00:00
tg f00db85c98 SUNWcc related fixes for normal and MKSH_SMALL 2009-09-23 18:22:38 +00:00
tg 31e02e59f7 add a do_realpath() implementation replacing the use of the external
libc function realpath(3) which may not be available on the target
system; compile the realpath builtin unconditionally

looks fine to me, but review is appreciated; this is (very) lightly
based upon MirBSD libc’s realpath(3) and pdksh’s get_phys_path()
2009-08-30 13:22:39 +00:00
tg aec424e631 rpmlint says that one scn.c is compiled without rpm’s $CFLAGS
it’s probably right, except, maybe it was from a CPP invocation
nevertheless it now will never call $CC without $CFLAGS et al.
2009-08-28 17:37:47 +00:00
tg 56d51abd1f need <sys/types.h> for mode_t 2009-08-08 13:52:35 +00:00
tg 0e1266ef90 While mksh R39 builds fine on MirOS #7s8E on my trusty sparc, pgcc 2.95.3
throws out quite some warnings – fix most of them except most emitted via
-Wconversion; work around some others; discard bogus warnings.

sync clog
2009-08-08 13:08:53 +00:00
tg 0d750bba12 Linux libc5 has some function protos in weird places 2009-08-01 21:58:06 +00:00
tg 5cc1722967 ULTRIX, OSF/1, Tru64, Linux 2.0: uint8_t check must come *before* the
arc4random.c source file is added to $LIBS (and related checks)
2009-08-01 21:52:02 +00:00
tg a49d855ab2 ash 0.2 (ecce!GNU/Linux 1.05) chokes on such "long" echo statements... 2009-08-01 21:51:24 +00:00
tg 587822eb4a *curses* ensure all ‘!’ are quoted, ash 0.2, ecce!GNU/Linux 1.05 2009-08-01 20:58:07 +00:00
tg cfa64cebd1 arc4random.c needs uint8_t
tested on ULTRIX
2009-08-01 20:29:02 +00:00
tg 7f5ce5e5ba oops, fix adding arc4random.c to SRCS 2009-08-01 14:12:13 +00:00
tg cb2fd22c38 "official" but unsupported printf-as-builtin code, cleaner API than
in the branch; USE_PRINTF_BUILTIN=1 to enable it (Build.sh + Makefile)
2009-07-30 19:11:12 +00:00
tg 758dc5c6fe * improve CPPFLAGS vs #define handling again: do not touch CPPFLAGS from
Build.sh but use 'if defined(PRECOND) && !defined(TOBEDEFINED)'if possible
* for all of the source code, drop annotations "imake style" (if we check
  for specific OSes, bad, instead of using mirtoconf checks proper) and
  "conditions correct?" (if I'm not entirely sure if that #if catches all
  cases and no false positives) where I can see it by grepping immediately
* bump mksh patchlevel
* refresh Makefiles
2009-07-25 21:31:27 +00:00
tg cfe6688a36 in an interesting piece of self humour, remove the stop and suspend
aliases from shells requiring the Arbeitsamt to get a job ;-)
2009-07-25 20:52:41 +00:00
tg 5e3aba8b00 simplify MKSH_SMALL => MKSH_CONSERVATIVE_FDS handling 2009-07-25 20:18:13 +00:00
tg 0a77903f53 allow overriding -DMKSH_SMALL with HAVE_PERSISTENT_HISTORY=x too 2009-07-25 20:04:09 +00:00
tg c7b8b512a8 restructure the build system: new ac_ifcpp macro for _reliably_ determining
the state of the C Præprocessor at configuration time (simple checks, i.e.
set/unset, set+1/set+!1/unset, and more complex checks), including verbose
output; related cosmetics and variable naming cleanup
2009-07-19 14:59:40 +00:00
tg db98d5e964 Nils Weller says to not use nwcc -stackprotect 2009-07-07 20:36:58 +00:00
tg 649eaa7244 nwcc accepts -std=gnu99 (but doesn't process it yet) and -Wall 2009-07-07 18:42:47 +00:00
tg fca27ce872 fix cast warnings discovered by nwcc, and work around const optimisation
related over-zealous warnings by using a non-const integer value
2009-07-07 18:39:51 +00:00
tg d162ed09a4 remove tack workarounds, for now 2009-07-07 18:38:49 +00:00
tg 30b1c9b2c0 prepare for ACK on GNU/Linux 2009-07-07 18:34:21 +00:00
tg be7764778f die, gcc, die! if main is called with 2 args, I can very well
use just the first one, grml...
2009-06-10 21:25:39 +00:00
tg 632ddd50a7 Add MKSH_NO_LIMITS, to define which has the same effect as the
absence of RLIM_INFINITY, namely make c_ulimit() into a true
2009-06-08 20:52:28 +00:00
tg 571546c562 • Check if killpg(3) is available; if not, use kill(2) with negative
process ID and hope it works (is POSIXly killpg-endowed)
• bump version
• sync clog
2009-06-08 20:34:40 +00:00
tg f4ed74a610 allow HAVE_REALPATH=x in the environment if MKSH_SMALL to enable the
feature if possible, like HAVE_MKNOD does. same for revoke.
2009-06-07 22:26:00 +00:00
tg 72c8f3c70d MKSH_BINSHREDUCED is independent from MKSH_SMALL, has been for a while
this is to accomodate e.g. Debian
2009-06-07 22:21:39 +00:00
tg d5d8fb0d40 naaina provided me with a patch from Sean Boudreau, QNX Software Systems,
which I applied slightly tuned: QNX 6.4.2 ed(1) is said to fix the issues
that made it unusable by our regression test suite
2009-06-07 14:50:58 +00:00
tg cda3cc93f1 From André “naaina” Wösten via IRC:
QNX 6.4 is out, which has a different waitfor() in <libutil.h>, which
we by definition of __NO_EXT_QNX do not want to use. They are in the
process of porting the NetBSD® pkgsrc® repository to it.

The /bin/ed situation hasn’t improved yet though.
2009-05-29 14:41:37 +00:00
tg b90007d784 • Build.sh, strlcpy.c: gcc-current conversion &c. warnings cleanup
• histrap.c, lex.c, misc.c: get average stack frame size to <= 768 bytes
• check.t, sh.h: bump version
2009-05-27 09:58:24 +00:00
tg b051f52dd4 we’re getting closer, but even a jobless mksh behaves the same 2009-05-20 10:10:35 +00:00
tg b6ce748064 • remove “#if 0” and “#ifdef notdef” style old debugging code
• expose “#ifdef MKSH_MIDNIGHTBSD01ASH_COMPAT” just in case they decide to
  require it and show it in the ksh version automatically
• sync the use of non-ASCII characters over files (unification)
2009-05-16 18:40:09 +00:00
tg b145ca5c9f • sync distrib/special/mksh/Makefile with bin/mksh/Build.sh and
fix the regression test’s results while here, which have been
  broken since cid 10049D9BE5254CE65B8
• get rid of separate copyright file which was intended for De-
  bian; track down commits in all files of oksh-mirbsd and mksh
  to get correct copyright years per-file, as is BSD custom
2009-05-16 16:59:42 +00:00
tg b122cd2b74 since <libutil.h> needs <sys/types.h> e.g. on mnbsd, use it later too
when checking for revoke()
2009-04-10 16:09:53 +00:00
tg 9e83002841 try to do some optimum struct packing except for struct env
(pointers, longs, size_t first; time_t next; int etc. then enum, bool)
2009-04-07 18:41:37 +00:00
tg c7ccde864e apply workaround given to me in IRC yesternight, just define away the
const keyword to not trigger the famous ACK const bug (no chance it’ll
get fixed, not even in Minix 3’s ACK version)
2009-04-06 08:37:42 +00:00
tg e88736b5ef decouple conservative file descriptor use from MKSH_SMALL, with the
new MKSH_CONSERVATIVE_FDS præprocessor flag, because Minix 3, for
example, needs it (otherwise “mksh Build.sh” fails)
2009-04-06 08:33:37 +00:00
tg b6dcee70fd fix CPPFLAGS detection logic for MKSH_ASSUME_UTF8 2009-04-06 08:29:21 +00:00
tg 2d2b3f0b2d on Minix 3, <strings.h> needs <ansi.h> (via <sys/types.h>) 2009-04-06 08:24:57 +00:00
tg 5c76604402 replaced cannot sort 2009-04-05 13:07:06 +00:00
tg 398be9867a fix jobless mksh so much to make it work on Minix 3 2009-04-05 12:35:32 +00:00
tg 81b84b63b0 assume Plan 9 will also want a jobless mksh 2009-04-05 12:21:14 +00:00
tg 81c6c80fd6 persistent history needs munmap, not just mmap (Minix 3 lacks only the former, WTF?) 2009-04-03 10:56:32 +00:00
tg 9aff4d78fe make {get,set}rlimit code depend on RLIM_INFINITY existence (PW32, Minix 3) 2009-04-03 09:45:23 +00:00
tg cf6109d912 detect ACK, handle Minix better 2009-04-03 09:42:37 +00:00
tg 56c6e384e6 (experimental) implement getrusage via times if not found 2009-04-03 09:39:07 +00:00
tg d6f6834d0d add some CPPFLAGS only if setmode.c 2009-03-29 17:50:45 +00:00
tg 0d254e4088 make buildable again after memory allocator change
(why didn’t anybody report this?)
2009-03-23 08:54:12 +00:00
tg ca539f08f0 remove espie's double-linked-list based allocator and write a
similarily simple one from scratch, which however performs
better than espie's with AFREE_DEBUG enabled which took away
the benefit of the double-linked-list approach

all of (core) mksh is now MirOS licenced
2009-03-22 16:55:38 +00:00
tg 6aa594849a with Build.sh -combine, only do it if it is usable (gcc only too)
XXX do other compilers support such thing?

sync clog
2008-12-31 16:09:51 +00:00
tg dc79b9b118 new option -combine (complementary to -llvm):
compile all source files at once using -fwhole-program --combine,
similarily to how it used to be done in older mksh versions, except
that the flags are now hardcoded; tested with llvm-gcc4.2 from MirPorts
2008-12-20 20:39:05 +00:00
tg 03acb8ce51 this was NOT intended to be committed; my sincere apologies 2008-11-13 00:36:07 +00:00
tg d099b00b53 leave at least a working tree, with zero-penalty -DAALLOC_NO_COOKIES
XXX cookies are still broken?

cost for aalloc.c: data -= (4, 0, 4, 0); text += (1665, ?, 2115, 2217)
2008-11-12 07:36:19 +00:00
tg 6a4afdde05 add the workaround for Debian #492377 into the main mirtoconf function,
because Hanno Böck has something similar triggered on Gentoo as well
2008-11-11 23:20:08 +00:00
tg f4f4f64492 if ‘-DMKSH_ASSUME_UTF8’, default HAVE_SETLOCALE_CTYPE to 0 since it’s
unused then anyway, to save two followup mirtoconf checks and headers
2008-11-11 21:52:51 +00:00
tg 6c02c37e52 add new Build.sh option -llvm for bytecode compilation and link-time
intra-module optimisation
2008-11-10 20:25:04 +00:00
tg 446e019c07 the QNX /bin/ed problem is worse than thought; use a new mechanism,
because categories in check.t are OR’d:
• no-stderr-ed disables the newish-ed tests (tried using testcase)
• stdout-ed enables the oldish-ed tests (variable, if the above
  testcase succeeds, it’s added, but QNX overrides the variable)
2008-11-08 17:36:35 +00:00
tg 2697deb55c say hello to QNX, sync clog 2008-11-02 23:06:36 +00:00
tg 89e96b6c86 experimental support for <strings.h>
cf. http://www.opengroup.org/onlinepubs/009695399/basedefs/strings.h.html
QNX seems to bury some functions in there
2008-11-02 22:29:36 +00:00
tg e561d9adfe say hello to nwcc, slightly b0rken though 2008-10-30 17:11:14 +00:00
tg 88d7b7d08b • rewrite code to no longer use statements-as-expressions
• optimise a little
• Build.sh: remove HAVE_EXPSTMT test
• Build.sh, */Makefile: sort tests, regenerate
• mksh.hts: sync clog
2008-10-28 14:32:43 +00:00
ahoka d5415fb04f Add BeOS/Haiku platform.
Compiles OK on Haiku pre-alpha as of 2008 October,
but currently hangs for unknown reason (could be OS bug).
2008-10-26 21:57:47 +00:00
ahoka 776cc76ccb Add check for the nice(3) system call.
It may be not implemented on some plaforms, though it's usually present.

Required to compile on Haiku as of 2008 October.
2008-10-26 21:51:27 +00:00
tg 00cbdc2d2e 12:51⎜«replaced:#!/bin/mksh» mirabilos: btw haiku port?
12:51⎜<mirabilos:#!/bin/mksh> dunno, I run no haiku
12:51⎜<mirabilos:#!/bin/mksh> I don't know anyone who does, either
12:51⎜«replaced:#!/bin/mksh» only caveat it creates nor .aout. nor a.exe by deafult
12:52⎜<mirabilos:#!/bin/mksh> so I focus on more widely-used things such as DEC ULTRIX 4.5 and Digital UNIX
     ⎜    2.0 ;)
12:52⎜«replaced:#!/bin/mksh» the problem was
12:52⎜«replaced:#!/bin/mksh» it creates src when you give hime src.c
12:53⎜«replaced:#!/bin/mksh» and it confused your Build.sh
12:54⎜<mirabilos:#!/bin/mksh> which compiler does it use?
12:55⎜«replaced:#!/bin/mksh» gcc 2.95

this might(!) be enough to support this weirdity. untested.

12:57⎜«replaced:#!/bin/mksh» can you commit that?
12:57⎜«replaced:#!/bin/mksh» i will try it
12:57⎜«replaced:#!/bin/mksh» but a bit later
2008-10-25 12:58:41 +00:00
tg 9fca87b9c3 replace some cat with echo for speed 2008-10-24 21:35:21 +00:00
tg 19b711692f fix mis-reporting gcc on OSF/1 V5.1 as dec due to the
rule we need to use to identify dec c on OSF/1 V2.0
2008-10-24 20:01:42 +00:00
tg 099cc33236 ucode is very similar to dec c; improve version reporting 2008-10-24 19:59:54 +00:00
tg e2b13ffeae say hello to mksh on OSF/1 V2.0
the trick is to use static linking…
2008-10-24 19:55:35 +00:00
tg a82a5e57f7 /bin/sh on DEC OSF/1 V2.0 (Digital UNIX) is a true Bourne Shell, so it sucks 2008-10-24 19:55:06 +00:00
tg 0c2de1902c • change mksh to only then behave more POSuXish when called as /bin/sh or
“-sh” if -DMKSH_BINSHREDUCED was passed during compilation, for example
  for Debian, but d̲e̲f̲i̲n̲i̲t̲i̲v̲e̲l̲y̲ n̲̲o̲̲t̲̲ for MirBSD™
• split up regression test to force this behaviour
• remove the gunk from our MirBSD™ startup scripts again
• mention arc4random.c changes on website, sync clog, warn packagers
2008-10-20 19:29:25 +00:00
tg ea72bd1b76 improve version reporting on modern AIX/xlC
XXX both cc -qversion and ld -V give errors on AIX 5.2 / xlC V7.0…
2008-10-10 21:57:16 +00:00
tg 25a8d9095d AIX has no UTF-8 locale:
aixuser@pscp520v5:~/bcc $ locale -a
C
POSIX
en_US
en_US.8859-15
en_US.ISO8859-1
aixuser@pscp520v5:~/bcc $ uname -a
AIX pscp520v5 3 5 00C56E7D4C00
2008-10-10 21:36:04 +00:00
tg 78a49e8faf miwi noticed that <libutil.h> on ViehBSE has a prerequisite header, but
didn’t tell me which one (T H A N K S !)… since I have no FleaBSD shell
account, I tried on DragonFly and MidnightBSD, which both are content
when adding <sys/types.h> first… let’s hope this fixes all 386BSD derivates
2008-10-04 19:13:22 +00:00
tg 8f5eda8859 remove the problematic ‘-q’ option, which causes trouble under unclear
circumstances, like some FreeBSD 8 (beta) incarnations (yet not others)
2008-09-30 17:34:25 +00:00
tg 024f0e161d heirloom-sh and Solaris /bin/sh caught use of $NROFF before definition
10x Elias Pipping for noticing
2008-07-21 21:00:25 +00:00
tg a125045432 ptrdiff_t needs <stddef.h> 2008-07-18 11:42:52 +00:00
tg cae7468fe6 (possible) warning cleanup 2008-07-18 11:34:20 +00:00
tg eff47cf33b this isn't needed, from pdksh 2008-07-17 15:17:46 +00:00
tg 79de8c1eb0 add some cppflags from pdksh 2008-07-17 14:50:24 +00:00
tg f894288204 BSDi BSD/OS 3.1’s /bin/ksh (PD KSH v5.2.8 96/08/19) is horridly broken and
removes the \n part of a “\\\n” sequence, but not the backslash ⇒ we can’t
use line continuation in a here document

someone might want to add this to *(autoconf) Portable Shell::
2008-07-15 23:44:51 +00:00
tg 31145570ef with dietlibc, <ulimit.h> requires <sys/types.h>, and as we unconditionally
include the latter anyway, just add it as a scan time requirement header

from Debian package
2008-07-15 20:54:47 +00:00
tg 5d25a177a2 better 2008-07-14 15:06:02 +00:00
tg 66e1416bb4 • handle perls without $^O better
• allow user to specify $PERL environment variable containing path to the
  perl5 interpreter to use, for Elias Pipping
2008-07-14 14:59:20 +00:00
tg e171d0fc11 protect test.sh some from being called by !mksh, as homsn did… 2008-07-14 14:40:47 +00:00
tg a9f219dd60 if MKSH_AFREE_DEBUG is defined, guard against wrong frees 2008-07-13 16:43:55 +00:00
tg 1619fa2538 • Build.sh, check.t: bring back the 'smksh' check category, which was
missing for a while yet its disappearance was unnoticed because…
• distrib/special/mksh/Makefile: sync check categories, this was missed
• mksh.hts: sync clog
2008-07-11 19:51:23 +00:00
tg a36a925ea6 IRIX also does not have any UTF-8 locale at all
confirmed by Elias Pipping, 10x
2008-07-11 18:31:10 +00:00
tg 7c239cd369 no UTF-8 locales on OSF/1 V5.1B, either 2008-07-10 18:55:43 +00:00
tg 7530a147e6 let’s find sizer on OSF/1 if it’s not in the PATH 2008-07-10 18:49:22 +00:00
tg b8980a59c1 gcc -v also accepts a file argument, and 'diet gcc -v' croaks, so… 2008-07-08 21:14:42 +00:00
tg 1f0e071c6d dump the perl $^O string in the logs… all Debian GNU/kFreeBSD developers
I can ping right now “need to refresh their keys on io/asdfasdf” or have
their machines unreachable… and I lost my VM to fsck recently (remember)
2008-07-08 21:05:01 +00:00
tg 077dbf2dd4 fix HP aCC compiler version identification 2008-07-06 23:19:31 +00:00
tg 667f309387 support arc4random.c in build but not src dir, too 2008-06-29 19:46:56 +00:00