Bug#671384: xplc: FTBFS on hurd-i386.
Package: xplc
Severity: important
Tags: upstream patch
Dear Maintainer,
xplc currently FTBFS on hurd-i386 because it uses the PATH_MAX macro, which is not defined on GNU/Hurd. The attached patch should fix this issue. Since PATH_MAX is not needed any more, it also removes the check for limits.h from configure.ac.
WBR,
Cyril Roelandt.
-- System Information:
Debian Release: wheezy/sid
APT prefers unreleased
APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hurd-i386 (i686-AT386)
Kernel: GNU-Mach 1.3.99/Hurd-0.3
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
--- xplc-0.3.13.orig/xplc/modulemgr.cpp 2004-09-30 21:09:54.000000000 +0000
+++ xplc-0.3.13/xplc/modulemgr.cpp 2012-05-03 16:28:28.000000000 +0000
@@ -29,9 +29,6 @@
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
#if !defined(WIN32)
# if HAVE_DIRENT_H
@@ -83,7 +80,7 @@
#if !defined(WIN32)
DIR* dir;
struct dirent* ent;
- char fname[PATH_MAX];
+ char *fname;
IServiceManager* servmgr = XPLC_getServiceManager();
IModuleLoader* loader;
ModuleNode* modules = 0;
@@ -106,7 +103,10 @@
while((ent = readdir(dir))) {
IModule* module;
- snprintf(fname, PATH_MAX, "%s/%s", directory, ent->d_name);
+ size_t size;
+ size = snprintf(NULL, 0, "%s/%s", directory, ent->d_name) + 1;
+ fname = new char[size];
+ snprintf(fname, size, "%s/%s", directory, ent->d_name);
module = loader->loadModule(fname);
if(module) {
@@ -115,6 +115,8 @@
if(node)
modules = node;
}
+
+ delete [] fname;
}
loader->release();
--- xplc-0.3.13.orig/configure.ac 2005-10-31 23:19:35.000000000 +0000
+++ xplc-0.3.13/configure.ac 2012-05-03 16:27:06.000000000 +0000
@@ -83,7 +83,6 @@
AC_PROG_LN_S
AC_HEADER_DIRENT
-AC_CHECK_HEADERS([limits.h])
AC_CHECK_PROGS([CVS2CL], [cvs2cl.pl cvs2cl], [no])
--- xplc-0.3.13.orig/include/autoconf.h.in 2005-10-31 22:50:02.000000000 +0000
+++ xplc-0.3.13/include/autoconf.h.in 2012-05-03 16:28:50.000000000 +0000
@@ -13,9 +13,6 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
/* Define to 1 if you have the <mach-o/dyld.h> header file. */
#undef HAVE_MACH_O_DYLD_H
Reply to: