From ca1b32573888af13d6f195020b32982a2521b7ac Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Fri, 18 May 2012 01:02:01 +0000 Subject: [PATCH] Tweak the java setup so it works better on Mac. Only build mapreduce and allocators if hadoop support was requested. This commit was SVN r26448. --- orte/config/orte_setup_java.m4 | 81 ++++++++++++++++++-------------- orte/tools/mapreduce/Makefile.am | 26 ++++++---- 2 files changed, 63 insertions(+), 44 deletions(-) diff --git a/orte/config/orte_setup_java.m4 b/orte/config/orte_setup_java.m4 index a002736b26..b16dbc9e9d 100644 --- a/orte/config/orte_setup_java.m4 +++ b/orte/config/orte_setup_java.m4 @@ -77,47 +77,58 @@ AC_DEFUN([ORTE_SETUP_JAVA],[ # Some java installations are in obscure places. So let's # hard-code a few of the common ones so that users don't have to # specify --with-java-=LONG_ANNOYING_DIRECTORY. - AS_IF([test -z "$with_jdk_dir" -a -z "$with_jdk_dir" -a -z "$with_jdk_bindir"], + AS_IF([test -z "$with_jdk_bindir"], [ # OS X Snow Leopard and Lion (10.6 and 10.7 -- did not # check prior versions) found=0 dir=/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers - AS_IF([test -d $dir], [found=1 - with_jdk_headers=$dir - with_jdk_bindir=/usr/bin]) + AC_MSG_CHECKING([OSX locations]) + AS_IF([test -d $dir], + [AC_MSG_RESULT([found]) + found=1 + with_jdk_headers=$dir + with_jdk_bindir=/usr/bin], + [AC_MSG_RESULT([not found])]) - # Various Linux - dir='/usr/lib/jvm/java-*-openjdk-*/include/' - jnih=`ls $dir/jni.h 2>/dev/null | head -n 1` - AS_IF([test -r "$jnih"], - [with_jdk_headers=`dirname $jnih` - OPAL_WHICH([javac], [with_jdk_bindir]) - AS_IF([test -n "$with_jdk_bindir"], - [found=1 - with_jdk_bindir=`dirname $with_jdk_bindir`], - [with_jdk_headers=])], - [dir='/usr/lib/jvm/default-java/include/' - jnih=`ls $dir/jni.h 2>/dev/null | head -n 1` - AS_IF([test -r "$jnih"], - [with_jdk_headers=`dirname $jnih` - OPAL_WHICH([javac], [with_jdk_bindir]) - AS_IF([test -n "$with_jdk_bindir"], - [found=1 - with_jdk_bindir=`dirname $with_jdk_bindir`], - [with_jdk_headers=])])]) + if test "$found" = "0"; then + # Various Linux + dir='/usr/lib/jvm/java-*-openjdk-*/include/' + jnih=`ls $dir/jni.h 2>/dev/null | head -n 1` + AC_MSG_CHECKING([Linux locations]) + AS_IF([test -r "$jnih"], + [with_jdk_headers=`dirname $jnih` + OPAL_WHICH([javac], [with_jdk_bindir]) + AS_IF([test -n "$with_jdk_bindir"], + [AC_MSG_RESULT([found]) + found=1 + with_jdk_bindir=`dirname $with_jdk_bindir`], + [with_jdk_headers=])], + [dir='/usr/lib/jvm/default-java/include/' + jnih=`ls $dir/jni.h 2>/dev/null | head -n 1` + AS_IF([test -r "$jnih"], + [with_jdk_headers=`dirname $jnih` + OPAL_WHICH([javac], [with_jdk_bindir]) + AS_IF([test -n "$with_jdk_bindir"], + [AC_MSG_RESULT([found]) + found=1 + with_jdk_bindir=`dirname $with_jdk_bindir`], + [with_jdk_headers=])], + [AC_MSG_RESULT([not found])])]) + fi - # Solaris - dir=/usr/java - AS_IF([test "$found" -eq 0 -a -d $dir -a -r "$dir/include/jni.h"], - [with_jdk_headers=$dir/include - with_jdk_bindir=$dir/bin - found=1]) - - # If we think we found them, announce - AS_IF([test "$found" -eq 1], - [AC_MSG_NOTICE([guessing that JDK headers are in $with_jdk_headers]) - AC_MSG_NOTICE([guessing that JDK javac is in $with_jdk_bindir])]) - ]) + if test "$found" = "0"; then + # Solaris + dir=/usr/java + AC_MSG_CHECKING([Solaris locations]) + AS_IF([test -d $dir -a -r "$dir/include/jni.h"], + [AC_MSG_RESULT([found]) + with_jdk_headers=$dir/include + with_jdk_bindir=$dir/bin + found=1], + [AC_MSG_RESULT([not found])]) + fi + ], + [found=1]) if test "$found" = "1"; then OMPI_CHECK_WITHDIR([jdk-bindir], [$with_jdk_bindir], [javac]) diff --git a/orte/tools/mapreduce/Makefile.am b/orte/tools/mapreduce/Makefile.am index 707194d606..e054a22651 100644 --- a/orte/tools/mapreduce/Makefile.am +++ b/orte/tools/mapreduce/Makefile.am @@ -13,12 +13,12 @@ include $(top_srcdir)/Makefile.man-page-rules man_pages = mapreduce.1 EXTRA_DIST = $(man_pages:.1=.1in) -if !ORTE_DISABLE_FULL_SUPPORT -if OMPI_INSTALL_BINARIES +bin_PROGRAMS = -bin_PROGRAMS = mapreduce +mapreduce_SOURCES = \ + mapreduce.c -nodist_man_MANS = $(man_pages) +mapreduce_LDADD = $(top_builddir)/orte/libopen-rte.la # Ensure that the man pages are rebuilt if the opal_config.h file # changes; a "good enough" way to know if configure was run again (and @@ -27,14 +27,22 @@ $(nodist_man_MANS): $(top_builddir)/opal/include/opal_config.h dist_pkgdata_DATA = help-mapreduce.txt +if !ORTE_DISABLE_FULL_SUPPORT +if OMPI_INSTALL_BINARIES + +# Only do this stuff if we want Hadoop support +if ORTE_WANT_HADOOP_SUPPORT + +bin_PROGRAMS += mapreduce + +nodist_man_MANS = $(man_pages) + +endif + endif # OMPI_INSTALL_BINARIES -mapreduce_SOURCES = \ - mapreduce.c - -mapreduce_LDADD = $(top_builddir)/orte/libopen-rte.la - endif # !ORTE_DISABLE_FULL_SUPPORT + distclean-local: rm -f $(man_pages)