From b4408c9585f2c1373cb874528a78a236552c95bf Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 13 Nov 2012 14:58:32 -0800 Subject: [PATCH] - build fixes for OpenBSD, from rustyBSD --- checkin_notes | 7 +++++++ client/hostinfo_unix.cpp | 11 ++--------- configure.ac | 27 ++++++++++++++++++++++++++- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/checkin_notes b/checkin_notes index 2fd6a11aa9..e7299e86d5 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6773,3 +6773,10 @@ David 13 Nov 2012 client/ cs_scheduler.cpp work_fetch.cpp + +David 13 Nov 2012 + - build fixes for OpenBSD, from rustyBSD + + configure.ac + client/ + hostinfo_unix.cpp diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index b535b3395e..081b5eada7 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -1365,15 +1365,8 @@ int HOST_INFO::get_host_info() { getsysinfo( GSI_PHYSMEM, (caddr_t) &mem_size, sizeof( mem_size)); m_nbytes = 1024.* (double)mem_size; #elif defined(HW_PHYSMEM) - // for OpenBSD - mib[0] = CTL_HW; - int mem_size; - mib[1] = HW_PHYSMEM; - len = sizeof(mem_size); - sysctl(mib, 2, &mem_size, &len, NULL, 0); - m_nbytes = mem_size; -#elif defined(__FreeBSD__) - unsigned int mem_size; + // for OpenBSD & NetBSD & FreeBSD + int mem_size; mib[0] = CTL_HW; mib[1] = HW_PHYSMEM; len = sizeof(mem_size); diff --git a/configure.ac b/configure.ac index 2b9d1c4371..1649567cb1 100644 --- a/configure.ac +++ b/configure.ac @@ -602,7 +602,32 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_TIME AC_TYPE_SIGNAL -AC_CHECK_HEADERS(windows.h sys/types.h sys/un.h arpa/inet.h dirent.h grp.h fcntl.h inttypes.h stdint.h malloc.h alloca.h memory.h netdb.h netinet/in.h netinet/tcp.h netinet/ether.h net/if.h net/if_arp.h signal.h strings.h sys/auxv.h sys/file.h sys/fcntl.h sys/ipc.h sys/ioctl.h sys/mount.h sys/msg.h sys/param.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/socket.h sys/stat.h sys/statvfs.h sys/statfs.h sys/swap.h sys/sysctl.h sys/systeminfo.h sys/time.h sys/types.h sys/utsname.h sys/vmmeter.h sys/wait.h unistd.h utmp.h errno.h procfs.h ieeefp.h setjmp.h resolv.h) +AC_CHECK_HEADERS(windows.h sys/types.h sys/un.h arpa/inet.h dirent.h grp.h fcntl.h inttypes.h stdint.h malloc.h alloca.h memory.h netdb.h netinet/in.h netinet/tcp.h netinet/ether.h signal.h strings.h sys/auxv.h sys/file.h sys/fcntl.h sys/ipc.h sys/ioctl.h sys/msg.h sys/param.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/socket.h sys/stat.h sys/statvfs.h sys/statfs.h sys/systeminfo.h sys/time.h sys/types.h sys/utsname.h sys/vmmeter.h sys/wait.h unistd.h utmp.h errno.h procfs.h ieeefp.h setjmp.h) + +AC_CHECK_HEADER(net/if.h, [], [], [[ +#if HAVE_SYS_SOCKET_H +# include +#endif +]]) + +AC_CHECK_HEADER(net/if_arp.h, [], [], [[ +#if HAVE_SYS_SOCKET_H +# include +#endif +]]) + +AC_CHECK_HEADERS(sys/sysctl.h sys/mount.h sys/swap.h, [], [], [[ +#ifdef HAVE_SYS_PARAM_H +# include +#endif +]]) + +AC_CHECK_HEADER(resolv.h, [], [], [[ +#ifdef HAVE_NETINET_IN_H +# include +#endif +]]) + AC_CHECK_HEADERS(netinet/if_ether.h,[],[],[[ #ifdef HAVE_SYS_TYPES_H #include