-
Notifications
You must be signed in to change notification settings - Fork 52
/
configure.ac
270 lines (233 loc) · 8.85 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
################################################################################
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
#
# The version number is extracted from include/majordomo.h using
# the version.sh script. Hence, it should be updated there.
# The version in git should reflect the *next* version planned.
#
AC_INIT([majordomo],[m4_esyscmd([./version.sh majordomo])],[zeromq-dev@lists.zeromq.org])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AC_CONFIG_HEADERS([src/platform.h])
AM_INIT_AUTOMAKE([subdir-objects tar-ustar foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# This defines PACKAGE_VERSION_... in src/platform.h
PV_MAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1`
PV_MINOR=`echo $PACKAGE_VERSION | cut -d . -f 2`
PV_PATCH=`echo $PACKAGE_VERSION | cut -d . -f 3`
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],[$PV_MAJOR],
[MAJORDOMO major version])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],[$PV_MINOR],
[MAJORDOMO minor version])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCH],[$PV_PATCH],
[MAJORDOMO patchlevel])
# This lets us use PACKAGE_VERSION in Makefiles
AC_SUBST(PACKAGE_VERSION)
#
# Libtool -version-info (ABI version)
#
# Currently 2.0.1 ("stable"). Don't change this unless you
# know exactly what you're doing and have read and understand
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
#
# libmajordomo -version-info
LTVER="0:1:0"
AC_SUBST(LTVER)
# Capture c flags
MAJORDOMO_ORIG_CFLAGS="${CFLAGS:-none}"
# Checks for programs
AC_PROG_CC
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_PROG_SED
AC_PROG_AWK
PKG_PROG_PKG_CONFIG
# Code coverage
AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
[With GCC Code Coverage reporting.])],
[MAJORDOMO_GCOV="$withval"])
if test "x${MAJORDOMO_GCOV}" == "xyes"; then
CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
if test "x${MAJORDOMO_ORIG_CFLAGS}" != "xnone"; then
CFLAGS="${CFLAGS} ${MAJORDOMO_ORIG_CFLAGS}"
fi
fi
PREVIOUS_CFLAGS="${CFLAGS}"
PREVIOUS_LIBS="${LIBS}"
was_zmq_check_lib_detected=no
PKG_CHECK_MODULES([zmq], [libzmq >= 2.2.0],,
[AC_MSG_ERROR([Cannot find required package for libzmq. Note, pkg-config is required due to specified version >= 2.2.0])
])
if test "x$was_zmq_check_lib_detected" = "xno"; then
CFLAGS="${zmq_CFLAGS} ${CFLAGS}"
LIBS="${zmq_LIBS} ${LIBS}"
fi
was_czmq_check_lib_detected=no
PKG_CHECK_MODULES([czmq], [libczmq >= 3.0.0],,
[AC_MSG_ERROR([Cannot find required package for libczmq. Note, pkg-config is required due to specified version >= 3.0.0])
])
if test "x$was_czmq_check_lib_detected" = "xno"; then
CFLAGS="${czmq_CFLAGS} ${CFLAGS}"
LIBS="${czmq_LIBS} ${LIBS}"
fi
CFLAGS="${PREVIOUS_CFLAGS}"
LIBS="${PREVIOUS_LIBS}"
# Platform specific checks
majordomo_on_mingw32="no"
majordomo_on_cygwin="no"
majordomo_on_android="no"
# Host specific checks
AC_CANONICAL_HOST
# Determine whether or not documentation should be built and installed.
majordomo_build_doc="yes"
majordomo_install_man="yes"
# Check for asciidoc and xmlto and don't build the docs if these are not installed.
AC_CHECK_PROG(majordomo_have_asciidoc, asciidoc, yes, no)
AC_CHECK_PROG(majordomo_have_xmlto, xmlto, yes, no)
if test "x$majordomo_have_asciidoc" = "xno" -o "x$majordomo_have_xmlto" = "xno"; then
majordomo_build_doc="no"
# Tarballs built with 'make dist' ship with prebuilt documentation.
if ! test -f doc/majordomo.7; then
majordomo_install_man="no"
AC_MSG_WARN([You are building an unreleased version of MAJORDOMO and asciidoc or xmlto are not installed.])
AC_MSG_WARN([Documentation will not be built and manual pages will not be installed.])
fi
fi
AC_MSG_CHECKING([whether to build documentation])
AC_MSG_RESULT([$majordomo_build_doc])
AC_MSG_CHECKING([whether to install manpages])
AC_MSG_RESULT([$majordomo_install_man])
# Set some default features required by libmajordomo code.
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
# OS-specific tests
case "${host_os}" in
*linux*)
# Define on Linux to enable all library features
CPPFLAGS="-D_GNU_SOURCE -DLINUX $CPPFLAGS"
AC_DEFINE(MAJORDOMO_HAVE_LINUX, 1, [Have Linux OS])
case "${host_os}" in
*android*)
AC_DEFINE(MAJORDOMO_HAVE_ANDROID, 1, [Have Android OS])
majordomo_on_android="yes"
;;
esac
;;
*solaris*)
# Define on Solaris to enable all library features
CPPFLAGS="-D_PTHREADS $CPPFLAGS"
AC_DEFINE(MAJORDOMO_HAVE_SOLARIS, 1, [Have Solaris OS])
CFLAGS="${CFLAGS} -lsocket -lssp"
;;
*freebsd*)
# Define on FreeBSD to enable all library features
CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS"
AC_DEFINE(MAJORDOMO_HAVE_FREEBSD, 1, [Have FreeBSD OS])
;;
*darwin*)
# Define on Darwin to enable all library features
CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS"
AC_DEFINE(MAJORDOMO_HAVE_OSX, 1, [Have DarwinOSX OS])
;;
*netbsd*)
# Define on NetBSD to enable all library features
CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS"
AC_DEFINE(MAJORDOMO_HAVE_NETBSD, 1, [Have NetBSD OS])
;;
*openbsd*)
# Define on OpenBSD to enable all library features
CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
AC_DEFINE(MAJORDOMO_HAVE_OPENBSD, 1, [Have OpenBSD OS])
;;
*nto-qnx*)
AC_DEFINE(MAJORDOMO_HAVE_QNXNTO, 1, [Have QNX Neutrino OS])
;;
*aix*)
AC_DEFINE(MAJORDOMO_HAVE_AIX, 1, [Have AIX OS])
;;
*hpux*)
# Define on HP-UX to enable all library features
CPPFLAGS="-D_POSIX_C_SOURCE=200112L"
AC_DEFINE(MAJORDOMO_HAVE_HPUX, 1, [Have HPUX OS])
;;
*mingw32*)
AC_DEFINE(MAJORDOMO_HAVE_WINDOWS, 1, [Have Windows OS])
AC_DEFINE(MAJORDOMO_HAVE_MINGW32, 1, [Have MinGW32])
AC_CHECK_HEADERS(windows.h)
majordomo_on_mingw32="yes"
majordomo_install_man="no"
;;
*cygwin*)
# Define on Cygwin to enable all library features
CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
AC_DEFINE(MAJORDOMO_HAVE_CYGWIN, 1, [Have Cygwin])
majordomo_on_cygwin="yes"
;;
*)
AC_MSG_ERROR([unsupported system: ${host_os}.])
;;
esac
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(errno.h arpa/inet.h netinet/tcp.h netinet/in.h stddef.h \
stdlib.h string.h sys/socket.h sys/time.h unistd.h \
limits.h ifaddrs.h)
AC_CHECK_HEADERS([net/if.h net/if_media.h linux/wireless.h], [], [],
[
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#include <stdint.h>
])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_HEADER_TIME
AC_TYPE_UINT32_T
AC_C_VOLATILE
AC_C_BIGENDIAN
# These options are GNU compiler specific.
if test "x$GCC" = "xyes"; then
CPPFLAGS="-pedantic -Werror -Wno-format-truncation -Wall -Wc++-compat ${CPPFLAGS}"
fi
AM_CONDITIONAL(ENABLE_SHARED, test "x$enable_shared" = "xyes")
AM_CONDITIONAL(ON_MINGW, test "x$majordomo_on_mingw32" = "xyes")
AM_CONDITIONAL(ON_CYGWIN, test "x$majordomo_on_cygwin" = "xyes")
AM_CONDITIONAL(ON_ANDROID, test "x$majordomo_on_android" = "xyes")
AM_CONDITIONAL(INSTALL_MAN, test "x$majordomo_install_man" = "xyes")
AM_CONDITIONAL(BUILD_DOC, test "x$majordomo_build_doc" = "xyes")
# Check for mdp_test intent
AC_ARG_WITH([mdp_test],
AS_HELP_STRING([--with-mdp_test],
[Compile and install the mdp_test program [default=yes].]),
[with_mdp_test=$withval],
[with_mdp_test=yes])
AM_CONDITIONAL([WITH_MDP_TEST], [test x$with_mdp_test != xno])
AM_COND_IF([WITH_MDP_TEST], [AC_MSG_NOTICE([WITH_MDP_TEST defined])])
# Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(perror gettimeofday memset getifaddrs)
# Set pkgconfigdir
AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
[Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
[pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST([pkgconfigdir])
# Specify output files
AC_CONFIG_FILES([Makefile
doc/Makefile
src/libmajordomo.pc
])
AC_OUTPUT
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
################################################################################