From 7684433709df94da85d1f0daf63c20dfea142b61 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 19 Jan 1998 02:09:47 -0800 Subject: [PATCH] configure.in: Add cpp stringify test. * configure.in: Add cpp stringify test. * acconfig.h (HAVE_CPP_STRINGIFY): New tag. * gengenrtl.c: Use it. * configure, config.in: Rebuild. From-SVN: r17419 --- gcc/ChangeLog | 7 +++ gcc/acconfig.h | 3 + gcc/config.in | 3 + gcc/configure | 180 +++++++++++++++++++++++++++++++++---------------------- gcc/configure.in | 13 ++++ gcc/gengenrtl.c | 2 +- 6 files changed, 135 insertions(+), 73 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index af0e17b..2099924 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Mon Jan 19 10:11:52 1998 Richard Henderson + + * configure.in: Add cpp stringify test. + * acconfig.h (HAVE_CPP_STRINGIFY): New tag. + * gengenrtl.c: Use it. + * configure, config.in: Rebuild. + Mon Jan 19 09:43:15 1998 Andreas Schwab * Makefile.in (genrtl.c genrtl.h): Add dummy command for GNU make. diff --git a/gcc/acconfig.h b/gcc/acconfig.h index 9321492..1a3c0d4 100644 --- a/gcc/acconfig.h +++ b/gcc/acconfig.h @@ -1,3 +1,6 @@ +/* Define if your cpp understands the stringify operator. */ +#undef HAVE_CPP_STRINGIFY + /* Define if you have a working header file. */ #undef HAVE_INTTYPES_H diff --git a/gcc/config.in b/gcc/config.in index 3cea962..1268b32 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1,4 +1,7 @@ /* config.in. Generated automatically from configure.in by autoheader. */ +/* Define if your cpp understands the stringify operator. */ +#undef HAVE_CPP_STRINGIFY + /* Define if you have a working header file. */ #undef HAVE_INTTYPES_H diff --git a/gcc/configure b/gcc/configure index 63d765a..da2d978 100755 --- a/gcc/configure +++ b/gcc/configure @@ -1790,15 +1790,51 @@ have_pthread_h= fi +# See if the system preprocessor understands the ANSI C preprocessor +# stringification operator. +echo $ac_n "checking whether cpp understands the stringify operator""... $ac_c" 1>&6 +echo "configure:1797: checking whether cpp understands the stringify operator" >&5 +if eval "test \"`echo '$''{'gcc_cv_c_have_stringify'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gcc_cv_c_have_stringify=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gcc_cv_c_have_stringify=no +fi +rm -f conftest* +fi + +echo "$ac_t""$gcc_cv_c_have_stringify" 1>&6 +if test $gcc_cv_c_have_stringify = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_CPP_STRINGIFY 1 +EOF + +fi + # Use only if it exists, # doesn't clash with , and declares intmax_t. echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6 -echo "configure:1797: checking for inttypes.h" >&5 +echo "configure:1833: checking for inttypes.h" >&5 if eval "test \"`echo '$''{'gcc_cv_header_inttypes_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1806,7 +1842,7 @@ int main() { intmax_t i = -1; ; return 0; } EOF -if { (eval echo configure:1810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <&6 for ac_func in strtoul do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1831: checking for $ac_func" >&5 +echo "configure:1867: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1882,12 +1918,12 @@ done for ac_func in bsearch do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1886: checking for $ac_func" >&5 +echo "configure:1922: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1937,12 +1973,12 @@ done for ac_func in strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1941: checking for $ac_func" >&5 +echo "configure:1977: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1992,12 +2028,12 @@ done for ac_func in putenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1996: checking for $ac_func" >&5 +echo "configure:2032: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2047,12 +2083,12 @@ done for ac_func in popen do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2051: checking for $ac_func" >&5 +echo "configure:2087: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2102,12 +2138,12 @@ done for ac_func in vprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2106: checking for $ac_func" >&5 +echo "configure:2142: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2157,12 +2193,12 @@ done for ac_func in bcopy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2161: checking for $ac_func" >&5 +echo "configure:2197: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2212,12 +2248,12 @@ done for ac_func in bzero do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2216: checking for $ac_func" >&5 +echo "configure:2252: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2267,12 +2303,12 @@ done for ac_func in bcmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2271: checking for $ac_func" >&5 +echo "configure:2307: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2322,12 +2358,12 @@ done for ac_func in index do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2326: checking for $ac_func" >&5 +echo "configure:2362: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2377,12 +2413,12 @@ done for ac_func in rindex do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2381: checking for $ac_func" >&5 +echo "configure:2417: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2432,12 +2468,12 @@ done for ac_func in kill do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2436: checking for $ac_func" >&5 +echo "configure:2472: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2487,12 +2523,12 @@ done for ac_func in getrlimit do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2491: checking for $ac_func" >&5 +echo "configure:2527: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2542,12 +2578,12 @@ done for ac_func in setrlimit do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2546: checking for $ac_func" >&5 +echo "configure:2582: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2596,12 +2632,12 @@ done echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:2600: checking whether malloc must be declared" >&5 +echo "configure:2636: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2628,7 +2664,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:2632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_decl_needed_malloc=no else @@ -2650,12 +2686,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:2654: checking whether realloc must be declared" >&5 +echo "configure:2690: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2682,7 +2718,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:2686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_decl_needed_realloc=no else @@ -2704,12 +2740,12 @@ EOF fi echo $ac_n "checking whether calloc must be declared""... $ac_c" 1>&6 -echo "configure:2708: checking whether calloc must be declared" >&5 +echo "configure:2744: checking whether calloc must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_calloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2736,7 +2772,7 @@ int main() { char *(*pfn) = (char *(*)) calloc ; return 0; } EOF -if { (eval echo configure:2740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_decl_needed_calloc=no else @@ -2758,12 +2794,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:2762: checking whether free must be declared" >&5 +echo "configure:2798: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2790,7 +2826,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:2794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_decl_needed_free=no else @@ -2812,12 +2848,12 @@ EOF fi echo $ac_n "checking whether index must be declared""... $ac_c" 1>&6 -echo "configure:2816: checking whether index must be declared" >&5 +echo "configure:2852: checking whether index must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_index'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2844,7 +2880,7 @@ int main() { char *(*pfn) = (char *(*)) index ; return 0; } EOF -if { (eval echo configure:2848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_decl_needed_index=no else @@ -2866,12 +2902,12 @@ EOF fi echo $ac_n "checking whether rindex must be declared""... $ac_c" 1>&6 -echo "configure:2870: checking whether rindex must be declared" >&5 +echo "configure:2906: checking whether rindex must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_rindex'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2898,7 +2934,7 @@ int main() { char *(*pfn) = (char *(*)) rindex ; return 0; } EOF -if { (eval echo configure:2902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_decl_needed_rindex=no else @@ -2920,12 +2956,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:2924: checking whether getenv must be declared" >&5 +echo "configure:2960: checking whether getenv must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2952,7 +2988,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:2956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_decl_needed_getenv=no else @@ -2974,12 +3010,12 @@ EOF fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:2978: checking whether sbrk must be declared" >&5 +echo "configure:3014: checking whether sbrk must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3006,7 +3042,7 @@ int main() { char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:3010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_decl_needed_sbrk=no else @@ -3029,12 +3065,12 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:3033: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "configure:3069: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3046,7 +3082,7 @@ int main() { char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else diff --git a/gcc/configure.in b/gcc/configure.in index 397114e..def3962 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -151,6 +151,19 @@ AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h fcntl.h un AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=]) AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=]) +# See if the system preprocessor understands the ANSI C preprocessor +# stringification operator. +AC_MSG_CHECKING(whether cpp understands the stringify operator) +AC_CACHE_VAL(gcc_cv_c_have_stringify, +[AC_TRY_COMPILE(, +[#define S(x) #x +char *test = S(foo);], +gcc_cv_c_have_stringify=yes, gcc_cv_c_have_stringify=no)]) +AC_MSG_RESULT($gcc_cv_c_have_stringify) +if test $gcc_cv_c_have_stringify = yes; then + AC_DEFINE(HAVE_CPP_STRINGIFY) +fi + # Use only if it exists, # doesn't clash with , and declares intmax_t. AC_MSG_CHECKING(for inttypes.h) diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c index 8104094..56f0a2e 100644 --- a/gcc/gengenrtl.c +++ b/gcc/gengenrtl.c @@ -35,7 +35,7 @@ struct rtx_definition const char *enumname, *name, *format; }; -#ifdef __STDC__ +#if defined(HAVE_CPP_STRINGIFY) || (defined(__GNUC__) && defined(__STDC__)) #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { # ENUM, NAME, FORMAT }, #else #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { "ENUM", NAME, FORMAT }, -- 2.7.4