From 2b67d252ebb6a00691618615488cf353ac721dda Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Sat, 26 Sep 1998 23:28:30 +0000 Subject: [PATCH] 1998-09-27 Ben Elliston * acspecific.m4 (AC_C_STRINGIZE): New macro to test the availability of the stringizing operator in the C preprocessor. Contributed by Arnold Robbins on behalf of the GNU AWK project. * acconfig.h (HAVE_STRINGIZE): Add for the AC_C_STRINGIZE macro. --- ChangeLog | 5 +++++ acconfig.h | 3 +++ acspecific.m4 | 16 ++++++++++++++++ lib/autoconf/specific.m4 | 16 ++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6ff280e1..9644fc0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,12 @@ * acspecific.m4 (AC_PROG_INSTALL): Substitute `INSTALL_SCRIPT'. Contributed by Franc,ois Pinard . + (AC_C_STRINGIZE): New macro to test the availability of the + stringizing operator in the C preprocessor. Contributed by Arnold + Robbins on behalf of the GNU AWK project. + * acconfig.h (HAVE_STRINGIZE): Add for the AC_C_STRINGIZE macro. + * testsuite/Makefile.in (check): If DejaGNU is not installed, print a warning and skip the `dejacheck' target (which will fail). (site.exp): Use tests to guard commands from generating error diff --git a/acconfig.h b/acconfig.h index 5bf096c5..dd3a6650 100644 --- a/acconfig.h +++ b/acconfig.h @@ -104,6 +104,9 @@ /* Define if you have the strftime function. */ #undef HAVE_STRFTIME +/* Define if you have the ANSI # stringizing operator in cpp. */ +#undef HAVE_STRINGIZE + /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H diff --git a/acspecific.m4 b/acspecific.m4 index bb59c63c..a99aa60f 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -1768,6 +1768,22 @@ if test $ac_cv_c_const = no; then fi ]) +AC_DEFUN(AC_C_STRINGIZE, [ +AC_REQUIRE([AC_PROG_CPP]) +AC_MSG_CHECKING([for preprocessor stringizing operator]) +AC_CACHE_VAL(ac_cv_c_stringize, +AC_EGREP_CPP([#teststring],[ +#define x(y) #y + +char *s = x(teststring); +], ac_cv_c_stringize=no, ac_cv_c_stringize=yes)) +if test "${ac_cv_c_stringize}" = yes +then + AC_DEFINE(HAVE_STRINGIZE) +fi +AC_MSG_RESULT([${ac_cv_c_stringize}]) +])dnl + define(AC_ARG_ARRAY, [errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments )m4exit(4)]) diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index bb59c63c..a99aa60f 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -1768,6 +1768,22 @@ if test $ac_cv_c_const = no; then fi ]) +AC_DEFUN(AC_C_STRINGIZE, [ +AC_REQUIRE([AC_PROG_CPP]) +AC_MSG_CHECKING([for preprocessor stringizing operator]) +AC_CACHE_VAL(ac_cv_c_stringize, +AC_EGREP_CPP([#teststring],[ +#define x(y) #y + +char *s = x(teststring); +], ac_cv_c_stringize=no, ac_cv_c_stringize=yes)) +if test "${ac_cv_c_stringize}" = yes +then + AC_DEFINE(HAVE_STRINGIZE) +fi +AC_MSG_RESULT([${ac_cv_c_stringize}]) +])dnl + define(AC_ARG_ARRAY, [errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments )m4exit(4)]) -- 2.47.2