aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2019-06-22 17:26:07 +0200
committerMatthias Andree <matthias.andree@gmx.de>2019-08-05 13:08:43 +0200
commit53f7f27693dc5b3ac606a1ca3a7225467e15e162 (patch)
tree8238000425697e90886e21fb92694954266d824a
parentfea8e876fcb668abd2f0f56f285327846fabdbde (diff)
downloadfetchmail-53f7f27693dc5b3ac606a1ca3a7225467e15e162.tar.gz
fetchmail-53f7f27693dc5b3ac606a1ca3a7225467e15e162.tar.bz2
fetchmail-53f7f27693dc5b3ac606a1ca3a7225467e15e162.zip
FreeBSD cleanups to header shuffling.
-rw-r--r--configure.ac21
-rw-r--r--fetchmail.h7
-rw-r--r--socket.c5
-rw-r--r--uid_db.c7
-rw-r--r--uid_db.h4
5 files changed, 12 insertions, 32 deletions
diff --git a/configure.ac b/configure.ac
index 2b210db0..b39c70b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,18 +78,12 @@ AC_CHECK_HEADERS([unistd.h termios.h termio.h sgtty.h stdarg.h \
if test _$ac_cv_header_stdarg_h != _yes ; then
AC_MSG_WARN([stdarg.h is not defined. Unsupported configuration, proceed at your own risk.])
fi
-AC_CHECK_TYPE(u_int32_t,,
- AC_DEFINE(u_int32_t,unsigned int,
- [Define to unsigned int if <sys/types.h> does not define.]),
- [AC_INCLUDES_DEFAULT
-#ifdef HAVE_ARPA_NAMESER_H
-#include <arpa/nameser.h>
-#endif])
+
+AC_TYPE_UINT32_T
+
AC_CHECK_HEADERS([resolv.h],,,[
#include <sys/types.h>
-#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
-#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
@@ -191,12 +185,8 @@ dnl INET6 is used by KAME/getnameinfo
AC_CACHE_CHECK(for AF_INET6/PF_INET6,ac_cv_inet6,
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
- #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
- #endif
- #ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
- #endif
]],[[
int foo = AF_INET6;
int bar = PF_INET6;
@@ -222,9 +212,7 @@ for lib in '' -lresolv; do
LIBS="$old_LIBS $lib"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
-#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
-#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
@@ -273,9 +261,8 @@ pid = waitpid (-1, &status, 0);
AC_MSG_CHECKING(sys_siglist declaration in signal.h or unistd.h)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>
/* NetBSD declares sys_siglist in <unistd.h>. */
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif]], [[char *msg = *(sys_siglist + 1);]])],[AC_DEFINE(SYS_SIGLIST_DECLARED,1,[Define if 'sys_siglist' is declared by <signal.h>.]) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
+]], [[char *msg = *(sys_siglist + 1);]])],[AC_DEFINE(SYS_SIGLIST_DECLARED,1,[Define if 'sys_siglist' is declared by <signal.h>.]) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
# Find the right directory to put the root-mode PID file in
for dir in "/var/run" "/etc"
diff --git a/fetchmail.h b/fetchmail.h
index 6a224cae..8e546693 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -5,7 +5,6 @@
* For license terms, see the file COPYING in this directory.
*/
-/* We need this for HAVE_STDARG_H, etc */
#include "config.h"
struct addrinfo;
@@ -40,12 +39,6 @@ struct addrinfo;
#endif
#include "uid_db.h"
-
-/* We need this for strstr */
-#if !defined(HAVE_STRSTR) && !defined(strstr)
-char *strstr(const char *, const char *);
-#endif
-
#include "fm_strl.h"
/* constants designating the various supported protocols */
diff --git a/socket.c b/socket.c
index 399ba189..123000ed 100644
--- a/socket.c
+++ b/socket.c
@@ -15,11 +15,7 @@
#endif /* HAVE_MEMORY_H */
#include <sys/types.h>
#include <sys/stat.h>
-#ifndef HAVE_NET_SOCKET_H
#include <sys/socket.h>
-#else
-#include <net/socket.h>
-#endif
#include <sys/un.h>
#include <netinet/in.h>
#ifdef HAVE_ARPA_INET_H
@@ -53,6 +49,7 @@
#include "getaddrinfo.h"
#include "i18n.h"
#include "sdump.h"
+#include "uid_db.h"
/* Defines to allow BeOS and Cygwin to play nice... */
#ifdef __BEOS__
diff --git a/uid_db.c b/uid_db.c
index fdc35b73..ef36efbe 100644
--- a/uid_db.c
+++ b/uid_db.c
@@ -8,9 +8,7 @@
6.3.17 release, including the OpenSSL exemption.
*/
-/* Have Solaris expose ffs() from strings.h: */
-#define __EXTENSIONS__
-#define _XOPEN_SOURCE 700
+#include "fetchmail.h"
/* includes */
#include <stdio.h>
@@ -18,9 +16,10 @@
#include <string.h>
#include <strings.h> /* ffs() lives here - needs #define on Solaris. */
-#include "xmalloc.h"
#include "uid_db.h"
+#include "xmalloc.h"
+
/* constants */
enum {
MIN_RECORDS = 16 /* arbitrary */
diff --git a/uid_db.h b/uid_db.h
index f76f740f..b24dea03 100644
--- a/uid_db.h
+++ b/uid_db.h
@@ -10,6 +10,10 @@
#ifndef fetchmail_uid_db_h
#define fetchmail_uid_db_h
+/* If ffs() is missing on, for instance, Solaris, make sure that config.h or fetchmail.h
+ * contains #define __EXTENSIONS__ - autoconf should set it in config.h. */
+#include "config.h"
+
/* includes */
#include <stddef.h>