done
-echo "$as_me:$LINENO: checking for member st_blocks in struct stat" >&5
-echo $ECHO_N "checking for member st_blocks in struct stat... $ECHO_C" >&6
-if test "${gdb_cv_have_struct_stat_with_st_blocks_member+set}" = set; then
+# ------------------------- #
+# Checks for declarations. #
+# ------------------------- #
+
+for ac_func in getopt
+do
+ ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5
+echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6
+if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/stat.h>
+#undef $ac_tr_decl
+#define $ac_tr_decl 1
+
+
int
main ()
{
-struct stat st; (void) st.st_blocks;
+#ifndef $ac_func
+char *(*pfn) = (char *(*)) $ac_func ;
+#endif
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- gdb_cv_have_struct_stat_with_st_blocks_member=yes
+ eval "gcc_cv_have_decl_$ac_func=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-gdb_cv_have_struct_stat_with_st_blocks_member=no
+eval "gcc_cv_have_decl_$ac_func=no"
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $gdb_cv_have_struct_stat_with_st_blocks_member" >&5
-echo "${ECHO_T}$gdb_cv_have_struct_stat_with_st_blocks_member" >&6
-if test $gdb_cv_have_struct_stat_with_st_blocks_member = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
+if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6 ; cat >>confdefs.h <<_ACEOF
+#define $ac_tr_decl 1
+_ACEOF
+
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6 ; cat >>confdefs.h <<_ACEOF
+#define $ac_tr_decl 0
_ACEOF
fi
-# ------------------------- #
-# Checks for declarations. #
-# ------------------------- #
+done
+if test x = y ; then
-for ac_func in getopt
-do
- ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5
-echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6
-if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DECL_GETOPT 1
+_ACEOF
+fi
+
+
+# ----------------------- #
+# Checks for structures. #
+# ----------------------- #
+
+echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5
+echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6
+if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#undef $ac_tr_decl
-#define $ac_tr_decl 1
-
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (ac_aggr.st_blocks)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_stat_st_blocks=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
int
main ()
{
-#ifndef $ac_func
-char *(*pfn) = (char *(*)) $ac_func ;
-#endif
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_blocks)
+return 0;
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- eval "gcc_cv_have_decl_$ac_func=yes"
+ ac_cv_member_struct_stat_st_blocks=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-eval "gcc_cv_have_decl_$ac_func=no"
+ac_cv_member_struct_stat_st_blocks=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5
+echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6
+if test $ac_cv_member_struct_stat_st_blocks = yes; then
-if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6 ; cat >>confdefs.h <<_ACEOF
-#define $ac_tr_decl 1
-_ACEOF
-
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6 ; cat >>confdefs.h <<_ACEOF
-#define $ac_tr_decl 0
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLOCKS 1
_ACEOF
-fi
-
-done
-if test x = y ; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DECL_GETOPT 1
-_ACEOF
fi
# unconditionally, so what's the point in checking these?
AC_CHECK_HEADERS(ctype.h time.h)
-dnl Check for struct stat with an st_blocks member
-AC_MSG_CHECKING(for member st_blocks in struct stat)
-AC_CACHE_VAL(gdb_cv_have_struct_stat_with_st_blocks_member,
- [AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/stat.h>],
- [struct stat st; (void) st.st_blocks;],
- gdb_cv_have_struct_stat_with_st_blocks_member=yes,
- gdb_cv_have_struct_stat_with_st_blocks_member=no)])
-AC_MSG_RESULT($gdb_cv_have_struct_stat_with_st_blocks_member)
-if test $gdb_cv_have_struct_stat_with_st_blocks_member = yes; then
- AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS)
-fi
-
# ------------------------- #
# Checks for declarations. #
# ------------------------- #
gcc_AC_CHECK_DECLS(getopt)
+# ----------------------- #
+# Checks for structures. #
+# ----------------------- #
+
+AC_CHECK_MEMBERS([struct stat.st_blocks])
+
# ------------------ #
# Checks for types. #
# ------------------ #