On 06/10/2016 04:25 PM, Joel Kulesza wrote:
> LyX Developers,
>
> I'm attempting to compile LyX 2.2.0 for local/single user use on RHEL6
> with GCC 5.3.0 / Python 3.4 (see below signature for configure
> summary) and very quickly run into errors on make.  Specifically, I see:
>
>   CXX      filetools.o
> ../../../src/support/filetools.cpp: In function ‘bool
> lyx::support::readLink(const lyx::support::FileName&,
> lyx::support::FileName&)’:
> ../../../src/support/filetools.cpp:980:18: error: ‘PATH_MAX’ was not
> declared in this scope
>   char linkbuffer[PATH_MAX + 1];
>                   ^
> ../../../src/support/filetools.cpp:982:10: error: ‘linkbuffer’ was not
> declared in this scope
>           linkbuffer, sizeof(linkbuffer) - 1);
>           ^
> make[5]: *** [filetools.o] Error 1
>
> at which time the 'make' aborts
>
> Has anyone encountered this / is there a known workaround (or
> configure option) I'm not aware of?

Hmm. This code

#ifdef HAVE_DEF_PATH_MAX
    char linkbuffer[PATH_MAX + 1];
    ssize_t const nRead = ::readlink(encoded.c_str(),
                     linkbuffer, sizeof(linkbuffer) - 1);
    if (nRead <= 0)
        return false;
    linkbuffer[nRead] = '\0'; // terminator
#else

is specifically protected by the #ifdef, which should be telling us
whether PATH_MAX is defined in limits.h. Which it presumably is on your
system. I wonder if limits.h isn't getting pulled in for some reason.
You could try adding:

#include <limits.h>

to support/filetools.cpp.

Richard

Reply via email to