Package: nas
Severity: important
Version: 1.8-1
Tags: patch


Hi,

the current version fails to build on GNU/kFreeBSD.
It needs updated libtool and small tweaks.

Please, apply attached patch and after that
perform following steps (to update libtool):

cd config
libtoolize -c -f
aclocal-1.7
autoconf

The patch contains also fix for #368726.

It would also be nice if you can ask upstream
to include this changes.

Thanks in advance

                        Petr
diff -u nas-1.8/lib/audio/Imakefile nas-1.8/lib/audio/Imakefile
--- nas-1.8/lib/audio/Imakefile 2006-07-25 15:44:03.000000000 +0200
+++ nas-1.8/lib/audio/Imakefile 2006-07-25 15:44:03.000000000 +0200
@@ -146,7 +146,7 @@
 
 XAULIB = 
 
-#if defined(LinuxArchitecture) || defined(GNUArchitecture)
+#if defined(LinuxArchitecture) || defined(GNUArchitecture) || 
defined(__FreeBSD_kernel__)
 REQUIREDLIBS = -L$(USRLIBDIR) -lXt $(XAULIB) -lm 
 #endif
 
diff -u nas-1.8/server/Imakefile nas-1.8/server/Imakefile
--- nas-1.8/server/Imakefile
+++ nas-1.8/server/Imakefile
@@ -96,7 +96,7 @@
 #endif
 
 
-#if defined(i386SVR4Architecture) || defined(__FreeBSD__) || 
defined(FreeBSDArchitecture) || defined(LinuxArchitecture) || 
defined(i386BsdArchitecture) || defined(USLArchitecture) || 
defined(cygwinArchitecture) || defined(__DragonFly__)
+#if defined(i386SVR4Architecture) || defined(__FreeBSD_kernel__) || 
defined(__FreeBSD__) || defined(FreeBSDArchitecture) || 
defined(LinuxArchitecture) || defined(i386BsdArchitecture) || 
defined(USLArchitecture) || defined(cygwinArchitecture) || 
defined(__DragonFly__)
 # define CanBuildAuServer      YES
 
 #if !defined(GNUMachArchitecture)
only in patch2:
unchanged:
--- nas-1.8.orig/server/dia/auservertype.h
+++ nas-1.8/server/dia/auservertype.h
@@ -14,7 +14,7 @@
 # define SGI_SERVER
 #endif                                         /* sgi */
 
-#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(linux) || (defined(SVR4) && (defined(SYSV386) || defined(i386))) || 
defined(__CYGWIN__)
+#if defined(__DragonFly__) || defined(__FreeBSD_kernel__) || 
defined(__FreeBSD__) || defined(__NetBSD__) || defined(linux) || (defined(SVR4) 
&& (defined(SYSV386) || defined(i386))) || defined(__CYGWIN__)
 # define VOXWARE_SERVER
 #endif                                          /* voxware */
 
only in patch2:
unchanged:
--- nas-1.8.orig/config/acinclude.m4
+++ nas-1.8/config/acinclude.m4
@@ -0,0 +1,72 @@
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_func_snprintf.html
+
+AC_DEFUN([AC_FUNC_SNPRINTF],
+[AC_CHECK_FUNCS(snprintf vsnprintf)
+AC_MSG_CHECKING(for working snprintf)
+AC_CACHE_VAL(ac_cv_have_working_snprintf,
+[AC_TRY_RUN(
+[#include <stdio.h>
+
+int main(void)
+{
+    char bufs[5] = { 'x', 'x', 'x', '\0', '\0' };
+    char bufd[5] = { 'x', 'x', 'x', '\0', '\0' };
+    int i;
+    i = snprintf (bufs, 2, "%s", "111");
+    if (strcmp (bufs, "1")) exit (1);
+    if (i != 3) exit (1);
+    i = snprintf (bufd, 2, "%d", 111);
+    if (strcmp (bufd, "1")) exit (1);
+    if (i != 3) exit (1);
+    exit(0);
+}], ac_cv_have_working_snprintf=yes, ac_cv_have_working_snprintf=no, 
ac_cv_have_working_snprintf=cross)])
+AC_MSG_RESULT([$ac_cv_have_working_snprintf])
+AC_MSG_CHECKING(for working vsnprintf)
+AC_CACHE_VAL(ac_cv_have_working_vsnprintf,
+[AC_TRY_RUN(
+[#include <stdio.h>
+#include <stdarg.h>
+
+int my_vsnprintf (char *buf, const char *tmpl, ...)
+{
+    int i;
+    va_list args;
+    va_start (args, tmpl);
+    i = vsnprintf (buf, 2, tmpl, args);
+    va_end (args);
+    return i;
+}
+
+int main(void)
+{
+    char bufs[5] = { 'x', 'x', 'x', '\0', '\0' };
+    char bufd[5] = { 'x', 'x', 'x', '\0', '\0' };
+    int i;
+    i = my_vsnprintf (bufs, "%s", "111");
+    if (strcmp (bufs, "1")) exit (1);
+    if (i != 3) exit (1);
+    i = my_vsnprintf (bufd, "%d", 111);
+    if (strcmp (bufd, "1")) exit (1);
+    if (i != 3) exit (1);
+    exit(0);
+}], ac_cv_have_working_vsnprintf=yes, ac_cv_have_working_vsnprintf=no, 
ac_cv_have_working_vsnprintf=cross)])
+AC_MSG_RESULT([$ac_cv_have_working_vsnprintf])
+if test x$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf != 
"xyesyes"; then
+  AC_LIBOBJ(snprintf)
+  AC_MSG_WARN([Replacing missing/broken (v)snprintf() with version from 
http://www.ijs.si/software/snprintf/.])
+  AC_DEFINE(PREFER_PORTABLE_SNPRINTF, 1, "enable replacement (v)snprintf if 
system (v)snprintf is broken")
+fi])
+
+
+

Reply via email to