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
271
272
273
274
275
276
277
|
dnl Process this file with autoconf to produce a configure script.
dnl
dnl This file is free software; as a special exception the author gives
dnl unlimited permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
AC_INIT([qpidc], [0.2], [qpid-dev@incubator.apache.org])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects])
# Minimum Autoconf version required.
AC_PREREQ(2.59)
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_SRCDIR([qpidc.spec.in])
AC_PROG_CC_STDC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_USE_SYSTEM_EXTENSIONS
AC_LANG([C++])
# AM_MISSING_PROG([HELP2MAN], [help2man])
AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
test -z "$HELP2MAN" && AC_MSG_ERROR([Missing help2man installation (try "yum install help2man").])
AC_ARG_ENABLE(warnings,
[ --enable-warnings turn on lots of compiler warnings (recommended)],
[case "${enableval}" in
yes|no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for warnings option]) ;;
esac],
[enableval=yes])
# Warnings: Enable as many as possible, keep the code clean. Please
# do not disable warnings or remove -Werror without discussing on
# qpid-dev list.
#
# The following warnings are deliberately omitted, they warn on valid code.
# -Wunreachable-code -Wpadded -Winline
# -Wshadow - warns about boost headers.
if test "${enableval}" = yes; then
gl_COMPILER_FLAGS(-Werror)
gl_COMPILER_FLAGS(-pedantic)
gl_COMPILER_FLAGS(-Wall)
gl_COMPILER_FLAGS(-Wextra)
gl_COMPILER_FLAGS(-Wno-shadow)
gl_COMPILER_FLAGS(-Wpointer-arith)
gl_COMPILER_FLAGS(-Wcast-qual)
gl_COMPILER_FLAGS(-Wcast-align)
gl_COMPILER_FLAGS(-Wno-long-long)
gl_COMPILER_FLAGS(-Wvolatile-register-var)
gl_COMPILER_FLAGS(-Winvalid-pch)
gl_COMPILER_FLAGS(-Wno-system-headers)
gl_COMPILER_FLAGS(-Woverloaded-virtual)
AC_SUBST([WARNING_CFLAGS], [$COMPILER_FLAGS])
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
COMPILER_FLAGS=
fi
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_SUBST([LIBTOOL_DEPS])
# For libraries (libcommon) that use dlopen, dlerror, etc.,
# test whether we need to link with -ldl.
gl_saved_libs=$LIBS
AC_SEARCH_LIBS(dlopen, [dl],
[test "$ac_cv_search_dlopen" = "none required" ||
LIB_DLOPEN=$ac_cv_search_dlopen])
AC_SUBST([LIB_DLOPEN])
LIBS=$gl_saved_libs
# Set the argument to be used in "libtool -version-info ARG".
QPID_CURRENT=1
QPID_REVISION=0
QPID_AGE=1
LIBTOOL_VERSION_INFO_ARG=$QPID_CURRENT:$QPID_REVISION:$QPID_AGE
AC_SUBST(LIBTOOL_VERSION_INFO_ARG)
gl_CLOCK_TIME
# Check for cppunit support.
CPPUNIT_MINIMUM_VERSION=1.10.2
AM_PATH_CPPUNIT([$CPPUNIT_MINIMUM_VERSION], , [CPPUNIT_LIBS=-lcppunit])
CPPUNIT_CXXFLAGS=$CPPUNIT_CFLAGS
AC_SUBST(CPPUNIT_LIBS)
AC_SUBST(CPPUNIT_CXXFLAGS)
# Enable Valgrind
AC_ARG_ENABLE([valgrind],
[AS_HELP_STRING([--enable-valgrind],
[run valgrind memory checker on tests, if available (default yes)])],
[case $enableval in
yes|no) enable_VALGRIND=$enableval;;
*) AC_MSG_ERROR([Invalid value for --enable-valgrind: $enableval]);;
esac],
[enable_VALGRIND=yes]
)
# We use valgrind for the tests. See if it's available.
# Check for it unconditionally, so we don't have to duplicate its
# use of AC_SUBST([VALGRIND]).
AC_CHECK_PROG([VALGRIND], [valgrind], [valgrind])
test "$enable_VALGRIND" = no && VALGRIND=
# If rpmlint is available we'll run it when building RPMs.
AC_CHECK_PROG([RPMLINT], [rpmlint], [rpmlint])
AM_CONDITIONAL([HAS_RPMLINT], [test -n "$RPMLINT"])
# Code generation: generated code is included in the distribution
# so code generation is only required in an svn checkout.
# It requires several external tools and files, which we check for here.
AC_CHECK_PROG([RUBY], [ruby], [ruby])
test -n "$RUBY" && generate=yes
test -z "$RUBY" && AC_MSG_ERROR([Missing ruby installation (try "yum install ruby").])
specdir=`pwd`/$srcdir/../specs
AMQP_FINAL_XML=$specdir/amqp.0-10-qpid-errata.xml
AC_SUBST(AMQP_FINAL_XML)
AM_CONDITIONAL([GENERATE], [ls $AMQP_FINAL_XML >/dev/null])
# URL and download URL for the package.
URL=http://rhm.et.redhat.com/qpidc
AC_SUBST(URL)
DOWNLOAD_URL=http://rhm.et.redhat.com/download
AC_SUBST(DOWNLOAD_URL)
# Check for headers from required devel kits.
AC_CHECK_HEADERS([boost/shared_ptr.hpp uuid/uuid.h],,
AC_MSG_ERROR([Missing required header files.]))
# Check for optional CPG requirement.
LDFLAGS="$LDFLAGS -L/usr/lib/openais -L/usr/lib64/openais"
AC_ARG_WITH([cpg],
[AS_HELP_STRING([--with-cpg], [Build with CPG support])],
[case "${withval}" in
yes) # yes - enable
with_CPG=yes
AC_CHECK_LIB([cpg],[cpg_initialize],,[AC_MSG_ERROR([libcpg not found, install openais])])
AC_CHECK_HEADERS([openais/cpg.h],,[AC_MSG_ERROR([openais/cpg.h not found, install openais-devel])])
;;
no) # no -disable
with_CPG=no
;;
*) AC_MSG_ERROR([Bad value ${withval} for --with-cpg option]) ;;
esac],
[ # not specified - GS 24-APR-2008 temporarily disabled - (enable if libs/headers available).
with_CPG=no
AC_CHECK_HEADERS([openais/cpg.h],,[with_CPG=no])
AC_CHECK_LIB([cpg],[cpg_initialize],,[with_CPG=no])
]
)
AM_CONDITIONAL([CPG], [test x$with_CPG = xyes])
if test x$with_CPG = xyes; then
CPPFLAGS+=" -DCPG"
fi
# Setup --with-sasl/--without-sasl as arguments to configure
AC_ARG_WITH([sasl],
[AS_HELP_STRING([--with-sasl], [Build with SASL authentication support])],
[WANT_SASL="$withval"],
[WANT_SASL=check])
# Make sure --with-sasl/--without-sasl were only give yes|no|check
AS_IF([test "x$WANT_SASL" != xyes -a \
"x$WANT_SASL" != xno -a \
"x$WANT_SASL" != xcheck],
[AC_MSG_ERROR([Bad value for --with-sasl: $withval])])
# If we weren't explicitly asked /not/ to test, i.e. not given --without-sasl
have_sasl=no
AS_IF([test "x$WANT_SASL" != xno],
# Perform tests for headers and libraries. Remember, AC_CHECK_LIB
# will give you some useful default behavior, e.g. setup LDFLAGS, if
# you do not give it a second argument, so try not to
[AC_CHECK_HEADER([sasl/sasl.h], , [HAVE_SASL_H=no])
AC_CHECK_LIB([sasl2], [sasl_checkpass], , [HAVE_SASL_LIB=no])
# If any of the tests failed
AS_IF([test "x$HAVE_SASL_H" = xno -o \
"x$HAVE_SASL_LIB" = xno],
# And we were given --with, then fail
[AS_IF([test "x$WANT_SASL" = xyes],
[AC_MSG_ERROR([sasl requested but not available])])],
# Otherwise, no tests failed, setup AC_SUBST/AC_DEFINE/vars for AM_CONDITIONALs
[AC_DEFINE([BROKER_SASL_NAME], ["qpidd"],
[The SASL app name for the qpid Broker])
AC_DEFINE([HAVE_SASL], [1], [Enable if libsasl is present])
have_sasl=yes])])
AM_CONDITIONAL([HAVE_SASL], [test "x$have_sasl" = xyes])
# Setup --with-xml/--without-xml as arguments to configure
use_xml=yes
want_xml=check
AC_ARG_WITH([xml],
[AS_HELP_STRING([--with-xml], [Build with XML Exchange])],
[want_xml=$withval])
case $want_xml in
yes|no|check) ;;
*) AC_MSG_ERROR([Bad value for --with-xml: $withval]) ;;
esac
test $want_xml = no && use_xml=no
# If the user doesn't say not to use XML, see if it's available.
if test $use_xml != no; then
# Then see if XQilla is available
AC_CHECK_LIB([xerces-c], [_init], , [use_xml=no])
AC_CHECK_HEADER([xercesc/framework/MemBufInputSource.hpp], , [use_xml=no])
AC_CHECK_HEADER([xqilla/xqilla-simple.hpp], , [use_xml=no])
AC_CHECK_LIB([xqilla], [canonicalCombiningClassTable], , [use_xml=no])
# If XQilla is not available, yet specifically requested, die.
test $use_xml:$want_xml = no:yes &&
AC_MSG_ERROR([XML Exchange requested, but XQilla or Xerces-C not available])
# Else XQilla is available - use it to build
test $use_xml = yes &&
AC_DEFINE([HAVE_XML], [1], [Compile-in XML Exchange support.])
fi
AM_CONDITIONAL([HAVE_XML], [test $use_xml = yes])
# Setup --with-rdma/--without-rdma as arguments to configure
AC_ARG_WITH([rdma],
[AS_HELP_STRING([--with-rdma], [Build with support for Remote DMA protocols])],
[case ${withval} in
yes)
with_RDMA=yes
AC_CHECK_LIB([ibverbs],[ibv_create_qp],,[AC_MSG_ERROR([libibverbs not found])])
AC_CHECK_LIB([rdmacm],[rdma_create_id],,[AC_MSG_ERROR([librdmacm not found])])
AC_CHECK_HEADERS([infiniband/verbs.h],,[AC_MSG_ERROR([ibverbs header files not found])])
AC_CHECK_HEADERS([rdma/rdma_cma.h],,[AC_MSG_ERROR([rdma_cm header files not found])])
;;
no)
with_RDMA=no
;;
*)
AC_MSG_ERROR([Bad value for --with-rdma: ${withval}])
;;
esac],
[
with_RDMA=no
AC_CHECK_LIB([ibverbs],[ibv_create_qp],,[with_RDMA=no])
AC_CHECK_LIB([rdmacm],[rdma_create_id],,[with_RDMA=no])
AC_CHECK_HEADERS([infiniband/verbs.h],,[with_RDMA=no])
AC_CHECK_HEADERS([rdma/rdma_cma.h],,[with_RDMA=no])
]
)
AM_CONDITIONAL([RDMA], [test x$with_RDMA = xyes])
# Files to generate
AC_CONFIG_FILES([
qpidc.spec
Makefile
examples/Makefile
managementgen/Makefile
etc/Makefile
src/Makefile
src/tests/Makefile
docs/man/Makefile
docs/api/Makefile
docs/api/user.doxygen
docs/api/developer.doxygen
])
AC_OUTPUT
|