Also check for DIR.__dd_fd. tools/compat now builds on the WWDC developer

preview version of Mac OS X "Leopard".
This commit is contained in:
thorpej 2006-08-20 18:52:05 +00:00
parent a06f7205fb
commit c1f7db8026
4 changed files with 126 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_defs.h,v 1.52 2006/02/14 04:59:33 dyoung Exp $ */
/* $NetBSD: compat_defs.h,v 1.53 2006/08/20 18:52:05 thorpej Exp $ */
#ifndef __NETBSD_COMPAT_DEFS_H__
#define __NETBSD_COMPAT_DEFS_H__
@ -198,6 +198,8 @@ char *dirname(char *);
#if !HAVE_DIRFD
#if HAVE_DIR_DD_FD
#define dirfd(dirp) ((dirp)->dd_fd)
#elif HAVE_DIR___DD_FD
#define dirfd(dirp) ((dirp)->__dd_fd)
#else
/*XXX: Very hacky but no other way to bring this into scope w/o defining
_NETBSD_SOURCE which we're avoiding. */

113
tools/compat/configure vendored
View File

@ -6032,6 +6032,119 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
fi
echo "$as_me:$LINENO: checking for DIR.__dd_fd" >&5
echo $ECHO_N "checking for DIR.__dd_fd... $ECHO_C" >&6
if test "${ac_cv_member_DIR___dd_fd+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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/types.h>
#include <dirent.h>
int
main ()
{
static DIR ac_aggr;
if (ac_aggr.__dd_fd)
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_DIR___dd_fd=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. */
#include <sys/types.h>
#include <dirent.h>
int
main ()
{
static DIR ac_aggr;
if (sizeof ac_aggr.__dd_fd)
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_DIR___dd_fd=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_DIR___dd_fd=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_DIR___dd_fd" >&5
echo "${ECHO_T}$ac_cv_member_DIR___dd_fd" >&6
if test $ac_cv_member_DIR___dd_fd = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_DIR___DD_FD 1
_ACEOF
fi
echo "$as_me:$LINENO: checking for struct dirent.d_namlen" >&5
echo $ECHO_N "checking for struct dirent.d_namlen... $ECHO_C" >&6

View File

@ -1,4 +1,4 @@
# $NetBSD: configure.ac,v 1.57 2006/02/22 00:14:05 dogcow Exp $
# $NetBSD: configure.ac,v 1.58 2006/08/20 18:52:05 thorpej Exp $
#
# Autoconf definition file for libnbcompat.
#
@ -8,7 +8,7 @@ AC_CONFIG_HEADERS(nbtool_config.h)
AC_CONFIG_FILES(defs.mk)
# Autoheader header and footer
AH_TOP([/* $NetBSD: configure.ac,v 1.57 2006/02/22 00:14:05 dogcow Exp $ */
AH_TOP([/* $NetBSD: configure.ac,v 1.58 2006/08/20 18:52:05 thorpej Exp $ */
#ifndef __NETBSD_NBTOOL_CONFIG_H__
#define __NETBSD_NBTOOL_CONFIG_H__])
@ -108,7 +108,7 @@ NB_CHECK_INTTYPE(32)
NB_CHECK_INTTYPE(64)
# Struct members.
AC_CHECK_MEMBERS([DIR.dd_fd, struct dirent.d_namlen],,,
AC_CHECK_MEMBERS([DIR.dd_fd, DIR.__dd_fd, struct dirent.d_namlen],,,
[#include <sys/types.h>
#include <dirent.h>])
AC_CHECK_MEMBERS([struct stat.st_flags, struct stat.st_gen,

View File

@ -1,6 +1,6 @@
/* nbtool_config.h.in. Generated from configure.ac by autoheader. */
/* $NetBSD: nbtool_config.h.in,v 1.12 2006/02/11 10:35:29 wiz Exp $ */
/* $NetBSD: nbtool_config.h.in,v 1.13 2006/08/20 18:52:05 thorpej Exp $ */
#ifndef __NETBSD_NBTOOL_CONFIG_H__
#define __NETBSD_NBTOOL_CONFIG_H__
@ -142,6 +142,9 @@
/* Define to 1 if `dd_fd' is member of `DIR'. */
#undef HAVE_DIR_DD_FD
/* Define to 1 if `__dd_fd' is member of `DIR'. */
#undef HAVE_DIR___DD_FD
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
@ -229,6 +232,9 @@
/* Define to 1 if you have the <machine/bswap.h> header file. */
#undef HAVE_MACHINE_BSWAP_H
/* Define to 1 if you have the <machine/endian.h> header file. */
#undef HAVE_MACHINE_ENDIAN_H
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
@ -368,9 +374,6 @@
*/
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/endian.h> header file. */
#undef HAVE_SYS_ENDIAN_H
/* Define to 1 if you have the <sys/featuretest.h> header file. */
#undef HAVE_SYS_FEATURETEST_H