summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormalosek <malosek@fastmq.com>2009-09-07 17:06:47 +0200
committermalosek <malosek@fastmq.com>2009-09-07 17:06:47 +0200
commitb71c3005e68d02f800ff09bcacece79d167bff75 (patch)
treef8a82fbb1cdc5f20e21da9809ea20c93f16bca56
parentf895426c1885729f4a4a20b1eb543a92915aed85 (diff)
include directory split into c and cpp dirs, added --with-c and --with-cpp configure options
-rw-r--r--Makefile.am2
-rwxr-xr-xautogen.sh8
-rw-r--r--c/zmq.h (renamed from include/zmq.h)0
-rw-r--r--configure.in45
-rw-r--r--cpp/zmq.hpp (renamed from include/zmq.hpp)0
-rw-r--r--perf/c/Makefile.am4
-rw-r--r--perf/cpp/Makefile.am4
-rw-r--r--src/Makefile.am15
-rw-r--r--src/app_thread.cpp2
-rw-r--r--src/dispatcher.cpp2
-rw-r--r--src/i_inout.hpp2
-rw-r--r--src/io_thread.cpp2
-rw-r--r--src/msg_content.hpp2
-rw-r--r--src/pipe.cpp2
-rw-r--r--src/pipe.hpp2
-rw-r--r--src/socket_base.cpp2
-rw-r--r--src/zmq.cpp2
-rw-r--r--src/zmq_decoder.hpp2
-rw-r--r--src/zmq_encoder.hpp2
19 files changed, 65 insertions, 35 deletions
diff --git a/Makefile.am b/Makefile.am
index 3055e64..4dda619 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,3 @@
-include_HEADERS = include/zmq.h include/zmq.hpp
-
if BUILD_PYTHON
DIR_P = python
endif
diff --git a/autogen.sh b/autogen.sh
index 19f2174..dfa69c0 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -18,7 +18,13 @@
# Script to generate all required files from fresh svn checkout.
-
+pkg-config --version > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+ echo
+ echo "Could not find pkg-config, pkg.m4 macro is probably not installed."
+ echo
+ exit 1
+fi
autoreconf --install --force --verbose -I config
diff --git a/include/zmq.h b/c/zmq.h
index a8394ed..a8394ed 100644
--- a/include/zmq.h
+++ b/c/zmq.h
diff --git a/configure.in b/configure.in
index 8feef7b..6d69333 100644
--- a/configure.in
+++ b/configure.in
@@ -164,11 +164,29 @@ if test "x$HAVE_INTTYPES_H" = "xyes"; then
inttypes="1"
fi
+# c
+czmq="no"
+AC_ARG_WITH([c], [AS_HELP_STRING([--with-c],
+ [build c language binding [default=no]])], [c=yes], [c=no])
+
+if test "x$c" != "xno"; then
+ czmq="yes"
+fi
+
+# c++
+cppzmq="no"
+AC_ARG_WITH([cpp], [AS_HELP_STRING([--with-cpp],
+ [build c++ language binding [default=no]])], [cpp=yes], [cpp=no])
+
+if test "x$cpp" != "xno"; then
+ cppzmq="yes"
+fi
+
# Python
pyzmq="no"
AC_ARG_WITH(python_headersdir,
- AC_HELP_STRING([--with-python-headersdir], [Python.h header file location]),
+ AS_HELP_STRING([--with-python-headersdir], [Python.h header file location]),
[python_headersdir="$withval"], [python_headersdir="no"])
AC_ARG_WITH([python], [AS_HELP_STRING([--with-python], [build Python language binding [default=no]])], [with_python=yes], [with_python=no])
@@ -209,7 +227,7 @@ fi
rbzmq="no"
AC_ARG_WITH(ruby_headersdir,
- AC_HELP_STRING([--with-ruby-headersdir], [ruby.h header file location]),
+ AS_HELP_STRING([--with-ruby-headersdir], [ruby.h header file location]),
[ruby_headersdir="$withval"], [ruby_headersdir="no"])
if test "x$ruby_headersdir" != "xno"; then
@@ -217,7 +235,7 @@ if test "x$ruby_headersdir" != "xno"; then
fi
AC_ARG_WITH(ruby_libdir,
- AC_HELP_STRING([--with-ruby-libdir],[libruby library file location]),
+ AS_HELP_STRING([--with-ruby-libdir],[libruby library file location]),
[ruby_libdir="$withval"], [ruby_libdir="no"])
if test "x$ruby_libdir" != "xno"; then
@@ -249,17 +267,12 @@ RUBYDIR="$rubydir"
AC_SUBST([RUBYDIR])
if test "x$pyzmq" != "xyes"; then
- AC_CHECK_PROG(have_python, python, yes, no)
- if test "x$have_python" != "xyes"; then
- AC_MSG_ERROR([Could not find python.])
- fi
+ AC_CHECK_PROG(have_python, python, yes, no)
+ if test "x$have_python" != "xyes"; then
+ AC_MSG_ERROR([Could not find python.])
fi
+fi
- # Generate version.c
- AC_CONFIG_COMMANDS([version.c],
- [python third-party/openpgm/libpgm-1.0.0/openpgm/pgm/version_generator.py > \
- third-party/openpgm/libpgm-1.0.0/openpgm/pgm/version.c])
-
# Java language binding
jzmq="no"
AC_ARG_WITH([java], [AS_HELP_STRING([--with-java], [build Java language binding [default=no]])], [with_java=yes], [with_java=no])
@@ -312,6 +325,10 @@ fi
AM_CONDITIONAL(BUILD_PYTHON, test "x$pyzmq" = "xyes")
AM_CONDITIONAL(BUILD_JAVA, test "x$jzmq" = "xyes")
+AM_CONDITIONAL(BUILD_PYTHON, test "x$pyzmq" = "xyes")
+AM_CONDITIONAL(BUILD_RUBY, test "x$rbzmq" = "xyes")
+AM_CONDITIONAL(BUILD_C, test "x$czmq" = "xyes")
+AM_CONDITIONAL(BUILD_CPP, test "x$cppzmq" = "xyes")
AC_SUBST(stdint)
AC_SUBST(inttypes)
@@ -319,8 +336,6 @@ AC_SUBST(inttypes)
# Subst ZMQ_EXTRA_CXXFLAGS
AC_SUBST(ZMQ_EXTRA_CXXFLAGS)
-AM_CONDITIONAL(BUILD_PYTHON, test "x$pyzmq" = "xyes")
-AM_CONDITIONAL(BUILD_RUBY, test "x$rbzmq" = "xyes")
# Checks for library functions.
AC_FUNC_MALLOC
@@ -342,6 +357,8 @@ AC_MSG_RESULT([ license text. ])
AC_MSG_RESULT([ ******************************************************** ])
AC_MSG_RESULT([])
AC_MSG_RESULT([ 0MQ install dir: $prefix])
+AC_MSG_RESULT([ C language binding: $czmq])
+AC_MSG_RESULT([ C++ language binding: $cppzmq])
AC_MSG_RESULT([ Python language binding: $pyzmq])
AC_MSG_RESULT([ Ruby language binding: $rbzmq])
if test "x$rbzmq" = "xyes"; then
diff --git a/include/zmq.hpp b/cpp/zmq.hpp
index ffdea7b..ffdea7b 100644
--- a/include/zmq.hpp
+++ b/cpp/zmq.hpp
diff --git a/perf/c/Makefile.am b/perf/c/Makefile.am
index 6762e66..430a9f2 100644
--- a/perf/c/Makefile.am
+++ b/perf/c/Makefile.am
@@ -1,6 +1,6 @@
-INCLUDES = -I$(top_builddir)/include
+INCLUDES = -I$(top_builddir)/c
-bin_PROGRAMS = local_lat remote_lat local_thr remote_thr
+noinst_PROGRAMS = local_lat remote_lat local_thr remote_thr
local_lat_LDADD = $(top_builddir)/src/libzmq.la
local_lat_SOURCES = local_lat.c
diff --git a/perf/cpp/Makefile.am b/perf/cpp/Makefile.am
index 7870943..1ea01a0 100644
--- a/perf/cpp/Makefile.am
+++ b/perf/cpp/Makefile.am
@@ -1,6 +1,6 @@
-INCLUDES = -I$(top_builddir)/include
+INCLUDES = -I$(top_srcdir)/cpp -I$(top_srcdir)/c
-bin_PROGRAMS = local_lat remote_lat local_thr remote_thr
+noinst_PROGRAMS = local_lat remote_lat local_thr remote_thr
local_lat_LDADD = $(top_builddir)/src/libzmq.la
local_lat_SOURCES = local_lat.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 88a6f4b..da442f4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,8 +1,17 @@
lib_LTLIBRARIES = libzmq.la
-pkginclude_HEADERS = \
- ../include/zmq.h \
- ../include/zmq.hpp
+
+if BUILD_CPP
+include_HEADERS = ../cpp/zmq.hpp ../c/zmq.h
+endif
+
+if BUILD_C
+if BUILD_CPP
+
+else
+include_HEADERS = ../c/zmq.h
+endif
+endif
libzmq_la_SOURCES = \
app_thread.hpp \
diff --git a/src/app_thread.cpp b/src/app_thread.cpp
index 847fcc1..bdceca5 100644
--- a/src/app_thread.cpp
+++ b/src/app_thread.cpp
@@ -19,7 +19,7 @@
#include <algorithm>
-#include "../include/zmq.h"
+#include "../c/zmq.h"
#include "platform.hpp"
diff --git a/src/dispatcher.cpp b/src/dispatcher.cpp
index 49c2197..530238d 100644
--- a/src/dispatcher.cpp
+++ b/src/dispatcher.cpp
@@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
+#include "../c/zmq.h"
#include "dispatcher.hpp"
#include "app_thread.hpp"
diff --git a/src/i_inout.hpp b/src/i_inout.hpp
index 89b9fbd..4664b13 100644
--- a/src/i_inout.hpp
+++ b/src/i_inout.hpp
@@ -20,7 +20,7 @@
#ifndef __ZMQ_I_INOUT_HPP_INCLUDED__
#define __ZMQ_I_INOUT_HPP_INCLUDED__
-#include "../include/zmq.h"
+#include "../c/zmq.h"
namespace zmq
{
diff --git a/src/io_thread.cpp b/src/io_thread.cpp
index 1d85292..d5de497 100644
--- a/src/io_thread.cpp
+++ b/src/io_thread.cpp
@@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
+#include "../c/zmq.h"
#include "io_thread.hpp"
#include "command.hpp"
diff --git a/src/msg_content.hpp b/src/msg_content.hpp
index b468746..6c91966 100644
--- a/src/msg_content.hpp
+++ b/src/msg_content.hpp
@@ -22,7 +22,7 @@
#include <stddef.h>
-#include "../include/zmq.h"
+#include "../c/zmq.h"
#include "atomic_counter.hpp"
diff --git a/src/pipe.cpp b/src/pipe.cpp
index 392d380..a5a18be 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
+#include "../c/zmq.h"
#include "pipe.hpp"
diff --git a/src/pipe.hpp b/src/pipe.hpp
index b4e592a..81316e4 100644
--- a/src/pipe.hpp
+++ b/src/pipe.hpp
@@ -20,7 +20,7 @@
#ifndef __ZMQ_PIPE_HPP_INCLUDED__
#define __ZMQ_PIPE_HPP_INCLUDED__
-#include "../include/zmq.h"
+#include "../c/zmq.h"
#include "stdint.hpp"
#include "i_endpoint.hpp"
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index 93a0a4c..ac5a88c 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -20,7 +20,7 @@
#include <string>
#include <algorithm>
-#include "../include/zmq.h"
+#include "../c/zmq.h"
#include "socket_base.hpp"
#include "app_thread.hpp"
diff --git a/src/zmq.cpp b/src/zmq.cpp
index 0ffd530..ad4839f 100644
--- a/src/zmq.cpp
+++ b/src/zmq.cpp
@@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
+#include "../c/zmq.h"
#include <errno.h>
#include <stdlib.h>
diff --git a/src/zmq_decoder.hpp b/src/zmq_decoder.hpp
index 212e68e..16b5312 100644
--- a/src/zmq_decoder.hpp
+++ b/src/zmq_decoder.hpp
@@ -20,7 +20,7 @@
#ifndef __ZMQ_ZMQ_DECODER_HPP_INCLUDED__
#define __ZMQ_ZMQ_DECODER_HPP_INCLUDED__
-#include "../include/zmq.h"
+#include "../c/zmq.h"
#include "decoder.hpp"
diff --git a/src/zmq_encoder.hpp b/src/zmq_encoder.hpp
index 29563fc..55826a5 100644
--- a/src/zmq_encoder.hpp
+++ b/src/zmq_encoder.hpp
@@ -20,7 +20,7 @@
#ifndef __ZMQ_ZMQ_ENCODER_HPP_INCLUDED__
#define __ZMQ_ZMQ_ENCODER_HPP_INCLUDED__
-#include "../include/zmq.h"
+#include "../c/zmq.h"
#include "encoder.hpp"