[
https://issues.apache.org/jira/browse/HADOOP-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13403002#comment-13403002
]
Colin Patrick McCabe commented on HADOOP-7147:
----------------------------------------------
bq. I haven't figured out how to do OS or compiler detection to do the correct
thing on non-gcc/non-Linux. (e.g., on Darwin, we should really be passing
-framework JavaVM amongst other flags when building libhadoop.dylib so we get
linked properly, can build a fat binary, etc.).
You want something like this:
{code}
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -framework JavaVM")
ENDIF()
{code}
There are a bunch of CMake variables that are set based on the platform and
environment. See http://www.cmake.org/Wiki/CMake_Useful_Variables. Of course,
it's usually better to check for the specific feature you need if that is at
all possible-- CHECK_FUNCTION_EXISTS is a good example of that.
You can also match against CMAKE_SYSTEM_NAME "Apple", but I think that covers
Mac OS classic too. I *hope* that nobody is trying to compile Hadoop on that,
although of course you can never be sure :)
> setnetgrent in native code is not portable
> ------------------------------------------
>
> Key: HADOOP-7147
> URL: https://issues.apache.org/jira/browse/HADOOP-7147
> Project: Hadoop Common
> Issue Type: Bug
> Components: native
> Affects Versions: 0.22.0, 0.23.0
> Reporter: Todd Lipcon
> Assignee: Allen Wittenauer
> Attachments: HADOOP-7147.patch, hadoop-7147.patch
>
>
> HADOOP-6864 uses the setnetgrent function in a way which is not compatible
> with BSD APIs, where the call returns void rather than int. This prevents the
> native libs from building on OSX, for example.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira