Commit fbf1f514 authored by Mikko Koppanen's avatar Mikko Koppanen Committed by Martin Sustrik

Upstream the openpgm build fixes. Add DSO symbol visibility to OpenPGM builds

Signed-off-by: 's avatarMikko Koppanen <mkoppanen@php.net>
parent d36d9a37
......@@ -51,5 +51,6 @@ builds/msvc/*/Release
foreign/openpgm/*
!foreign/openpgm/*.tar.bz2
!foreign/openpgm/*.tar.gz
!foreign/openpgm/Makefile.am
zeromq-*.tar.gz
zeromq-*.zip
ACLOCAL_AMFLAGS = -I config
if BUILD_PGM
SUBDIRS = foreign/openpgm src doc perf tests
else
SUBDIRS = src doc perf tests
DIST_SUBDIRS = src doc perf tests builds/msvc
endif
DIST_SUBDIRS = foreign/openpgm src doc perf tests builds/msvc
EXTRA_DIST = \
autogen.sh \
......@@ -29,8 +34,8 @@ dist-hook:
fi
-cp $(top_srcdir)/builds/redhat/zeromq.spec $(distdir)/zeromq.spec
-sed s/\@PACKAGE_VERSION\@/@PACKAGE_VERSION@/ -i $(distdir)/zeromq.spec
-rm -rf $(distdir)/foreign/openpgm/@pgm_basename@
-rm -rf $(distdir)/foreign/openpgm/build-staging
distclean-local:
-rm -rf $(top_srcdir)/foreign/openpgm/@pgm_basename@
-rm -rf $(top_srcdir)/foreign/openpgm/build-staging
maintainer-clean-local:
-rm -rf $(top_srcdir)/config
......@@ -12,6 +12,7 @@ AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AM_CONFIG_HEADER(src/platform.hpp)
AM_INIT_AUTOMAKE(tar-ustar dist-zip foreign)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# This lets us use PACKAGE_VERSION in Makefiles
AC_SUBST(PACKAGE_VERSION)
......@@ -45,6 +46,10 @@ AC_PROG_SED
AC_PROG_AWK
# Libtool configuration for different targets. See acinclude.m4
AC_ARG_VAR([XMLTO], [Path to xmlto command])
AC_PATH_PROG([XMLTO], [xmlto])
AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
AC_PATH_PROG([ASCIIDOC], [asciidoc])
AC_ZMQ_CONFIG_LIBTOOL
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
......@@ -212,10 +217,6 @@ esac
# Check if the compiler supports -fvisibility=hidden flag. MinGW32 uses __declspec
#
if test "x$ac_zmq_dso_visibility" = "xyes"; then
AC_LANG_PUSH([C])
AC_ZMQ_CHECK_LANG_VISIBILITY([LIBZMQ_EXTRA_CFLAGS="$ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag ${LIBZMQ_EXTRA_CFLAGS}"])
AC_LANG_POP([C])
AC_LANG_PUSH([C++])
AC_ZMQ_CHECK_LANG_VISIBILITY([LIBZMQ_EXTRA_CXXFLAGS="$ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag ${LIBZMQ_EXTRA_CXXFLAGS}"])
AC_LANG_POP([C++])
......@@ -266,70 +267,21 @@ AC_C_VOLATILE
# PGM extension
ac_zmq_pgm_ext="no"
pgm_basename="libpgm-5.0.92~dfsg"
AC_SUBST(pgm_basename)
pgm_basename="libpgm-5.1.115~dfsg"
AC_ARG_WITH([pgm], [AS_HELP_STRING([--with-pgm],
[build libzmq with PGM extension [default=no]])],
[with_pgm_ext=yes], [with_pgm_ext=no])
[with_pgm_ext=$withval], [with_pgm_ext=no])
if test "x$with_pgm_ext" != "xno"; then
if test "x$ac_cv_prog_cc_c99" = "xno"; then
AC_MSG_WARN([The C compiler is not set to C99 mode. The build will most likely fail])
fi
AC_MSG_CHECKING([if the PGM extension is supported on this platform])
# OpenPGM is only supported by the vendor on x86, AMD64, and SPARC platforms...
case "${host_cpu}" in
i*86|x86_64|amd64|*sparc*|s390*)
# Supported
;;
*)
AC_MSG_ERROR([the PGM extension is not supported on the ${host_cpu} platform.])
;;
esac
# ... and on Linux/Windows/Solaris/FreeBSD/OSX systems.
case "${host_os}" in
*linux*|*mingw32*|*solaris*|*freebsd*|*darwin*)
AC_MSG_RESULT([yes])
AC_LANG_PUSH([C++])
AC_ZMQ_CHECK_LANG_FLAG([-Wno-variadic-macros], [LIBZMQ_EXTRA_CXXFLAGS="-Wno-variadic-macros $LIBZMQ_EXTRA_CXXFLAGS"])
AC_ZMQ_CHECK_LANG_FLAG([-Wno-long-long], [LIBZMQ_EXTRA_CXXFLAGS="-Wno-long-long $LIBZMQ_EXTRA_CXXFLAGS"])
AC_LANG_POP([C++])
AC_LANG_PUSH([C])
AC_ZMQ_LANG_STRICT([LIBZMQ_EXTRA_CFLAGS="$ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag $LIBZMQ_EXTRA_CFLAGS"])
if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \
"x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
LIBZMQ_EXTRA_CFLAGS="-Dasm=__asm__ $LIBZMQ_EXTRA_CFLAGS"
fi
AC_LANG_POP([C])
;;
*)
AC_MSG_ERROR([the PGM extension is not supported on system ${host_os}.])
;;
esac
# Gzip, Perl and Python are required during PGM build
AC_CHECK_PROG(ac_zmq_have_gzip, gzip, yes, no)
if test "x$ac_zmq_have_gzip" != "xyes"; then
AC_MSG_ERROR([gzip is required for building the PGM extension.])
fi
AC_CHECK_PROG(ac_zmq_have_perl, perl, yes, no)
if test "x$ac_zmq_have_perl" != "xyes"; then
AC_MSG_ERROR([perl is required for building the PGM extension.])
fi
AC_CHECK_PROG(ac_zmq_have_python, python, yes, no)
if test "x$ac_zmq_have_python" != "xyes"; then
AC_MSG_ERROR([python is required for building the PGM extension.])
# This allows placing the tar.gz to foreign/openpgm
# and using ./configure --with-pgm=libpgm-x.y.z
if test "x$with_pgm_ext" != "xyes"; then
pgm_basename="$with_pgm_ext"
fi
# Unpack libpgm
# Unpack libpgm
AC_MSG_NOTICE([Unpacking ${pgm_basename}.tar.gz])
ac_zmq_pwd=`pwd`
cd foreign/openpgm
......@@ -337,17 +289,38 @@ if test "x$with_pgm_ext" != "xno"; then
if ! (gzip -dc "${pgm_basename}.tar.gz" || echo "failed") | ${am__untar}; then
AC_MSG_ERROR([cannot unpack the foreign/openpgm/${pgm_basename}.tar.gz file])
fi
cd "${ac_zmq_pwd}"
# Success!
if test -d foreign/openpgm/build-staging; then
rm -rf foreign/openpgm/build-staging
fi
mv foreign/openpgm/${pgm_basename} foreign/openpgm/build-staging
pgm_srcdir=foreign/openpgm/build-staging/openpgm/pgm
if ! test -d foreign/openpgm/build-staging/openpgm/pgm/config; then
mkdir foreign/openpgm/build-staging/openpgm/pgm/config
fi
# DSO symbol visibility for openpgm
AC_LANG_PUSH([C])
AC_ZMQ_CHECK_LANG_VISIBILITY([ac_configure_args="CFLAGS='$ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag' ${ac_configure_args}"])
AC_LANG_POP([C])
pgm_subdir=build-staging/openpgm/pgm
AC_SUBST(pgm_subdir)
AC_SUBST(pgm_srcdir)
AC_CONFIG_SUBDIRS([foreign/openpgm/build-staging/openpgm/pgm/])
# Success!
AC_DEFINE(ZMQ_HAVE_OPENPGM, 1, [Have OpenPGM extension])
ac_zmq_pgm_ext="yes"
# these break OpenPGM so don't specify them if we are building with it.
ac_zmq_pedantic="no"
ac_zmq_werror="no"
fi
AC_SUBST(pgm_basename)
# Set -Wall, -Werror and -pedantic
AC_LANG_PUSH([C++])
......@@ -371,52 +344,6 @@ AC_TYPE_SIGNAL
AC_CHECK_FUNCS(perror gettimeofday memset socket getifaddrs freeifaddrs)
AC_CHECK_HEADERS([alloca.h])
if test "x$with_pgm_ext" != "xno"; then
# Check additional functions for PGM build
AC_CHECK_FUNCS(poll epoll_create pselect getopt vasprintf getprotobyname_r2 getprotobyname_r)
if test "x$ac_cv_func_gettimeofday" = "xyes"; then
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_GETTIMEOFDAY $LIBZMQ_EXTRA_CFLAGS"
fi
if test "x$ac_cv_func_getprotobyname_r2" = "xyes"; then
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_GETPROTOBYNAME_R2 $LIBZMQ_EXTRA_CFLAGS"
fi
if test "x$ac_cv_func_poll" = "xyes"; then
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_POLL $LIBZMQ_EXTRA_CFLAGS"
fi
if test "x$ac_cv_func_epoll_create" = "xyes"; then
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_EPOLL $LIBZMQ_EXTRA_CFLAGS"
fi
if test "x$ac_cv_func_getifaddrs" = "xyes"; then
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_GETIFADDRS $LIBZMQ_EXTRA_CFLAGS"
fi
if test "x$ac_cv_func_getopt" = "xyes"; then
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_GETOPT $LIBZMQ_EXTRA_CFLAGS"
fi
if test "x$ac_cv_func_pselect" = "xyes"; then
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_PSELECT $LIBZMQ_EXTRA_CFLAGS"
fi
if test "x$ac_cv_header_alloca_h" = "xyes"; then
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_ALLOCA_H $LIBZMQ_EXTRA_CFLAGS"
fi
if test "x$ac_cv_c_compiler_gnu" = "xno"; then
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_ISO_VARARGS $LIBZMQ_EXTRA_CFLAGS"
else
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_GNU_VARARGS $LIBZMQ_EXTRA_CFLAGS"
fi
if test "x$ac_cv_func_vasprintf" = "xyes"; then
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_VASPRINTF $LIBZMQ_EXTRA_CFLAGS"
fi
case "${host_cpu}" in
i*86|x86_64|amd64|*sparc*)
LIBZMQ_EXTRA_CFLAGS="-DCONFIG_HAVE_TSC -DCONFIG_HAVE_RTC -DCONFIG_HAVE_HPET $LIBZMQ_EXTRA_CFLAGS"
;;
*sparc*|s390*)
;;
esac
fi
# Subst LIBZMQ_EXTRA_CFLAGS & CXXFLAGS & LDFLAGS
AC_SUBST(LIBZMQ_EXTRA_CFLAGS)
AC_SUBST(LIBZMQ_EXTRA_CXXFLAGS)
......@@ -424,6 +351,7 @@ AC_SUBST(LIBZMQ_EXTRA_LDFLAGS)
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile
perf/Makefile src/libzmq.pc \
builds/msvc/Makefile tests/Makefile])
builds/msvc/Makefile tests/Makefile \
foreign/openpgm/Makefile])
AC_OUTPUT
SUBDIRS = $(pgm_subdir)
DIST_SUBDIRS =
# Override Automake's installation targets with the command ":" that does nothing.
install:; @:
install-exec:; @:
install-data:; @:
uninstall:; @:
dist:; @;
......@@ -5,61 +5,6 @@ pkgconfig_DATA = libzmq.pc
include_HEADERS = ../include/zmq.h ../include/zmq_utils.h
if BUILD_PGM
noinst_LTLIBRARIES = libpgm.la
nodist_libpgm_la_SOURCES = ../foreign/openpgm/@pgm_basename@/openpgm/pgm/thread.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/mem.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/string.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/list.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/slist.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/queue.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/hashtable.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/messages.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/error.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/math.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/packet_parse.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/packet_test.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/sockaddr.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/time.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/if.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/getifaddrs.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/getnodeaddr.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/indextoaddr.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/indextoname.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/nametoindex.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/inet_network.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/md5.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/rand.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/gsi.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/tsi.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/txw.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/rxw.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/skbuff.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/socket.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/source.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/receiver.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/recv.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/engine.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/timer.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/net.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/rate_control.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/checksum.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/histogram.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/version.c
../foreign/openpgm/@pgm_basename@/openpgm/pgm/version.c: ../foreign/openpgm/@pgm_basename@/openpgm/pgm/version_generator.py
python ../foreign/openpgm/@pgm_basename@/openpgm/pgm/version_generator.py > $@
../foreign/openpgm/@pgm_basename@/openpgm/pgm/galois_tables.c: ../foreign/openpgm/@pgm_basename@/openpgm/pgm/galois_generator.pl
perl ../foreign/openpgm/@pgm_basename@/openpgm/pgm/galois_generator.pl > $@
libpgm_la_LIBADD = @LTLIBOBJS@
endif
libzmq_la_SOURCES = \
array.hpp \
atomic_counter.hpp \
......@@ -195,47 +140,11 @@ else
libzmq_la_LDFLAGS = -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@
endif
if BUILD_PGM
if ON_MINGW
libpgm_diff_flags = \
-D_WIN32_WINNT=0x0501 \
-DCONFIG_HAVE_ISO_VARARGS \
-DCONFIG_HAVE_TSC \
-DCONFIG_HAVE_WSACMSGHDR \
-DCONFIG_BIND_INADDR_ANY
else
libpgm_diff_flags = \
-DCONFIG_HAVE_PROC \
-DCONFIG_HAVE_BACKTRACE \
-DCONFIG_HAVE_IFR_NETMASK \
-DCONFIG_HAVE_MCAST_JOIN \
-DCONFIG_HAVE_IP_MREQN \
-DCONFIG_HAVE_SPRINTF_GROUPING \
-DCONFIG_BIND_INADDR_ANY
endif
libpgm_la_CFLAGS = -I$(top_srcdir)/foreign/openpgm/@pgm_basename@/openpgm/pgm/include/ @LIBZMQ_EXTRA_CFLAGS@ \
-D_XOPEN_SOURCE=600 \
-D_BSD_SOURCE \
-D_REENTRANT \
-DCONFIG_16BIT_CHECKSUM \
-DCONFIG_GALOIS_MUL_LUT \
-DGETTEXT_PACKAGE='"pgm"' \
-DPGM_GNUC_INTERNAL= \
${libpgm_diff_flags}
libzmq_la_CXXFLAGS = -I$(top_srcdir)/foreign/openpgm/@pgm_basename@/openpgm/pgm/include/ \
@LIBZMQ_EXTRA_CXXFLAGS@
endif
if !BUILD_PGM
libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@
endif
if BUILD_PGM
libzmq_la_LIBADD = libpgm.la
libzmq_la_CPPFLAGS = -I$(top_srcdir)/@pgm_srcdir@/include/
libzmq_la_LIBADD = $(top_srcdir)/@pgm_srcdir@/libpgm_noinst.la
endif
dist-hook:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment