diff --git a/src/common/autoconfig.h.in b/src/common/autoconfig.h.in index 925a50fb..5e99c482 100644 --- a/src/common/autoconfig.h.in +++ b/src/common/autoconfig.h.in @@ -109,7 +109,7 @@ #undef _FILE_OFFSET_BITS #undef _LARGE_FILES -#if _FILE_OFFSET_BITS == 64 || defined(__APPLE__) +#if _FILE_OFFSET_BITS == 64 || defined(__APPLE__) || defined(__OpenBSD__) #define OFFTPC "%lld" #else #define OFFTPC "%ld" diff --git a/src/configure b/src/configure index 6dc34abc..eeabe6fe 100755 --- a/src/configure +++ b/src/configure @@ -4008,10 +4008,42 @@ fi done +for ac_header in sys/param.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_PARAM_H 1 +_ACEOF + +fi + +done + +for ac_header in bar.h +do : + ac_fn_c_check_header_compile "$LINENO" "bar.h" "ac_cv_header_bar_h" "#ifdef HAVE_FOO_H +# include +#endif + +" +if test "x$ac_cv_header_bar_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BAR_H 1 +_ACEOF + +fi + +done + for ac_header in sys/mount.h sys/statfs.h sys/statvfs.h sys/vfs.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_PARAM_H +# include +#endif + +" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 diff --git a/src/configure.ac b/src/configure.ac index 596304f4..4ccb7d61 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -23,7 +23,14 @@ fi AC_SYS_LARGEFILE -AC_CHECK_HEADERS(sys/mount.h sys/statfs.h sys/statvfs.h sys/vfs.h) +# OpenBSD needs sys/param.h for mount.h to compile +AC_CHECK_HEADERS([sys/param.h]) + +AC_CHECK_HEADERS([sys/mount.h sys/statfs.h sys/statvfs.h sys/vfs.h], [], [], +[#ifdef HAVE_SYS_PARAM_H +# include +#endif +]) # Use specific 'file' command ? (Useful on solaris to specify # /usr/local/bin/file instead of the system's which doesn't understand '-i'