[zeromq-dev] Autoconf/Automake for PGM
Neale Ferguson
neale at sinenomine.net
Mon Jan 10 18:52:25 CET 2011
For 0MQ and until the have autoconf stuff you're working on is complete and incorporated, I am building using the following changes to configure.in and src/Makefile.am to eliminate the hardcoding of many of the defines. I get a clean build and it passes the tests on s390x.
diff --git a/configure.in b/configure.in
index dbbf2d9..012b941 100644
--- a/configure.in
+++ b/configure.in
@@ -315,7 +315,7 @@ if test "x$with_pgm_ext" != "xno"; then
;;
esac
- # Gzip, Perl and Python are required duing PGM build
+ # 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.])
@@ -373,8 +373,53 @@ AC_SUBST(LIBZMQ_EXTRA_LDFLAGS)
# Checks for library functions.
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(perror gettimeofday memset socket getifaddrs freeifaddrs)
+AC_CHECK_FUNCS(perror gettimeofday memset socket getifaddrs freeifaddrs poll epoll_create pselect getopt vas
+AC_CHECK_HEADERS([alloca.h])
+PGM_DEFINES=""
+if test "x$with_pgm_ext" != "xno"; then
+ if test "x$ac_cv_func_gettimeofday" = "xyes"; then
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_GETTIMEOFDAY"
+ fi
+ if test "x$ac_cv_func_getprotobyname_r2" = "xyes"; then
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_GETPROTOBYNAME_R2"
+ fi
+ if test "x$ac_cv_func_poll" = "xyes"; then
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_POLL"
+ fi
+ if test "x$ac_cv_func_epoll_create" = "xyes"; then
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_EPOLL"
+ fi
+ if test "x$ac_cv_func_getifaddrs" = "xyes"; then
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_GETIFADDRS"
+ fi
+ if test "x$ac_cv_func_getopt" = "xyes"; then
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_GETOPT"
+ fi
+ if test "x$ac_cv_func_pselect" = "xyes"; then
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_PSELECT"
+ fi
+ if test "x$ac_cv_header_alloca_h" = "xyes"; then
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_ALLOCA_H"
+ fi
+ if test "x$ac_cv_c_compiler_gnu" = "xno"; then
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_ISO_VARARGS"
+ else
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_GNU_VARARGS"
+ fi
+ if test "x$ac_cv_func_vasprintf" = "xyes"; then
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_VASPRINTF"
+ fi
+ case "${host_cpu}" in
+ i*86|x86_64|amd64|*sparc*)
+ PGM_DEFINES="$PGM_DEFINES -DCONFIG_HAVE_TSC -DCONFIG_HAVE_RTC -DCONFIG_HAVE_HPET"
+ ;;
+ *sparc*|s390*)
+ ;;
+ esac
+fi
+
+AC_SUBST(PGM_DEFINES)
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile
perf/Makefile src/libzmq.pc \
devices/Makefile devices/zmq_forwarder/Makefile \
diff --git a/foreign/openpgm/libpgm-5.0.92~dfsg.tar.gz b/foreign/openpgm/libpgm-5.0.92~dfsg.tar.gz
index 8a539cb..61cf368 100644
Binary files a/foreign/openpgm/libpgm-5.0.92~dfsg.tar.gz and b/foreign/openpgm/libpgm-5.0.92~dfsg.tar.gz diff
diff --git a/src/Makefile.am b/src/Makefile.am
index 0b00f1c..3286bc4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -207,25 +207,13 @@ libpgm_diff_flags = \
else
libpgm_diff_flags = \
- -DCONFIG_HAVE_GETPROTOBYNAME_R2 \
- -DCONFIG_HAVE_ISO_VARARGS \
- -DCONFIG_HAVE_ALLOCA_H \
-DCONFIG_HAVE_PROC \
-DCONFIG_HAVE_BACKTRACE \
- -DCONFIG_HAVE_PSELECT \
- -DCONFIG_HAVE_RTC \
- -DCONFIG_HAVE_TSC \
- -DCONFIG_HAVE_HPET \
- -DCONFIG_HAVE_POLL \
- -DCONFIG_HAVE_EPOLL \
- -DCONFIG_HAVE_GETIFADDRS \
-DCONFIG_HAVE_IFR_NETMASK \
-DCONFIG_HAVE_MCAST_JOIN \
-DCONFIG_HAVE_IP_MREQN \
-DCONFIG_HAVE_SPRINTF_GROUPING \
- -DCONFIG_HAVE_VASPRINTF \
- -DCONFIG_BIND_INADDR_ANY \
- -DCONFIG_HAVE_GETOPT
+ -DCONFIG_BIND_INADDR_ANY
endif
libpgm_la_CFLAGS = -I$(top_srcdir)/foreign/openpgm/@pgm_basename@/openpgm/pgm/include/ @LIBZMQ_EXTRA_CFLAGS@
On 1/10/11 11:25 AM, "Steven McCoy" <steven.mccoy at miru.hk> wrote:
Well it builds a library now at least on Linux, needs work to match the current build configurations. Also missing eventfd checks.
...
checking for pthread_spinlock... no
Presumably needs to bring in pthread.h
checking for getprotobyname_r... yes
checking for 4- or 5-param getprotobyname_r... 5-param
checking for getnetent... yes
checking for C99 variadic macros... yes
checking for GNU-style variadic macros... yes
checking for alloca.h... yes
checking for /proc/cpuinfo... yes
checking for backtrace... yes
checking for pselect... yes
checking for /dev/rtc... no
Presumably due to file permissions
checking for RDTSC instruction... yes
checking for /dev/hpet... no
Presumably due to file permissions
checking for poll... yes
checking for epoll... no
Presumably needs to bring in epoll.h
checking for getifaddrs... yes
checking for struct ifreq.ifr_netmask... no
Presumably needs to bring in ifaddrs.h
checking for struct _WSAMSG.name... no
checking for struct group_req.fr_interface... no
Presumably needs to bring in netinet/in.h
checking for struct ip_mreqn.imr_ifindex... no
Presumably needs to bring in netinet/in.h
checking for printf thousands' grouping... yes
checking for vasprintf... yes
checking for hidden visibility attribute... yes
checking for raw IP sockets ip_{len,off} host byte ordering... no
--
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110110/bf0201a2/attachment.htm>
More information about the zeromq-dev
mailing list