fixed build error under linux.

This commit is contained in:
Abdulaziz Ghuloum 2008-11-16 04:22:23 -05:00
parent bc11d4f44f
commit e3a7a875a4
5 changed files with 484 additions and 1 deletions

View File

@ -83,6 +83,18 @@
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
/* stat struct has st_ctim field */
#undef HAVE_STAT_ST_CTIM
/* stat struct has st_ctimespec field */
#undef HAVE_STAT_ST_CTIMESPEC
/* stat struct has st_mtim field */
#undef HAVE_STAT_ST_MTIM
/* stat struct has st_mtimespec field */
#undef HAVE_STAT_ST_MTIMESPEC
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H

426
configure vendored
View File

@ -7277,6 +7277,432 @@ _ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for struct stat.st_mtimespec" >&5
$as_echo_n "checking for struct stat.st_mtimespec... " >&6; }
if test "${ac_cv_member_struct_stat_st_mtimespec+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/stat.h>
int
main ()
{
static struct stat ac_aggr;
if (ac_aggr.st_mtimespec)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_mtimespec=yes
else
$as_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. */
#include <sys/stat.h>
int
main ()
{
static struct stat ac_aggr;
if (sizeof ac_aggr.st_mtimespec)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_mtimespec=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_stat_st_mtimespec=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_mtimespec" >&5
$as_echo "$ac_cv_member_struct_stat_st_mtimespec" >&6; }
if test "x$ac_cv_member_struct_stat_st_mtimespec" = x""yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_STAT_ST_MTIMESPEC 1
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for struct stat.st_mtim" >&5
$as_echo_n "checking for struct stat.st_mtim... " >&6; }
if test "${ac_cv_member_struct_stat_st_mtim+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/stat.h>
int
main ()
{
static struct stat ac_aggr;
if (ac_aggr.st_mtim)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_mtim=yes
else
$as_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. */
#include <sys/stat.h>
int
main ()
{
static struct stat ac_aggr;
if (sizeof ac_aggr.st_mtim)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_mtim=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_stat_st_mtim=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_mtim" >&5
$as_echo "$ac_cv_member_struct_stat_st_mtim" >&6; }
if test "x$ac_cv_member_struct_stat_st_mtim" = x""yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_STAT_ST_MTIM 1
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for struct stat.st_ctimespec" >&5
$as_echo_n "checking for struct stat.st_ctimespec... " >&6; }
if test "${ac_cv_member_struct_stat_st_ctimespec+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/stat.h>
int
main ()
{
static struct stat ac_aggr;
if (ac_aggr.st_ctimespec)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_ctimespec=yes
else
$as_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. */
#include <sys/stat.h>
int
main ()
{
static struct stat ac_aggr;
if (sizeof ac_aggr.st_ctimespec)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_ctimespec=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_stat_st_ctimespec=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_ctimespec" >&5
$as_echo "$ac_cv_member_struct_stat_st_ctimespec" >&6; }
if test "x$ac_cv_member_struct_stat_st_ctimespec" = x""yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_STAT_ST_CTIMESPEC 1
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for struct stat.st_ctim" >&5
$as_echo_n "checking for struct stat.st_ctim... " >&6; }
if test "${ac_cv_member_struct_stat_st_ctim+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/stat.h>
int
main ()
{
static struct stat ac_aggr;
if (ac_aggr.st_ctim)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_ctim=yes
else
$as_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. */
#include <sys/stat.h>
int
main ()
{
static struct stat ac_aggr;
if (sizeof ac_aggr.st_ctim)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_ctim=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_stat_st_ctim=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_ctim" >&5
$as_echo "$ac_cv_member_struct_stat_st_ctim" >&6; }
if test "x$ac_cv_member_struct_stat_st_ctim" = x""yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_STAT_ST_CTIM 1
_ACEOF
fi
# Checks for typedefs, structures, and compiler characteristics.
{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }

View File

@ -90,6 +90,32 @@ AC_DEFINE(ENABLE_LIBFFI, 1, [adds support for libffi])
fi
AC_CHECK_MEMBER([struct stat.st_mtimespec],
AC_DEFINE(HAVE_STAT_ST_MTIMESPEC, 1,
[stat struct has st_mtimespec field]),
[],
[[#include <sys/stat.h>]])
AC_CHECK_MEMBER([struct stat.st_mtim],
AC_DEFINE(HAVE_STAT_ST_MTIM, 1,
[stat struct has st_mtim field]),
[],
[[#include <sys/stat.h>]])
AC_CHECK_MEMBER([struct stat.st_ctimespec],
AC_DEFINE(HAVE_STAT_ST_CTIMESPEC, 1,
[stat struct has st_ctimespec field]),
[],
[[#include <sys/stat.h>]])
AC_CHECK_MEMBER([struct stat.st_ctim],
AC_DEFINE(HAVE_STAT_ST_CTIM, 1,
[stat struct has st_ctim field]),
[],
[[#include <sys/stat.h>]])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE

View File

@ -1 +1 @@
1681
1683

View File

@ -297,6 +297,7 @@ timespec_bytevector(struct timespec* s, ikpcb* pcb) {
return r + bytevector_tag;
}
ikptr
ikrt_file_ctime2(ikptr filename, ikpcb* pcb){
struct stat s;
@ -304,7 +305,16 @@ ikrt_file_ctime2(ikptr filename, ikpcb* pcb){
if(err) {
return ik_errno_to_code();
}
#if HAVE_STAT_ST_CTIMESPEC
return timespec_bytevector(&s.st_ctimespec, pcb);
#elif HAVE_STAT_ST_CTIM
return timespec_bytevector(&s.st_ctim, pcb);
#else
struct timespec ts;
ts.tv_sec = s.st_ctime;
ts.tv_nsec = 0;
return timespec_bytevector(&st, pcb);
#endif
}
ikptr
@ -314,7 +324,16 @@ ikrt_file_mtime2(ikptr filename, ikpcb* pcb){
if(err) {
return ik_errno_to_code();
}
#if HAVE_STAT_ST_MTIMESPEC
return timespec_bytevector(&s.st_mtimespec, pcb);
#elif HAVE_STAT_ST_MTIM
return timespec_bytevector(&s.st_mtim, pcb);
#else
struct timespec ts;
ts.tv_sec = s.st_mtime;
ts.tv_nsec = 0;
return timespec_bytevector(&st, pcb);
#endif
}