From ceb5a7dba0e4589f4ecc620ade48e260aa15816f Mon Sep 17 00:00:00 2001 From: tg Date: Wed, 17 Jan 2007 21:42:23 +0000 Subject: [PATCH] check if __RCSID() can be used multiple times; req'd eg. on Mac --- Build.sh | 12 +++++++++++- Makefile | 12 ++++++------ sh.h | 5 ++++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Build.sh b/Build.sh index 3944a44..e868d05 100644 --- a/Build.sh +++ b/Build.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $MirOS: src/bin/mksh/Build.sh,v 1.125 2007/01/17 17:57:31 tg Exp $ +# $MirOS: src/bin/mksh/Build.sh,v 1.126 2007/01/17 21:42:23 tg Exp $ #- # Environment: CC, CFLAGS, CPP, CPPFLAGS, LDFLAGS, LIBS, NOWARN, NROFF # With -x (cross compile): TARGET_OS (default: uname -s) @@ -398,6 +398,16 @@ ac_test strlcpy <<-'EOF' int main(int ac, char *av[]) { return (strlcpy(*av, av[1], ac)); } EOF +# +# other checks +# +ac_test multi_idstring '' 'if we can use __RCSID(x) multiple times' <<-'EOF' + #include "sh.h" + __RCSID("one"); + __RCSID("two"); + int main(void) { return (0); } +EOF + # # Compiler: Praeprocessor (only if needed) # diff --git a/Makefile b/Makefile index d228684..ac28b5d 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ -# $MirOS: src/bin/mksh/Makefile,v 1.22 2007/01/12 01:11:03 tg Exp $ +# $MirOS: src/bin/mksh/Makefile,v 1.23 2007/01/17 21:42:23 tg Exp $ 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 -CPPFLAGS+= -DHAVE_SYS_PARAM_H -DHAVE_ARC4RANDOM -DHAVE_ARC4RANDOM_PUSH CPPFLAGS+= -DHAVE_ATTRIBUTE -DHAVE_ATTRIBUTE_BOUNDED -DHAVE_ATTRIBUTE_USED -CPPFLAGS+= -DHAVE_SETLOCALE_CTYPE -DHAVE_LANGINFO_CODESET -CPPFLAGS+= -DHAVE_SETMODE -DHAVE_SETRESUGID -DHAVE_SETGROUPS -CPPFLAGS+= -DHAVE_STRCASESTR -DHAVE_STRLCPY -CPPFLAGS+= -DHAVE_SYS_SIGLIST -DHAVE_SYS_SIGNAME +CPPFLAGS+= -DHAVE_SYS_PARAM_H -DHAVE_SYS_SIGNAME -DHAVE_SYS_SIGLIST +CPPFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_ARC4RANDOM_PUSH -DHAVE_SETLOCALE_CTYPE +CPPFLAGS+= -DHAVE_LANGINFO_CODESET -DHAVE_SETMODE -DHAVE_SETRESUGID +CPPFLAGS+= -DHAVE_SETGROUPS -DHAVE_STRCASESTR -DHAVE_STRLCPY +CPPFLAGS+= -DHAVE_MULTI_IDSTRING CDIAGFLAGS+= -Wno-cast-qual LINKS+= ${BINDIR}/${PROG} ${BINDIR}/sh diff --git a/sh.h b/sh.h index c46e36b..89b8d7c 100644 --- a/sh.h +++ b/sh.h @@ -8,13 +8,16 @@ /* $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 $ */ -#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.99 2007/01/17 01:24:29 tg Exp $" +#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.100 2007/01/17 21:42:23 tg Exp $" #define MKSH_VERSION "R29 2007/01/17" #if HAVE_SYS_PARAM_H #include #endif #include +#if defined(HAVE_MULTI_IDSTRING) && !HAVE_MULTI_IDSTRING +#undef __RCSID +#endif #if !defined(__RCSID) || !defined(__SCCSID) #undef __IDSTRING #undef __IDSTRING_CONCAT