You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by mi...@apache.org on 2014/03/29 04:23:58 UTC

svn commit: r1582941 - in /zookeeper/trunk: CHANGES.txt build.xml src/c/configure.ac src/c/configure.ac.in src/c/include/zookeeper_version.h src/c/include/zookeeper_version.h.in

Author: michim
Date: Sat Mar 29 03:23:57 2014
New Revision: 1582941

URL: http://svn.apache.org/r1582941
Log:
ZOOKEEPER-297. centralize version numbering in the source/build (Diego de Oliveira via michim)

Added:
    zookeeper/trunk/src/c/configure.ac.in
    zookeeper/trunk/src/c/include/zookeeper_version.h.in
Removed:
    zookeeper/trunk/src/c/configure.ac
    zookeeper/trunk/src/c/include/zookeeper_version.h
Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/build.xml

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1582941&r1=1582940&r2=1582941&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Sat Mar 29 03:23:57 2014
@@ -814,6 +814,9 @@ IMPROVEMENTS:
   ZOOKEEPER-602. log all exceptions not caught by ZK threads (Rakesh R via
   michim)
 
+  ZOOKEEPER-297. centralize version numbering in the source/build (Diego de
+  Oliveira via michim)
+
 headers
 
 Release 3.4.0 - 

Modified: zookeeper/trunk/build.xml
URL: http://svn.apache.org/viewvc/zookeeper/trunk/build.xml?rev=1582941&r1=1582940&r2=1582941&view=diff
==============================================================================
--- zookeeper/trunk/build.xml (original)
+++ zookeeper/trunk/build.xml Sat Mar 29 03:23:57 2014
@@ -29,7 +29,11 @@ xmlns:maven="antlib:org.apache.maven.art
 
     <property environment="env"/>
     
-    <property name="version" value="3.5.0-SNAPSHOT" />
+    <property name="version-major" value="3" />
+    <property name="version-minor" value="5" />
+    <property name="version-patch" value="0" />
+    <property name="version" value="${version-major}.${version-minor}.${version-patch}-SNAPSHOT" />
+
     <property name="final.name" value="${name}-${version}"/>
     <property name="revision.dir" value="${basedir}/.revision" />
     <property name="revision.properties" value="revision.properties" />
@@ -354,7 +358,7 @@ xmlns:maven="antlib:org.apache.maven.art
         </java>
     </target>
     
-    <target name="build-generated" depends="compile_jute,version-info" >
+    <target name="build-generated" depends="compile_jute,version-info,process-template" >
         <javac srcdir="${src_generated.dir}" destdir="${build.classes}" includeantruntime="false"
             target="${javac.target}" source="${javac.source}" debug="on" />
     </target>
@@ -404,6 +408,24 @@ xmlns:maven="antlib:org.apache.maven.art
       <ivy:cachepath pathid="releaseaudit-classpath" conf="releaseaudit"/>
     </target>
 
+    <target name="process-template">
+      <copy todir="${c.src.dir}" verbose="true" overwrite="true" failonerror="true">
+        <fileset dir="${c.src.dir}">
+          <include name="configure.ac.in"/>
+          <include name="include/zookeeper_version.h.in"/>
+        </fileset>
+        <mapper>
+          <globmapper from="*.in" to="*"/>
+        </mapper>
+        <filterchain>
+          <striplinecomments>
+	     <comment value="!" />
+	  </striplinecomments>
+          <expandproperties />
+        </filterchain>
+      </copy>
+    </target>
+    
     <target name="ivy-retrieve-mvn-ant-task" depends="init,ivy-init">
       <ivy:retrieve settingsRef="${ant.project.name}" conf="mvn-ant-task"
                     pattern="${ivy.lib}/[artifact]-[revision].[ext]"/>

Added: zookeeper/trunk/src/c/configure.ac.in
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/c/configure.ac.in?rev=1582941&view=auto
==============================================================================
--- zookeeper/trunk/src/c/configure.ac.in (added)
+++ zookeeper/trunk/src/c/configure.ac.in Sat Mar 29 03:23:57 2014
@@ -0,0 +1,149 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.59)
+
+AC_INIT([zookeeper C client],${version-major}.${version-minor}.${version-patch},[user@zookeeper.apache.org],[zookeeper])
+AC_CONFIG_SRCDIR([src/zookeeper.c])
+
+# Save initial CFLAGS and CXXFLAGS values before AC_PROG_CC and AC_PROG_CXX
+init_cflags="$CFLAGS"
+init_cxxflags="$CXXFLAGS"
+
+# initialize Doxygen support
+DX_HTML_FEATURE(ON)
+DX_CHM_FEATURE(OFF)
+DX_CHI_FEATURE(OFF)
+DX_MAN_FEATURE(OFF)
+DX_RTF_FEATURE(OFF)
+DX_XML_FEATURE(OFF)
+DX_PDF_FEATURE(OFF)
+DX_PS_FEATURE(OFF)
+DX_INIT_DOXYGEN([zookeeper],[c-doc.Doxyfile],[docs])
+
+# initialize automake
+AM_INIT_AUTOMAKE([-Wall foreign])
+AC_CONFIG_HEADER([config.h])
+
+# Checks for programs.
+AC_ARG_WITH(cppunit,
+        [  --without-cppunit       do not use CPPUNIT])
+
+if test "$with_cppunit" = "no" ; then
+   CPPUNIT_PATH="No_CPPUNIT"
+   CPPUNIT_INCLUDE=
+   CPPUNIT_LIBS=
+else
+   AM_PATH_CPPUNIT(1.10.2)
+fi
+
+if test "$CALLER" = "ANT" ; then
+CPPUNIT_CFLAGS="$CPPUNIT_CFLAGS -DZKSERVER_CMD=\"\\\"${base_dir}/src/c/tests/zkServer.sh\\\"\""
+else
+CPPUNIT_CFLAGS="$CPPUNIT_CFLAGS -DZKSERVER_CMD=\"\\\"./tests/zkServer.sh\\\"\""
+AC_CHECK_FILES([generated/zookeeper.jute.c generated/zookeeper.jute.h],[],
+    [AC_MSG_ERROR([jute files are missing! Please run "ant compile_jute" while in the zookeeper top level directory.])
+])
+fi
+AC_SUBST(CPPUNIT_CFLAGS)
+
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_LN_S
+
+# AC_DISABLE_SHARED
+AC_PROG_LIBTOOL
+
+#enable -D_GNU_SOURCE since the return code value of getaddrinfo
+#ifdefed with __USE_GNU
+#features.h header undef's __USE_GNU and defines it only if _GNU_SOURCE is defined
+#hence this define for gcc
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug],[enable debug build [default=no]])],
+ [],[enable_debug=no])
+
+if test "x$enable_debug" = xyes; then
+    if test "x$init_cflags" = x; then
+        CFLAGS=""
+    fi
+    CFLAGS="$CFLAGS -g -O0 -D_GNU_SOURCE"
+else
+    if test "x$init_cflags" = x; then
+        CFLAGS="-g -O2 -D_GNU_SOURCE"
+    fi
+fi
+
+if test "x$enable_debug" = xyes; then
+    if test "x$init_cxxflags" = x; then
+        CXXFLAGS=""
+    fi
+    CXXFLAGS="$CXXFLAGS -g -O0"
+else
+    if test "x$init_cxxflags" = x; then
+        CXXFLAGS="-g -O2"
+    fi
+fi
+
+AC_ARG_WITH([syncapi],
+ [AS_HELP_STRING([--with-syncapi],[build with support for SyncAPI [default=yes]])],
+ [],[with_syncapi=yes])
+
+# Checks for libraries.
+AC_CHECK_LIB([pthread], [pthread_mutex_lock],[have_pthread=yes],[have_pthread=no])
+
+if test "x$with_syncapi" != xno && test "x$have_pthread" = xno; then
+    AC_MSG_WARN([cannot build SyncAPI -- pthread not found])
+    with_syncapi=no
+fi
+if test "x$with_syncapi" != xno; then
+    AC_MSG_NOTICE([building with SyncAPI support])
+else
+    AC_MSG_NOTICE([building without SyncAPI support])
+fi
+
+AM_CONDITIONAL([WANT_SYNCAPI],[test "x$with_syncapi" != xno])
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h sys/utsname.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_INLINE
+AC_HEADER_TIME
+AC_CHECK_TYPE([nfds_t],
+    [AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[poll() second argument type])],
+    [AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[poll() second argument type])],
+    [#include <poll.h>])
+
+AC_MSG_CHECKING([whether to enable ipv6])
+
+AC_TRY_RUN([ /* is AF_INET6 available? */
+#include <sys/types.h>
+#include <sys/socket.h>
+main()
+{
+ if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
+   exit(1);
+ else
+   exit(0);
+}
+], AC_MSG_RESULT(yes) 
+   ipv6=yes, 
+   AC_MSG_RESULT(no) 
+   ipv6=no, 
+   AC_MSG_RESULT(no) 
+   ipv6=no)
+
+if test x"$ipv6" = xyes; then
+  USEIPV6="-DZOO_IPV6_ENABLED"
+  AC_SUBST(USEIPV6)
+fi
+
+# Checks for library functions.
+AC_CHECK_FUNCS([getcwd gethostbyname gethostname getlogin getpwuid_r gettimeofday getuid memmove memset poll socket strchr strdup strerror strtol])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT

Added: zookeeper/trunk/src/c/include/zookeeper_version.h.in
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/c/include/zookeeper_version.h.in?rev=1582941&view=auto
==============================================================================
--- zookeeper/trunk/src/c/include/zookeeper_version.h.in (added)
+++ zookeeper/trunk/src/c/include/zookeeper_version.h.in Sat Mar 29 03:23:57 2014
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ZOOKEEPER_VERSION_H_
+#define ZOOKEEPER_VERSION_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZOO_MAJOR_VERSION ${version-major}
+#define ZOO_MINOR_VERSION ${version-minor}
+#define ZOO_PATCH_VERSION ${version-patch}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZOOKEEPER_VERSION_H_ */