Commit 0ded6c19 authored by Martin Lucina's avatar Martin Lucina

Multiple fixes to --with-pgm

Disallow build --with-pgm on non-x86/AMB64 CPUs
Check correctly for all dependencies required by --with-pgm
Don't assume tar has -j
Reorder --with-pgm checks
parent 94c74d5c
...@@ -445,39 +445,60 @@ if test "x$with_pgm2_ext" != "xno"; then ...@@ -445,39 +445,60 @@ if test "x$with_pgm2_ext" != "xno"; then
pgm_basename=${pgm2_basename} pgm_basename=${pgm2_basename}
# Test if we have pkg-config AC_MSG_CHECKING([if the PGM extension is supported on this platform])
if test "x$have_pkg_config" != "xyes"; then # OpenPGM is only supported by the vendor on x86 and AMD64 platforms...
AC_MSG_ERROR([To run configure with --with-pgm2 option, pkg-config has to be installed.]); case "${host_cpu}" in
fi i*86|x86_64)
# Supported
case "${host_os}" in ;;
*linux*) *)
LIBZMQ_EXTRA_CXXFLAGS="${LIBZMQ_EXTRA_CXXFLAGS} -Wno-variadic-macros -Wno-long-long " AC_MSG_ERROR([the PGM extension is not supported on the ${host_cpu} platform.])
;; ;;
*mingw32*) esac
# ... and on Linux/Windows/Solaris systems.
case "${host_os}" in
*linux*|*mingw32*|*solaris*)
LIBZMQ_EXTRA_CXXFLAGS="${LIBZMQ_EXTRA_CXXFLAGS} -Wno-variadic-macros -Wno-long-long " LIBZMQ_EXTRA_CXXFLAGS="${LIBZMQ_EXTRA_CXXFLAGS} -Wno-variadic-macros -Wno-long-long "
;; ;;
*) *)
AC_MSG_ERROR([PGM extesion is not supported on this platform $host.]) AC_MSG_ERROR([the PGM extension is not supported on system ${host_os}.])
;; ;;
esac esac
AC_MSG_RESULT([yes])
# Unpack libpgm2 # Test if we have pkg-config
AC_MSG_CHECKING([Unpacking ${pgm_basename}.tar.bz2]) if test "x$have_pkg_config" != "xyes"; then
AC_MSG_ERROR([the --with-pgm option requires that pkg-config be installed.]);
if tar -xjf foreign/openpgm/${pgm_basename}.tar.bz2 -C foreign/openpgm/; then fi
AC_MSG_RESULT([yes])
else # Check for OpenPGM dependencies
AC_MSG_ERROR([Could not unpack foreign/openpgm/${pgm_basename}.tar.bz2 file.]) PKG_CHECK_MODULES([GLIB], [glib-2.0 gthread-2.0])
LIBZMQ_EXTRA_CXXFLAGS="${LIBZMQ_EXTRA_CXXFLAGS} ${GLIB_CFLAGS} "
LIBZMQ_EXTRA_LDFLAGS="${LIBZMQ_EXTRA_LDFLAGS} ${GLIB_LIBS} "
# Bunzip2, Perl and Python are required duing PGM build
AC_CHECK_PROG(have_bunzip2, bunzip2, yes, no)
if test "x$have_bunzip2" != "xyes"; then
AC_MSG_ERROR([bunzip2 is required for building the PGM extension.])
fi
AC_CHECK_PROG(have_perl, perl, yes, no)
if test "x$have_perl" != "xyes"; then
AC_MSG_ERROR([perl is required for building the PGM extension.])
fi fi
if test "x$pyzmq" != "xyes"; then if test "x$pyzmq" != "xyes"; then
AC_CHECK_PROG(have_python, python, yes, no) AC_CHECK_PROG(have_python, python, yes, no)
if test "x$have_python" != "xyes"; then if test "x$have_python" != "xyes"; then
AC_MSG_ERROR([Could not find python.]) AC_MSG_ERROR([python is required for building the PGM extension.])
fi fi
fi fi
# Unpack libpgm2
AC_MSG_NOTICE([Unpacking ${pgm_basename}.tar.bz2])
if ! bunzip2 -c foreign/openpgm/${pgm_basename}.tar.bz2 | tar -xf - -C foreign/openpgm/; then
AC_MSG_ERROR([could not unpack the foreign/openpgm/${pgm_basename}.tar.bz2 file.])
fi
# Generate galois_tables.c # Generate galois_tables.c
AC_CONFIG_COMMANDS([galois_tables2.c], AC_CONFIG_COMMANDS([galois_tables2.c],
[perl foreign/openpgm/libpgm-2.0.23rc8/openpgm/pgm/galois_generator.pl > \ [perl foreign/openpgm/libpgm-2.0.23rc8/openpgm/pgm/galois_generator.pl > \
...@@ -488,15 +509,8 @@ if test "x$with_pgm2_ext" != "xno"; then ...@@ -488,15 +509,8 @@ if test "x$with_pgm2_ext" != "xno"; then
[python foreign/openpgm/libpgm-2.0.23rc8/openpgm/pgm/version_generator.py > \ [python foreign/openpgm/libpgm-2.0.23rc8/openpgm/pgm/version_generator.py > \
foreign/openpgm/libpgm-2.0.23rc8/openpgm/pgm/version.c]) foreign/openpgm/libpgm-2.0.23rc8/openpgm/pgm/version.c])
# Check for OpenPGM nedded libraries. # Success!
PKG_CHECK_MODULES([GLIB], [glib-2.0 gthread-2.0]) AC_DEFINE(ZMQ_HAVE_OPENPGM, 1, [Have OpenPGM extension])
LIBZMQ_EXTRA_CXXFLAGS="${LIBZMQ_EXTRA_CXXFLAGS} ${GLIB_CFLAGS} "
LIBZMQ_EXTRA_LDFLAFS="${LIBZMQ_EXTRA_LDFLAFS} ${GLIB_LIBS}"
AC_DEFINE(ZMQ_HAVE_OPENPGM, 1, [Have OpenPGM v1 or v2 extension.])
AC_DEFINE(ZMQ_HAVE_OPENPGM2, 1, [Have OpenPGM v2 extension.])
pgm2_ext="yes" pgm2_ext="yes"
else else
# Fallback for make dist. # Fallback for make dist.
......
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