summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormalosek <malosek@fastmq.com>2009-10-19 19:00:04 +0200
committermalosek <malosek@fastmq.com>2009-10-19 19:00:04 +0200
commit8b08047cb08dd6ba7ae142007f82607183574ef6 (patch)
treeed083bd0044b1e73d37e980b987d8f761153ee06
parent71e455bfe5dd1df1220e9280e536be56238d2178 (diff)
added --with-pgm2-examples configure option
-rw-r--r--configure.in17
-rw-r--r--perf/c/Makefile.am104
-rw-r--r--src/Makefile.am4
3 files changed, 123 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index be28221..1b1db35 100644
--- a/configure.in
+++ b/configure.in
@@ -406,10 +406,22 @@ AC_ARG_WITH([pgm2], [AS_HELP_STRING([--with-pgm2],
[build libzmq with PGM v2 extension [default=no]])],
[with_pgm2_ext=yes], [with_pgm2_ext=no])
+AC_ARG_WITH([pgm2-examples], [AS_HELP_STRING([--with-pgm2-examples],
+ [build PGM v2 examples [default=no]])],
+ [with_pgm2_examples=yes], [with_pgm2_examples=no])
+
if test "x$with_pgm1_ext" != "xno" -a "x$with_pgm2_ext" != "xno"; then
AC_MSG_ERROR([Can not configure --with-pgm and --with-pgm2.]);
fi
+if test "x$with_pgm2_ext" = "xno" -a "x$with_pgm2_examples" = "xyes"; then
+ AC_MSG_ERROR([Can not configure --with-pgm2-examples without --with-pgm2.]);
+fi
+
+if test "x$c" = "xno" -a "x$with_pgm2_examples" = "xyes"; then
+ AC_MSG_ERROR([Can not configure --with-pgm2-examples without --with-c.]);
+fi
+
if test "x$with_pgm1_ext" != "xno"; then
pgm_basename=${pgm1_basename}
@@ -588,6 +600,10 @@ if test "x$with_perf" != "xno"; then
fi
fi
+if test "x$with_perf" = "xno" -a "x$with_pgm2_examples" = "xyes"; then
+ AC_MSG_ERROR([Can not configure --with-pgm2-examples without --with-perf.]);
+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")
@@ -600,6 +616,7 @@ AM_CONDITIONAL(BUILD_NO_PGM, test "x$pgm2_ext" = "xno" -a "x$pgm1_ext" = "xno")
AM_CONDITIONAL(BUILD_FORWARDER, test "x$forwarder" = "xyes")
AM_CONDITIONAL(BUILD_PERF, test "x$perf" = "xyes")
AM_CONDITIONAL(ON_MINGW, test "x$on_mingw32" = "xyes")
+AM_CONDITIONAL(BUILD_PGM2_EXAMPLES, test "x$with_pgm2_ext" = "xyes")
AC_SUBST(stdint)
AC_SUBST(inttypes)
diff --git a/perf/c/Makefile.am b/perf/c/Makefile.am
index e23816b..b810afe 100644
--- a/perf/c/Makefile.am
+++ b/perf/c/Makefile.am
@@ -1,6 +1,10 @@
INCLUDES = -I$(top_builddir)/bindings/c
-noinst_PROGRAMS = local_lat remote_lat local_thr remote_thr
+if BUILD_PGM2_EXAMPLES
+PGM_EXAMPLES_BINS = pgmsend pgmrecv
+endif
+
+noinst_PROGRAMS = local_lat remote_lat local_thr remote_thr $(PGM_EXAMPLES_BINS)
local_lat_LDADD = $(top_builddir)/src/libzmq.la
local_lat_SOURCES = local_lat.c
@@ -18,3 +22,101 @@ remote_thr_LDADD = $(top_builddir)/src/libzmq.la
remote_thr_SOURCES = remote_thr.c
remote_thr_CXXFLAGS = -Wall -pedantic -Werror
+if BUILD_PGM2_EXAMPLES
+
+if ON_MINGW
+pgmexamples_diff_flags = \
+ -D_WIN32_WINNT=0x0501 \
+ -DCONFIG_HAVE_IFR_NETMASK \
+ -DCONFIG_BIND_INADDR_ANY \
+ -DCONFIG_GALOIS_MUL_LUT \
+ -DIF_NAMESIZE=256 \
+ -DGETTEXT_PACKAGE='"pgm"' \
+ -DG_LOG_DOMAIN='"Pgm"'
+
+else
+pgmexamples_diff_flags = \
+ -D__need_IOV_MAX \
+ -DCONFIG_HAVE_PSELECT \
+ -DCONFIG_HAVE_POLL \
+ -DCONFIG_HAVE_PPOLL \
+ -DCONFIG_HAVE_EPOLL \
+ -DCONFIG_HAVE_CLOCK_GETTIME \
+ -DCONFIG_HAVE_CLOCK_NANOSLEEP \
+ -DCONFIG_HAVE_NANOSLEEP \
+ -DCONFIG_HAVE_USLEEP \
+ -DCONFIG_HAVE_RTC \
+ -DCONFIG_HAVE_TSC \
+ -DCONFIG_HAVE_IFR_NETMASK \
+ -DCONFIG_HAVE_GETIFADDRS \
+ -DCONFIG_HAVE_GETHOSTBYNAME2 \
+ -DCONFIG_HAVE_GETPROTOBYNAME_R \
+ -DCONFIG_BIND_INADDR_ANY \
+ -DCONFIG_GALOIS_MUL_LUT \
+ -DGETTEXT_PACKAGE='"pgm"' \
+ -DG_LOG_DOMAIN='"Pgm"'
+endif
+
+pgmsend_SOURCES = ../../foreign/openpgm/@pgm_basename@/openpgm/pgm/examples/pgmsend.c
+pgmsend_LDADD = $(top_builddir)/src/libzmq.la
+pgmsend_CFLAGS = -I$(top_srcdir)/foreign/openpgm/@pgm_basename@/openpgm/pgm/include/ -Wall @LIBZMQ_EXTRA_CXXFLAGS@ \
+ -pipe \
+ -Wall \
+ -Wextra \
+ -Wfloat-equal \
+ -Wshadow \
+ -Wunsafe-loop-optimizations \
+ -Wpointer-arith \
+ -Wbad-function-cast \
+ -Wcast-qual \
+ -Wcast-align \
+ -Wwrite-strings \
+ -Waggregate-return \
+ -Wstrict-prototypes \
+ -Wold-style-definition \
+ -Wmissing-prototypes \
+ -Wmissing-declarations \
+ -Wmissing-noreturn \
+ -Wmissing-format-attribute \
+ -Wredundant-decls \
+ -Wnested-externs \
+ -Winline \
+ -pedantic \
+ -std=gnu99 \
+ --param max-inline-insns-single=600 \
+ -D_REENTRANT \
+ -D_GNU_SOURCE \
+ ${pgmexamples_diff_flags}
+
+pgmrecv_SOURCES = ../../foreign/openpgm/@pgm_basename@/openpgm/pgm/examples/pgmrecv.c
+pgmrecv_LDADD = $(top_builddir)/src/libzmq.la
+pgmrecv_CFLAGS = -I$(top_srcdir)/foreign/openpgm/@pgm_basename@/openpgm/pgm/include/ -Wall @LIBZMQ_EXTRA_CXXFLAGS@ \
+ -pipe \
+ -Wall \
+ -Wextra \
+ -Wfloat-equal \
+ -Wshadow \
+ -Wunsafe-loop-optimizations \
+ -Wpointer-arith \
+ -Wbad-function-cast \
+ -Wcast-qual \
+ -Wcast-align \
+ -Wwrite-strings \
+ -Waggregate-return \
+ -Wstrict-prototypes \
+ -Wold-style-definition \
+ -Wmissing-prototypes \
+ -Wmissing-declarations \
+ -Wmissing-noreturn \
+ -Wmissing-format-attribute \
+ -Wredundant-decls \
+ -Wnested-externs \
+ -Winline \
+ -pedantic \
+ -std=gnu99 \
+ --param max-inline-insns-single=600 \
+ -D_REENTRANT \
+ -D_GNU_SOURCE \
+ ${pgmexamples_diff_flags}
+
+endif
diff --git a/src/Makefile.am b/src/Makefile.am
index 767b1e5..91fb555 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -61,7 +61,9 @@ pgm_sources = ../foreign/openpgm/@pgm_basename@/openpgm/pgm/packet.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/reed_solomon.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/galois_tables.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/wsastrerror.c \
- ../foreign/openpgm/@pgm_basename@/openpgm/pgm/glib-compat.c
+ ../foreign/openpgm/@pgm_basename@/openpgm/pgm/glib-compat.c \
+ ../foreign/openpgm/@pgm_basename@/openpgm/pgm/backtrace.c \
+ ../foreign/openpgm/@pgm_basename@/openpgm/pgm/log.c
endif
nodist_libzmq_la_SOURCES = $(pgm_sources)