In addition to shimming on platforms that don't have them, we also need to
shim sys/mount.h on DragonFlyBSD since it uses its native STAILQ_ENTRYs
which our compat queues.h does not have, which causes sftp-server.o to
not build. This is a little icky, but it limits the blast radius to
just one source file on only DragonFly. ok djm@
poll.h \
stdint.h \
sys/mman.h \
+ sys/mount.h \
sys/stat.h \
+ sys/statvfs.h \
sys/time.h \
sys/un.h \
time.h \
esac >"$header"
done
+# DragonFly uses STAILQ_* in its sys/mount.h, so we explicitly
+# need to include the system one first, not our shim.
+case "$host" in
+*-*-dragonfly*)
+ mkdir -p openbsd-compat/include/sys
+ echo '#include "/usr/include/sys/queue.h"'
+ echo '#include "/usr/include/sys/mount.h"'
+ ;;
+esac > "openbsd-compat/include/sys/mount.h"
+
AC_CHECK_DECLS([le32toh, le64toh, htole64], [], [], [
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#include <sys/types.h>
#include <sys/queue.h>
-#ifdef HAVE_SYS_STATVFS_H
-#include <sys/statvfs.h>
-#endif
#include <sys/stat.h>
#include <sys/time.h>
+#include <sys/statvfs.h>
#include <sys/uio.h>
#include <dirent.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/time.h>
-#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
-#endif
-#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
-#endif
#include <dirent.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/socket.h>
-#include <sys/wait.h>
-#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
-#endif
+#include <sys/wait.h>
#include <ctype.h>
#include <errno.h>