Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.7
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: C Extensions, Launcher
-
Environment:OSX 10.8.0 (Snow Leopard) i386 Kernel
GCC 4.6.3 (MacPorts provided)
-
Number of attachments :
Description
When trying to install jruby-launcher gem, it fails with the following output:
<pre>
mkdir -p build/unix/Darwin
rm -f build/unix/Darwin/argparser.o.d
g++ -O2 -Wall -I/opt/local/include -c argparser.cpp -MMD -MP -MF build/unix/Darwin/argparser.o.d -o build/unix/Darwin/argparser.o
argparser.cpp: In member function 'bool ArgParser::initPlatformDir()':
argparser.cpp:126:15: error: 'MAX_PATH' was not declared in this scope
argparser.cpp:130:40: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
argparser.cpp:131:17: error: 'path' was not declared in this scope
argparser.cpp:150:44: error: 'path' was not declared in this scope
argparser.cpp:155:40: error: 'path' was not declared in this scope
argparser.cpp:181:17: error: 'path' was not declared in this scope
argparser.cpp:187:16: error: 'path' was not declared in this scope
argparser.cpp:196:17: error: 'path' was not declared in this scope
argparser.cpp:201:16: error: 'path' was not declared in this scope
make[2]: *** [build/unix/Darwin/argparser.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
</pre>
This works under Apple's GCC 4.2.1 (port select --set gcc gcc42).
Here's a possible patch. It looks like there's no consistent way to get the maximum path length, so I try a couple constants. Can you see if this works for you?
diff --git a/argparser.cpp b/argparser.cpp index ee42a16..24d45b3 100644 --- a/argparser.cpp +++ b/argparser.cpp @@ -116,7 +116,11 @@ void ArgParser::addEnvVarToOptions(std::list<std::string> & optionsList, const c #endif #ifndef PATH_MAX -#define PATH_MAX MAX_PATH +# if defined(MAX_PATH) +# define PATH_MAX MAX_PATH +# else defined(MAXPATHLEN) +# define PATH_MAX MAXPATHLEN +# endif #endif bool ArgParser::initPlatformDir() {You could also check the limits.h header file for me to see if it has something defined we can use.