check if __RCSID() can be used multiple times; req'd eg. on Mac

This commit is contained in:
tg 2007-01-17 21:42:23 +00:00
parent 6646fff759
commit ceb5a7dba0
3 changed files with 21 additions and 8 deletions

View File

@ -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)
#

View File

@ -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

5
sh.h
View File

@ -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 <sys/param.h>
#endif
#include <sys/types.h>
#if defined(HAVE_MULTI_IDSTRING) && !HAVE_MULTI_IDSTRING
#undef __RCSID
#endif
#if !defined(__RCSID) || !defined(__SCCSID)
#undef __IDSTRING
#undef __IDSTRING_CONCAT