• 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
This commit is contained in:
tg 2007-02-18 16:24:13 +00:00
parent 6661a2b408
commit e0e4c992fc
2 changed files with 25 additions and 7 deletions

View File

@ -1,8 +1,8 @@
#!/bin/sh
# $MirOS: src/bin/mksh/Build.sh,v 1.150 2007/02/13 12:26:46 tg Exp $
# $MirOS: src/bin/mksh/Build.sh,v 1.151 2007/02/18 16:24:13 tg Exp $
#-
# Env: CC, CFLAGS, CPP, CPPFLAGS, LDFLAGS, LIBS, NOWARN, NROFF, TARGET_OS
# CPPFLAGS recognised: MKSH_SMALL MKSH_NOPWNAM
# CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NEED_MKNOD MKSH_NOPWNAM
v()
{
@ -304,6 +304,20 @@ ac_testn mksh_full '' "if we're building without MKSH_SMALL" <<-'EOF'
int main(void) { return (0); }
EOF
ac_testn mksh_defutf8 '' "if we assume UTF-8 is enabled" <<-'EOF'
#ifndef MKSH_ASSUME_UTF8
#error Nope, we shall check with setlocale() and nl_langinfo(CODESET)
#endif
int main(void) { return (0); }
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
ac_testn mksh_nopam mksh_full 1 'if the user wants to omit getpwnam()' <<-'EOF'
#ifndef MKSH_NOPWNAM
#error No, the user wants to pull in getpwnam.
@ -441,7 +455,7 @@ EOF
test 11 = $HAVE_FLOCK_EX$HAVE_MKSH_FULL || \
check_categories=$check_categories,no-histfile
ac_test setlocale_ctype '' 'setlocale(LC_CTYPE, "")' <<-'EOF'
ac_test setlocale_ctype '!' mksh_defutf8 0 'setlocale(LC_CTYPE, "")' <<-'EOF'
#include <locale.h>
#include <stddef.h>
int main(void) { return ((ptrdiff_t)(void *)setlocale(LC_CTYPE, "")); }
@ -458,7 +472,7 @@ ac_test revoke mksh_full 0 <<-'EOF'
int main(int ac, char *av[]) { return (ac + revoke(av[0])); }
EOF
ac_test setmode mksh_full 1 <<-'EOF'
ac_test setmode mksh_need_mknod 1 <<-'EOF'
#if defined(__MSVCRT__) || defined(__CYGWIN__)
#error Win32 setmode() is different from what we need
#endif

View File

@ -1,10 +1,13 @@
# $MirOS: src/bin/mksh/Makefile,v 1.30 2007/02/10 21:59:15 tg Exp $
# $MirOS: src/bin/mksh/Makefile,v 1.31 2007/02/18 16:24:13 tg Exp $
.include <bsd.own.mk>
PROG= mksh
SRCS= alloc.c edit.c eval.c exec.c expr.c funcs.c histrap.c \
jobs.c lex.c main.c misc.c shf.c syn.c tree.c var.c
.if !make(test-build)
CPPFLAGS+= -DHAVE_ATTRIBUTE=1 -DHAVE_ATTRIBUTE_BOUNDED=1 \
CPPFLAGS+= -DMKSH_ASSUME_UTF8 \
-DHAVE_ATTRIBUTE=1 -DHAVE_ATTRIBUTE_BOUNDED=1 \
-DHAVE_ATTRIBUTE_USED=1 -DHAVE_SYS_PARAM_H=1 \
-DHAVE_SYS_MKDEV_H=0 -DHAVE_SYS_SYSMACROS_H=0 \
-DHAVE_LIBGEN_H=1 -DHAVE_PATHS_H=1 -DHAVE_STDBOOL_H=1 \
@ -16,7 +19,8 @@ CPPFLAGS+= -DHAVE_ATTRIBUTE=1 -DHAVE_ATTRIBUTE_BOUNDED=1 \
-DHAVE_SETLOCALE_CTYPE=0 -DHAVE_LANGINFO_CODESET=0 \
-DHAVE_REVOKE=1 -DHAVE_SETMODE=1 -DHAVE_SETRESUGID=1 \
-DHAVE_SETGROUPS=1 -DHAVE_STRCASESTR=1 -DHAVE_STRLCPY=1 \
-DHAVE_MULTI_IDSTRING=1 -DMKSH_ASSUME_UTF8
-DHAVE_MULTI_IDSTRING=1
COPTS+= -std=gnu99 -Wall
.endif
CDIAGFLAGS+= -Wno-cast-qual