libnss-myhostname (0.3-4) 0001-Fix-building-on-kFreeBSD-MAX_HOST_NAME.patch

Summary

 configure.ac |   10 ++++++++++
 1 file changed, 10 insertions(+)

    
download this patch

Patch contents

From 818479cdd74dd257bf53d013c03aa404ed47331b Mon Sep 17 00:00:00 2001
From: Joachim Breitner <mail@joachim-breitner.de>
Date: Fri, 4 Jun 2010 11:27:46 +0200
Subject: Fix building on kFreeBSD (MAX_HOST_NAME)

---
 configure.ac |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 38cd58f..a766d7a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,6 +69,16 @@ AC_FUNC_MALLOC
 AC_FUNC_SELECT_ARGTYPES
 AC_CHECK_FUNCS([gethostbyaddr gethostbyname gettimeofday inet_ntoa memset select socket strcspn strdup strerror strncasecmp strcasecmp strspn])
 
+# HOST_NAME_MAX not available on BSD-Kernels
+# first call to AC_CHECK_DECL can not be nested, thus add a dummy call here
+AC_CHECK_DECL(DUMMY,[],[])
+AC_CHECK_DECL(HOST_NAME_MAX,[],
+ AC_CHECK_DECL(_POSIX_HOST_NAME_MAX,
+ AC_DEFINE(HOST_NAME_MAX, _POSIX_HOST_NAME_MAX, []),
+  AC_DEFINE(HOST_NAME_MAX, 256, [Define to 256 if neither have HOST_NAME_MAX nor _POSIX_HOST_NAME_MAX]),
+  [[#include <limits.h>]]),
+[[#include <limits.h>]])
+
 # LYNX documentation generation
 ZP_LYNX_DOC
 
-- 
1.7.5.4