summaryrefslogtreecommitdiff
path: root/source4/heimdal_build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/heimdal_build')
-rw-r--r--source4/heimdal_build/ifaddrs.hin1
-rw-r--r--source4/heimdal_build/internal.m49
-rw-r--r--source4/heimdal_build/replace.c5
-rw-r--r--source4/heimdal_build/roken.h16
4 files changed, 28 insertions, 3 deletions
diff --git a/source4/heimdal_build/ifaddrs.hin b/source4/heimdal_build/ifaddrs.hin
new file mode 100644
index 0000000000..a50b03335b
--- /dev/null
+++ b/source4/heimdal_build/ifaddrs.hin
@@ -0,0 +1 @@
+#include "system/network.h"
diff --git a/source4/heimdal_build/internal.m4 b/source4/heimdal_build/internal.m4
index 5c8d78e56d..e7e7ae1842 100644
--- a/source4/heimdal_build/internal.m4
+++ b/source4/heimdal_build/internal.m4
@@ -46,6 +46,15 @@ dnl declarations will be correct). Phew!
AC_CHECK_HEADERS([err.h], [],
[ cp heimdal/lib/roken/err.hin heimdal_build/err.h ])
+dnl Not all systems have ifaddrs.h, so we provide a replacement. Heimdal
+dnl unconditionally #includes <ifaddrs.h>, so we need to create an ifaddrs.h,
+dnl but we can't just have a static one because we don't want to use
+dnl it on systems that have a real ifaddrs.h. If the system has a real
+dnl ifaddrs.h. We don't use heimdal's lib/roken/ifaddrs.hin because
+dnl our libreplace would conflict with it.
+AC_CHECK_HEADERS([ifaddrs.h], [],
+ [ cp heimdal_build/ifaddrs.hin heimdal_build/ifaddrs.h ])
+
AC_CHECK_HEADERS([ \
crypt.h \
curses.h \
diff --git a/source4/heimdal_build/replace.c b/source4/heimdal_build/replace.c
index ba43dd9495..8c3def7dca 100644
--- a/source4/heimdal_build/replace.c
+++ b/source4/heimdal_build/replace.c
@@ -21,11 +21,9 @@
*/
#include "config.h"
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
#include "err.h"
#include "roken.h"
+#include "system/filesys.h"
#ifndef HAVE_ERR
void err(int eval, const char *format, ...)
@@ -63,6 +61,7 @@
#ifndef HAVE_FLOCK
int flock(int fd, int op)
{
+#undef flock
struct flock lock;
lock.l_whence = 0;
lock.l_start = 0;
diff --git a/source4/heimdal_build/roken.h b/source4/heimdal_build/roken.h
index 4eabbe2af4..87060cff17 100644
--- a/source4/heimdal_build/roken.h
+++ b/source4/heimdal_build/roken.h
@@ -37,6 +37,10 @@
#define HAVE_SETEUID 1
#endif
+#ifndef HAVE_STRNLEN
+#define HAVE_STRNLEN
+#endif
+
#ifndef HAVE_STRNDUP
#define HAVE_STRNDUP
#endif
@@ -53,6 +57,14 @@
#define HAVE_STRCASECMP
#endif
+#ifndef HAVE_ASPRINTF
+#define HAVE_ASPRINTF
+#endif
+
+#ifndef HAVE_VASPRINTF
+#define HAVE_VASPRINTF
+#endif
+
#ifndef HAVE_MKSTEMP
#define HAVE_MKSTEMP
#endif
@@ -85,6 +97,10 @@
#define HAVE_INNETGR
#endif
+#ifndef HAVE_INET_ATON
+#define HAVE_INET_ATON
+#endif
+
/* we lie about having pidfile() so that NetBSD5 can compile. Nothing
in the parts of heimdal we use actually uses pidfile(), and we
don't use it in Samba, so this works, although its ugly */