summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sim/common/ChangeLog13
-rw-r--r--sim/common/aclocal.m468
-rw-r--r--sim/common/callback.c52
-rw-r--r--sim/common/config.in40
-rwxr-xr-xsim/common/configure870
-rw-r--r--sim/common/configure.in6
6 files changed, 1044 insertions, 5 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 4b4b6779f1c..2158275768f 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,16 @@
+2004-12-03 Hans-Peter Nilsson <hp@axis.com>
+
+ * configure.in (SIM_CHECK_MEMBERS): Call for struct stat members
+ st_dev, st_ino, st_mode, st_nlink, st_uid, st_gid, st_rdev,
+ st_size, st_blksize, st_blocks, st_atime, st_mtime and st_ctime.
+ * aclocal.m4 (SIM_CHECK_MEMBER, SIM_CHECK_MEMBERS_1)
+ (SIM_CHECK_MEMBERS): New macros.
+ * callback.c (cb_host_to_target_stat): Use temporary macro ST_x
+ for struct stat member test and write. Add ST_x calls for each
+ struct stat member tested in configure.in. Wrap each ST_x call in
+ #ifdef of configure macro for that member.
+ * configure, config.in: Regenerate.
+
2004-12-01 Hans-Peter Nilsson <hp@axis.com>
* cgen.sh: New thirteenth parameter opcfile, defaulting to
diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4
index ceee6d49f83..20c72ffe156 100644
--- a/sim/common/aclocal.m4
+++ b/sim/common/aclocal.m4
@@ -1257,3 +1257,71 @@ AC_SUBST(CGEN_MAINT)
AC_SUBST(cgendir)
AC_SUBST(cgen)
])
+dnl FIXME: When upgrading to modern autoconf, remove
+dnl SIM_CHECK_MEMBER and SIM_CHECK_MEMBERS et al and use
+dnl AC_CHECK_MEMBERS from autoconf.
+dnl
+dnl Translated from a FC2 autoconf-2.59-3 installation.
+dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
+dnl [INCLUDES])
+dnl
+dnl ---------------------------------------------------------
+dnl AGGREGATE.MEMBER is for instance `struct passwd.pw_gecos', shell
+dnl variables are not a valid argument.
+AC_DEFUN([SIM_CHECK_MEMBER],
+dnl Extract the aggregate name, and the member name
+[AC_CACHE_CHECK([for $1], [ac_]patsubst([$1], [[\. ]], [_]),
+[ac_]patsubst([$1], [[\. ]], [_])[=no;]
+AC_TRY_COMPILE([$4],[
+dnl AGGREGATE ac_aggr;
+static ]patsubst([$1], [\..*])[ ac_aggr;
+dnl ac_aggr.MEMBER;
+if (ac_aggr.]patsubst([$1], [^[^.]*\.])[)
+return 0;],[ac_]patsubst([$1], [[\. ]], [_])[=yes;],
+AC_TRY_COMPILE([$4],[
+dnl AGGREGATE ac_aggr;
+static ]patsubst([$1], [\..*])[ ac_aggr;
+dnl ac_aggr.MEMBER;
+if (sizeof ac_aggr.]patsubst([$1], [^[^.]*\.])[)
+return 0;],
+[ac_]patsubst([$1], [[\. ]], [_])[=yes;],
+[ac_]patsubst([$1], [[\. ]], [_])[=no;]))
+[if test [$]ac_]patsubst([$1], [[\. ]], [_])[ = yes; then :; [$2]
+else :; [$3]
+fi])
+])dnl SIM_CHECK_MEMBER
+dnl
+dnl Translated from a FC2 autoconf-2.59-3 installation.
+dnl SIM_CHECK_MEMBERS([AGGREGATE.MEMBER, ...])
+dnl except we just work with a limited set of fixed includes.
+dnl
+AC_DEFUN([SIM_CHECK_MEMBERS_1],
+[ifelse($#, 1,
+[SIM_CHECK_MEMBER([$1],
+AC_DEFINE_UNQUOTED([HAVE_]translit([$1], [a-z .], [A-Z__]), 1,
+[Define to 1 if ]patsubst([$1],
+[^[^.]*\.])[ is a member of ]patsubst([$1], [\..*])[. ]),,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif])],
+[SIM_CHECK_MEMBER([$1],
+AC_DEFINE_UNQUOTED([HAVE_]translit([$1], [a-z .], [A-Z__]), 1,
+[Define to 1 if ]patsubst([$1],
+[^[^.]*\.])[ is a member of ]patsubst([$1], [\..*])[. ]),,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif])
+SIM_CHECK_MEMBERS_1(builtin(shift,$@))])])dnl SIM_CHECK_MEMBERS
+dnl
+AC_DEFUN([SIM_CHECK_MEMBERS],
+[ifelse($#, 1, [SIM_CHECK_MEMBERS_1($1)],
+[errprint(__file__:__line__:
+[This SIM_CHECK_MEMBERS only supports one argument,]
+[the list of struct tests])])])dnl SIM_CHECK_MEMBERS
diff --git a/sim/common/callback.c b/sim/common/callback.c
index ca707fc18cd..d2a92d084ca 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -816,10 +816,54 @@ cb_host_to_target_stat (cb, hs, ts)
if (hs != NULL)
{
- if (strncmp (m, "st_dev", q - m) == 0)
- store (p, size, hs->st_dev, big_p);
- else if (strncmp (m, "st_ino", q - m) == 0)
- store (p, size, hs->st_ino, big_p);
+ if (1)
+ ;
+ /* Defined here to avoid emacs indigestion on a lone "else". */
+#undef ST_x
+#define ST_x(FLD) \
+ else if (strncmp (m, #FLD, q - m) == 0) \
+ store (p, size, hs->FLD, big_p)
+
+#ifdef HAVE_STRUCT_STAT_ST_DEV
+ ST_x (st_dev);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_INO
+ ST_x (st_ino);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_MODE
+ ST_x (st_mode);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_NLINK
+ ST_x (st_nlink);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_UID
+ ST_x (st_uid);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_GID
+ ST_x (st_gid);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
+ ST_x (st_rdev);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_SIZE
+ ST_x (st_size);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
+ ST_x (st_blksize);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
+ ST_x (st_blocks);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_ATIME
+ ST_x (st_atime);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_MTIME
+ ST_x (st_mtime);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_CTIME
+ ST_x (st_ctime);
+#endif
+#undef ST_x
/* FIXME:wip */
else
store (p, size, 0, big_p); /* unsupported field, store 0 */
diff --git a/sim/common/config.in b/sim/common/config.in
index 0b222e8b6ef..1360d7ba5bb 100644
--- a/sim/common/config.in
+++ b/sim/common/config.in
@@ -180,3 +180,43 @@
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
+
+/* Define to 1 if st_dev is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_DEV
+
+/* Define to 1 if st_ino is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_INO
+
+/* Define to 1 if st_mode is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_MODE
+
+/* Define to 1 if st_nlink is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_NLINK
+
+/* Define to 1 if st_uid is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_UID
+
+/* Define to 1 if st_gid is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_GID
+
+/* Define to 1 if st_rdev is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_RDEV
+
+/* Define to 1 if st_size is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_SIZE
+
+/* Define to 1 if st_blksize is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if st_blocks is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_BLOCKS
+
+/* Define to 1 if st_atime is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_ATIME
+
+/* Define to 1 if st_mtime is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_MTIME
+
+/* Define to 1 if st_ctime is a member of struct stat. */
+#undef HAVE_STRUCT_STAT_ST_CTIME
+
diff --git a/sim/common/configure b/sim/common/configure
index 11c0e64e6c9..74f5e11c95b 100755
--- a/sim/common/configure
+++ b/sim/common/configure
@@ -3617,6 +3617,876 @@ else
fi
done
+echo $ac_n "checking for struct stat.st_dev""... $ac_c" 1>&6
+echo "configure:3622: checking for struct stat.st_dev" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_dev'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_dev=no;
+cat > conftest.$ac_ext <<EOF
+#line 3628 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_dev)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:3643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_dev=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3651 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_dev)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:3666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_dev=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_dev=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_dev = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_DEV 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_dev" 1>&6
+
+echo $ac_n "checking for struct stat.st_ino""... $ac_c" 1>&6
+echo "configure:3689: checking for struct stat.st_ino" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_ino'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_ino=no;
+cat > conftest.$ac_ext <<EOF
+#line 3695 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_ino)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:3710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_ino=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3718 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_ino)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:3733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_ino=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_ino=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_ino = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_INO 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_ino" 1>&6
+
+echo $ac_n "checking for struct stat.st_mode""... $ac_c" 1>&6
+echo "configure:3756: checking for struct stat.st_mode" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_mode'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_mode=no;
+cat > conftest.$ac_ext <<EOF
+#line 3762 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_mode)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:3777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_mode=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3785 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_mode)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:3800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_mode=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_mode=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_mode = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_MODE 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_mode" 1>&6
+
+echo $ac_n "checking for struct stat.st_nlink""... $ac_c" 1>&6
+echo "configure:3823: checking for struct stat.st_nlink" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_nlink'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_nlink=no;
+cat > conftest.$ac_ext <<EOF
+#line 3829 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_nlink)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:3844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_nlink=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3852 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_nlink)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:3867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_nlink=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_nlink=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_nlink = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_NLINK 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_nlink" 1>&6
+
+echo $ac_n "checking for struct stat.st_uid""... $ac_c" 1>&6
+echo "configure:3890: checking for struct stat.st_uid" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_uid'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_uid=no;
+cat > conftest.$ac_ext <<EOF
+#line 3896 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_uid)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:3911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_uid=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3919 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_uid)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:3934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_uid=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_uid=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_uid = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_UID 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_uid" 1>&6
+
+echo $ac_n "checking for struct stat.st_gid""... $ac_c" 1>&6
+echo "configure:3957: checking for struct stat.st_gid" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_gid'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_gid=no;
+cat > conftest.$ac_ext <<EOF
+#line 3963 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_gid)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:3978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_gid=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3986 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_gid)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_gid=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_gid=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_gid = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_GID 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_gid" 1>&6
+
+echo $ac_n "checking for struct stat.st_rdev""... $ac_c" 1>&6
+echo "configure:4024: checking for struct stat.st_rdev" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_rdev'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_rdev=no;
+cat > conftest.$ac_ext <<EOF
+#line 4030 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_rdev)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_rdev=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 4053 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_rdev)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_rdev=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_rdev=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_rdev = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_rdev" 1>&6
+
+echo $ac_n "checking for struct stat.st_size""... $ac_c" 1>&6
+echo "configure:4091: checking for struct stat.st_size" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_size'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_size=no;
+cat > conftest.$ac_ext <<EOF
+#line 4097 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_size)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_size=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 4120 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_size)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_size=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_size=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_size = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_SIZE 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_size" 1>&6
+
+echo $ac_n "checking for struct stat.st_blksize""... $ac_c" 1>&6
+echo "configure:4158: checking for struct stat.st_blksize" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_blksize'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_blksize=no;
+cat > conftest.$ac_ext <<EOF
+#line 4164 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_blksize)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_blksize=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 4187 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_blksize)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_blksize=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_blksize=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_blksize = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_blksize" 1>&6
+
+echo $ac_n "checking for struct stat.st_blocks""... $ac_c" 1>&6
+echo "configure:4225: checking for struct stat.st_blocks" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_blocks'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_blocks=no;
+cat > conftest.$ac_ext <<EOF
+#line 4231 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_blocks)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_blocks=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 4254 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_blocks)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_blocks=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_blocks=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_blocks = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_BLOCKS 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_blocks" 1>&6
+
+echo $ac_n "checking for struct stat.st_atime""... $ac_c" 1>&6
+echo "configure:4292: checking for struct stat.st_atime" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_atime'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_atime=no;
+cat > conftest.$ac_ext <<EOF
+#line 4298 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_atime)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_atime=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 4321 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_atime)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_atime=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_atime=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_atime = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_ATIME 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_atime" 1>&6
+
+echo $ac_n "checking for struct stat.st_mtime""... $ac_c" 1>&6
+echo "configure:4359: checking for struct stat.st_mtime" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_mtime'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_mtime=no;
+cat > conftest.$ac_ext <<EOF
+#line 4365 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_mtime)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_mtime=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 4388 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_mtime)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_mtime=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_mtime=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_mtime = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_MTIME 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_mtime" 1>&6
+
+echo $ac_n "checking for struct stat.st_ctime""... $ac_c" 1>&6
+echo "configure:4426: checking for struct stat.st_ctime" >&5
+if eval "test \"`echo '$''{'ac_struct_stat_st_ctime'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_struct_stat_st_ctime=no;
+cat > conftest.$ac_ext <<EOF
+#line 4432 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (ac_aggr.st_ctime)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_ctime=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 4455 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+int main() {
+
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_ctime)
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:4470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_struct_stat_st_ctime=yes;
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_struct_stat_st_ctime=no;
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+if test $ac_struct_stat_st_ctime = yes; then :; cat >> confdefs.h <<EOF
+#define HAVE_STRUCT_STAT_ST_CTIME 1
+EOF
+
+else :;
+fi
+fi
+
+echo "$ac_t""$ac_struct_stat_st_ctime" 1>&6
trap '' 1 2 15
cat > confcache <<\EOF
diff --git a/sim/common/configure.in b/sim/common/configure.in
index 44218783be7..e6d27107fbf 100644
--- a/sim/common/configure.in
+++ b/sim/common/configure.in
@@ -36,6 +36,10 @@ AC_SUBST(TARGET_SUBDIR)
# These aren't all needed yet, but will be eventually.
AC_CHECK_HEADERS(stdlib.h string.h strings.h time.h sys/times.h sys/stat.h sys/mman.h)
AC_CHECK_FUNCS(mmap munmap)
-
+SIM_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_ino],
+[struct stat.st_mode], [struct stat.st_nlink], [struct stat.st_uid],
+[struct stat.st_gid], [struct stat.st_rdev], [struct stat.st_size],
+[struct stat.st_blksize], [struct stat.st_blocks], [struct stat.st_atime],
+[struct stat.st_mtime], [struct stat.st_ctime]])
AC_OUTPUT(Makefile,
[case x$CONFIG_HEADERS in xcconfig.h:config.in) echo > stamp-h ;; esac])