mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-13 09:39:50 +00:00
Merge pull request #3 from johntconklin/master
Cherry-picked configure and rpmbuild fixes from libzmq/master
This commit is contained in:
commit
966256d1b6
11
Makefile.am
11
Makefile.am
@ -228,11 +228,18 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
libzmq_la_CPPFLAGS =
|
||||
libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@
|
||||
libzmq_la_LIBADD =
|
||||
|
||||
if HAVE_SODIUM
|
||||
libzmq_la_CPPFLAGS += ${sodium_CFLAGS}
|
||||
libzmq_la_LIBADD += ${sodium_LIBS}
|
||||
endif
|
||||
|
||||
if HAVE_PGM
|
||||
libzmq_la_CPPFLAGS = ${pgm_CFLAGS}
|
||||
libzmq_la_LIBADD = ${pgm_LIBS}
|
||||
libzmq_la_CPPFLAGS += ${pgm_CFLAGS}
|
||||
libzmq_la_LIBADD += ${pgm_LIBS}
|
||||
endif
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
|
@ -11,14 +11,30 @@ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
BuildRequires: gcc, make, gcc-c++, libstdc++-devel, asciidoc, xmlto
|
||||
Requires: libstdc++
|
||||
|
||||
%if %{?rhel}%{!?rhel:0} >= 5
|
||||
BuildRequires: e2fsprogs-devel
|
||||
Requires: e2fsprogs
|
||||
%endif
|
||||
#
|
||||
# Conditional build options
|
||||
# Default values aree
|
||||
# --without-libsodium
|
||||
# --without-pgm
|
||||
#
|
||||
|
||||
# If neither macro exists, use the default value.
|
||||
%{!?_with_libsodium: %{!?_without_libsodium: %define _without_libsodium --without-libsodium}}
|
||||
%{!?_with_pgm: %{!?_without_pgm: %define _without_pgm --without-pgm}}
|
||||
|
||||
# It's an error if both --with and --without options are specified
|
||||
%{?_with_libsodium: %{?_without_libsodium: %{error: both _with_libsodium and _without_libsodium}}}
|
||||
%{?_with_pgm: %{?_without_pgm: %{error: both _with_pgm and _without_pgm}}}
|
||||
|
||||
%{?_with_libsodium:BuildRequires: libsodium-devel}
|
||||
%{?_with_libsodium:Requires: libsodium}
|
||||
|
||||
%{?_with_pgm:BuildRequires: openpgm-devel}
|
||||
%{?_with_pgm:Requires: openpgm}
|
||||
|
||||
# Build pgm only on supported archs
|
||||
%ifarch pentium3 pentium4 athlon i386 i486 i586 i686 x86_64
|
||||
BuildRequires: python, perl
|
||||
%{!?_with_pic: %{!?_without_pic: %define _with_pic --with-pic}}
|
||||
%{!?_with_gnu_ld: %{!?_without_gnu_ld: %define _with_gnu_ld --with-gnu_ld}}
|
||||
%endif
|
||||
|
||||
%description
|
||||
@ -50,11 +66,15 @@ This package contains ZeroMQ related development libraries and header files.
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%ifarch pentium3 pentium4 athlon i386 i486 i586 i686 x86_64
|
||||
%configure --with-pgm --with-pic --with-gnu-ld
|
||||
%else
|
||||
%configure
|
||||
%endif
|
||||
%configure \
|
||||
%{?_with_libsodium} \
|
||||
%{?_without_libsodium} \
|
||||
%{?_with_pgm} \
|
||||
%{?_without_pgm} \
|
||||
%{?_with_pic} \
|
||||
%{?_without_pic} \
|
||||
%{?_with_gnu_ld} \
|
||||
%{?_without_gnu_ld}
|
||||
|
||||
%{__make} %{?_smp_mflags}
|
||||
|
||||
@ -153,6 +173,10 @@ This package contains ZeroMQ related development libraries and header files.
|
||||
%{_mandir}/man7/zmq_tipc.7.gz
|
||||
|
||||
%changelog
|
||||
* Sat Oct 18 2014 J.T. Conklin <jtc@acorntoolworks.com>
|
||||
- Add --with/--without pgm support
|
||||
- Add --with/--without libsodium support
|
||||
|
||||
* Tue Jun 10 2014 Tristian Celestin <tristian.celestin@outlook.com> 4.0.4
|
||||
- Updated packaged files
|
||||
|
||||
|
80
configure.ac
80
configure.ac
@ -48,6 +48,7 @@ AC_PROG_CXX
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_SED
|
||||
AC_PROG_AWK
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
# Libtool configuration for different targets. See acinclude.m4
|
||||
AC_ARG_VAR([XMLTO], [Path to xmlto command])
|
||||
@ -101,46 +102,6 @@ AC_RUN_IFELSE(
|
||||
AC_MSG_RESULT([$libzmq_tipc_support])
|
||||
|
||||
|
||||
|
||||
# Allow libsodium to be installed in a custom path:
|
||||
|
||||
AC_ARG_WITH([libsodium],
|
||||
[AS_HELP_STRING([--with-libsodium],
|
||||
[Specify libsodium prefix])],
|
||||
[zmq_search_libsodium="yes"],
|
||||
[])
|
||||
|
||||
if test "x$zmq_search_libsodium" = "xyes"; then
|
||||
if test -r "${with_libsodium}/include/sodium.h"; then
|
||||
CPPFLAGS="-I${with_libsodium}/include ${CPPFLAGS}"
|
||||
LDFLAGS="-L${with_libsodium}/lib ${LDFLAGS}"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([libsodium-include-dir],
|
||||
[AS_HELP_STRING([--with-libsodium-include-dir],
|
||||
[Specify libsodium include prefix])],
|
||||
[zmq_search_libsodium_include="yes"],
|
||||
[])
|
||||
|
||||
if test "x$zmq_search_libsodium_include" = "xyes"; then
|
||||
if test -r "${with_libsodium_include_dir}/sodium.h"; then
|
||||
CPPFLAGS="-I${with_libsodium_include_dir}/include ${CPPFLAGS}"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([libsodium_lib_dir],
|
||||
[AS_HELP_STRING([--with-libsodium-lib-dir],
|
||||
[Specify libsodium library prefix])],
|
||||
[zmq_search_libsodium_lib="yes"],
|
||||
[])
|
||||
|
||||
if test "x$zmq_search_libsodium_lib" = "xyes"; then
|
||||
if test -r "${with_libsodium_lib_dir}/libsodium.{a|so|dylib}"; then
|
||||
LDFLAGS="-L${with_libsodium}/lib ${LDFLAGS}"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([relaxed],
|
||||
[AS_HELP_STRING([--with-relaxed],
|
||||
[Switch off pedantic compiler])],
|
||||
@ -320,12 +281,6 @@ esac
|
||||
AC_CHECK_LIB([pthread], [pthread_create])
|
||||
AC_CHECK_LIB([rt], [clock_gettime])
|
||||
|
||||
if test "x$zmq_search_libsodium" = "xyes"; then
|
||||
AC_CHECK_LIB([sodium],[sodium_init],,AC_MSG_ERROR(libsodium is not installed. Install it or don't pass --with-libsodium to configure script))
|
||||
else
|
||||
AC_CHECK_LIB([sodium], [sodium_init],,AC_MSG_WARN(libsodium is needed for CURVE security))
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context],,AC_MSG_WARN(libgssapi_krb5 is needed for GSSAPI security))
|
||||
|
||||
#
|
||||
@ -423,23 +378,38 @@ AC_HEADER_TIME
|
||||
AC_TYPE_UINT32_T
|
||||
AC_C_VOLATILE
|
||||
|
||||
# build using libsodium
|
||||
have_sodium_library="no"
|
||||
|
||||
AC_ARG_WITH([libsodium], [AS_HELP_STRING([--with-libsodium],
|
||||
[require libzmq build with libsodium. Requires pkg-config [default=no]])],
|
||||
[require_libsodium_ext=$withval],
|
||||
[require_libsodium_ext=no])
|
||||
|
||||
#conditionally require libsodium package
|
||||
if test "x$require_libsodium_ext" != "xno"; then
|
||||
PKG_CHECK_MODULES([sodium], [libsodium], [have_sodium_library="yes"])
|
||||
fi
|
||||
|
||||
if test "x$have_sodium_library" != "xno"; then
|
||||
AC_DEFINE(HAVE_LIBSODIUM, 1, [The libsodium library is to be used.])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_SODIUM, test "x$have_sodium_library" != "xno")
|
||||
|
||||
# build using pgm
|
||||
have_pgm_library="no"
|
||||
|
||||
AC_ARG_WITH([pgm], [AS_HELP_STRING([--with-pgm],
|
||||
[build libzmq with PGM extension. Requires pkg-config [default=no]])],
|
||||
[with_pgm_ext=yes], [with_pgm_ext=no])
|
||||
[with_pgm_ext=$withval],
|
||||
[with_pgm_ext=no])
|
||||
|
||||
# conditionally require pgm package
|
||||
if test "x$with_pgm_ext" != "xno"; then
|
||||
m4_ifdef([PKG_CHECK_MODULES], [
|
||||
PKG_CHECK_MODULES([pgm], [openpgm-5.2 >= 5.2],
|
||||
[ have_pgm_library="yes" ],
|
||||
[PKG_CHECK_MODULES([pgm], [openpgm-5.1 >= 5.1],
|
||||
[ have_pgm_library="yes" ])]
|
||||
)
|
||||
],
|
||||
[AC_MSG_ERROR([--with-pgm requires a working pkg-config installation])])
|
||||
PKG_CHECK_MODULES([pgm], [openpgm-5.2 >= 5.2], [ have_pgm_library="yes" ],
|
||||
[PKG_CHECK_MODULES([pgm], [openpgm-5.1 >= 5.1],
|
||||
[ have_pgm_library="yes" ])])
|
||||
fi
|
||||
|
||||
if test "x$have_pgm_library" = "xyes"; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user