From e0e4c992fc0aad0c99cdff56a36f777aa5c7bdee Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 18 Feb 2007 16:24:13 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=A2=20embed=20MKSH=5FASSUME=5FUTF8=20and?= =?UTF-8?q?=20MKSH=5FNEED=5FMKNOD=20in=20Build.sh=20=E2=80=A2=20have=20mks?= =?UTF-8?q?h=20with=20BSD=20makefiles=20always=20enable=20MKSH=5FASSUME=5F?= =?UTF-8?q?UTF8=20=E2=80=A2=20sync=20BSD=20makefiles=20with=20Build.sh=20o?= =?UTF-8?q?utput?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Build.sh | 22 ++++++++++++++++++---- Makefile | 10 +++++++--- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Build.sh b/Build.sh index 6412278..15f1fc6 100644 --- a/Build.sh +++ b/Build.sh @@ -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 #include 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 diff --git a/Makefile b/Makefile index a50d6be..4e8e310 100644 --- a/Makefile +++ b/Makefile @@ -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 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