diff --git a/3rdparty/Makefile.am b/3rdparty/Makefile.am index 7cf0c88..6df5526 100644 --- a/3rdparty/Makefile.am +++ b/3rdparty/Makefile.am @@ -94,10 +94,6 @@ if WITH_BUNDLED_ZOOKEEPER $(MAKE) $(AM_MAKEFLAGS) ALL_LOCAL += $(ZOOKEEPER)/src/c/libzookeeper_mt.la -else - # No matter what, we need to extract ZooKeeper so that we can run - # 'make check' (some of our tests need the ZooKeeper JAR). - ALL_LOCAL += $(ZOOKEEPER)-stamp endif all-local: $(ALL_LOCAL) diff --git a/configure.ac b/configure.ac index 86d448c..75e494c 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,12 @@ AC_PREREQ([2.61]) AC_INIT([mesos], [0.23.0]) +MAJOR_VER=0 +MINOR_VER=23 +PATCH_VER=0 +AC_SUBST(MAJOR_VER) +AC_SUBST(MINOR_VER) +AC_SUBST(PATCH_VER) # Have autoconf setup some variables related to the system. AC_CANONICAL_HOST @@ -216,6 +222,8 @@ AC_ARG_VAR([MAVEN_HOME], [looks for mvn at MAVEN_HOME/bin/mvn]) AC_ARG_VAR([PROTOBUF_JAR], [full path to protobuf jar on prefixed builds]) +AC_ARG_VAR([ZOOKEEPER_JAR], [full path to zookeeper jar on prefixed builds]) + AC_ARG_VAR([PYTHON], [which Python interpreter to use]) AC_MSG_NOTICE([Setting up build environment for ${target_cpu} ${target_os}]) @@ -284,8 +296,18 @@ fi if test -n "`echo $with_zookeeper`"; then CPPFLAGS="$CPPFLAGS -I${with_zookeeper}/include/zookeeper" LDFLAGS="$LDFLAGS -L${with_zookeeper}/lib" + if test -z "`echo ZOOKEEPER_JAR`"; then + ZOOKEEPER_JAR="${with_zookeeper}/zookeeper.jar" + fi elif test "x$enable_bundled" = "xno"; then CPPFLAGS="$CPPFLAGS -I/usr/include/zookeeper" + if test -z "`echo ZOOKEEPER_JAR`"; then + ZOOKEEPER_JAR="/usr/share/java/zookeeper/zookeeper.jar" + fi +else + if test -z "`echo ZOOKEEPER_JAR`"; then + ZOOKEEPER_JAR="3rdparty/zookeeper-3.4.5/zookeeper-3.4.5.jar" + fi fi @@ -400,6 +422,7 @@ fi AM_CONDITIONAL([WITH_BUNDLED_ZOOKEEPER], [test "x$with_bundled_zookeeper" = "xyes"]) +AC_SUBST([ZOOKEEPER_JAR]) # Check if user has asked us to use a preinstalled protobuf, or if # they asked us to ignore all bundled libraries while compiling and diff --git a/src/Makefile.am b/src/Makefile.am index b821a3b..17fac25 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,8 +27,6 @@ include ../3rdparty/libprocess/3rdparty/versions.am # them include $(top_builddir) as appropriate. DISTRIBUTE = 3rdparty/distribute-$(DISTRIBUTE_VERSION) LEVELDB = 3rdparty/leveldb -ZOOKEEPER = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/src/c -ZOOKEEPER_JAR = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/zookeeper-$(ZOOKEEPER_VERSION).jar LIBPROCESS = 3rdparty/libprocess STOUT = $(LIBPROCESS)/3rdparty/stout BOOST = $(LIBPROCESS)/3rdparty/boost-$(BOOST_VERSION) @@ -38,6 +36,10 @@ GTEST = $(GMOCK)/gtest PROTOBUF = $(LIBPROCESS)/3rdparty/protobuf-$(PROTOBUF_VERSION) PICOJSON = $(LIBPROCESS)/3rdparty/picojson-$(PICOJSON_VERSION) +if WITH_BUNDLED_ZOOKEEPER + ZOOKEEPER = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/src/c +endif + # Unfortunatley, 'pkglibexecdir' and 'pkgsysconfdir' are not set # before automake 1.11, so we need to set them manually (until we in @@ -564,7 +566,7 @@ lib_LTLIBRARIES += libmesos.la # Include as part of the distribution. libmesos_la_SOURCES = $(MESOS_PROTO) $(CONTAINERIZER_PROTO) $(SCHEDULER_PROTO) -libmesos_la_LDFLAGS = -release $(PACKAGE_VERSION) +libmesos_la_LDFLAGS = -version-info $(MINOR_VER):$(MAJOR_VER):0 # Since we just include the convenience library (and no sources), we # need to tell libtool to build this as a C++ library. @@ -909,7 +911,7 @@ $(EXAMPLES_JAR): $(EXAMPLES_SOURCE) @echo "Building examples.jar ..." $(MKDIR_P) examples/java $(JAVA_HOME)/bin/javac -source 1.6 -target 1.6 \ - -cp ../$(ZOOKEEPER_JAR):@PROTOBUF_JAR@:$(MESOS_JAR):$(srcdir)/examples/java \ + -cp @ZOOKEEPER_JAR@:@PROTOBUF_JAR@:$(MESOS_JAR):$(srcdir)/examples/java \ -sourcepath $(srcdir)/examples/java -d examples/java \ $(srcdir)/examples/java/*.java $(JAVA_HOME)/bin/jar cf $@ -C examples/java . @@ -1160,6 +1162,7 @@ if HAS_JAVA mesos_tests_CPPFLAGS += $(JAVA_CPPFLAGS) mesos_tests_CPPFLAGS += -DZOOKEEPER_VERSION=\"$(ZOOKEEPER_VERSION)\" + mesos_tests_CPPFLAGS += -DZOOKEEPER_JAR=\"@ZOOKEEPER_JAR@\" mesos_tests_LDFLAGS = $(AM_LDFLAGS) mesos_tests_DEPENDENCIES += $(EXAMPLES_JAR) diff --git a/src/examples/java/test-log.in b/src/examples/java/test-log.in index 4c8547a..7723e73 100644 --- a/src/examples/java/test-log.in +++ b/src/examples/java/test-log.in @@ -21,11 +21,10 @@ test ! -e ${PROTOBUF_JAR} && \ # TODO(vinod): Deduce the zookeeper version. ZOOKEEPER=${MESOS_BUILD_DIR}/3rdparty/zookeeper-3.4.5 -ZOOKEEPER_JAR=${ZOOKEEPER}/zookeeper-3.4.5.jar +ZOOKEEPER_JAR=@ZOOKEEPER_JAR@ test ! -e ${ZOOKEEPER_JAR} && \ - echo "${RED}Failed to find ${ZOOKEEPER_JAR}${NORMAL}" && \ - exit 1 + echo "${RED}Failed to find ${ZOOKEEPER_JAR}${NORMAL}" MESOS_JAR=${MESOS_BUILD_DIR}/src/java/target/mesos-@PACKAGE_VERSION@.jar diff --git a/src/tests/zookeeper.cpp b/src/tests/zookeeper.cpp index 08cab86..1e6e315 100644 --- a/src/tests/zookeeper.cpp +++ b/src/tests/zookeeper.cpp @@ -56,16 +56,17 @@ const Duration ZooKeeperTest::NO_TIMEOUT = Seconds(10); void ZooKeeperTest::SetUpTestCase() { if (!Jvm::created()) { + string classpath = "-Djava.class.path=" ZOOKEEPER_JAR; + +#ifdef BUNDLED string zkHome = path::join(flags.build_dir, "/3rdparty/zookeeper-" ZOOKEEPER_VERSION); - string classpath = "-Djava.class.path=" + - path::join(zkHome, "zookeeper-" ZOOKEEPER_VERSION ".jar"); - // Now add all the libraries in 'lib' too. Try > jars = os::glob(path::join(zkHome, "lib", "*.jar")); CHECK_SOME(jars); +#endif foreach (const string& jar, jars.get()) { classpath += ":" + jar;