Commit Graph

519 Commits

Author SHA1 Message Date
tg df9b1b9b84 choose perl5 over perl, which can be perl 4.0… 2008-03-23 20:21:24 +00:00
tg 444214f5c2 fix Rebuild.sh generation 2008-03-23 20:19:26 +00:00
tg 5f22a5cd7c much improve the Syllable situation – now en par with Plan 9 2008-03-14 21:34:55 +00:00
tg 17ffadce08 attempt version report on msc/interix 2008-03-06 18:12:58 +00:00
tg a9501a7372 more hw info, 10x penpen 2008-03-06 18:02:33 +00:00
tg 34aa8c7a8b make gcc not nōn-silently accept -std=gnu99 if it can’t 2008-03-05 19:59:27 +00:00
tg f0234c03b9 -Wl,+k is no longer needed on HP-sUX with the native linker now that we
check the errorlevel
XXX TODO: Digital Mars
2008-03-05 19:14:19 +00:00
tg 845f6f0d64 • check for flock decl too (weird on OSF/1: if !POSIX and BSD)
• un-experimental Tru64
2008-03-05 18:49:15 +00:00
tg 194972394d yeah, sure… 2008-03-05 18:25:57 +00:00
tg 0e6df4736a • now this builds fine on DEChengst’s Tru64 box:
| OSF1 rubbereendje.dechengst.nl V5.1 2650 alpha
  with the vendor compiler:
  | Compaq C V6.5-011 on HP Tru64 UNIX V5.1B (Rev. 2650)
  | Compiler Driver V6.5-003 (sys) cc Driver
• the platform’s sig_t is incompatible too (simplify check)
• no compile warnings at all
• results in:
  $ size mksh
  | text    data    bss     dec     hex
  | 327680  16384   17808   361872  58590
  $ file mksh
  | mksh:   COFF format alpha dynamically linked, demand paged executable or object module not stripped - version 3.13-14
  $ ldd mksh
  |
  |         Main  =>   mksh
  |         libc.so  =>   /usr/shlib/libc.so
  $ ls -l mksh
  | -rwxr-xr-x   1 mirbsd   users     395200 Mar  5 19:18 mksh
• minor testsuite issues:
  FAIL ./check.t:regression-13
        unexpected stderr - got too much output
        wanted nothing
        got:
                Successful
                cat: output error
  ⇒ probably harmless
• works like a charm!
2008-03-05 18:21:45 +00:00
tg a592c65cf0 somehow magically make it seem to work 2008-03-05 17:52:43 +00:00
tg 7081a38796 Tru64 aka OSF/1 5.1 (10x DEChengst@#UnixNL) is more nice than OSF/1 4.0 2008-03-05 17:30:10 +00:00
tg f25151387d • OSF/1, PW32: speed up mirtoconf test for sig_t (which does not exist)
• OSF/1: need _XOPEN_SOURCE_EXTENDED for mknod(2) decl
2008-03-05 17:12:08 +00:00
tg 3d9bd0e1f0 OSF/1 doesn’t seem to declare revoke(2) anywhere 2008-03-05 17:06:50 +00:00
tg 227a5af8bc try to support
• DEC C on OSF/1 (10x Jupp the IceWM coffee pot maintainer)
• other stuff which doesn’t nuke a.out on failure

XXX this must be tested on *ALL* supported platforms!
2008-03-05 17:00:33 +00:00
tg 2cae6c9ab5 report OE and compiler versions inside the build script now, where methods
to query them are known (missing: bcc/dmc/msc compilers; additional OS info
besides “uname -a” and Darwin’s “hwprefs os_type” – please tell me!)
2008-03-03 19:40:08 +00:00
tg fe612d223b better debugging aid: print versions at several places 2008-03-01 15:07:50 +00:00
tg 8d170a3d01 fix on Interix, where tr(1) is more weird than even Solaris’ XPG4 one…
just do not use ranges, no matter what.
2008-02-29 16:38:41 +00:00
tg d17e25c7f4 fix passing of env var to regression tests 2008-02-29 11:57:30 +00:00
tg 3e870cb1a5 handle slowlaris idiotic /usr/xpg4/bin/tr(1) 2008-02-29 11:48:32 +00:00
tg 6976ed8bc3 get rid of u_char, u_int, u_long 2007-10-25 15:23:10 +00:00
tg 13676f4914 even better: don't require 64-bit types at all
also, improve wording of Build.sh (passive terms)
2007-10-25 14:26:53 +00:00
tg bbbe959bf2 only check for 64-bit integer types if needed (arc4random support) 2007-10-25 14:18:56 +00:00
tg d0fc6b07e0 • the “check headers for declarations” block must be a compile-time check,
not a link-time check (the only one in mirtoconf, and there are, still,
  no run-time checks, thank goddess)
• NEED_ARC4RANDOM is thusly superfluous
2007-10-15 21:09:51 +00:00
tg 0b9f22abe6 • we don’t need -D__Plan9__ at the moment
• finish with “exit 0” for good measure
2007-10-14 13:31:01 +00:00
tg 7dad41efe3 fix warning and simplify one case 2007-10-10 11:42:24 +00:00
tg 6903e79b30 improve integer type detection, as some OSes may lack only some types 2007-10-10 11:32:49 +00:00
tg eab0a407eb implement parallel make (Build.sh -j)
this is for the 16-fold Itanium Ⅱ box with 64 GiB RAM ☻
2007-10-09 14:29:42 +00:00
tg abe075c319 remove the deprecated -DMKSH_DO_MKNOD
instead, use the environment variable
• HAVE_MKNOD=0 ‣ force off
• HAVE_MKNOD=1 ‣ force on
• HAVE_MKNOD=x ‣ force detection (on even if -DMKSH_SMALL)
2007-10-09 14:21:54 +00:00
tg 491a420607 initial support pcc (somewhat) 2007-09-21 10:46:56 +00:00
tg e6ceaf921b mksh R31c 2007-09-11 18:38:29 +00:00
tg 12e371f1af • scanning for integer types: only scan for these we need,
i.e. uint32_t and uint64_t
• faking <stdint.h>: u_int32_t is not part of ISO C99, so
  do not add it there
• add a test if u_int32_t is declared, for the sake of the
  fucked up OpenBSD standard arc4random(3) declaration, and
  define it to uint32_t if the former type is not available,
  e.g. on Solaris or if we fake <stdint.h>
• fix detection of arc4random_pushb(3) and the prototypes
  if one of the things above applied to our system
• fix detection of arc4random function suite prototypes if
  they are added via an arc4random.c file in the srcdir, and
  copy that file into builddir (if it does not already exist)
  to keep these isolated from each other

based on a real-life bug report by cnuke@ at the Croatian restaurant ☺☻
unbreaks “set ±o arc4random” on Solaris, both SUNpro and GCC
2007-09-11 18:12:16 +00:00
tg 699b908b9d do not use “test … -o …” 2007-09-11 17:49:57 +00:00
tg 88bfbeb0f0 make "test $x = 1" into "test 1 = $x" consistently 2007-09-11 17:47:25 +00:00
tg 0904ad7d89 extend the scope of tests run with -Werror for gcc
otherwise, gcc4 on non-propolice-capable targets doesn’t find __attribute__
2007-09-10 20:16:47 +00:00
tg 49c7194ffa • plug in some Digital Taugtnix support, with help from the IceWM coffee pot
maintainer, or, From: Josef 'Jupp' Schugt <schugt@cip.physik.uni-bonn.de>
• www: sync changelog
2007-09-09 19:24:58 +00:00
tg 1b7294b564 more cosmetics 2007-09-09 18:31:41 +00:00
tg 9e7a50327f cosmetics - fix missing variable name 2007-09-09 18:30:04 +00:00
tg cdac7b7d65 clean up our own junk 2007-09-09 18:21:52 +00:00
tg fe65f616e4 some have u_int but not uint32_t 2007-09-09 12:02:38 +00:00
tg 6f30f395bf -std=foo can’t be made fatal even with -Werror, live with it 2007-09-09 11:55:44 +00:00
tg b06d40f8f2 autoscan for uint32_t et al. if <stdint.h> not present
this un-special-cases PW32 and should help OSF/1
2007-09-09 11:04:30 +00:00
tg a1afc4e0a7 gcc 2.8.1 (on Digital Taugtnix a.k.a. alpha-dec-osf4.0d) makes -std=foo
failures a warning only
2007-09-09 10:49:20 +00:00
tg 6c47b381c2 testing with the Heirloom sh found this… d’oh 2007-09-07 21:58:40 +00:00
tg 499327f7b8 add “set -o arc4random”, RTFM for details 2007-08-12 13:42:23 +00:00
tg 496b8f4dc3 • new way of checking for mknod & friends, due to tcc vs glibc weirdness
• bump vsn for the code restructuring
2007-07-31 11:11:25 +00:00
tg 809c1446b2 some steps towards building with tcc 2007-07-31 10:42:15 +00:00
tg 9884efef00 • implement some (not yet tested) kludges for tcc
• define $CPP internally
2007-07-31 10:17:52 +00:00
tg 735ec12dfd • TenDRA (testsuite pass)
• Fabrice Bellard’s tcc (not supported yet, may follow later)

reminded by tarzeau (Gürkan Sengün)
2007-07-31 10:04:46 +00:00
tg 3e5b234965 these are actually cool people, I think 2007-07-26 22:38:31 +00:00
tg 7374f12176 some more not-so working platforms
can't extend the working ones better since my UWIN decided to break
after MSVC++ Expreß seems to have “upgraded” some libraries… *sigh*
2007-07-24 21:54:46 +00:00
tg b20e5a90ce initial support for PW32, not quite working yet (same issues as Minix 3 and Plan 9, I think) 2007-07-24 21:47:14 +00:00
tg 748d09122a de-experimental AIX 2007-07-22 13:47:10 +00:00
tg a1433b7122 • Build.sh: always prepend well-known signal names, so that some signals
will not come up weirdly (e.g. on AIX: SIGSAK (SIGMAX?), SIGIO (SIGAIO?),
  SIGURG (SIGIOINT?)), and add a few more while here
• check.t, sh.h: bump
2007-07-22 13:46:15 +00:00
tg 979406bba7 • support IBM xlC on AIX
• fix all bugs it could find ☺
2007-07-22 13:34:52 +00:00
tg 211ecedf4e • move __GNUC__ test quite to the bottom, since I fear other compilers,
such as icc, define it too
• provide a Rebuild.sh skipping the mirtoconf checks – devel only!
2007-07-22 13:08:54 +00:00
tg 29d4125e3c switch $CC default from gcc to cc, as we support most native compilers now,
and – with Daniel's words – das ist doch kein Rumgeleenockse hier!
2007-07-17 19:41:26 +00:00
tg 823f5c2a17 hopefully fix large file stuff for real 2007-07-09 11:19:55 +00:00
tg 888740cf66 fix what happens after we check for -D_FILE_OFFSET_BITS=64 – actually
use it. discovered in debian 29.6-2 by hondza via IRC, thanks a lot!
2007-07-04 14:53:19 +00:00
tg 77e27b9656 fix temp files not being cleaned up correctly 2007-07-01 21:59:10 +00:00
tg 3ef434d378 fix NOWARN stuff 2007-07-01 21:52:20 +00:00
tg f948c13a78 • fix display problem
• add <libutil.h> if it exists – revoke(2) on UWIN
• add <stdlib.h> for NULL in test of mmap(2)
• regen CPPFLAGS for MirBSD native builds
2007-07-01 21:47:08 +00:00
tg 7004525fcc • add support for the Borland C++ Builder (on UWIN)
• add support for the Digital Mars compiler (on UWIN)
• clean up
• describe new build targets and that UWIN sucks
• bump vsn
2007-07-01 21:27:03 +00:00
tg 320b95ea4f • ugh, CR-LF line endings
• reduce number of temp files used
2007-07-01 19:24:11 +00:00
tg 36188c60be coerce this into running on UWIN - or rather sort of. Ugly. 2007-07-01 19:04:53 +00:00
tg af1aa9655f MSC improvements 2007-07-01 18:00:18 +00:00
tg 2f734698d3 • mirtoconf if MS C security checks work (with our C library)
• simplify "-Wc," ./. "-X " ./. "-Yc," separation
2007-07-01 17:22:07 +00:00
tg 74c0adf312 mirtoconf for mmap(2), UWIN doesn't have it 2007-07-01 17:19:15 +00:00
tg f84505395a some vendors' cc(1) doesn't support -E from stdin like cpp(1) 2007-07-01 16:57:00 +00:00
tg 69f7683156 • enable UWIN as operating environment
• cover for differences in UWIN's and Interix' cc(1) wrapper
• AT&T tr(1) is defective, just skip + and - chars
2007-07-01 16:47:05 +00:00
tg cf6137238c • fix AIX variant of large files
• use DOWARN semantically correct
• support the Microsoft® C Compiler
• on Interix, disable msc's security checks, as it relies on
  library functions not provided by Interix' libc (XXX mirtoconf this)
2007-07-01 15:45:58 +00:00
tg cf29aa83c5 oops (quoting) 2007-06-30 22:02:50 +00:00
tg b97fd7f401 optimise, fix quoting, modularise even more 2007-06-30 21:34:23 +00:00
tg 126eb43ab3 improve wording and remove a dead check 2007-06-30 21:01:42 +00:00
tg 1336e9f1bb modularise, optimise, upgrade coding style(9), display nicer 2007-06-30 20:57:55 +00:00
tg 0cc45784ca nuke $tcbo (unused) 2007-06-30 20:04:23 +00:00
tg 360c956b10 make HAVE_CPP_DD a 0/1/undef mirtoconf value like the others
XXX maybe generalise the logic from there and ac_testn
XXX offer the user to give list of known signal names (and NSIG? or ignore?)
2007-06-30 19:58:51 +00:00
tg af5c570143 • bugfix – "printf %d '(1)'" is a syntax error too, enhance character class
• speed up – I don't worry about embedded control characters in the source,
  as jupp(1) handles these just fine [http://mirbsd.de/jupp]
2007-06-30 19:48:04 +00:00
tg 265e82757f kludge for intel's c(rap) compiler 2007-06-23 20:51:21 +00:00
tg 4fef868b6d solve the ugly warnings, be more consistent, allow __attribute__ to depend
on compiler option features, etc.
2007-06-21 16:11:37 +00:00
tg f738b28b3b this solves
| HP-UX td193 B.11.31 U ia64 2909796781 unlimited-user license
| cc: HP C/aC++ B3910B A.06.14 [Feb 22 2007]
| ld: 92453-07 linker ld HP Itanium(R) B.12.43  IPF/IPF
| Total failed: 1 (as expected)
| Total passed: 220
except for an ugly warning
2007-06-21 15:53:14 +00:00
tg bf503a1fa0 make this build with
| cpp.ansi: HP92453-01 B.11.31.01 HP C Preprocessor (ANSI)
| ccom: HP92453-01 B.11.X.36086-36089-36092.GP HP C Compiler
| /usr/ccs/bin/ld: 92453-07 linker linker ld B.11.60 070209
on
| mirbsd@td191:~/mksh $ uname -a
| HP-UX td191 B.11.31 U 9000/800 3397116299 unlimited-user license
resulting in
| Total failed: 1 (as expected)
| Total passed: 220

so I suppose it's no longer experimental on HP-UX… it also works on/with
| HP-UX td192 B.11.11 U 9000/800 1839940656 unlimited-user license
| gcc version 3.4.2
| Can't locate POSIX.pm in @INC…
and
| HP-UX td192 B.11.11 U 9000/800 1839940656 unlimited-user license
| cpp.ansi: HP92453-01 B.11.X.35175-35176.GP HP C Preprocessor (ANSI)
| ccom: HP92453-01 B.11.X.36086-36089-36092.GP HP C Compiler
| /usr/ccs/bin/ld: 92453-07 linker linker ld B.11.60 070209
and
| HP-UX td176 B.11.23 U ia64 1928826293 unlimited-user license
| Reading specs from /usr/local/lib/gcc/ia64-hp-hpux11.23/3.4.3/specs
| Total failed: 1 (as expected)
| Total passed: 219

still work to do for HP C on IA64
2007-06-21 15:43:33 +00:00
tg 17b7a28ac8 • check.t: add some FPOSIX regression tests (1 still fails)
• all: remove vi editing mode #if defined(MKSH_SMALL) || defined(MKSH_NOVI)
  saves 12608 byts on i386
• check.t: add $0 quoting
2007-06-15 21:55:20 +00:00
tg f9b33dffea from my change in debian mksh-29.6-2: if arc4random exists, use it 2007-06-10 17:06:07 +00:00
tg eb47c62e8d fix -xO2 to environment addition, discovered by cnuke@ 2007-06-09 22:06:55 +00:00
tg bf671f42fa don't use __extension__, cought by sunpro on linux 2007-06-09 22:01:42 +00:00
tg ffd63798f3 ugh… (no comment) 2007-06-06 23:25:28 +00:00
tg dd4b823c07 oops 2007-06-06 22:03:24 +00:00
tg 799a89e9cf remove support for $CPP, just use $CC -E (-) instead consistently 2007-06-06 21:59:38 +00:00
tg 7c76e5752d part 1 of the icc support diff (experimental, untested)
icc sucks…
2007-06-06 21:56:12 +00:00
tg 5dfde5c670 first part of the Intel C Compiler (Linux) shaddap
| tglaser@hephaistos:~ $ /usr/local/intel/cc/9.1.042/bin/icc -V
| Intel(R) C Compiler for 32-bit applications, Version 9.1    Build 20060706Z Package ID: l_cc_c_9.1.042
this one is muuuuch too verbose IMHO, _and_ it #defines __GNUC__ (eek)
2007-06-06 21:36:29 +00:00
tg e74e6fae7e even if Solaris 10 still doesn't have the mdoc libraries, don't make it
impossible to, e.g. by setenv NROFF, create catman pages on it
2007-06-05 23:10:51 +00:00
tg 91431e4cf6 with this, we don't need the special list of pre-known signal names
any more either, and can make use of code sharing between detection
of sys_siglist and sys_signame (and the underscored variants); nuke
the now-useless signames.c file too (merge struct into histrap.c)
2007-06-05 21:47:49 +00:00
tg 5835e7d3aa HAVE_PERSISTENT_HISTORY is req'd in CPPFLAGS, oops 2007-06-05 21:17:05 +00:00
tg ae4a7272e7 even without cpp -dD scan for a number of common signal names
enables “kill -TERM 1” on solaris with the SUNpro 5.8 compiler
2007-06-05 21:10:52 +00:00
tg 7e4a39b11c ignore any whitespace between preprocessor output tokens 2007-06-05 20:57:46 +00:00
tg dbdda6f14e sort the signals list; this has the effect to, on Solaris, prefer
SIGABRT to SIGIOT (good), SIGCHLD to SIGCLD (necessary and reason),
SIGIO to SIGPOLL (the former also exists on mirbsd so okay); changes
on other OSes should be monitored by porters
2007-06-05 20:18:54 +00:00
tg 7c2efd083e shortcut 2007-06-05 20:01:26 +00:00
tg 63c31c43e3 fix for the SUNpro 8 on yofuh's E420:
cc: Sun C 5.8 Patch 121015-04 2007/01/10
2007-06-05 19:48:47 +00:00
tg 487eff541d ugh, echo -n is NOT portable… 2007-06-05 19:39:20 +00:00
tg 6e1bfd6e4b When compiling native MirOS BSD binaries with SUNpro 12 (don't look like a
car only slower, yes this is possible, and the resulting binary passes the
testsuite just fine), the definition of __RCSID() in <sys/cdefs.h> expands
to something with __attribute__((used)), which triggers a warning, because
__attribute__ in general is supported but the used attribute isn't. Thusly
always use our own strings and get rid of the MULTI_RCSID test (introduced
because __RCSID() on Darwin is inferiour).

Maybe we should fix <sys/cdefs.h> too? #ifdef __SUNPRO_C helps here.
2007-06-04 21:27:53 +00:00
tg 0926a6d182 remove the .o files too 2007-06-04 21:15:27 +00:00
tg 33038853cb glibc headers with SUNpro make this test pass incorrectly 2007-06-04 20:26:47 +00:00
tg 76f015e2ab use our includes first 2007-06-04 20:22:08 +00:00
tg 11312995b4 do not compile all files at once any more; collect .o files in $curdir rather 2007-06-04 20:14:34 +00:00
tg f104e7c9f9 work around “a fucking bug in the fuckin' optimiser” (hi Александр) 2007-06-04 20:00:50 +00:00
tg c55dcc364b we don't need to check for -fno-tree-vrp any longer either 2007-06-03 17:29:29 +00:00
tg ffa0764e19 first stage of adaption to SUNpro CC (Sun Studio 12, to be released on next
Monday, running under Linuxulator) ☻
2007-05-31 21:25:25 +00:00
tg 60893dd663 by packager request from gecko2, add option -Q which makes the
post-build a little bit more quiet
2007-05-28 13:47:09 +00:00
tg 2beb60ebf3 for R30, don't check for confstr() declaration any more
it was #if solaris'd in R28, and the system I have access
on does declare it now (still Solaris 8)

this can be put back if anyone complains, of course.
2007-05-24 23:07:19 +00:00
tg 49760de778 fix detection of f̲u̲n̲c̲t̲i̲o̲n̲ prototypes which, in contrast to d̲a̲t̲a̲ prototypes,
don't give an error if they're missing
2007-05-24 09:22:58 +00:00
tg 5f61b50a90 we only require strcasestr if setlocale() is used at the moment 2007-05-02 20:02:07 +00:00
tg 9e708d91b8 mksh R30 will no longer build a statically linked shell by default;
does not try, nor provide any means; user has to use LDFLAGS instead.
2007-04-30 19:50:09 +00:00
tg 8ca51f5ff3 retain Build.sh path for test.sh (e.g. if /bin/ed != /usr/xpg4/bin/ed – on
Solaris some tools are weird, I recommend to prefix /usr/xpg4/bin to $PATH
even for dot.mkshrc because /usr/bin/id sucks, /usr/xpg4/bin/id works…)
2007-04-30 19:18:37 +00:00
tg 8d1ede2697 do not “-fwhole-program --combine” since it at least breaks FORTIFY_SOURCE
on SuSE and causes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=408850
so I'll assume it's a gcc bug

thanks to Pascal “loki” Bleser (yaloki), darix, Martin Zobel-Helas, Steve
Langasek (vorlon) for tracking this bug down in two different instances
2007-04-30 19:12:18 +00:00
tg 7a775ab0cf some wording and #if 0 cleanup 2007-04-24 10:44:58 +00:00
tg 1a0b51b697 • arc4random, arc4random_push: use our own protos to check
XXX u_int32_t is not ISO C99, but seems to work well enough
  XXX if it fails anywhere, we'll see in the build logs
  XXX apple doesn't have the standard uint32_t and API doesn't specify it
• sys_siglist_defn: rename to sys_siglist_decl as we're really checking
  for the declaration in the headers; change wording to “check if … does
  not need to be declared” since we don't need to declare if we don't use
• scan for arc4random, arc4random_push, confstr declarations too
• sh.h: confstr declaration is no longer #ifdef __sun__; sort
2007-04-24 10:42:02 +00:00
tg 2cf5695f69 • mention HP-UX, AIX success
• mention Darwin failure in R29c, fix in -current
• also clean up core dump file
• on HP-UX 11i v2, <stdint.h> requires <stdarg.h> because it pulls in
  a <wchar.h> generated from gcc's fixincludes… dunno, but it works…
• HP-UX 11i v2 on ia64 only works with -mlp64; the default seems to be
  -milp32 which generates SIGBUS due to misalignment (due to optimisation?)

-> in theory, HP-UX works on both PA-RISC and IA64 in R29c
-> R29c doesn't contain support for AIX or Mac OSX though…
2007-04-23 22:33:20 +00:00
tg c3d8ca7f82 fix multi-rcsid test broken in 100462D18E37B6B8D16 2007-04-23 21:36:02 +00:00
tg eb6e4d4bbb fix case matching 2007-04-23 21:31:58 +00:00
tg 03488df380 clean up used files better 2007-04-23 21:15:44 +00:00
tg c4826b28b8 possibly fix the last issue on AIX: NSIG is (63 +1) 2007-04-23 20:57:50 +00:00
tg 615a7794a6 AIX has sys_siglist[] but doesn't define it anywhere, so add a means to
scan for defns and use it here; bug reported by Kurt Telep
2007-04-23 20:37:16 +00:00
tg 24f650213a according to Kurt Telep, AIX _does_ require -lcrypt, and, when using
it, apps are expected to export certain symbols; thanks for the help
2007-04-23 20:17:58 +00:00
tg d38897a75d when we're starting to talk sensible default values, begin here:
if $LIBS is empty (i.e. not " " or so), use "-lcrypt" on Interix

AIX seems to require some too…
2007-04-23 14:06:47 +00:00
tg ec4dea6cfa $ uname -a; (gcc -v) 2>&1 | tail -1; echo $KSH_VERSION
HP-UX td192 B.11.11 U 9000/800 1839940656 unlimited-user license
gcc version 3.4.2
@(#)MIRBSD KSH R29 2007/04/17

it apparently works, but there's no POSIX.pm, and the backspace
key acts as abort key (probably all things that can be fixed)
2007-04-23 12:13:03 +00:00
tg 4c9511e7a4 • strlcpy.c: remove superfluous rcs ids in comments
• Build.sh: NetBSD® gives an ignorable link-time warning in mirtoconf
• Build.sh: GNU (HURD) and GNU/kFreeBSD are no longer experimental, I think
2007-04-23 11:33:26 +00:00
tg 67addd064f support crazy ones that still haven't gotten rid of zsh 2007-04-01 01:48:31 +00:00
tg e867a4c669 mirtoconf for large file support vars, requested by bsiegert@ 2007-03-19 22:58:19 +00:00
tg b08848c7ff • improve description why we use -fno-tree-vrp; this is thanks
to http://blog.fefe.de/?ts=bb2654d4 by the way
• simplify a.out / a.exe distinguishation
2007-03-10 19:19:12 +00:00
tg 219bc99362 check for -fno-tree-vrp (existence and if it is required to würg around a gcc 4.1.1 bug) 2007-03-10 18:51:59 +00:00
tg 95eaf0c9bb try to add -fstack-protector-all – it's in gcc 4.1+, so why not… 2007-03-10 17:29:53 +00:00
tg e0e432347b Minix 3 has no S_ISSOCK (probably not even UNIX® domain sockets)
and lacks other things (rlimit stuff), so it won't make it today
2007-03-04 05:14:10 +00:00
tg 95632ee53b better tr, better descr 2007-03-04 05:03:57 +00:00
tg 2e11e89d8b • _NSIG seems to be more standard than NSIG (non-POSIX)
• allow off-by-one (sigmax eq NSIG not NSIG-1)
2007-03-04 04:53:06 +00:00
tg 67ff737230 some tr(1) are more weird than others 2007-03-04 04:52:28 +00:00
tg 2cbd686fc4 cppflags for Minix 3 2007-03-04 04:45:36 +00:00
tg 0a20bb8dd4 • Minix 3 doesn't have <sys/mman.h>
• Some OSes might need <stdint.h> for int32_t (Minix 3 with GCC)
2007-03-04 04:36:45 +00:00
tg 0f291e9ff5 Support old versions of ash 2007-03-04 04:28:58 +00:00
tg 3844d3629e fix a warning 2007-03-04 03:48:50 +00:00
tg 83c2ee87f4 • remove strcasestr.c, use home-grown implementation¹, call it stricmp,
and have it return an API-correct const char *
• enhance and stylify comments
• a little KNF and simplifications
• #ifdef DEBUG: replace strchr and strstr with ucstrchr and ucstrstr
  that take and return a non-const char *, and fix the violations
• new cstrchr, cstrstr (take and give const char *)
• new vstrchr, vstrstr (take const or not, give boolean value)
• new afreechk(x) = afreechv(x,x) = if (x1) afree(x2, ATEMP)
• new ksh_isdash(str) = (str != NULL) && !strcmp(str, "-")
• replace the only use of strrchr with inlined code to shrink
• minor man page fixes
• Minix 3 signames are autogenerated with gcc
• rename strlfun.c to strlcpy.c since we don't do strlcat(3) anyway,
  only strlcpy(3), and shorten it
• dot.mkshrc: move MKSH=… down to the export line
  to not disturb the PS1 visual impression ☺
• dot.mkshrc: Lstripcom(): optimise
• bump version

¹) side effect from creating API-correct cstrchr, cstrstr, etc.
   uses goto so it must be better ☻

tested on mirbsd-current via both Makefile and Build.sh
2007-03-04 03:04:28 +00:00
tg e31b852abc mirtoconf the checks if to use persistent history support 2007-03-03 21:36:08 +00:00
tg 6485b06eed * From the Solaris tr(1) manual page:
o  Each input character found in the array  specified  by
           string1 is replaced by the character in the same rela-
           tive position in the array specified by string2.  When
           the array specified by string2 is shorter that the one
           specified by string1, the results are unspecified.
  So give tr <everythingbutalphanum> _ the appropriate number of underscores.
* Also strip dashes from header names.
2007-02-27 00:31:17 +00:00
tg e9d1b0fb7b /usr/ucb/tr chokes to freeze state on tr -d -c 2007-02-27 00:23:20 +00:00
tg e0e4c992fc • embed MKSH_ASSUME_UTF8 and MKSH_NEED_MKNOD in Build.sh
• have mksh with BSD makefiles always enable MKSH_ASSUME_UTF8
• sync BSD makefiles with Build.sh output
2007-02-18 16:24:13 +00:00
tg ebaf8ed5b5 add CPPFLAGS for The HURD 2007-02-13 12:26:46 +00:00
tg 83b2f7d316 * _POSIX_C_SOURCE=2 is redundant and _BSD_SOURCE makes ancient BSD have
precedence over POSIX/SUSv3 stuff and requires libbsd-compat which is
  something we don't desire; _GNU_SOURCE even in Linux libc5 always has
  included _POSIX_C_SOURCE=2 and BSD functions since at least Feb 1995.
* sync GNU/kFreeBSD with GNU/Linux, it uses glibc2

First mentioned and second response on inquiry by Bastian "waldi" Blank
Thanks!
2007-02-02 10:27:21 +00:00
tg 890da93291 * GNU/kFreeBSD: seems to work, except for missing defns of
strcasestr, setres[ug]id - probably needs same cflags as linux
* Linux: default HAVE_REVOKE to 0 since it's unimplemented anyway
2007-01-28 20:05:29 +00:00
tg d62686fdf8 don't scan for revoke() if mksh_small since use_chvt isn't used then 2007-01-26 18:25:01 +00:00
tg dec386d3f5 fix test for flock() on Debian 4.0 2007-01-18 20:40:39 +00:00
tg 9a442d732e oops, persistent history also depends on MKSH_FULL 2007-01-18 16:06:22 +00:00
tg 6d157ffe47 autoscan for persistent history support 2007-01-18 16:05:05 +00:00
tg 7b903e4aa9 header overhaul: replace all #ifdef __OS__ with mirtoconf checks
(except the persistent history one)
2007-01-18 15:50:32 +00:00
tg 44af708ac8 remove a line which shows the other possible values of $s
separate commit for educational & hysteric purposes
2007-01-18 03:31:50 +00:00
tg 1ea10f62cd more ldstatic fuckup, late night reverse logic errors 2007-01-18 03:31:24 +00:00
tg ef81fd0b75 simplify this LDSTATIC shit and fix -nd in the process *sigh*
found on ecce!GNU/Linux 1.0, all tests pass, mksh-current
is exactly half the size of bash 2.01.1(1)r, both dynamic
2007-01-18 02:54:19 +00:00
tg 21bceac32e autoscan for the correct ed(1) type
XXX amend check_categories with stuff like persist history, etc.
2007-01-18 01:10:55 +00:00
tg 9e0001d315 pasto, and add more comments 2007-01-18 00:16:26 +00:00
tg 65a86d2f67 bring back sig_t as void pointer in the rare case we
don't have sighandler_t or __sighandler_t either
2007-01-18 00:10:16 +00:00
tg ecc6beb7d5 scan for sig_t (and friends) 2007-01-17 23:54:39 +00:00
tg 2099f1765d prevent confusion 2007-01-17 23:50:26 +00:00
tg bca0f4d603 * Build.sh, histrap.c: prevent testing of strsignal() if we have sys_siglist[]
* mksh.1: .Nm is never used with "" as argument, fixes GNU groff 1.15
2007-01-17 23:47:15 +00:00
tg 65a2806e81 scan for revoke() 2007-01-17 23:27:47 +00:00
tg af606537e2 if we don't have rlim_t, assume it's long 2007-01-17 23:18:55 +00:00
tg c3de1d7564 <sys/sysmacros.h> contains major/minor/makedev on Linux 2.0 2007-01-17 23:04:19 +00:00
tg 4c82f74d2b new option -nd to force static linking of mksh but not mirtoconf tests 2007-01-17 22:59:25 +00:00
tg da2f916010 remove -x (cross-build) option, use -d instead, it does the same
side effect: TARGET_OS is now honoured without -x too
2007-01-17 22:55:47 +00:00
tg ddd2dac47d * support old environments without libgen.h (ancient GNU/Linux)
and stdbool.h (ancient GNU/Linux; NetBSD® 1.6.1)
* __dead must come after, not before, to accomodate gcc 2.7.2.3
2007-01-17 22:51:47 +00:00
tg 8fea7398d3 we need "$CC -E -" as cpp, not "$CC -E"
found on
Linux ecce 2.0.38 #1 Wed Jul 26 22:05:46 2000 i686 unknown
Reading specs from /usr/lib/gcc-lib/i386-linux/2.7.2.3/specs
gcc version 2.7.2.3

Note: during the entire compile, there are warnings like
| gcc: unrecognized option `-std=gnu99'
but these won't trigger -Werror since they are in the driver,
not in the front-end, so they are harmless, I guess. (I don't
know of a way to make them vanish, either.)
2007-01-17 22:35:09 +00:00
tg ceb5a7dba0 check if __RCSID() can be used multiple times; req'd eg. on Mac 2007-01-17 21:42:23 +00:00
tg 42783fdfd9 only call nroff to see if it's gnroff if -r is not given 2007-01-17 17:57:31 +00:00
tg f077c0ab5a list all "known good" OSes in the $TARGET_OS switch,
echo a warning (but continue) for unknown OSes, with
the desire the porter should send in diffs
2007-01-17 17:46:18 +00:00
tg 8620379fcc * add #ifdef MKSH_NOPWNAM to prevent pulling in getpwnam()
* document possible "functionality omission defines" in Build.sh
* sort and sectionise mirtoconf checks; add big comments
2007-01-17 17:42:22 +00:00
tg c231ab8cc4 * order tests: we want to use correct NOWARN as much as possible
* "$e" and "echo" fixes for if the stuff begins with a -, and
  quoting cleanup (where feasible, feel free to send diffs)
* cosmetics

I hereby name this baby "Mirtoconf".
2007-01-17 17:31:59 +00:00
tg f946d405f8 if both "$CPP" (from parent) and "$CC -E" fail, try "cpp" (from $PATH) and
"/usr/libexec/cpp" and "/lib/cpp" last
2007-01-17 17:14:25 +00:00
tg 8211416e5a make a loop (removes dup code) 2007-01-17 17:12:43 +00:00
tg 478374ba3b autoscan for c præprocessor now prefers $CPP to "$CC -E" 2007-01-17 17:08:34 +00:00
tg da03ad5be2 autoconf for -O2 (if CFLAGS is _empty_), -Wall, -fwrapv, -fno-strict-aliasing
XXX untested
2007-01-17 17:03:59 +00:00
tg d4b4ca5e92 simplify 2007-01-17 16:57:41 +00:00
tg e19a99efaf more creative use of ac_flags() 2007-01-17 16:52:00 +00:00
tg f6dbde5115 thinko 2007-01-17 16:44:19 +00:00
tg bcb0852dcc new shell function for autoconfing compiler flags, reduces redundancy 2007-01-17 16:39:55 +00:00
tg 69584be3bb add two TODOs 2007-01-17 01:59:38 +00:00
tg 263f518dfd * Build.sh: add -fwrapv to standard CFLAGS, just to be on the safe
side (I don't have capacities to scan 71711 files in MirOS for a
  standards-compliance whack)
* copyright: mention CVS changelogs as place of contributors' name
  and credit information, too
* check.t, sh.h: bump
2007-01-17 01:24:29 +00:00
tg a00fbd3eb7 autoconf for -std=gnu99 (not c99 because of brokenness in the field)
from ankon -> solaris 10 with gcc 3.4.6 from sunfreeware
2007-01-14 21:38:25 +00:00
tg 03e8f0ec83 CPP is honoured now as well (but only needed for the siglist) 2007-01-12 03:30:40 +00:00
tg 9c888e103a oops… really unbreak -d 2007-01-12 03:20:07 +00:00
tg 22538dcf0d unbreak -d 2007-01-12 03:17:08 +00:00
tg e9d944e825 user should be able to override if he wants setlocale calls in his
extra small mksh…
2007-01-12 02:46:27 +00:00
tg ca7a9c3eb0 ] scn.c:1: warning: ISO C forbids an empty source file
yeaaah, we #error out anyway, but…
2007-01-12 02:40:18 +00:00
tg e768017c58 gcc 4.1.2 pedantic warning free configure 2007-01-12 02:37:32 +00:00
tg 2c46d96042 * instead of setting LDSTATIC='' for OSes which did not support it
until now, set it to '@'
* if LDSTATIC is '@' make it '-static' if MKSH_SMALL, '' otherwise

Yep, this might break, e.g. Darwin or Cygwin. But let's test that.
2007-01-12 02:34:46 +00:00
tg 21e2397c1b disallow the user to specify (overload) SRCS, if there is special
target platform specific crap, it belongs into LIBS instead
2007-01-12 02:27:40 +00:00
tg 6e5437f86b interesting way to break things… oeps ☺ 2007-01-12 02:12:16 +00:00
tg 552aebd24f more verbose 2007-01-12 02:09:10 +00:00
tg 80393db1b6 fix configuration on solaris 8 with whitespaces in both curdir and
srcdir, mostly due to 'eval' issues and a picky /bin/sh (yeaaah…)
2007-01-12 02:01:48 +00:00
tg 5891915f1b * Scan for __attribute__((...)) in general (the earliest was 2.5,
where we had 'noreturn' etc. but no '__noreturn__')
* Scan for __attribute__((bounded)) and __attribute__((used))
  if we have __attribute__((noreturn))
* To be able to scan if certain attributes give warnings,
  scan for -Werror with a simple programme which hopefully triggers none
* Convert __attribute__((unused)) to __unused, noreturn -> __dead
* Unify other attributes
* Clean up typography a little more
2007-01-12 01:49:29 +00:00
tg 70eb6d19c2 solaris /bin/sh:
| v() { ... }
| v=1
undefines v()
2007-01-12 01:44:32 +00:00
tg 636ef70a24 underline actual autoconf results (test names are in bold)
FWIW, works ATM, even with spaces in directory name
2007-01-12 01:32:27 +00:00
tg 6fb4af0a9d * typo
* include path
2007-01-12 01:27:28 +00:00
tg 5309e33974 implement colouring of "autoconf" output. yay!
NB: only if stdout isatty
2007-01-12 01:17:10 +00:00
tg 2f15a11c55 Clean up the signal mess, saves 172 Bytes:
* 'sigseen' in Build.sh goes away
* Signal name existence is checked in this order:
  have our own¹ -> sys_signame[] -> _sys_signame[] -> build our own²
* Signal description existence is checked in this order:
  sys_siglist[] -> _sys_siglist[] -> strsignal() -> NULL³
¹ Predefined list of items, for operating systems where we
  cannot build² them, i.e. Plan 9 and Minix 3 (e.g. no $CPP -dD)
² The usual cpp(1) stuff
³ Changed later, see below
* Make $CPP test dependent on $NEED_MKSH_SIGNAME (others can
  be added here, this is not absolute)
* Make signal name list generation² dependent on $NEED_MKSH_SIGNAME
* Fix check if the generation worked
* Guarantee that sigtraps[*].name and sigtraps[*].mess are valid
  C strings; this makes the code shorter *and* removes a few pos-
  sible nil pointer dereferences
* Embed autoconf'd usages of sys_sig* / strsignal / mksh_sigpairs
  into inittraps()
* Check for each signal 0<=i<=NSIG that
  name is not NULL or "" -> replace with ("%d", i)
  mess is not NULL or "" -> replace with ("Signal %d", i)
  name does not start (case-insensitive) with "SIG" -> name += 3
* In gettrap(), fix check if signal name starts, case-sensitive
  or case-insensitive, depending on need, with "SIG" (bug from millert@)

Other changes:
* Build.sh: ac_test[n]() are documented
* Build.sh: ac_test[n]() can have negative prereqs as well now
* Build.sh: use <<-'EOF' consistently
* bump patchlevel to today
2007-01-12 00:25:40 +00:00
tg 3b63b986c3 * pasto (patcho?)
* improve output readability

I wonder if I should use ANSI escapes to make the results
from the configuration bold… but then, this'd look worse
in e.g. mc or less. Suggestions?
2007-01-11 03:03:34 +00:00
tg 3b6b37c671 make use of the new $CPP variable (and enable the cpp check if needed)
@Benny:	this is why I don't use GNU autoconf: writing configure.in
	files is, supposedly, easy - but nobody teaches you which
	changes you have to apply to your source files. Here I know.
2007-01-11 02:41:53 +00:00
tg 4d2624fd1d add test how to run the C preprocessor and fix the $NOWARN check and docs 2007-01-11 02:37:40 +00:00
tg 546e97621a small mkshs also shouldn't pull in the entire locale package,
so don't even call setlocale, lest alone nl_langinfo (already
disabled before)
2007-01-11 02:11:46 +00:00
tg e269c4ed29 if building a small mksh, don't check for persistent history,
since it's not supported anyway; makes regression tests pass there
2007-01-11 02:08:50 +00:00
tg f3168d3e9d introduce TARGET_OS, for crossbuilds, contains uname -s output 2007-01-11 00:57:56 +00:00
tg 8bfc693178 this double-backtick in double-backtick (SunOS /bin/sh) stuff
looked waay too weird to me, use a temporary variable instead
and make the two occurencies of the code look more alike
2007-01-11 00:47:40 +00:00
tg 8dc1a064fa use the same matching for NSIG as for the others - cut off
everything which doesn't look like a dec/hex/oct number
2007-01-11 00:44:08 +00:00
tg c822cbedd8 oops, match hex numbers; seen while looking at ankon's (FreeBSD) problem 2007-01-11 00:38:37 +00:00
tg a080fc385d add a TODO here 2006-12-11 19:58:37 +00:00
tg 2122e253e7 fix bitching of: gcc version 3.3.5 (Debian 1:3.3.5-13) 2006-11-21 21:45:24 +00:00
tg fa7407a37c __CRAZY=Yes clean autoconf functions 2006-11-12 13:49:22 +00:00
tg 06b5723f83 oops, wrong protos 2006-11-12 13:38:40 +00:00
tg f7ef916ed9 * fix CR-LF accident
* fix gcc4 warnings in autoconf tests
* Debian needs <grp.h> for setgroups, which seems fairly POSIX

Testsuite succeeds on Debian testing/unstable (i386)
2006-11-12 13:35:29 +00:00
tg 2c1ffced08 unbelievably, cygwin doesn't have strcasestr(3) 2006-11-12 13:15:27 +00:00
tg 5267e51098 header checks before function checks 2006-11-12 13:09:09 +00:00
tg c20d203346 check for getmode as well when checking for setmode;
disable this check on winapi systems since their setmode is something else
2006-11-12 13:08:30 +00:00
tg a799f50fea scan for setresuid/setresgid and setgroups
no alternative implementation yet
2006-11-12 12:56:10 +00:00
tg feb7dddd44 * use only macros for ctype stuff any more
XXX one of these uses a gcc extension, ok for now tho
* don't include <ctype.h> any more at all
* don't try nl_langinfo in small mode, just check locale

saves 171 .text, 4 .data, 256 .bss, 1 import
2006-11-10 07:18:58 +00:00
tg 625928f9f1 make autoconf checks more verbose as well 2006-11-09 23:09:05 +00:00
tg e49b50f8f1 check for a few more things 2006-11-09 23:04:34 +00:00
tg 7148a691e0 simplify 2006-11-09 22:56:55 +00:00
tg ee55f29a31 new function ac_testn() does the same as ac_test() but doesn't amend CPPFLAGS 2006-11-09 22:56:09 +00:00
tg 2bdcd71ef0 unbreak -d (was broken in R28) 2006-11-09 22:53:21 +00:00
tg a48a880c00 ac_test for MKSH_SMALL presence in CPPFLAGS
if present, don't even look for setmode as it's only used by mknod builtin
2006-11-09 22:51:49 +00:00
tg 36ac8dc0f7 get rid of the need of strlcat() altogether (only one use was left) 2006-11-09 15:02:31 +00:00
tg 1ffa722d73 optic sugar 2006-11-09 00:13:27 +00:00
tg 0307ecb492 * instead of including <sys/cdefs.h> (not in Solaris), we hope <sys/types.h>
includes it for us
* autoconf-test for <sys/param.h> (not in SUSv3) existence
2006-11-09 00:11:39 +00:00
tg 9b0dbaddbf oops, missed syntactic change 2006-11-09 00:08:25 +00:00
tg 1c7e58a9d9 use \u0060...\u0060 instead of $(...)
demanded by solaris /bin/sh
2006-11-09 00:06:33 +00:00
tg 84088b91d0 there is no compat.c any more 2006-11-09 00:03:37 +00:00
tg e97ddf1eef some build issues 2006-11-09 00:01:04 +00:00
tg 11fbdb4378 implement autoconf tests for langstuff; sync date 2006-11-08 23:45:47 +00:00
tg d5c0de53e3 use shell macros instead of dupe code 2006-11-08 23:38:28 +00:00
tg 0e0782c856 first attempts at more autoconf'isation 2006-11-08 23:23:41 +00:00
tg 367186ecbc something about the strength-reduce bug being fixed 2006-09-29 19:33:48 +00:00
tg c65efd6fd4 of course, I had to screw up
tested on Debian stale:
| Total failed: 1 (as expected)
| Total passed: 213
| tg@flyingfish:~/mk b $ uname -a
| Linux flyingfish 2.6.13.1-grsec-aurisp #1 Wed Sep 28 15:13:07 CEST 2005 i686 GNU/Linux
2006-09-21 22:12:05 +00:00
tg 582aebf1c4 shebang, she don't work with spaces 2006-09-21 22:09:41 +00:00
tg 74efecaff0 no _POSIX_C_SOURCE=200112L for now, it works without on Solaris 8
and only without on "opensolaris build47 x86 32-bit"

reported in irc #ksh by <IvanR_> ivan@babylon-5.seppuku.net (Ivan Richwalski)
thanks
2006-09-13 23:07:10 +00:00
tg 6ec5e11ff2 in the case of BSD software, the F in RTFM is not vulgar... 2006-08-28 01:37:29 +00:00
tg 2b4f10b424 * move functions to top
* remove a few immature or redundant comments
* variablise better; use /usr/ucb/install on Solaris
2006-08-28 01:30:37 +00:00
tg 606909d6f6 Solaris 8 friendliness 2006-08-26 20:48:29 +00:00
tg 695503952f use an autoconf-like approach to check for arc4random(3)
after gecko2 told me his mac recently has it and I found
out that Interix has it in -lcrypt and soon -lmirmake (:
2006-08-26 20:30:27 +00:00
tg c81966621a merge non-Plan9-specific stuff from the branch, add KNF, etc. 2006-08-24 20:32:53 +00:00
tg e20d82c4d1 * rename the (generated) Test.sh to test.sh
* point to it, TFM and the sample more
2006-08-22 22:01:59 +00:00
tg b208f76525 fix quoting levels of backthingies 2006-08-12 20:30:22 +00:00
tg 36b7c841d3 some help from the autoconf portable shell docs 2006-08-12 20:19:36 +00:00
tg 70babe6b0c fix and simplify further 2006-08-12 20:01:35 +00:00