* 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
This commit is contained in:
tg 2009-07-25 21:31:27 +00:00
parent cfe6688a36
commit 758dc5c6fe
7 changed files with 25 additions and 13 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.411 2009/07/25 20:52:39 tg Exp $'
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.412 2009/07/25 21:31:23 tg Exp $'
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Thorsten Glaser <tg@mirbsd.org>
@ -910,7 +910,7 @@ if ac_ifcpp 'ifdef MKSH_SMALL' isset_MKSH_SMALL '' \
: ${HAVE_REVOKE=0}
: ${HAVE_PERSISTENT_HISTORY=0}
check_categories=$check_categories,smksh
CPPFLAGS="$CPPFLAGS -DMKSH_CONSERVATIVE_FDS"
HAVE_ISSET_MKSH_CONSERVATIVE_FDS=1 # from sh.h
fi
ac_ifcpp 'ifdef MKSH_BINSHREDUCED' isset_MKSH_BINSHREDUCED '' \
"if a reduced-feature sh is requested" && \
@ -1181,6 +1181,8 @@ ac_test langinfo_codeset setlocale_ctype 0 'nl_langinfo(CODESET)' <<-'EOF'
EOF
ac_test setmode mknod 1 <<-'EOF'
/* XXX imake style */
/* XXX conditions correct? */
#if defined(__MSVCRT__) || defined(__CYGWIN__)
/* force a failure: Win32 setmode() is not what we want... */
int main(void) { return (thiswillneverbedefinedIhope()); }

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.294 2009/07/25 20:52:40 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.295 2009/07/25 21:31:24 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -25,7 +25,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout:
@(#)MIRBSD KSH R39 2009/07/16
@(#)MIRBSD KSH R39 2009/07/25
description:
Check version of shell.
stdin:

View File

@ -25,7 +25,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.117 2009/07/25 20:35:22 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.118 2009/07/25 21:31:25 tg Exp $");
#if HAVE_KILLPG
/*
@ -38,6 +38,7 @@ __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.117 2009/07/25 20:35:22 tg Exp $");
#define mksh_kill kill
#endif
/* XXX conditions correct? */
#if !defined(RLIM_INFINITY) && !defined(MKSH_NO_LIMITS)
#define MKSH_NO_LIMITS
#endif

4
jobs.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.57 2009/06/11 12:42:19 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.58 2009/07/25 21:31:25 tg Exp $");
#if HAVE_KILLPG
#define mksh_killpg killpg
@ -123,7 +123,7 @@ static int32_t njobs; /* # of jobs started */
#ifndef CHILD_MAX
#ifdef _POSIX_CHILD_MAX
#define CHILD_MAX _POSIX_CHILD_MAX
#elif defined(__KLIBC__)
#elif defined(__KLIBC__) /* XXX imake style */
#define CHILD_MAX 999 /* no limit :-) */
#endif
#endif

4
main.c
View File

@ -33,7 +33,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.135 2009/07/25 20:52:41 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.136 2009/07/25 21:31:26 tg Exp $");
extern char **environ;
@ -788,6 +788,7 @@ tty_init(bool init_ttystate, bool need_tty)
tty_devtty = 1;
#ifdef _UWIN
/* XXX imake style */
if (isatty(3))
tfd = 3;
else
@ -1006,6 +1007,7 @@ ksh_dup2(int ofd, int nfd, bool errok)
errorf("too many files open in shell");
#ifdef __ultrix
/* XXX imake style */
if (rv >= 0)
fcntl(nfd, F_SETFD, 0);
#endif

4
misc.c
View File

@ -29,9 +29,10 @@
#include <grp.h>
#endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.111 2009/06/11 12:42:20 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.112 2009/07/25 21:31:26 tg Exp $");
#undef USE_CHVT
/* XXX conditions correct? */
#if defined(TIOCSCTTY) && !defined(MKSH_SMALL)
#define USE_CHVT
#endif
@ -1414,7 +1415,6 @@ chvt(const char *fn)
#endif
#ifdef DEBUG
char longsizes_are_okay[sizeof(long) == sizeof(unsigned long) ? 1 : -1];
char arisize_is_okay[sizeof(mksh_ari_t) == 4 ? 1 : -1];
char uarisize_is_okay[sizeof(mksh_uari_t) == 4 ? 1 : -1];

13
sh.h
View File

@ -29,6 +29,7 @@
*/
#ifdef __dietlibc__
/* XXX imake style */
#define _BSD_SOURCE /* live, BSD, live! */
#endif
@ -122,9 +123,9 @@
#define __SCCSID(x) __IDSTRING(sccsid,x)
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.315 2009/07/25 20:26:33 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.316 2009/07/25 21:31:27 tg Exp $");
#endif
#define MKSH_VERSION "R39 2009/07/16"
#define MKSH_VERSION "R39 2009/07/25"
#ifndef MKSH_INCLUDES_ONLY
@ -224,6 +225,7 @@ typedef int bool;
#endif
#if !defined(MAP_FAILED)
/* XXX imake style */
# if defined(__linux)
#define MAP_FAILED ((void *)-1)
# elif defined(__bsdi__) || defined(__osf__) || defined(__ultrix)
@ -271,6 +273,7 @@ void *setmode(const char *);
#endif
#ifdef __ultrix
/* XXX imake style */
int strcasecmp(const char *, const char *);
#endif
@ -287,6 +290,7 @@ extern const char *const sys_siglist[];
#endif
#ifdef __INTERIX
/* XXX imake style */
#define makedev mkdev
extern int __cdecl seteuid(uid_t);
extern int __cdecl setegid(gid_t);
@ -312,7 +316,7 @@ typedef int32_t mksh_ari_t;
typedef uint32_t mksh_uari_t;
/* these shall be smaller than 100 */
#ifdef MKSH_CONSERVATIVE_FDS)
#ifdef MKSH_CONSERVATIVE_FDS
#define NUFILE 32 /* Number of user-accessible files */
#define FDBASE 10 /* First file usable by Shell */
#else
@ -431,6 +435,9 @@ char *ucstrstr(char *, const char *);
#endif
#ifdef MKSH_SMALL
#ifndef MKSH_CONSERVATIVE_FDS
#define MKSH_CONSERVATIVE_FDS
#endif
#ifndef MKSH_NOPWNAM
#define MKSH_NOPWNAM
#endif