• new way of checking for mknod & friends, due to tcc vs glibc weirdness

• bump vsn for the code restructuring
This commit is contained in:
tg
2007-07-31 11:11:25 +00:00
parent 809c1446b2
commit 496b8f4dc3
5 changed files with 28 additions and 21 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $MirOS: src/bin/mksh/Build.sh,v 1.249 2007/07/31 10:42:14 tg Exp $ # $MirOS: src/bin/mksh/Build.sh,v 1.250 2007/07/31 11:11:23 tg Exp $
#- #-
# Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS # Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS
# CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NEED_MKNOD MKSH_NOPWNAM # CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NEED_MKNOD MKSH_NOPWNAM
@ -621,13 +621,6 @@ ac_testn mksh_defutf8 '' "if we assume UTF-8 is enabled" <<-'EOF'
int main(void) { return (0); } int main(void) { return (0); }
EOF EOF
ac_testn mksh_need_mknod '!' mksh_full 1 'if we still want c_mknod()' <<-'EOF'
#ifndef MKSH_NEED_MKNOD
#error Nope, the user really wants it teensy.
#endif
int main(void) { return (0); }
EOF
if test 0 = $HAVE_MKSH_FULL; then if test 0 = $HAVE_MKSH_FULL; then
if test $ct = xlc; then if test $ct = xlc; then
ac_flags 1 fnoinline -qnoinline ac_flags 1 fnoinline -qnoinline
@ -794,6 +787,19 @@ ac_test langinfo_codeset setlocale_ctype 0 'nl_langinfo(CODESET)' <<-'EOF'
int main(void) { return ((ptrdiff_t)(void *)nl_langinfo(CODESET)); } int main(void) { return ((ptrdiff_t)(void *)nl_langinfo(CODESET)); }
EOF EOF
ac_test mknod '' 'if we use mknod(), makedev() and friends' <<-'EOF'
#define MKSH_INCLUDES_ONLY
#include "sh.h"
#if defined(MKSH_SMALL) && !defined(MKSH_NEED_MKNOD)
#error We do not want to include the mknod builtin.
#endif
int main(int ac, char *av[]) {
dev_t dv;
dv = makedev(ac, 1);
return (mknod(av[0], 0, dv) ? (int)major(dv) : (int)minor(dv));
}
EOF
ac_test revoke mksh_full 0 <<-'EOF' ac_test revoke mksh_full 0 <<-'EOF'
#if HAVE_LIBUTIL_H #if HAVE_LIBUTIL_H
#include <libutil.h> #include <libutil.h>
@ -802,7 +808,7 @@ ac_test revoke mksh_full 0 <<-'EOF'
int main(int ac, char *av[]) { return (ac + revoke(av[0])); } int main(int ac, char *av[]) { return (ac + revoke(av[0])); }
EOF EOF
ac_test setmode mksh_need_mknod 1 <<-'EOF' ac_test setmode mknod 1 <<-'EOF'
#if defined(__MSVCRT__) || defined(__CYGWIN__) #if defined(__MSVCRT__) || defined(__CYGWIN__)
#error Win32 setmode() is different from what we need #error Win32 setmode() is different from what we need
#endif #endif

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/Makefile,v 1.44 2007/07/01 21:47:07 tg Exp $ # $MirOS: src/bin/mksh/Makefile,v 1.45 2007/07/31 11:11:23 tg Exp $
#- #-
# use CPPFLAGS=-DDEBUG __CRAZY=Yes to check for certain more stuff # use CPPFLAGS=-DDEBUG __CRAZY=Yes to check for certain more stuff
@ -19,10 +19,11 @@ CPPFLAGS+= -DMKSH_ASSUME_UTF8 \
-DHAVE_SYS_SIGLIST=1 -DHAVE_STRSIGNAL=0 -DHAVE_ARC4RANDOM=1 \ -DHAVE_SYS_SIGLIST=1 -DHAVE_STRSIGNAL=0 -DHAVE_ARC4RANDOM=1 \
-DHAVE_ARC4RANDOM_PUSH=1 -DHAVE_FLOCK_EX=1 \ -DHAVE_ARC4RANDOM_PUSH=1 -DHAVE_FLOCK_EX=1 \
-DHAVE_SETLOCALE_CTYPE=0 -DHAVE_LANGINFO_CODESET=0 \ -DHAVE_SETLOCALE_CTYPE=0 -DHAVE_LANGINFO_CODESET=0 \
-DHAVE_REVOKE=1 -DHAVE_SETMODE=1 -DHAVE_SETRESUGID=1 \ -DHAVE_MKNOD=1 -DHAVE_REVOKE=1 -DHAVE_SETMODE=1 \
-DHAVE_SETGROUPS=1 -DHAVE_STRCASESTR=1 -DHAVE_STRLCPY=1 \ -DHAVE_SETRESUGID=1 -DHAVE_SETGROUPS=1 -DHAVE_STRCASESTR=1 \
-DHAVE_ARC4RANDOM_DECL=1 -DHAVE_ARC4RANDOM_PUSH_DECL=1 \ -DHAVE_STRLCPY=1 -DHAVE_ARC4RANDOM_DECL=1 \
-DHAVE_SYS_SIGLIST_DECL=1 -DHAVE_PERSISTENT_HISTORY=1 -DHAVE_ARC4RANDOM_PUSH_DECL=1 -DHAVE_SYS_SIGLIST_DECL=1 \
-DHAVE_PERSISTENT_HISTORY=1
COPTS+= -std=gnu99 -Wall COPTS+= -std=gnu99 -Wall
.endif .endif

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.131 2007/07/26 13:23:51 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.132 2007/07/31 11:11:23 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas 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: 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 $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -7,7 +7,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh # http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout: expected-stdout:
@(#)MIRBSD KSH R30 2007/07/26 @(#)MIRBSD KSH R30 2007/07/31
description: description:
Check version of shell. Check version of shell.
category: pdksh category: pdksh

View File

@ -5,7 +5,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.60 2007/07/22 14:01:48 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.61 2007/07/31 11:11:24 tg Exp $");
int int
c_cd(const char **wp) c_cd(const char **wp)
@ -2203,7 +2203,7 @@ c_exec(const char **wp __unused)
return 0; return 0;
} }
#if !defined(MKSH_SMALL) || defined(MKSH_NEED_MKNOD) #if HAVE_MKNOD
static int static int
c_mknod(const char **wp) c_mknod(const char **wp)
{ {
@ -2324,7 +2324,7 @@ const struct builtin shbuiltins [] = {
{"ulimit", c_ulimit}, {"ulimit", c_ulimit},
{"+umask", c_umask}, {"+umask", c_umask},
{"*=unset", c_unset}, {"*=unset", c_unset},
#if !defined(MKSH_SMALL) || defined(MKSH_NEED_MKNOD) #if HAVE_MKNOD
{"mknod", c_mknod}, {"mknod", c_mknod},
#endif #endif
{NULL, (int (*)(const char **))NULL} {NULL, (int (*)(const char **))NULL}

4
sh.h
View File

@ -8,8 +8,8 @@
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.165 2007/07/26 13:23:52 tg Exp $" #define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.166 2007/07/31 11:11:25 tg Exp $"
#define MKSH_VERSION "R30 2007/07/26" #define MKSH_VERSION "R30 2007/07/31"
#if HAVE_SYS_PARAM_H #if HAVE_SYS_PARAM_H
#include <sys/param.h> #include <sys/param.h>