File: configure.ac

package info (click to toggle)
xmltooling 1.6.0-4+deb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,928 kB
  • sloc: cpp: 22,289; sh: 11,065; makefile: 337; xml: 170; ansic: 49
file content (293 lines) | stat: -rw-r--r-- 12,217 bytes parent folder | download | duplicates (2)
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# Process this file with autoreconf
AC_PREREQ([2.50])
AC_INIT([xmltooling],[1.6.0],[https://issues.shibboleth.net/],[xmltooling])
AC_CONFIG_SRCDIR(xmltooling)
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_MACRO_DIR(m4)
AM_INIT_AUTOMAKE
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
PKG_INSTALLDIR

# Docygen features
DX_HTML_FEATURE(ON)
DX_DOT_FEATURE(ON)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(OFF)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN(xmltooling, doxygen.cfg, doc/api)

AC_ARG_ENABLE(debug,
    AS_HELP_STRING([--enable-debug],[Have GCC compile with symbols (Default = no)]),
    enable_debug=$enableval, enable_debug=no)

if test "$enable_debug" = "yes" ; then
    GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
    GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
else
    GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
    GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
fi

AC_CONFIG_HEADERS([config.h xmltooling/config_pub.h])
AC_CONFIG_FILES([xmltooling.pc xmltooling-lite.pc xmltooling.spec])
AC_CONFIG_FILES([Makefile xmltooling/Makefile xmltoolingtest/Makefile schemas/Makefile doc/Makefile])

AC_PROG_CC([gcc gcc3 cc])
AC_PROG_CXX([g++ g++3 c++ CC])
AC_CANONICAL_HOST

if test "$GCC" = "yes" ; then
#    AC_HAVE_GCC_VERSION(4,0,0,0,
#        [
#        AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
#            [Define to enable class visibility control in gcc.])
#        GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
#        GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
#        ])
    CFLAGS="-Wall $GCC_CFLAGS"
    CXXFLAGS="-Wall $GCC_CXXFLAGS"
fi

# Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
# Also enables POSIX semantics for some functions.
case "${host_cpu}-${host_os}" in
    *solaris*)
	CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"
	CXXFLAGS="$CXXFLAGS -D_POSIX_PTHREAD_SEMANTICS"
	if test "$CXX" = "CC" ; then
		CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
	fi
    ;;
esac

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T

# Checks for library functions.
AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r strcasecmp])
AC_CHECK_HEADERS([dlfcn.h])
AX_SAVE_FLAGS
LIBS=""
AC_SEARCH_LIBS([dlopen],[dl],,[AC_MSG_ERROR([cannot find dlopen() function])])
AC_SUBST([dlopen_LIBS],[$LIBS])
AX_RESTORE_FLAGS

# checks for pthreads
AX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
if test $enable_threads != "pthread"; then
    AC_MSG_ERROR([unable to find pthreads, currently this is required])
else
    AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])
    AX_SAVE_FLAGS
    LIBS="$PTHREAD_LIBS $LIBS"
    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
    AC_CHECK_FUNCS([pthread_rwlock_init])
    AX_RESTORE_FLAGS
fi

AM_CONDITIONAL(BUILD_PTHREAD,test "$enable_threads" = "pthread")

AC_LANG([C++])

# C++ requirements
AC_CXX_NAMESPACES
AC_CXX_REQUIRE_STL

# Boost
BOOST_REQUIRE
BOOST_BIND
BOOST_CONVERSION
BOOST_LAMBDA
BOOST_POINTER_CONTAINER
BOOST_SMART_PTR
BOOST_STRING_ALGO
BOOST_TOKENIZER

# are covariant methods allowed?
AC_LINK_IFELSE(
    [AC_LANG_PROGRAM([[]],
        [[
        class base { public: virtual base *GetPtr( void ) { return this; } };
        class derived: virtual public base { public: virtual derived *GetPtr( void ) { return this; } };
        ]])],
    [AC_DEFINE([HAVE_COVARIANT_RETURNS],[1],[Define to 1 if C++ compiler supports covariant virtual methods.])])

# is nullptr supported?
AC_COMPILE_IFELSE(
    [AC_LANG_PROGRAM([[#include <cstddef>]],[[const char* ptr = nullptr;]])],
    [AC_DEFINE([HAVE_NULLPTR],[1],[Define to 1 if C++ compiler supports nullptr keyword.])])

AX_PKG_CHECK_MODULES([log4shib],,[log4shib],
    [AC_DEFINE([XMLTOOLING_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
    [AX_PKG_CHECK_MODULES([log4cpp],,[log4cpp],
        [AC_DEFINE([XMLTOOLING_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],,
        [XMLTOOLING_LITE_REQUIRES],[XMLTOOLING_LITE_REQUIRES_PRIVATE])],,
    [XMLTOOLING_LITE_REQUIRES],[XMLTOOLING_LITE_REQUIRES_PRIVATE])

# Xerces-C v2.6.0 has bugs that inhibit use with signed XML
AX_PKG_CHECK_MODULES([xerces],,[xerces-c != 2.6.0],,,
    [XMLTOOLING_LITE_REQUIRES],[XMLTOOLING_LITE_REQUIRES_PRIVATE])
AX_SAVE_FLAGS
CPPFLAGS="$xerces_CFLAGS $CPPFLAGS"
LIBS="$xerces_LIBS $LIBS"

AC_MSG_CHECKING([whether Xerces is 64-bit clean])
AC_COMPILE_IFELSE(
    [AC_LANG_PROGRAM([[#include <xercesc/framework/MemBufInputSource.hpp>]],
        [[using namespace XERCES_CPP_NAMESPACE; XMLFilePos testvar;]])],
    [AC_MSG_RESULT([yes])AC_DEFINE([XMLTOOLING_XERCESC_64BITSAFE],[1],[Define to 1 if Xerces has a 64-bit-safe API.])],
    [AC_MSG_RESULT([no])])

AC_MSG_CHECKING([whether Xerces BinInputStream requires getContentType])
AC_COMPILE_IFELSE(
    [AC_LANG_PROGRAM([[#include <xercesc/util/BinMemInputStream.hpp>]],
        [[using namespace XERCES_CPP_NAMESPACE; XMLByte buf[1024]; BinMemInputStream in(buf,1024); in.getContentType();]])],
    [AC_MSG_RESULT([yes])AC_DEFINE([XMLTOOLING_XERCESC_INPUTSTREAM_HAS_CONTENTTYPE],[1],[Define to 1 if Xerces InputStream class requires getContentType.])],
    [AC_MSG_RESULT([no])])

AC_MSG_CHECKING([whether Xerces DOMLS API is compliant])
AC_COMPILE_IFELSE(
    [AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]],
        [[using namespace XERCES_CPP_NAMESPACE;
        DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(NULL);
        DOMLSSerializer *ls = ((DOMImplementationLS*)impl)->createLSSerializer();]])],
    [AC_MSG_RESULT([yes])AC_DEFINE([XMLTOOLING_XERCESC_COMPLIANT_DOMLS],[1],[Define to 1 if Xerces supports a compliant DOMLS API.])],
    [AC_MSG_RESULT([no])])

AC_MSG_CHECKING([whether Xerces has setIdAttribute(XMLCh*, bool)])
AC_COMPILE_IFELSE(
    [AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]],
        [[using namespace XERCES_CPP_NAMESPACE; DOMElement * elt; elt->setIdAttribute(NULL, false);]])],
    [AC_MSG_RESULT([yes])AC_DEFINE([XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE],[1],[Define to 1 if Xerces DOM ID methods take extra parameter.])],
    [AC_MSG_RESULT([no])])

AC_MSG_CHECKING([whether Xerces XMLString::release(XMLByte**) exists])
AC_COMPILE_IFELSE(
    [AC_LANG_PROGRAM([[#include <xercesc/util/XMLString.hpp>]],
    [[using namespace XERCES_CPP_NAMESPACE; XMLByte* buf=NULL; XMLString::release(&buf);]])],
    [AC_MSG_RESULT([yes])AC_DEFINE([XMLTOOLING_XERCESC_HAS_XMLBYTE_RELEASE],[1],[Define to 1 if Xerces XMLString includes XMLByte release.])],
    [AC_MSG_RESULT([no])])

AX_RESTORE_FLAGS

AC_ARG_WITH(xmlsec,
    AS_HELP_STRING([--with-xmlsec],
        [include signature/encryption support via Apache Santuario (XML Security) @<:@default=check@:>@]),,
    [with_xmlsec=check])

AS_IF([test "x$with_xmlsec" != xno],
    [AX_PKG_CHECK_MODULES([XMLSEC],,[xml-security-c >= 1.4 openssl libcurl],
        [AX_SAVE_FLAGS
         CPPFLAGS="$XMLSEC_CFLAGS $CPPFLAGS"
         LIBS="$XMLSEC_LIBS $LIBS"

    AC_CHECK_DECL(EVP_sha512,
        [AC_DEFINE([XMLTOOLING_OPENSSL_HAVE_SHA2],[1],[Define to 1 if OpenSSL supports the SHA-2 hash family.])],
		,[#include <openssl/evp.h>])
    AC_CHECK_DECL(EVP_PKEY_set1_EC_KEY,
        [AC_DEFINE([XMLTOOLING_OPENSSL_HAVE_EC],[1],[Define to 1 if OpenSSL has EC support.])],
        ,[#include <openssl/evp.h>])

    AC_CHECK_TYPE([xsecsize_t],[AC_DEFINE([HAVE_XSECSIZE_T],[1],[Define to 1 if you have the 'xsecsize_t' type.])])

    AC_MSG_CHECKING([whether XML-Security-C has multiple CRL support])
    AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[#include <xsec/dsig/DSIGKeyInfoX509.hpp>]],
            [[DSIGKeyInfoX509* klist; klist->getX509CRLListSize();]])],
        [AC_MSG_RESULT([yes])AC_DEFINE([XMLTOOLING_XMLSEC_MULTIPLECRL],[1],[Define to 1 if XML-Security-C handles multiple CRLs.])],
        [AC_MSG_RESULT([no])])

    AC_MSG_CHECKING([whether XML-Security-C exposes the signature algorithm URI])
    AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[#include <xsec/dsig/DSIGSignature.hpp>]],
            [[DSIGSignature* sig; sig->getAlgorithmURI();]])],
        [AC_MSG_RESULT([yes])AC_DEFINE([XMLTOOLING_XMLSEC_SIGALGORITHM],[1],[Define to 1 if XML-Security-C exposes the signature algorithm URI.])],
        [AC_MSG_RESULT([no])])

    AC_MSG_CHECKING([whether XML-Security-C includes ECC support])
    AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[#include <xsec/dsig/DSIGKeyInfoValue.hpp>]],
            [[DSIGKeyInfoValue* info; info->getECNamedCurve();]])],
        [AC_MSG_RESULT([yes])AC_DEFINE([XMLTOOLING_XMLSEC_ECC],[1],[Define to 1 if XML-Security-C includes ECC support.])],
        [AC_MSG_RESULT([no])])

    AC_MSG_CHECKING([whether XML-Security-C includes C14N 1.1 support])
    AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[#include <xsec/dsig/DSIGConstants.hpp>]],
            [[transformType t = TRANSFORM_C14N11;]])],
        [AC_MSG_RESULT([yes])AC_DEFINE([XMLTOOLING_XMLSEC_C14N11],[1],[Define to 1 if XML-Security-C includes C14N 1.1 support.])],
        [AC_MSG_RESULT([no])])

    AC_MSG_CHECKING([whether XML-Security-C includes debug logging support])
    AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[#include <xsec/utils/XSECPlatformUtils.hpp>]],
            [[XSECPlatformUtils::SetReferenceLoggingSink(NULL)]])],
        [AC_MSG_RESULT([yes])AC_DEFINE([XMLTOOLING_XMLSEC_DEBUGLOGGING],[1],[Define to 1 if XML-Security-C includes debug logging support.])],
        [AC_MSG_RESULT([no])])

    AC_MSG_CHECKING([for CURLOPT_SSL_CTX_FUNCTION in curl.h])
    AC_EGREP_HEADER([CURLOPT_SSL_CTX_FUNCTION], [curl/curl.h],
        [AC_MSG_RESULT([yes])],
        [AC_MSG_RESULT([no])
         AC_MSG_ERROR([need libcurl that supports CURLOPT_SSL_CTX_FUNCTION])])
    AC_CHECK_TYPE([curl_off_t],[AC_DEFINE([HAVE_CURL_OFF_T],[1],[Define to 1 if you have the 'curl_off_t' type.])],,[[#include <curl/curl.h>]])
    AC_MSG_CHECKING([for CURLINFO_TLS_SSL_PTR in curl.h])
    AC_EGREP_HEADER([CURLINFO_TLS_SSL_PTR], [curl/curl.h],
        [AC_MSG_RESULT([yes])
         AC_DEFINE([HAVE_CURLINFO_TLS_SSL_PTR],[1],[Define to 1 if you have support for the CURLINFO_TLS_SSL_PTR feature.])],
        [AC_MSG_RESULT([no])])

         AX_RESTORE_FLAGS
        ],
        [AS_IF([test "x$with_xmlsec" = xcheck],
             [AC_MSG_WARN([xmlsec disabled, building without signature/encryption support])
              AC_DEFINE([XMLTOOLING_NO_XMLSEC],[1],
                  [Define to 1 if you wish to disable XML-Security-dependent features.])],
             [AC_MSG_FAILURE([--with-xmlsec was given, but the package was not found])])
        ],[XMLTOOLING_REQUIRES],[XMLTOOLING_REQUIRES_PRIVATE])
    ])

AM_CONDITIONAL(BUILD_XMLSEC,test "x$XMLSEC_LIBS" != x)

# Does the STL in use help or screw us?
AC_LINK_IFELSE(
    [AC_LANG_PROGRAM([[#include <string>]],[[std::basic_string<unsigned short> foo; foo=foo+(unsigned short)65]])],
    [AC_DEFINE([HAVE_GOOD_STL],[1],[Define to 1 if you have an STL implementation that supports useful string specialization.])],[])
AC_LINK_IFELSE(
    [AC_LANG_PROGRAM([[#include <vector>]],[[std::iterator_traits<std::vector<int>::iterator>::value_type foo=0]])],
    [AC_DEFINE([HAVE_ITERATOR_TRAITS],[1],[Define to 1 if you have an STL implementation that supports std::iterator_traits.])],[])

# Check for unit test support
CXXTEST="/usr/bin/cxxtestgen"
CXXTESTFLAGS=""
AC_ARG_WITH(cxxtest,
    AS_HELP_STRING([--with-cxxtest=PATH], [where cxxtest is installed]),
    [if test x_$with_cxxtest != x_/usr; then
        CXXTEST="${with_cxxtest}/cxxtestgen.pl"
        CXXTESTFLAGS="-I${with_cxxtest}"
    fi])
if ! test -f "${CXXTEST}"; then
    AC_MSG_WARN([cxxtestgen not found, won't build unit tests])
fi

AC_SUBST(CXXTEST)
AC_SUBST(CXXTESTFLAGS)
AM_CONDITIONAL(BUILD_UNITTEST,test -f ${CXXTEST})

dnl Disabled on Debian since build log analysis wants verbose logs.
dnl LIBTOOL="$LIBTOOL --silent"

AC_ARG_WITH([pkgxmldir],
    AS_HELP_STRING([--with-pkgxmldir=DIR],
        [where to install the schema files @<:@default=${datadir}/xml/AC_PACKAGE_TARNAME@:>@])],
    [],[with_pkgxmldir=${datadir}/xml/AC_PACKAGE_TARNAME])
AC_SUBST([pkgxmldir],[${with_pkgxmldir}])

# output packaging and makefiles
AC_OUTPUT