Check for dirfd in autoconf build

This commit via
https://anonhg.netbsd.org/pkgsrc/file/tip/shells/fish/patches/patch-configure.ac,
credit to jklos@pkgsrc.org.
This commit is contained in:
Fabian Homborg 2018-12-11 20:31:40 +01:00
parent ee5e4cf8e2
commit e4b6007f33

View file

@ -322,7 +322,24 @@ AC_CHECK_FUNCS( wcslcpy lrand48_r killpg )
AC_CHECK_FUNCS( backtrace_symbols getifaddrs )
AC_CHECK_FUNCS( futimens clock_gettime )
AC_CHECK_FUNCS( getpwent flock )
AC_CHECK_FUNCS( dirfd )
AC_MSG_CHECKING([dirfd])
AC_LINK_IFELSE([
#include <dirent.h>
DIR *dirp;
int
main(void)
{
return dirfd(dirp);
}
], [ AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_DIRFD], 1, [ Define to 1 if you have the `dirfd' function or macro. ])
],
[ AC_MSG_RESULT([no])]
)
AC_CHECK_DECL( [__NetBSD__], AC_DEFINE([TPARM_VARARGS], 1, [ Make tparm take varargs ]) )
AC_CHECK_DECL( [mkostemp], [ AC_CHECK_FUNCS([mkostemp]) ] )