From 6581c4616a99088868b7392da8c2da76faa3eaed Mon Sep 17 00:00:00 2001 From: goodale Date: Tue, 2 May 2000 21:16:01 +0000 Subject: Checks for the presence of mode_t. Under NT mkdir doesn't take the second argument, so the absence of this typedef is a good test of this situation. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1623 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/make/cctk_Config.h.in | 4 +++ lib/make/configure | 89 ++++++++++++++++++++++++++++++++++------------- lib/make/configure.in | 18 ++++++++++ 3 files changed, 87 insertions(+), 24 deletions(-) (limited to 'lib') diff --git a/lib/make/cctk_Config.h.in b/lib/make/cctk_Config.h.in index d56bdc3d..71abe8ca 100644 --- a/lib/make/cctk_Config.h.in +++ b/lib/make/cctk_Config.h.in @@ -72,6 +72,10 @@ #undef HAVE_MKDIR #undef HAVE_SCANDIR +/* Do we have mode_t ? */ + +#undef HAVE_MODE_T + /* Some include things */ #undef TIME_WITH_SYS_TIME #undef HAVE_TIME_H diff --git a/lib/make/configure b/lib/make/configure index d69fd2a2..d1965220 100755 --- a/lib/make/configure +++ b/lib/make/configure @@ -2605,14 +2605,55 @@ fi done +# Check if we have mode_t available +echo $ac_n "checking if mode_t is defined""... $ac_c" 1>&6 +echo "configure:2611: checking if mode_t is defined" >&5 +if eval "test \"`echo '$''{'cctk_cv_have_mode_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +int main() { +mode_t foo; return 0 +; return 0; } +EOF +if { (eval echo configure:2626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "cctk_cv_have_mode_t=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "cctk_cv_have_mode_t=no" +fi +rm -f conftest* + +fi + +if test "$cctk_cv_have_mode_t" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_MODE_T 1 +EOF + + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for availability of gettimeofday timing""... $ac_c" 1>&6 -echo "configure:2611: checking for availability of gettimeofday timing" >&5 +echo "configure:2652: checking for availability of gettimeofday timing" >&5 if eval "test \"`echo '$''{'cctk_cv_time_gettimeofday'+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:2665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "cctk_cv_time_gettimeofday=yes" else @@ -2642,12 +2683,12 @@ else fi if eval "test \"`echo '$cctk_cv_time_gettimeofday'`\" = yes"; then echo $ac_n "checking if gettimeofday needs timezone""... $ac_c" 1>&6 -echo "configure:2646: checking if gettimeofday needs timezone" >&5 +echo "configure:2687: checking if gettimeofday needs timezone" >&5 if eval "test \"`echo '$''{'cctk_cv_time_gettimeofday_timezone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2660,7 +2701,7 @@ struct timeval tp; return 0; ; return 0; } EOF -if { (eval echo configure:2664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "cctk_cv_time_gettimeofday_timezone=yes" else @@ -2683,12 +2724,12 @@ fi fi echo $ac_n "checking for availability of getrusage timing""... $ac_c" 1>&6 -echo "configure:2687: checking for availability of getrusage timing" >&5 +echo "configure:2728: checking for availability of getrusage timing" >&5 if eval "test \"`echo '$''{'cctk_cv_time_getrusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2701,7 +2742,7 @@ struct rusage ru; return 0; ; return 0; } EOF -if { (eval echo configure:2705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "cctk_cv_time_getrusage=yes" else @@ -2723,12 +2764,12 @@ else fi echo $ac_n "checking for availability of _ftime timing""... $ac_c" 1>&6 -echo "configure:2727: checking for availability of _ftime timing" >&5 +echo "configure:2768: checking for availability of _ftime timing" >&5 if eval "test \"`echo '$''{'cctk_cv_time_ftime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2741,7 +2782,7 @@ int main() { return 0; ; return 0; } EOF -if { (eval echo configure:2745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "cctk_cv_time_ftime=yes" else @@ -2768,19 +2809,19 @@ for cctk_hdr in sys/time.h do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2772: checking for $cctk_hdr" >&5 +echo "configure:2813: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return 0; ; return 0; } EOF -if { (eval echo configure:2784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2807,19 +2848,19 @@ for cctk_hdr in unistd.h do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2811: checking for $cctk_hdr" >&5 +echo "configure:2852: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return 0; ; return 0; } EOF -if { (eval echo configure:2823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2846,19 +2887,19 @@ for cctk_hdr in string.h do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2850: checking for $cctk_hdr" >&5 +echo "configure:2891: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return 0; ; return 0; } EOF -if { (eval echo configure:2862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2883,12 +2924,12 @@ done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2887: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:2928: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2897,7 +2938,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else diff --git a/lib/make/configure.in b/lib/make/configure.in index 2f9533d8..2e3fd593 100644 --- a/lib/make/configure.in +++ b/lib/make/configure.in @@ -264,6 +264,24 @@ dnl Checks for library functions. AC_CHECK_FUNCS(mkdir) AC_CHECK_FUNCS(scandir) +# Check if we have mode_t available +AC_MSG_CHECKING([if mode_t is defined]) +AC_CACHE_VAL(cctk_cv_have_mode_t, +[AC_TRY_COMPILE([#include +#include +#include +#include ], +[mode_t foo; return 0], eval "cctk_cv_have_mode_t=yes", +eval "cctk_cv_have_mode_t=no") +]) +if test "$cctk_cv_have_mode_t" = "yes"; then + AC_DEFINE(HAVE_MODE_T) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + + dnl Check some timing stuff CCTK_TIME_GETTIMEOFDAY -- cgit v1.2.3