From 5ea2e8123818f96099cb5c3c7948e3bdfec1cf69 Mon Sep 17 00:00:00 2001 From: Tom Whittock Date: Fri, 13 Feb 2015 00:19:22 +0800 Subject: [PATCH] zproject based build --- CMakeLists.txt | 47 +++--- Makefile.am | 151 +++--------------- autogen.sh | 30 ++-- builds/android/Android.mk | 16 +- builds/cygwin/Makefile.cygwin | 21 ++- builds/mingw32/Makefile.mingw32 | 16 +- builds/msvc/vs2008/czmq/czmq.sln | 65 ++++++++ builds/msvc/vs2008/czmq/czmq.vcproj | 19 +-- builds/msvc/vs2010/czmq/czmq.vcxproj | 19 +-- builds/msvc/vs2010/czmq/czmq.vcxproj.filters | 21 +-- .../czmq_selftest/czmq_selftest.vcxproj | 16 +- builds/msvc/vs2012/czmq/czmq.vcxproj | 19 +-- builds/msvc/vs2012/czmq/czmq.vcxproj.filters | 21 +-- .../czmq_selftest/czmq_selftest.vcxproj | 16 +- builds/msvc/vs2013/czmq/czmq.vcxproj | 19 +-- builds/msvc/vs2013/czmq/czmq.vcxproj.filters | 21 +-- .../czmq_selftest/czmq_selftest.vcxproj | 16 +- builds/qt-android/android_build_helper.sh | 9 ++ builds/qt-android/build.sh | 11 +- builds/qt-android/ci_build.sh | 13 +- configure.ac | 92 ++++++++--- doc/Makefile.am | 105 ++++++++++-- doc/asciidoc.conf | 28 ++-- doc/makecert.txt | 1 + doc/test_zgossip.txt | 1 + doc/zgossip_msg.txt | 1 + generate.sh | 5 + include/czmq.h | 23 +++ include/czmq_library.h | 128 +++++++++++---- include/test_zgossip.h | 55 +++++++ include/zhashx.h | 12 ++ license.xml | 10 ++ project.xml | 59 +++++++ src/Makemodule.am | 82 +++++----- src/czmq_classes.h | 28 ++++ src/czmq_selftest.c | 129 +++++++-------- src/libczmq.pc.in | 16 +- version.sh | 25 ++- 38 files changed, 880 insertions(+), 486 deletions(-) create mode 100644 builds/msvc/vs2008/czmq/czmq.sln create mode 100644 doc/makecert.txt create mode 100644 doc/test_zgossip.txt create mode 100644 doc/zgossip_msg.txt create mode 100755 generate.sh create mode 100644 include/czmq.h create mode 100644 include/test_zgossip.h create mode 100644 license.xml create mode 100644 project.xml create mode 100644 src/czmq_classes.h diff --git a/CMakeLists.txt b/CMakeLists.txt index fb82657d3..c814e45cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ ######################################################################## # Project setup @@ -14,16 +14,11 @@ enable_testing() set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) -####################################################################### -# Do we build and register self tests ? -###################################################################### -set(CZMQ_BUILD_TESTS true CACHE BOOL "build czmq selftest") - ######################################################################## # determine version ######################################################################## foreach(which MAJOR MINOR PATCH) - file(STRINGS "${SOURCE_DIR}/include/czmq.h" CZMQ_VERSION_STRING REGEX "#define CZMQ_VERSION_${which}") + file(STRINGS "${SOURCE_DIR}/include/czmq_library.h" CZMQ_VERSION_STRING REGEX "#define CZMQ_VERSION_${which}") string(REGEX MATCH "#define CZMQ_VERSION_${which} ([0-9_]+)" CZMQ_REGEX_MATCH "${CZMQ_VERSION_STRING}") if (NOT CZMQ_REGEX_MATCH) message(FATAL_ERROR "failed to parse CZMQ_VERSION_${which} from czmq.h") @@ -74,18 +69,27 @@ if (MINGW) set(MORE_LIBRARIES -lws2_32 -lrpcrt4 -liphlpapi) endif() +# required libraries for cygwin +if (CYGWIN) + set(MORE_LIBRARIES -luuid) +endif() + +list(APPEND CMAKE_MODULE_PATH ${SOURCE_DIR}) + ######################################################################## -# ZeroMQ depedency +# ZMQ dependency ######################################################################## -list(APPEND CMAKE_MODULE_PATH ${SOURCE_DIR}) find_package(ZeroMQ REQUIRED) +include_directories(${ZEROMQ_INCLUDE_DIRS}) +list(APPEND MORE_LIBRARIES ${ZEROMQ_LIBRARIES}) ######################################################################## # includes ######################################################################## set (czmq_headers - include/czmq.h + include/czmq_library.h include/czmq_prelude.h + include/czmq.h include/zactor.h include/zauth.h include/zarmour.h @@ -139,7 +143,6 @@ install(FILES ${czmq_headers} DESTINATION include) ######################################################################## include_directories(${BINARY_DIR}) include_directories(${SOURCE_DIR}/include) -include_directories(${ZEROMQ_INCLUDE_DIRS}) set (czmq_sources src/zactor.c src/zauth.c @@ -215,11 +218,9 @@ install( ######################################################################## # tests ######################################################################## -if (CZMQ_BUILD_TESTS) - add_executable(czmq_selftest ${SOURCE_DIR}/src/czmq_selftest.c) - target_link_libraries(czmq_selftest czmq ${ZEROMQ_LIBRARIES}) - add_test(czmq_selftest czmq_selftest) -endif() +add_executable(czmq_selftest ${SOURCE_DIR}/src/czmq_selftest.c) +target_link_libraries(czmq_selftest czmq ${ZEROMQ_LIBRARIES}) +add_test(czmq_selftest czmq_selftest) ######################################################################## # summary @@ -227,7 +228,7 @@ endif() message(STATUS "version: ${CZMQ_VERSION}") message(STATUS "install: ${CMAKE_INSTALL_PREFIX}") -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/Makefile.am b/Makefile.am index af9c5d9bc..6d863c7c2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,145 +1,34 @@ +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ + ACLOCAL_AMFLAGS = -I config AM_CPPFLAGS = \ - ${zmq_CFLAGS} \ - -I$(srcdir)/include + ${zmq_CFLAGS} \ + -I$(srcdir)/include -SUBDIRS = doc +project_libs = \ + ${zmq_LIBS} -DIST_SUBDIRS = doc +SUBDIRS = +SUBDIRS += doc +DIST_SUBDIRS = lib_LTLIBRARIES = - bin_PROGRAMS = - check_PROGRAMS = EXTRA_DIST = \ - version.sh \ - builds/android/Android.mk \ - builds/android/Application.mk \ - builds/android/build.sh \ - builds/android/clean.sh \ - builds/mingw32/Makefile.mingw32 \ - builds/mingw32/platform.h \ - builds/cygwin/Makefile.cygwin \ - examples/security/grasslands.c \ - examples/security/strawhouse.c \ - examples/security/woodhouse.c \ - examples/security/stonehouse.c \ - examples/security/ironhouse.c \ - examples/security/ironhouse2.c \ - examples/security/README.txt \ - examples/security/LICENSE \ - foreign/slre/readme.txt \ - foreign/slre/slre.h \ - foreign/slre/slre.c \ - foreign/sha1/sha1.c \ - foreign/sha1/sha1.h \ - packaging/dist/gitlog2changelog.py \ - packaging/nuget/package.config \ - packaging/nuget/package.targets \ - packaging/nuget/package.bat \ - packaging/nuget/package.gsl \ - packaging/nuget/package.xml \ - packaging/nuget/package.nuspec \ - builds/msvc/build/buildbase.bat \ - builds/msvc/build/buildall.bat \ - builds/msvc/vs2012/czmq.sln \ - builds/msvc/vs2012/czmq_selftest/czmq_selftest.props \ - builds/msvc/vs2012/czmq_selftest/czmq_selftest.vcxproj \ - builds/msvc/vs2012/czmq/czmq.props \ - builds/msvc/vs2012/czmq/czmq.vcxproj \ - builds/msvc/vs2012/czmq/czmq.vcxproj.filters \ - builds/msvc/vs2012/.gitignore \ - builds/msvc/vs2012/libzmq.import.props \ - builds/msvc/vs2012/libzmq.import.xml \ - builds/msvc/vs2012/czmq.import.props \ - builds/msvc/vs2012/czmq.import.xml \ - builds/msvc/vs2012/libsodium.import.props \ - builds/msvc/vs2012/libsodium.import.xml \ - builds/msvc/vs2008/README.txt \ - builds/msvc/vs2008/czmq.sln \ - builds/msvc/vs2008/czmq_selftest/czmq_selftest.vcproj \ - builds/msvc/vs2008/czmq/czmq.vcproj \ - builds/msvc/.gitignore \ - builds/msvc/vs2010/czmq.sln \ - builds/msvc/vs2010/czmq_selftest/czmq_selftest.props \ - builds/msvc/vs2010/czmq_selftest/czmq_selftest.vcxproj \ - builds/msvc/vs2010/czmq/czmq.props \ - builds/msvc/vs2010/czmq/czmq.vcxproj \ - builds/msvc/vs2010/czmq/czmq.vcxproj.filters \ - builds/msvc/vs2010/.gitignore \ - builds/msvc/vs2010/libzmq.import.props \ - builds/msvc/vs2010/libzmq.import.xml \ - builds/msvc/vs2010/czmq.import.props \ - builds/msvc/vs2010/czmq.import.xml \ - builds/msvc/vs2010/libsodium.import.props \ - builds/msvc/vs2010/libsodium.import.xml \ - builds/msvc/platform.h \ - builds/msvc/vs2013/czmq.sln \ - builds/msvc/vs2013/czmq_selftest/czmq_selftest.props \ - builds/msvc/vs2013/czmq_selftest/czmq_selftest.vcxproj \ - builds/msvc/vs2013/czmq/czmq.props \ - builds/msvc/vs2013/czmq/czmq.vcxproj \ - builds/msvc/vs2013/czmq/czmq.vcxproj.filters \ - builds/msvc/vs2013/libzmq.import.props \ - builds/msvc/vs2013/libzmq.import.xml \ - builds/msvc/vs2013/czmq.import.props \ - builds/msvc/vs2013/czmq.import.xml \ - builds/msvc/vs2013/libsodium.import.props \ - builds/msvc/vs2013/libsodium.import.xml \ - builds/msvc/resource.h \ - builds/msvc/czmq.rc \ - builds/msvc/properties/ReleaseLIB.props \ - builds/msvc/properties/Debug.props \ - builds/msvc/properties/LIB.props \ - builds/msvc/properties/ReleaseDLL.props \ - builds/msvc/properties/LTCG.props \ - builds/msvc/properties/Link.props \ - builds/msvc/properties/DebugLTCG.props \ - builds/msvc/properties/ReleaseLTCG.props \ - builds/msvc/properties/x64.props \ - builds/msvc/properties/Messages.props \ - builds/msvc/properties/DebugDEXE.props \ - builds/msvc/properties/Release.props \ - builds/msvc/properties/Win32.props \ - builds/msvc/properties/DLL.props \ - builds/msvc/properties/ReleaseSEXE.props \ - builds/msvc/properties/DebugSEXE.props \ - builds/msvc/properties/EXE.props \ - builds/msvc/properties/ReleaseDEXE.props \ - builds/msvc/properties/DebugLIB.props \ - builds/msvc/properties/Common.props \ - builds/msvc/properties/DebugDLL.props \ - builds/msvc/properties/ReleaseLEXE.props \ - builds/msvc/properties/DebugLEXE.props \ - builds/msvc/properties/Output.props - -include $(srcdir)/model/Makemodule.am + zgossip_engine.inc \ + zhash_primes.inc \ + zclass_example.xml \ + version.sh include $(srcdir)/src/Makemodule.am -include $(srcdir)/addons/Makemodule.am - -# workaround the dist generated files that are also part of the distribution -#distcleancheck_listfiles = \ -# find . -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';' -# Note that distcleancheck is disabled for now, while waiting for a proper -# solution, that do not break older unix systems -distcleancheck: - @: - -# Automatically generate the ChangeLog from Git logs: -MAINTAINERCLEAN_FILES = ChangeLog -# Force ChangeLog regeneration upon make dist (due to nonexistant 'dummy-stamp'), -# in case it has already been generated previously -# -# Older boundary of the ChangeLog commits range -# It can be a tag ('v2.2.0'), a commit hash, a date, ... -# See gitrevisions for more information on specifying ranges -GIT_START_POINT=v2.2.0 -dummy-stamp: -ChangeLog: packaging/dist/gitlog2changelog.py dummy-stamp - $(top_srcdir)/packaging/dist/gitlog2changelog.py $(GIT_START_POINT) || \ - echo "gitlog2changelog.py failed to generate the ChangeLog. See https://github.com/zeromq/czmq/commits/master" > $@ +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/autogen.sh b/autogen.sh index ed64a8be1..7806825a1 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,23 +1,8 @@ -#!/bin/sh -# -# Copyright (c) 1991-2012 iMatix Corporation -# Copyright other contributors as noted in the AUTHORS file. -# -# This file is part of CZMQ, the high-level C binding for 0MQ: -# http://czmq.zeromq.org. -# -# This is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +#!/usr/bin/env sh +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ # Script to generate all required files from fresh git checkout. @@ -50,3 +35,8 @@ if [ $? -ne 0 ]; then echo "autogen.sh: error: autoreconf exited with status $?" 1>&2 exit 1 fi + +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/builds/android/Android.mk b/builds/android/Android.mk index 47205f201..aa8a61e8b 100644 --- a/builds/android/Android.mk +++ b/builds/android/Android.mk @@ -1,7 +1,7 @@ -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ BASE_PATH := $(call my-dir) APP_PLATFORM = android-10 @@ -24,7 +24,7 @@ LOCAL_SRC_FILES := zactor.c zauth.c zarmour.c zbeacon.c zcert.c zcertstore.c zch LOCAL_SHARED_LIBRARIES := zmq include $(BUILD_SHARED_LIBRARY) -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/builds/cygwin/Makefile.cygwin b/builds/cygwin/Makefile.cygwin index fe645891b..6ac535f9b 100755 --- a/builds/cygwin/Makefile.cygwin +++ b/builds/cygwin/Makefile.cygwin @@ -1,7 +1,7 @@ -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ CC=gcc # replace the following with wherever you have installed libzmq @@ -14,19 +14,18 @@ OBJS = zactor.o zauth.o zarmour.o zbeacon.o zcert.o zcertstore.o zchunk.o zclock %.o: ../../src/%.c $(CC) -c -o $@ $< $(CFLAGS) -all: libczmq.dll # czmq_selftest.exe +all: libczmq.dll czmq_selftest.exe libczmq.dll: $(OBJS) - $(CC) -shared -o $@ $(OBJS) -Wl,--out-implib,$@.a $(LIBDIR) -lzmq -luuid + $(CC) -shared -o $@ $(OBJS) -Wl,--out-implib,$@.a $(LIBDIR) -lzmq -luuid # the test functions are not exported into the DLL czmq_selftest.exe: czmq_selftest.o $(OBJS) $(CC) -o $@ $^ $(LIBDIR) -lzmq -luuid - clean: del *.o *.a *.dll *.exe -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/builds/mingw32/Makefile.mingw32 b/builds/mingw32/Makefile.mingw32 index 06a324ca2..9dffb2d61 100644 --- a/builds/mingw32/Makefile.mingw32 +++ b/builds/mingw32/Makefile.mingw32 @@ -1,7 +1,7 @@ -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ CC=gcc # replace the following with wherever you have installed libzmq @@ -26,7 +26,7 @@ czmq_selftest.exe: czmq_selftest.o $(OBJS) clean: del *.o *.a *.dll *.exe -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/builds/msvc/vs2008/czmq/czmq.sln b/builds/msvc/vs2008/czmq/czmq.sln new file mode 100644 index 000000000..4468fa619 --- /dev/null +++ b/builds/msvc/vs2008/czmq/czmq.sln @@ -0,0 +1,65 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "czmq", "czmq$(project.name).vcproj", "{0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "czmq_selftest", "czmq_selftest$(project.name)_selftest.vcproj", "{A5497C4B-1CD1-4779-9458-2CF7908E7E26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + DebugDLL|Win32 = DebugDLL|Win32 + DebugDLL|x64 = DebugDLL|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + ReleaseDLL|Win32 = ReleaseDLL|Win32 + ReleaseDLL|x64 = ReleaseDLL|x64 + RelWithDebInfo|Win32 = RelWithDebInfo|Win32 + RelWithDebInfo|x64 = RelWithDebInfo|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.Debug|Win32.ActiveCfg = Debug|Win32 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.Debug|Win32.Build.0 = Debug|Win32 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.Debug|x64.ActiveCfg = Debug|x64 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.Debug|x64.Build.0 = Debug|x64 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.DebugDLL|Win32.Build.0 = DebugDLL|Win32 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.DebugDLL|x64.ActiveCfg = DebugDLL|x64 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.DebugDLL|x64.Build.0 = DebugDLL|x64 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.Release|Win32.ActiveCfg = Release|Win32 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.Release|Win32.Build.0 = Release|Win32 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.Release|x64.ActiveCfg = Release|x64 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.Release|x64.Build.0 = Release|x64 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.Debug|Win32.ActiveCfg = Debug|Win32 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.Debug|Win32.Build.0 = Debug|Win32 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.Debug|x64.ActiveCfg = Debug|x64 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.Debug|x64.Build.0 = Debug|x64 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.DebugDLL|Win32.Build.0 = DebugDLL|Win32 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.DebugDLL|x64.ActiveCfg = DebugDLL|x64 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.DebugDLL|x64.Build.0 = DebugDLL|x64 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.Release|Win32.ActiveCfg = Release|Win32 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.Release|Win32.Build.0 = Release|Win32 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.Release|x64.ActiveCfg = Release|x64 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.Release|x64.Build.0 = Release|x64 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {A5497C4B-1CD1-4779-9458-2CF7908E7E26}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/builds/msvc/vs2008/czmq/czmq.vcproj b/builds/msvc/vs2008/czmq/czmq.vcproj index edae6cc37..26d7cd9ef 100644 --- a/builds/msvc/vs2008/czmq/czmq.vcproj +++ b/builds/msvc/vs2008/czmq/czmq.vcproj @@ -1,9 +1,9 @@ @@ -1554,8 +1554,9 @@ - + + @@ -1563,9 +1564,9 @@ diff --git a/builds/msvc/vs2010/czmq/czmq.vcxproj b/builds/msvc/vs2010/czmq/czmq.vcxproj index 08a955e86..045558d28 100644 --- a/builds/msvc/vs2010/czmq/czmq.vcxproj +++ b/builds/msvc/vs2010/czmq/czmq.vcxproj @@ -1,9 +1,9 @@ @@ -77,8 +77,9 @@ - + + @@ -221,9 +222,9 @@ diff --git a/builds/msvc/vs2010/czmq/czmq.vcxproj.filters b/builds/msvc/vs2010/czmq/czmq.vcxproj.filters index c9fb89958..d8a8aeaaf 100644 --- a/builds/msvc/vs2010/czmq/czmq.vcxproj.filters +++ b/builds/msvc/vs2010/czmq/czmq.vcxproj.filters @@ -1,9 +1,9 @@ @@ -132,12 +132,15 @@ - + include include + + include + src @@ -201,9 +204,9 @@ diff --git a/builds/msvc/vs2010/czmq_selftest/czmq_selftest.vcxproj b/builds/msvc/vs2010/czmq_selftest/czmq_selftest.vcxproj index 5c10b6d1a..21bb93233 100644 --- a/builds/msvc/vs2010/czmq_selftest/czmq_selftest.vcxproj +++ b/builds/msvc/vs2010/czmq_selftest/czmq_selftest.vcxproj @@ -1,9 +1,9 @@ @@ -79,9 +79,9 @@ diff --git a/builds/msvc/vs2012/czmq/czmq.vcxproj b/builds/msvc/vs2012/czmq/czmq.vcxproj index 19ab752b6..c08bb4e6a 100644 --- a/builds/msvc/vs2012/czmq/czmq.vcxproj +++ b/builds/msvc/vs2012/czmq/czmq.vcxproj @@ -1,9 +1,9 @@ @@ -77,8 +77,9 @@ - + + @@ -221,9 +222,9 @@ diff --git a/builds/msvc/vs2012/czmq/czmq.vcxproj.filters b/builds/msvc/vs2012/czmq/czmq.vcxproj.filters index c9fb89958..d8a8aeaaf 100644 --- a/builds/msvc/vs2012/czmq/czmq.vcxproj.filters +++ b/builds/msvc/vs2012/czmq/czmq.vcxproj.filters @@ -1,9 +1,9 @@ @@ -132,12 +132,15 @@ - + include include + + include + src @@ -201,9 +204,9 @@ diff --git a/builds/msvc/vs2012/czmq_selftest/czmq_selftest.vcxproj b/builds/msvc/vs2012/czmq_selftest/czmq_selftest.vcxproj index 6227adeaa..f6f20df80 100644 --- a/builds/msvc/vs2012/czmq_selftest/czmq_selftest.vcxproj +++ b/builds/msvc/vs2012/czmq_selftest/czmq_selftest.vcxproj @@ -1,9 +1,9 @@ @@ -79,9 +79,9 @@ diff --git a/builds/msvc/vs2013/czmq/czmq.vcxproj b/builds/msvc/vs2013/czmq/czmq.vcxproj index 6ee4326db..a3b0bb573 100644 --- a/builds/msvc/vs2013/czmq/czmq.vcxproj +++ b/builds/msvc/vs2013/czmq/czmq.vcxproj @@ -1,9 +1,9 @@ @@ -77,8 +77,9 @@ - + + @@ -221,9 +222,9 @@ diff --git a/builds/msvc/vs2013/czmq/czmq.vcxproj.filters b/builds/msvc/vs2013/czmq/czmq.vcxproj.filters index c9fb89958..d8a8aeaaf 100644 --- a/builds/msvc/vs2013/czmq/czmq.vcxproj.filters +++ b/builds/msvc/vs2013/czmq/czmq.vcxproj.filters @@ -1,9 +1,9 @@ @@ -132,12 +132,15 @@ - + include include + + include + src @@ -201,9 +204,9 @@ diff --git a/builds/msvc/vs2013/czmq_selftest/czmq_selftest.vcxproj b/builds/msvc/vs2013/czmq_selftest/czmq_selftest.vcxproj index fa4aeaed4..00d89f903 100644 --- a/builds/msvc/vs2013/czmq_selftest/czmq_selftest.vcxproj +++ b/builds/msvc/vs2013/czmq_selftest/czmq_selftest.vcxproj @@ -1,9 +1,9 @@ @@ -79,9 +79,9 @@ diff --git a/builds/qt-android/android_build_helper.sh b/builds/qt-android/android_build_helper.sh index 17d41fc47..3ae389f36 100644 --- a/builds/qt-android/android_build_helper.sh +++ b/builds/qt-android/android_build_helper.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ # # Courtesy of Joe Eli McIlvain; original code at: # https://github.com/jemc/android_build_helper @@ -277,3 +281,8 @@ function android_build_verify_so { android_build_check_fail } + +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/builds/qt-android/build.sh b/builds/qt-android/build.sh index a960f47da..c38663a19 100755 --- a/builds/qt-android/build.sh +++ b/builds/qt-android/build.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ # Use directory of current script as the build directory and working directory cd "$( dirname "${BASH_SOURCE[0]}" )" @@ -30,7 +34,7 @@ fi (android_build_verify_so "libzmq.so" &> /dev/null) || { # Use a default value assuming the zmq project sits alongside this one - test -z "$ZMQ_ROOT" && ZMQ_ROOT="$(cd ../../../libzmq && pwd)" + test -z "$ZMQ_ROOT" && ZMQ_ROOT="$(cd ../../../zmq && pwd)" if [ ! -d "$ZMQ_ROOT" ]; then echo "The ZMQ_ROOT directory does not exist" @@ -65,3 +69,8 @@ fi android_build_verify_so "libzmq.so" android_build_verify_so "libczmq.so" "libzmq.so" + +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/builds/qt-android/ci_build.sh b/builds/qt-android/ci_build.sh index af6640514..045c2e7f0 100755 --- a/builds/qt-android/ci_build.sh +++ b/builds/qt-android/ci_build.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ # Assumes Travis CI os:linux (x86_64) (cd '/tmp' \ @@ -12,7 +16,12 @@ export TOOLCHAIN_NAME="arm-linux-androideabi-4.8" export TOOLCHAIN_HOST="arm-linux-androideabi" export TOOLCHAIN_ARCH="arm" -export ZMQ_ROOT="/tmp/libzmq" -git clone git://github.com/zeromq/libzmq.git $ZMQ_ROOT +export ZMQ_ROOT="/tmp/zmq" +git clone https://github.com/zeromq/libzmq $ZMQ_ROOT source ./build.sh + +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/configure.ac b/configure.ac index 585be0aa3..e1425988a 100755 --- a/configure.ac +++ b/configure.ac @@ -1,3 +1,8 @@ +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ + # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) @@ -35,7 +40,7 @@ AC_SUBST(PACKAGE_VERSION) # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html # # libczmq -version-info -LTVER="2:0:1" +LTVER="3:0:0" AC_SUBST(LTVER) # Capture c flags @@ -51,20 +56,6 @@ AC_PROG_SED AC_PROG_AWK PKG_PROG_PKG_CONFIG -# Check for makecert intent -AC_ARG_WITH([makecert], - AS_HELP_STRING([--with-makecert], - [Include the program makecert for compilation and installation [default=yes].]), - [with_makecert=$withval], - [with_makecert=yes]) - -AM_CONDITIONAL([WITH_MAKECERT], [test x$with_makecert != xno]) -AM_COND_IF([WITH_MAKECERT], [AC_MSG_NOTICE([WITH_MAKECERT defined])]) - -# Checks for libraries -AC_CHECK_LIB([pthread], [pthread_create]) -AC_CHECK_LIB([uuid], [uuid_generate]) - # Code coverage AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no], [With GCC Code Coverage reporting.])], @@ -78,15 +69,62 @@ if test "x${CZMQ_GCOV}" == "xyes"; then fi fi -# Check for libzmq -PKG_CHECK_MODULES([zmq], [libzmq]) +PREVIOUS_CFLAGS="${CFLAGS}" +PREVIOUS_LIBS="${LIBS}" + + +was_zmq_check_lib_detected=no + +PKG_CHECK_MODULES([zmq], [libzmq],, + [ + AC_ARG_WITH([libzmq], + [ + AS_HELP_STRING([--with-libzmq], + [Specify libzmq prefix]) + ], + [search_libzmq="yes"], + []) + + zmq_synthetic_cflags="" + zmq_synthetic_libs="-lzmq" + + if test "x$search_libzmq" = "xyes"; then + if test -r "${with_libzmq}/include/zmq.h"; then + zmq_synthetic_cflags="-I${with_libzmq}/include" + zmq_synthetic_libs="-L${with_libzmq}/lib -lzmq" + else + AC_MSG_ERROR([${with_libzmq}/include/zmq.h not found. Please check libzmq prefix]) + fi + fi + + CFLAGS="${zmq_synthetic_cflags} ${CFLAGS}" + LDFLAGS="${zmq_synthetic_libs} ${LDFLAGS}" + LIBS="${zmq_synthetic_libs} ${LIBS}" + + AC_CHECK_LIB([zmq], [zmq_init], + [ + AC_SUBST([zmq_CFLAGS],[${zmq_synthetic_cflags}]) + AC_SUBST([zmq_LIBS],[${zmq_synthetic_libs}]) + was_zmq_check_lib_detected=yes + ], + [AC_MSG_ERROR([cannot link with -lzmq, install libzmq.])]) + ]) + +if test "x$was_zmq_check_lib_detected" = "xno"; then + CFLAGS="${zmq_CFLAGS} ${CFLAGS}" + LIBS="${zmq_LIBS} ${LIBS}" +fi + + +CFLAGS="${PREVIOUS_CFLAGS}" +LIBS="${PREVIOUS_LIBS}" # Platform specific checks czmq_on_mingw32="no" czmq_on_cygwin="no" czmq_on_android="no" -# Host speciffic checks +# Host specific checks AC_CANONICAL_HOST # Determine whether or not documentation should be built and installed. @@ -175,7 +213,7 @@ case "${host_os}" in # Define on Cygwin to enable all library features CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" AC_DEFINE(CZMQ_HAVE_CYGWIN, 1, [Have Cygwin]) - czmq_on_mingw32="yes" + czmq_on_cygwin="yes" ;; *) AC_MSG_ERROR([unsupported system: ${host_os}.]) @@ -215,11 +253,7 @@ AM_CONDITIONAL(ON_CYGWIN, test "x$czmq_on_cygwin" = "xyes") AM_CONDITIONAL(ON_ANDROID, test "x$czmq_on_android" = "xyes") AM_CONDITIONAL(INSTALL_MAN, test "x$czmq_install_man" = "xyes") AM_CONDITIONAL(BUILD_DOC, test "x$czmq_build_doc" = "xyes") - -# PKG_CHECK_MODULES doesn't add to LIBS on android -if test "x$czmq_on_android" = "xyes"; then - LIBS="-lzmq $LIBS" -fi +AM_CONDITIONAL([ENABLE_LABS], [test "x$enable_labs" = "xyes"]) # Checks for library functions. AC_TYPE_SIGNAL @@ -232,5 +266,13 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH], AC_SUBST([pkgconfigdir]) # Specify output files -AC_CONFIG_FILES([Makefile doc/Makefile src/libczmq.pc]) +AC_CONFIG_FILES([Makefile + doc/Makefile + src/libczmq.pc + ]) AC_OUTPUT + +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/doc/Makefile.am b/doc/Makefile.am index 3d1e83105..de3f5a3ee 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,7 +1,7 @@ -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ MAN1 = MAN3 = zactor.3 zauth.3 zarmour.3 zbeacon.3 zcert.3 zcertstore.3 zchunk.3 zclock.3 zconfig.3 zdigest.3 zdir.3 zdir_patch.3 zfile.3 zframe.3 zgossip.3 zhashx.3 ziflist.3 zlistx.3 zloop.3 zmonitor.3 zmsg.3 zpoller.3 zproxy.3 zrex.3 zsock.3 zsock_option.3 zstr.3 zsys.3 zuuid.3 zauth_v2.3 zbeacon_v2.3 zctx.3 zhash.3 zlist.3 zmonitor_v2.3 zmutex.3 zproxy_v2.3 zsocket.3 zsockopt.3 zthread.3 MAN7 = czmq.7 @@ -11,7 +11,7 @@ MAN_TXT = $(MAN1:%.1=%.txt) MAN_TXT += $(MAN3:%.3=%.txt) MAN_TXT += $(MAN7:%.7=%.txt) -EXTRA_DIST = asciidoc.conf mkman $(MAN_TXT) +EXTRA_DIST = asciidoc.conf $(MAN_TXT) if BUILD_DOC if INSTALL_MAN @@ -25,17 +25,100 @@ dist-hook : $(MAN_DOC) SUFFIXES=.txt .xml .1 .3 .7 .txt.xml: - $(srcdir)/mkman $< asciidoc -d manpage -b docbook -f $(srcdir)/asciidoc.conf \ - -aczmq_version=@PACKAGE_VERSION@ -o$@ $< + -aczmq_version=@PACKAGE_VERSION@ -o$@ $< .xml.1: xmlto man $< .xml.3: xmlto man $< .xml.7: xmlto man $< + +zactor.txt: + zproject_mkman $< +zauth.txt: + zproject_mkman $< +zarmour.txt: + zproject_mkman $< +zbeacon.txt: + zproject_mkman $< +zcert.txt: + zproject_mkman $< +zcertstore.txt: + zproject_mkman $< +zchunk.txt: + zproject_mkman $< +zclock.txt: + zproject_mkman $< +zconfig.txt: + zproject_mkman $< +zdigest.txt: + zproject_mkman $< +zdir.txt: + zproject_mkman $< +zdir_patch.txt: + zproject_mkman $< +zfile.txt: + zproject_mkman $< +zframe.txt: + zproject_mkman $< +zgossip.txt: + zproject_mkman $< +zhashx.txt: + zproject_mkman $< +ziflist.txt: + zproject_mkman $< +zlistx.txt: + zproject_mkman $< +zloop.txt: + zproject_mkman $< +zmonitor.txt: + zproject_mkman $< +zmsg.txt: + zproject_mkman $< +zpoller.txt: + zproject_mkman $< +zproxy.txt: + zproject_mkman $< +zrex.txt: + zproject_mkman $< +zsock.txt: + zproject_mkman $< +zsock_option.txt: + zproject_mkman $< +zstr.txt: + zproject_mkman $< +zsys.txt: + zproject_mkman $< +zuuid.txt: + zproject_mkman $< +zauth_v2.txt: + zproject_mkman $< +zbeacon_v2.txt: + zproject_mkman $< +zctx.txt: + zproject_mkman $< +zhash.txt: + zproject_mkman $< +zlist.txt: + zproject_mkman $< +zmonitor_v2.txt: + zproject_mkman $< +zmutex.txt: + zproject_mkman $< +zproxy_v2.txt: + zproject_mkman $< +zsocket.txt: + zproject_mkman $< +zsockopt.txt: + zproject_mkman $< +zthread.txt: + zproject_mkman $< +clean: + rm -f *.1 *.3 + zproject_mkman zactor zauth zarmour zbeacon zcert zcertstore zchunk zclock zconfig zdigest zdir zdir_patch zfile zframe zgossip zhashx ziflist zlistx zloop zmonitor zmsg zpoller zproxy zrex zsock zsock_option zstr zsys zuuid zauth_v2 zbeacon_v2 zctx zhash zlist zmonitor_v2 zmutex zproxy_v2 zsocket zsockopt zthread endif -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf index 1617b5d91..b8bce3618 100644 --- a/doc/asciidoc.conf +++ b/doc/asciidoc.conf @@ -1,3 +1,7 @@ +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ [paradef-default] literal-style=template="literalparagraph" @@ -5,7 +9,7 @@ literal-style=template="literalparagraph" (?su)[\\]?(?Plinkczmq):(?P\S*?)\[(?P.*?)\]= ifdef::backend-docbook[] -[linkczmq-inlinemacro] +[linkfczmq-inlinemacro] {0%{target}} {0#} {0#{target}{0}} @@ -36,22 +40,26 @@ template::[header-declarations] [footer] AUTHORS -The CZMQ manual was written by Pieter Hintjens<ph@imatix.com>. +The czmq manual was written by the authors in the AUTHORS file. RESOURCES -Main web site: http://czmq.zeromq.org/ -Report bugs to the 0MQ development mailing list: <zeromq-dev@lists.zeromq.org> +Main web site: +Report bugs to the email <zeromq-dev@lists.zeromq.org> COPYRIGHT -Copyright (c) the Contributors as noted in the AUTHORS file. This file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +Copyright (c) 1991-2012 iMatix Corporation -- http://www.imatix.com +Copyright other contributors as noted in the AUTHORS file. + +This file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org + +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, You can obtain one at http://mozilla.org/MPL/2.0/. + LICENSE included with the czmq distribution. endif::backend-docbook[] endif::doctype-manpage[] - -[replacements] -ifdef::backend-xhtml11[] -0MQ=ØMQ -endif::backend-xhtml11[] diff --git a/doc/makecert.txt b/doc/makecert.txt new file mode 100644 index 000000000..d85554171 --- /dev/null +++ b/doc/makecert.txt @@ -0,0 +1 @@ +makecert(1) diff --git a/doc/test_zgossip.txt b/doc/test_zgossip.txt new file mode 100644 index 000000000..ce899c494 --- /dev/null +++ b/doc/test_zgossip.txt @@ -0,0 +1 @@ +test_zgossip(3) diff --git a/doc/zgossip_msg.txt b/doc/zgossip_msg.txt new file mode 100644 index 000000000..a86126ae8 --- /dev/null +++ b/doc/zgossip_msg.txt @@ -0,0 +1 @@ +zgossip_msg(3) diff --git a/generate.sh b/generate.sh new file mode 100755 index 000000000..f5cc72c61 --- /dev/null +++ b/generate.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +gsl project.xml + +chmod +x autogen.sh version.sh diff --git a/include/czmq.h b/include/czmq.h new file mode 100644 index 000000000..4032ed3c7 --- /dev/null +++ b/include/czmq.h @@ -0,0 +1,23 @@ +/* ========================================================================= + czmq - an open-source framework for proximity-based P2P apps + + Copyright (c) 1991-2012 iMatix Corporation -- http://www.imatix.com + Copyright other contributors as noted in the AUTHORS file. + + This file is part of CZMQ -- See http://czmq.zeromq.org + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + ========================================================================= +*/ + +#ifndef __CZMQ_H_INCLUDED__ +#define __CZMQ_H_INCLUDED__ + +// Include the project library file +#include "czmq_library.h" + +// Add your own public definitions here, if you need them + +#endif diff --git a/include/czmq_library.h b/include/czmq_library.h index e005a7e44..7c5d03bf2 100644 --- a/include/czmq_library.h +++ b/include/czmq_library.h @@ -1,23 +1,31 @@ /* ========================================================================= - czmq.h - CZMQ wrapper + czmq - CZMQ wrapper - Copyright (c) the Contributors as noted in the AUTHORS file. - This file is part of CZMQ, the high-level C binding for 0MQ: - http://czmq.zeromq.org. + Copyright (c) 1991-2012 iMatix Corporation -- http://www.imatix.com + Copyright other contributors as noted in the AUTHORS file. + + This file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ ========================================================================= */ -#ifndef __CZMQ_H_INCLUDED__ -#define __CZMQ_H_INCLUDED__ +#ifndef __czmq_library_H_INCLUDED__ +#define __czmq_library_H_INCLUDED__ // Set up environment for the application - #include "czmq_prelude.h" +// External dependencies +#include + // CZMQ version macros for compile-time API detection #define CZMQ_VERSION_MAJOR 3 @@ -29,51 +37,105 @@ #define CZMQ_VERSION \ CZMQ_MAKE_VERSION(CZMQ_VERSION_MAJOR, CZMQ_VERSION_MINOR, CZMQ_VERSION_PATCH) +#if defined (__WINDOWS__) +# if defined LIBCZMQ_STATIC +# define CZMQ_EXPORT +# elif defined LIBCZMQ_EXPORTS +# define CZMQ_EXPORT __declspec(dllexport) +# else +# define CZMQ_EXPORT __declspec(dllimport) +# endif +#else +# define CZMQ_EXPORT +#endif + // Opaque class structures to allow forward references typedef struct _zactor_t zactor_t; +#define ZACTOR_T_DEFINED +typedef struct _zauth_t zauth_t; +#define ZAUTH_T_DEFINED typedef struct _zarmour_t zarmour_t; +#define ZARMOUR_T_DEFINED +typedef struct _zbeacon_t zbeacon_t; +#define ZBEACON_T_DEFINED typedef struct _zcert_t zcert_t; +#define ZCERT_T_DEFINED typedef struct _zcertstore_t zcertstore_t; +#define ZCERTSTORE_T_DEFINED typedef struct _zchunk_t zchunk_t; +#define ZCHUNK_T_DEFINED +typedef struct _zclock_t zclock_t; +#define ZCLOCK_T_DEFINED typedef struct _zconfig_t zconfig_t; +#define ZCONFIG_T_DEFINED typedef struct _zdigest_t zdigest_t; +#define ZDIGEST_T_DEFINED typedef struct _zdir_t zdir_t; +#define ZDIR_T_DEFINED typedef struct _zdir_patch_t zdir_patch_t; +#define ZDIR_PATCH_T_DEFINED typedef struct _zfile_t zfile_t; +#define ZFILE_T_DEFINED typedef struct _zframe_t zframe_t; -typedef struct _zhash_t zhash_t; +#define ZFRAME_T_DEFINED +typedef struct _zgossip_t zgossip_t; +#define ZGOSSIP_T_DEFINED +typedef struct _zhashx_t zhashx_t; +#define ZHASHX_T_DEFINED typedef struct _ziflist_t ziflist_t; -typedef struct _zlist_t zlist_t; +#define ZIFLIST_T_DEFINED +typedef struct _zlistx_t zlistx_t; +#define ZLISTX_T_DEFINED typedef struct _zloop_t zloop_t; +#define ZLOOP_T_DEFINED +typedef struct _zmonitor_t zmonitor_t; +#define ZMONITOR_T_DEFINED typedef struct _zmsg_t zmsg_t; +#define ZMSG_T_DEFINED typedef struct _zpoller_t zpoller_t; +#define ZPOLLER_T_DEFINED +typedef struct _zproxy_t zproxy_t; +#define ZPROXY_T_DEFINED typedef struct _zrex_t zrex_t; +#define ZREX_T_DEFINED typedef struct _zsock_t zsock_t; +#define ZSOCK_T_DEFINED +typedef struct _zsock_option_t zsock_option_t; +#define ZSOCK_OPTION_T_DEFINED +typedef struct _zstr_t zstr_t; +#define ZSTR_T_DEFINED +typedef struct _zsys_t zsys_t; +#define ZSYS_T_DEFINED typedef struct _zuuid_t zuuid_t; - -// Deprecated V2 classes, remove some time after 3.0 stability -typedef struct _zauth_t zauth_t; -typedef struct _zbeacon_t zbeacon_t; +#define ZUUID_T_DEFINED +typedef struct _zauth_v2_t zauth_v2_t; +#define ZAUTH_V2_T_DEFINED +typedef struct _zbeacon_v2_t zbeacon_v2_t; +#define ZBEACON_V2_T_DEFINED typedef struct _zctx_t zctx_t; -typedef struct _zhashx_t zhashx_t; -typedef struct _zlistx_t zlistx_t; -typedef struct _zmonitor_t zmonitor_t; +#define ZCTX_T_DEFINED +typedef struct _zhash_t zhash_t; +#define ZHASH_T_DEFINED +typedef struct _zlist_t zlist_t; +#define ZLIST_T_DEFINED +typedef struct _zmonitor_v2_t zmonitor_v2_t; +#define ZMONITOR_V2_T_DEFINED typedef struct _zmutex_t zmutex_t; -typedef struct _zproxy_t zproxy_t; +#define ZMUTEX_T_DEFINED +typedef struct _zproxy_v2_t zproxy_v2_t; +#define ZPROXY_V2_T_DEFINED +typedef struct _zsocket_t zsocket_t; +#define ZSOCKET_T_DEFINED +typedef struct _zsockopt_t zsockopt_t; +#define ZSOCKOPT_T_DEFINED +typedef struct _zthread_t zthread_t; +#define ZTHREAD_T_DEFINED -// These are signatures for handler functions that customize the -// behavior of CZMQ containers -// -- destroy an item -typedef void (czmq_destructor) (void **item); -// -- duplicate an item -typedef void *(czmq_duplicator) (const void *item); -// - compare two items, for sorting -typedef int (czmq_comparator) (const void *item1, const void *item2); // Public API classes #include "zactor.h" -#include "zarmour.h" #include "zauth.h" +#include "zarmour.h" #include "zbeacon.h" #include "zcert.h" #include "zcertstore.h" @@ -100,8 +162,6 @@ typedef int (czmq_comparator) (const void *item1, const void *item2); #include "zstr.h" #include "zsys.h" #include "zuuid.h" - -// Deprecated V2 classes, remove some time after 3.0 stability #include "zauth_v2.h" #include "zbeacon_v2.h" #include "zctx.h" @@ -115,3 +175,9 @@ typedef int (czmq_comparator) (const void *item1, const void *item2); #include "zthread.h" #endif +/* +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ +*/ diff --git a/include/test_zgossip.h b/include/test_zgossip.h new file mode 100644 index 000000000..0d6e19006 --- /dev/null +++ b/include/test_zgossip.h @@ -0,0 +1,55 @@ +/* ========================================================================= + test_zgossip - + + Copyright (c) 1991-2012 iMatix Corporation -- http://www.imatix.com + Copyright other contributors as noted in the AUTHORS file. + + This file is part of Zyre, an open-source framework for proximity-based + peer-to-peer applications -- See http://zyre.org. + + This is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 3 of the License, or (at your + option) any later version. + + This software is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTA- + BILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see http://www.gnu.org/licenses/. + ========================================================================= +*/ + +#ifndef __TEST_ZGOSSIP_H_INCLUDED__ +#define __TEST_ZGOSSIP_H_INCLUDED__ + +#ifdef __cplusplus +extern "C" { +#endif + + +// @interface +// Create a new test_zgossip +CZMQ_EXPORT test_zgossip_t * + test_zgossip_new (void); + +// Destroy the test_zgossip +CZMQ_EXPORT void + test_zgossip_destroy (test_zgossip_t **self_p); + +// Print properties of object +CZMQ_EXPORT void + test_zgossip_print (test_zgossip_t *self); + +// Self test of this class +CZMQ_EXPORT void + test_zgossip_test (bool verbose); +// @end + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/zhashx.h b/include/zhashx.h index e1c1158df..2eef19cdd 100644 --- a/include/zhashx.h +++ b/include/zhashx.h @@ -18,6 +18,18 @@ extern "C" { #endif +// These are signatures for handler functions that customize the +// behavior of CZMQ containers. These are shared between all CZMQ +// container types. + +// -- destroy an item +typedef void (czmq_destructor) (void **item); +// -- duplicate an item +typedef void *(czmq_duplicator) (const void *item); +// - compare two items, for sorting +typedef int (czmq_comparator) (const void *item1, const void *item2); + + // @interface // Callback function for zhashx_freefn method typedef void (zhashx_free_fn) (void *data); diff --git a/license.xml b/license.xml new file mode 100644 index 000000000..0de401216 --- /dev/null +++ b/license.xml @@ -0,0 +1,10 @@ + +Copyright (c) 1991-2012 iMatix Corporation -- http://www.imatix.com +Copyright other contributors as noted in the AUTHORS file. + +This file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org + +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, You can obtain one at http://mozilla.org/MPL/2.0/. + diff --git a/project.xml b/project.xml new file mode 100644 index 000000000..5b8733bb0 --- /dev/null +++ b/project.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/src/Makemodule.am b/src/Makemodule.am index be2af9d31..3cad9bf37 100644 --- a/src/Makemodule.am +++ b/src/Makemodule.am @@ -1,14 +1,18 @@ -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ +program_libs = \ + src/libczmq.la \ + ${project_libs} + lib_LTLIBRARIES += src/libczmq.la pkgconfig_DATA = src/libczmq.pc include_HEADERS = \ - include/czmq.h \ include/czmq_prelude.h \ + include/czmq.h \ include/zactor.h \ include/zauth.h \ include/zarmour.h \ @@ -38,7 +42,6 @@ include_HEADERS = \ include/zstr.h \ include/zsys.h \ include/zuuid.h \ - src/zgossip_msg.h \ include/zauth_v2.h \ include/zbeacon_v2.h \ include/zctx.h \ @@ -49,13 +52,10 @@ include_HEADERS = \ include/zproxy_v2.h \ include/zsocket.h \ include/zsockopt.h \ - include/zthread.h + include/zthread.h \ + include/czmq_library.h src_libczmq_la_SOURCES = \ - src/platform.h \ - src/zgossip_engine.inc \ - src/zhash_primes.inc \ - src/zclass_example.xml \ src/zactor.c \ src/zauth.c \ src/zarmour.c \ @@ -96,10 +96,13 @@ src_libczmq_la_SOURCES = \ src/zproxy_v2.c \ src/zsocket.c \ src/zsockopt.c \ - src/zthread.c + src/zthread.c \ + src/zgossip_engine.inc \ + src/zhash_primes.inc \ + src/zclass_example.xml \ + src/platform.h -src_libczmq_la_CPPFLAGS = \ - ${AM_CPPFLAGS} +src_libczmq_la_CPPFLAGS = ${AM_CPPFLAGS} src_libczmq_la_LDFLAGS = \ -version-info @LTVER@ \ @@ -111,28 +114,30 @@ src_libczmq_la_LDFLAGS += \ -avoid-version endif -src_libczmq_la_LIBADD = \ - ${zmq_LIBS} - -if ON_ANDROID -src_libczmq_la_LIBADD += \ - -llog +if ON_CYGWIN +src_libczmq_la_LDFLAGS += \ + -no-undefined \ + -avoid-version endif -check_PROGRAMS += src/czmq_selftest - -src_czmq_selftest_CPPFLAGS = \ - ${src_libczmq_la_CFLAGS} +src_libczmq_la_LIBADD = ${project_libs} -src_czmq_selftest_LDADD = \ - src/libczmq.la \ - ${zmq_LIBS} +bin_PROGRAMS += src/test_zgossip +src_test_zgossip_CPPFLAGS = ${AM_CPPFLAGS} +src_test_zgossip_LDADD = ${program_libs} +src_test_zgossip_SOURCES = src/test_zgossip.c -src_czmq_selftest_SOURCES = \ - src/czmq_selftest.c +check_PROGRAMS += src/czmq_selftest +src_czmq_selftest_CPPFLAGS = ${src_libczmq_la_CPPFLAGS} +src_czmq_selftest_LDADD = ${program_libs} +src_czmq_selftest_SOURCES = src/czmq_selftest.c TESTS = src/czmq_selftest + +# define custom target for all products of /src +src: src/libczmq.la src/czmq_selftest + # Run the selftest binary under valgrind to check for memory leaks memcheck: src/czmq_selftest $(LIBTOOL) --mode=execute valgrind --tool=memcheck \ @@ -145,16 +150,11 @@ debug: src/czmq_selftest $(LIBTOOL) --mode=execute gdb -q \ $(srcdir)/src/czmq_selftest -# define custom target for all products of /src -src: src/libczmq.la src/czmq_selftest - -# Produce generated models; do this manually in src directory -code: - cd $(srcdir)/src; gsl -q sockopts.xml - cd $(srcdir)/src; gsl -q zgossip.xml - cd $(srcdir)/src; gsl -q zgossip_msg.xml +# Run the selftest binary with verbose switch for tracing +animate: src/czmq_selftest + $(LIBTOOL) --mode=execute $(srcdir)/src/czmq_selftest -v -################################################################# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # -# Please read the README.txt file in the model directory. # -################################################################# +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/src/czmq_classes.h b/src/czmq_classes.h new file mode 100644 index 000000000..7c157bc15 --- /dev/null +++ b/src/czmq_classes.h @@ -0,0 +1,28 @@ +/* ========================================================================= + czmq_classes - private header file + + Copyright (c) 1991-2012 iMatix Corporation -- http://www.imatix.com + Copyright other contributors as noted in the AUTHORS file. + + This file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ + ========================================================================= +*/ + +#ifndef __CZMQ_CLASSES_H_INCLUDED__ +#define __CZMQ_CLASSES_H_INCLUDED__ + +// External API +#include "../include/czmq.h" + +// Internal API +#include "zgossip_msg.h" + +#endif diff --git a/src/czmq_selftest.c b/src/czmq_selftest.c index 0fdedbc7f..6c669dd1d 100644 --- a/src/czmq_selftest.c +++ b/src/czmq_selftest.c @@ -1,32 +1,26 @@ /* ========================================================================= - czmq_tests.c - run selftests + czmq_selftest.c - run selftests Runs all selftests. ------------------------------------------------------------------------- - Copyright (c) 1991-2014 iMatix Corporation - Copyright other contributors as noted in the AUTHORS file. + Copyright (c) 1991-2012 iMatix Corporation -- http://www.imatix.com + Copyright other contributors as noted in the AUTHORS file. + + This file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. - This file is part of czmq, the high-level C binding for 0MQ: - http://czmq.zeromq.org. - - This is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 3 of the License, or (at - your option) any later version. - - This software is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ ========================================================================= */ -#include "../include/czmq.h" +#include "czmq_classes.h" int main (int argc, char *argv []) @@ -37,55 +31,56 @@ main (int argc, char *argv []) else verbose = false; - printf ("Running CZMQ selftests...\n"); + printf ("Running czmq selftests...\n"); - // These are ordered from lowest level to highest level - zarmour_test (verbose); - zrex_test (verbose); - zsys_test (verbose); - zchunk_test (verbose); - zconfig_test (verbose); - zclock_test (verbose); - zdir_patch_test (verbose); - zdir_test (verbose); - zdigest_test (verbose); - zframe_test (verbose); - zstr_test (verbose); - zlist_test (verbose); - zlistx_test (verbose); - zhash_test (verbose); - zhashx_test (verbose); - zmsg_test (verbose); - zfile_test (verbose); - ziflist_test (verbose); - zuuid_test (verbose); - zsock_test (verbose); - zsock_option_test (verbose); - zactor_test (verbose); - zpoller_test (verbose); - zloop_test (verbose); - zproxy_test (verbose); - zmonitor_test (verbose); - zbeacon_test (verbose); - zgossip_test (verbose); - zcert_test (verbose); - zcertstore_test (verbose); - zauth_test (verbose); + zactor_test (verbose); + zauth_test (verbose); + zarmour_test (verbose); + zbeacon_test (verbose); + zcert_test (verbose); + zcertstore_test (verbose); + zchunk_test (verbose); + zclock_test (verbose); + zconfig_test (verbose); + zdigest_test (verbose); + zdir_test (verbose); + zdir_patch_test (verbose); + zfile_test (verbose); + zframe_test (verbose); + zgossip_test (verbose); + zhashx_test (verbose); + ziflist_test (verbose); + zlistx_test (verbose); + zloop_test (verbose); + zmonitor_test (verbose); + zmsg_test (verbose); + zpoller_test (verbose); + zproxy_test (verbose); + zrex_test (verbose); + zsock_test (verbose); + zsock_option_test (verbose); + zstr_test (verbose); + zsys_test (verbose); + zuuid_test (verbose); + zgossip_msg_test (verbose); + zauth_v2_test (verbose); + zbeacon_v2_test (verbose); + zctx_test (verbose); + zhash_test (verbose); + zlist_test (verbose); + zmonitor_v2_test (verbose); + zmutex_test (verbose); + zproxy_v2_test (verbose); + zsocket_test (verbose); + zsockopt_test (verbose); + zthread_test (verbose); - // Deprecated V2 classes*/ - zauth_v2_test (verbose); - zbeacon_v2_test (verbose); - zctx_test (verbose); - zmonitor_v2_test (verbose); - zmutex_test (verbose); - zproxy_v2_test (verbose); - zsocket_test (verbose); - zsockopt_test (verbose); - zthread_test (verbose); - - zsys_shutdown (); - - printf ("Number of memory allocations=%" PRId64 "\n", zsys_allocs); printf ("Tests passed OK\n"); return 0; } +/* +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ +*/ diff --git a/src/libczmq.pc.in b/src/libczmq.pc.in index 6e9024efa..48b641f5f 100755 --- a/src/libczmq.pc.in +++ b/src/libczmq.pc.in @@ -1,11 +1,23 @@ +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ + prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libczmq -Description: High-level C binding for 0MQ +Description: The high-level C binding for 0MQ Version: @VERSION@ -Requires: libzmq + +Requires:libzmq + Libs: -L${libdir} -lczmq Cflags: -I${includedir} + +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ diff --git a/version.sh b/version.sh index 527ba285e..3f10de722 100755 --- a/version.sh +++ b/version.sh @@ -1,17 +1,22 @@ -#!/bin/sh +#!/usr/bin/env sh +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ # # This script extracts the version from the project header file # project=$1 -if [ ! -f include/$project.h ]; then - echo "version.sh: error: include/$project.h does not exist" 1>&2 - exit 1 +appendix="_library" +if [ ! -f include/$project$appendix.h ]; then + echo 3.0.1 | tr -d '\n' + exit 0 fi -MAJOR=`egrep '^#define .*_VERSION_MAJOR +[0-9]+$' include/$project.h` -MINOR=`egrep '^#define .*_VERSION_MINOR +[0-9]+$' include/$project.h` -PATCH=`egrep '^#define .*_VERSION_PATCH +[0-9]+$' include/$project.h` +MAJOR=`egrep '^#define .*_VERSION_MAJOR +[0-9]+$' include/$project$appendix.h` +MINOR=`egrep '^#define .*_VERSION_MINOR +[0-9]+$' include/$project$appendix.h` +PATCH=`egrep '^#define .*_VERSION_PATCH +[0-9]+$' include/$project$appendix.h` if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then - echo "version.sh: error: could not extract version from include/$project.h" 1>&2 + echo "version.sh: error: could not extract version from include/$project$appendix.h" 1>&2 exit 1 fi MAJOR=`echo $MAJOR | awk '{ print $3 }'` @@ -19,3 +24,7 @@ MINOR=`echo $MINOR | awk '{ print $3 }'` PATCH=`echo $PATCH | awk '{ print $3 }'` echo $MAJOR.$MINOR.$PATCH | tr -d '\n' +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################