From 9658948f65e10c7f64714d8578fa68bb8ee8fbfd Mon Sep 17 00:00:00 2001 From: schnetter Date: Tue, 4 Apr 2006 23:10:05 +0000 Subject: Check for the "restrict" qualifier more thoroughly. Certain compilers (old versions of g++) don't support restrict in arrays which are structure members. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4282 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/make/aclocal.m4 | 2 + lib/make/configure | 104 ++++++++++++++++++++++++++-------------------------- 2 files changed, 55 insertions(+), 51 deletions(-) (limited to 'lib/make') diff --git a/lib/make/aclocal.m4 b/lib/make/aclocal.m4 index 39035a1c..2b8fb597 100644 --- a/lib/make/aclocal.m4 +++ b/lib/make/aclocal.m4 @@ -286,6 +286,7 @@ for ac_kw in restrict __restrict__ __restrict; do AC_TRY_COMPILE(, [ double * $ac_kw foo; void bar (void * $ac_kw arr[]); +struct tux { char * $ac_kw arr[3]; }; ], [cctk_cv_c_restrict=$ac_kw; break]) done ]) @@ -305,6 +306,7 @@ for ac_kw in restrict __restrict__ __restrict; do AC_TRY_COMPILE(, [ double * $ac_kw foo; void bar (void * $ac_kw arr[]); +struct tux { char * $ac_kw arr[3]; }; ], [cctk_cv_cxx_restrict=$ac_kw; break]) done AC_LANG_RESTORE diff --git a/lib/make/configure b/lib/make/configure index b793844c..f2af5aa4 100755 --- a/lib/make/configure +++ b/lib/make/configure @@ -3594,10 +3594,11 @@ int main() { double * $ac_kw foo; void bar (void * $ac_kw arr[]); +struct tux { char * $ac_kw arr[3]; }; ; return 0; } EOF -if { (eval echo configure:3601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cctk_cv_c_restrict=$ac_kw; break else @@ -3623,7 +3624,7 @@ EOF esac echo $ac_n "checking for C++ restrict""... $ac_c" 1>&6 -echo "configure:3627: checking for C++ restrict" >&5 +echo "configure:3628: checking for C++ restrict" >&5 if eval "test \"`echo '$''{'cctk_cv_cxx_restrict'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3638,17 +3639,18 @@ cross_compiling=$ac_cv_prog_cxx_cross for ac_kw in restrict __restrict__ __restrict; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cctk_cv_cxx_restrict=$ac_kw; break else @@ -3682,20 +3684,20 @@ esac echo $ac_n "checking for C bool""... $ac_c" 1>&6 -echo "configure:3686: checking for C bool" >&5 +echo "configure:3688: checking for C bool" >&5 if eval "test \"`echo '$''{'cctk_cv_have_c_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cctk_cv_have_c_bool=no cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cctk_cv_have_c_bool=yes else @@ -3717,7 +3719,7 @@ EOF fi echo $ac_n "checking for CXX bool""... $ac_c" 1>&6 -echo "configure:3721: checking for CXX bool" >&5 +echo "configure:3723: checking for CXX bool" >&5 if eval "test \"`echo '$''{'cctk_cv_have_cxx_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3731,14 +3733,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cctk_cv_have_cxx_bool=yes else @@ -3769,12 +3771,12 @@ fi ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5' echo $ac_n "checking for crypt""... $ac_c" 1>&6 -echo "configure:3773: checking for crypt" >&5 +echo "configure:3775: checking for crypt" >&5 if eval "test \"`echo '$''{'ac_cv_func_crypt'+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${ac_exeext}; then +if { (eval echo configure:3803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_crypt=yes" else @@ -3815,7 +3817,7 @@ if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for crypt in library crypt""... $ac_c" 1>&6 -echo "configure:3819: checking for crypt in library crypt" >&5 +echo "configure:3821: checking for crypt in library crypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3824,7 +3826,7 @@ else ac_save_LIBS="$LIBS" LIBS="crypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3876,12 +3878,12 @@ ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ for ac_func in finite do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3880: checking for $ac_func" >&5 +echo "configure:3882: 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${ac_exeext}; then +if { (eval echo configure:3910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3926,7 +3928,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for finite in library m""... $ac_c" 1>&6 -echo "configure:3930: checking for finite in library m" >&5 +echo "configure:3932: checking for finite in library m" >&5 ac_lib_var=`echo m'_'finite | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3935,7 +3937,7 @@ else ac_save_LIBS="$LIBS" LIBS="m $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3988,12 +3990,12 @@ ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ for ac_func in isnan do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3992: checking for $ac_func" >&5 +echo "configure:3994: 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${ac_exeext}; then +if { (eval echo configure:4022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4038,7 +4040,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for isnan in library m""... $ac_c" 1>&6 -echo "configure:4042: checking for isnan in library m" >&5 +echo "configure:4044: checking for isnan in library m" >&5 ac_lib_var=`echo m'_'isnan | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4047,7 +4049,7 @@ else ac_save_LIBS="$LIBS" LIBS="m $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4100,12 +4102,12 @@ ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ for ac_func in mkstemp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4104: checking for $ac_func" >&5 +echo "configure:4106: 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${ac_exeext}; then +if { (eval echo configure:4134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4150,7 +4152,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for mkstemp in library c""... $ac_c" 1>&6 -echo "configure:4154: checking for mkstemp in library c" >&5 +echo "configure:4156: checking for mkstemp in library c" >&5 ac_lib_var=`echo c'_'mkstemp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4159,7 +4161,7 @@ else ac_save_LIBS="$LIBS" LIBS="c $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4209,19 +4211,19 @@ done echo $ac_n "checking for va_copy""... $ac_c" 1>&6 -echo "configure:4213: checking for va_copy" >&5 +echo "configure:4215: checking for va_copy" >&5 if eval "test \"`echo '$''{'cctk_cv_have_va_copy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { va_list src, dest; va_copy(dest, src); return 0 ; return 0; } EOF -if { (eval echo configure:4225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "cctk_cv_have_va_copy=yes" else @@ -4248,7 +4250,7 @@ fi if test "X$PTHREADS" = 'Xyes'; then PTHREAD_LIBS= echo $ac_n "checking for main in library c_r""... $ac_c" 1>&6 -echo "configure:4252: checking for main in library c_r" >&5 +echo "configure:4254: checking for main in library c_r" >&5 ac_lib_var=`echo c_r'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4257,14 +4259,14 @@ else ac_save_LIBS="$LIBS" LIBS="c_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4285,7 +4287,7 @@ else fi echo $ac_n "checking for main in library pthread""... $ac_c" 1>&6 -echo "configure:4289: checking for main in library pthread" >&5 +echo "configure:4291: checking for main in library pthread" >&5 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4294,14 +4296,14 @@ else ac_save_LIBS="$LIBS" LIBS="pthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4320,7 +4322,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for main in library pthreads""... $ac_c" 1>&6 -echo "configure:4324: checking for main in library pthreads" >&5 +echo "configure:4326: checking for main in library pthreads" >&5 ac_lib_var=`echo pthreads'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4329,14 +4331,14 @@ else ac_save_LIBS="$LIBS" LIBS="pthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4917,7 +4919,7 @@ if test "x$CCTK_NEED_X" = 'xyes' ; then # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:4921: checking for X" >&5 +echo "configure:4923: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4979,12 +4981,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5053,14 +5055,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. -- cgit v1.2.3