"Fossies" - the Fresh Open Source Software Archive 
Member "jq-1.6/configure.ac" (2 Nov 2018, 9307 Bytes) of package /linux/misc/jq-1.6.tar.gz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
See also the latest
Fossies "Diffs" side-by-side code changes report for "configure.ac":
1.5_vs_1.6.
1 m4_define([jq_version], [1.6])
2
3 AC_INIT([jq], [jq_version], [https://github.com/stedolan/jq/issues],
4 [jq], [https://stedolan.github.io/jq])
5
6 m4_include([m4/ax_compare_version.m4])
7 m4_include([m4/ax_prog_bison_version.m4])
8
9 dnl Created autoconf implementation thompson@dtosolutions, 26NOV12
10 AC_PREREQ([2.64])
11 AC_CONFIG_AUX_DIR([config])
12 AM_INIT_AUTOMAKE([1.11.2 subdir-objects parallel-tests foreign -Wall])
13 AM_SILENT_RULES([yes])
14 AM_PROG_AR
15 AM_MAINTAINER_MODE([enable])
16 AC_PROG_CC
17 AC_PROG_CC_STDC
18 AC_PROG_CPP_WERROR
19 AC_PROG_YACC
20 AC_OBJEXT
21 AC_EXEEXT
22 LT_INIT([shared static win32-dll])
23 AM_PROG_CC_C_O
24
25
26 dnl couldn't use AM_PROG_LEX as it doesn't support header files like the
27 dnl AC_PROG_YACC macros...
28
29 dnl check bison version
30
31 if test "$USE_MAINTAINER_MODE" = yes; then
32 if test "$YACC" != "bison -y"; then
33 AC_MSG_CHECKING([bison version])
34 AC_MSG_RESULT([not bison])
35 else
36 AX_PROG_BISON_VERSION([3],
37 [],
38 [AC_MSG_ERROR([You need bison version 3.0 or greater, or use --disable-maintainer-mode.])])
39 fi
40
41 AC_CHECK_PROGS(LEX, flex lex)
42 fi
43
44 dnl Check for valgrind
45 AC_CHECK_PROGS(valgrind_cmd, valgrind)
46 if test "x$valgrind_cmd" = "x" ; then
47 AC_MSG_WARN([valgrind is required to test jq.])
48 fi
49 AC_CHECK_FUNCS(memmem)
50 AC_CHECK_FUNCS(mkstemp)
51
52 AC_CHECK_HEADER("shlwapi.h",[have_win32=1;])
53 AM_CONDITIONAL([WIN32], [test "x$have_win32" = x1])
54
55 dnl Running tests with Valgrind is slow. It is faster to iterate on
56 dnl code without Valgrind until tests pass, then enable Valgrind and
57 dnl fix leaks.
58 AC_ARG_ENABLE([valgrind],
59 AC_HELP_STRING([--disable-valgrind], [do not run tests under Valgrind]))
60
61 dnl Running tests with Valgrind is slow; address sanitizer (ASAN) is
62 dnl faster.
63 AC_ARG_ENABLE([asan],
64 AC_HELP_STRING([--enable-asan], [enable address sanitizer]))
65
66 dnl Undefined Behavior Sanitizer
67 AC_ARG_ENABLE([ubsan],
68 AC_HELP_STRING([--enable-ubsan], [enable undefined behavior sanitizer]))
69
70 dnl Code coverage
71 AC_ARG_ENABLE([gcov],
72 AC_HELP_STRING([--enable-gcov], [enable gcov code coverage tool]))
73
74 dnl Don't attempt to build docs if there's no Ruby lying around
75 AC_ARG_ENABLE([docs],
76 AC_HELP_STRING([--disable-docs], [don't build docs]))
77
78 dnl Don't attempt to build the error injection object (if there is no LD_PRELOAD support)
79 AC_ARG_ENABLE([error-injection],
80 AC_HELP_STRING([--enable-error-injection], [build and test with error injection]))
81
82 dnl Enable building all static
83 AC_ARG_ENABLE([all-static],
84 AC_HELP_STRING([--enable-all-static], [link jq with static libraries only]))
85
86 AS_IF([test "x$enable_docs" != "xno"],[
87 AC_CHECK_PROGS(bundle_cmd, bundle)
88
89 AC_CACHE_CHECK([for Ruby dependencies], [jq_cv_ruby_deps],
90 [jq_cv_ruby_deps=yes;
91 AS_IF([test "x$bundle_cmd" = "x" || \
92 ! bmsg="`cd ${srcdir}/docs; "$bundle_cmd" check 2>/dev/null`"],[
93 AC_MSG_WARN([$bmsg])
94 cat <<EOF
95 *****************************************************************
96 * Ruby dependencies for building jq documentation not found. *
97 * You can still build, install and hack on jq, but the manpage *
98 * will not be rebuilt and some of the tests will not run. *
99 * See docs/README.md for how to install the docs dependencies. *
100 *****************************************************************
101 EOF
102 jq_cv_ruby_deps=no
103 ])])
104
105 if test "x$jq_cv_ruby_deps" != "xyes"; then
106 enable_docs=no
107 fi
108 ])
109
110 AM_CONDITIONAL([ENABLE_VALGRIND], [test "x$enable_valgrind" != xno])
111 AM_CONDITIONAL([ENABLE_ASAN], [test "x$enable_asan" = xyes])
112 AM_CONDITIONAL([ENABLE_UBSAN], [test "x$enable_ubsan" = xyes])
113 AM_CONDITIONAL([ENABLE_GCOV], [test "x$enable_gcov" = xyes])
114 AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" != xno])
115 AM_CONDITIONAL([ENABLE_ERROR_INJECTION], [test "x$enable_error_injection" = xyes])
116 AM_CONDITIONAL([ENABLE_ALL_STATIC], [test "x$enable_all_static" = xyes])
117
118 AC_FUNC_ALLOCA
119
120 AC_FIND_FUNC([isatty], [c], [#include <unistd.h>], [0])
121 AC_FIND_FUNC([_isatty], [c], [#include <io.h>], [0])
122 AC_FIND_FUNC([strptime], [c], [#include <time.h>], [0, 0, 0])
123 AC_FIND_FUNC([strftime], [c], [#include <time.h>], [0, 0, 0, 0])
124 AC_FIND_FUNC([timegm], [c], [#include <time.h>], [0])
125 AC_FIND_FUNC([gmtime_r], [c], [#include <time.h>], [0, 0])
126 AC_FIND_FUNC([gmtime], [c], [#include <time.h>], [0])
127 AC_FIND_FUNC([localtime_r], [c], [#include <time.h>], [0, 0])
128 AC_FIND_FUNC([localtime], [c], [#include <time.h>], [0])
129 AC_FIND_FUNC([gettimeofday], [c], [#include <time.h>], [0, 0])
130 AC_CHECK_MEMBER([struct tm.tm_gmtoff], [AC_DEFINE([HAVE_TM_TM_GMT_OFF],1,[Define to 1 if the system has the tm_gmt_off field in struct tm])],
131 [], [[#include <time.h>]])
132 AC_CHECK_MEMBER([struct tm.__tm_gmtoff], [AC_DEFINE([HAVE_TM___TM_GMT_OFF],1,[Define to 1 if the system has the __tm_gmt_off field in struct tm])],
133 [], [[#include <time.h>]])
134
135 AC_ARG_ENABLE([pthread-tls],
136 [AC_HELP_STRING([--enable-pthread-tls],
137 [Enable use of pthread thread local storage])],
138 [],
139 [enable_pthread_tls=no])
140
141 if test $enable_pthread_tls = yes; then
142 AC_FIND_FUNC([pthread_key_create], [pthread], [#include <pthread.h>], [NULL, NULL])
143 AC_FIND_FUNC([pthread_once], [pthread], [#include <pthread.h>], [NULL, NULL])
144 AC_FIND_FUNC([atexit], [pthread], [#include <stdlib.h>], [NULL])
145 fi
146
147 dnl libm math.h functions
148 AC_CHECK_MATH_FUNC(acos)
149 AC_CHECK_MATH_FUNC(acosh)
150 AC_CHECK_MATH_FUNC(asin)
151 AC_CHECK_MATH_FUNC(asinh)
152 AC_CHECK_MATH_FUNC(atan2)
153 AC_CHECK_MATH_FUNC(atan)
154 AC_CHECK_MATH_FUNC(atanh)
155 AC_CHECK_MATH_FUNC(cbrt)
156 AC_CHECK_MATH_FUNC(ceil)
157 AC_CHECK_MATH_FUNC(copysign)
158 AC_CHECK_MATH_FUNC(cos)
159 AC_CHECK_MATH_FUNC(cosh)
160 AC_CHECK_MATH_FUNC(drem)
161 AC_CHECK_MATH_FUNC(erf)
162 AC_CHECK_MATH_FUNC(erfc)
163 AC_CHECK_MATH_FUNC(exp10)
164 AC_CHECK_MATH_FUNC(exp2)
165 AC_CHECK_MATH_FUNC(exp)
166 AC_CHECK_MATH_FUNC(expm1)
167 AC_CHECK_MATH_FUNC(fabs)
168 AC_CHECK_MATH_FUNC(fdim)
169 AC_CHECK_MATH_FUNC(floor)
170 AC_CHECK_MATH_FUNC(fma)
171 AC_CHECK_MATH_FUNC(fmax)
172 AC_CHECK_MATH_FUNC(fmin)
173 AC_CHECK_MATH_FUNC(fmod)
174 AC_CHECK_MATH_FUNC(frexp)
175 AC_CHECK_MATH_FUNC(gamma)
176 AC_CHECK_MATH_FUNC(hypot)
177 AC_CHECK_MATH_FUNC(j0)
178 AC_CHECK_MATH_FUNC(j1)
179 AC_CHECK_MATH_FUNC(jn)
180 AC_CHECK_MATH_FUNC(ldexp)
181 AC_CHECK_MATH_FUNC(lgamma)
182 AC_CHECK_MATH_FUNC(log10)
183 AC_CHECK_MATH_FUNC(log1p)
184 AC_CHECK_MATH_FUNC(log2)
185 AC_CHECK_MATH_FUNC(log)
186 AC_CHECK_MATH_FUNC(logb)
187 AC_CHECK_MATH_FUNC(modf)
188 AC_CHECK_MATH_FUNC(lgamma_r)
189 AC_CHECK_MATH_FUNC(nearbyint)
190 AC_CHECK_MATH_FUNC(nextafter)
191 AC_CHECK_MATH_FUNC(nexttoward)
192 AC_CHECK_MATH_FUNC(pow10) # Not available with glibc version >= 2.27
193 AC_CHECK_MATH_FUNC(pow)
194 AC_CHECK_MATH_FUNC(remainder)
195 AC_CHECK_MATH_FUNC(rint)
196 AC_CHECK_MATH_FUNC(round)
197 AC_CHECK_MATH_FUNC(scalb)
198 AC_CHECK_MATH_FUNC(scalbln)
199 AC_CHECK_MATH_FUNC(significand)
200 AC_CHECK_MATH_FUNC(sin)
201 AC_CHECK_MATH_FUNC(sinh)
202 AC_CHECK_MATH_FUNC(sqrt)
203 AC_CHECK_MATH_FUNC(tan)
204 AC_CHECK_MATH_FUNC(tanh)
205 AC_CHECK_MATH_FUNC(tgamma)
206 AC_CHECK_MATH_FUNC(trunc)
207 AC_CHECK_MATH_FUNC(y0)
208 AC_CHECK_MATH_FUNC(y1)
209 AC_CHECK_MATH_FUNC(yn)
210
211 dnl Thread local storage
212 have___thread=no
213 AC_MSG_CHECKING(for thread-local storage)
214 AC_LINK_IFELSE([AC_LANG_SOURCE([
215 static __thread int x ;
216 int main () { x = 123; return x; }
217 ])], have___thread=yes)
218 if test $have___thread = yes; then
219 AC_DEFINE([HAVE___THREAD],1,[Define to 1 if the system supports __thread])
220 fi
221 AC_MSG_RESULT($have___thread)
222
223 AC_C_BIGENDIAN(
224 AC_DEFINE([IEEE_MC68k], 1, [machine is bigendian]),
225 AC_DEFINE([IEEE_8087], 1, [machine is littleendian]),
226 AC_MSG_ERROR(unknown endianess),
227 AC_MSG_ERROR(universial endianess not supported)
228 )
229
230 dnl Oniguruma
231 AC_ARG_WITH([oniguruma],
232 [AS_HELP_STRING([--with-oniguruma=prefix],
233 [try this for a non-standard install prefix of the oniguruma library])], ,
234 [with_oniguruma=yes])
235
236 onig_CFLAGS=
237 onig_LDFLAGS=
238 build_oniguruma=no
239 AS_IF([test "x$with_oniguruma" != xno], [
240 save_CFLAGS="$CFLAGS"
241 save_LDFLAGS="$LDFLAGS"
242 AS_IF([test "x$with_oniguruma" != xyes], [
243 AS_IF([test "x$with_oniguruma" = xbuiltin], [
244 build_oniguruma=yes
245 ], [
246 onig_CFLAGS="-I${with_oniguruma}/include"
247 onig_LDFLAGS="-L${with_oniguruma}/lib"
248 ])
249 ])
250 AS_IF([test "x$build_oniguruma" = xno], [
251 # check for ONIGURUMA library, either in /usr or where requested
252 CFLAGS="$CFLAGS $onig_CFLAGS"
253 LDFLAGS="$LDFLAGS $onig_LDFLAGS"
254 AC_CHECK_HEADER("oniguruma.h",
255 AC_CHECK_LIB([onig],[onig_version]))
256 # handle check results
257 AS_IF([test "x$ac_cv_lib_onig_onig_version" != "xyes"], [
258 build_oniguruma=yes
259 AC_MSG_NOTICE([Oniguruma was not found. Will use the packaged oniguruma.])
260 ])
261 ])
262 AS_IF([test "x$build_oniguruma" = xyes -a -f "${srcdir}/modules/oniguruma/configure.ac" ], [
263 onig_CFLAGS="-I${srcdir}/modules/oniguruma/src"
264 onig_LDFLAGS="-L${srcdir}/modules/oniguruma/src -Wl,-rpath,${libdir}"
265 AC_CONFIG_SUBDIRS([modules/oniguruma])
266 AC_DEFINE([HAVE_LIBONIG],1,[Define to 1 if the system includes libonig])
267 ])
268 CFLAGS="$save_CFLAGS"
269 LDFLAGS="$save_LDFLAGS"
270 ])
271 AC_SUBST(onig_CFLAGS)
272 AC_SUBST(onig_LDFLAGS)
273
274 AM_CONDITIONAL([BUILD_ONIGURUMA], [test "x$build_oniguruma" = xyes])
275 AC_SUBST([BUNDLER], ["$bundle_cmd"])
276
277 AC_CONFIG_MACRO_DIR([config/m4])
278 AC_CONFIG_FILES([Makefile])
279 AC_OUTPUT
280