Commit Graph

73 Commits

Author SHA1 Message Date
William Langford 208c668818 Remove ruby dependency from website build 2019-02-22 19:32:31 -05:00
HE, Tao b436156f5b Mingw-w64 on windows doesn't have setenv, fix that.
Signed-off-by: HE, Tao <sighingnow@gmail.com>
2018-12-19 09:07:14 -06:00
Alex Ozdemir 0c845aa291 Bugfix: Math function checking
We had config machinery that determined which math functions are
available in libc. If a c math function was missing on the host system,
then the corresponding jq function would be removed from the source,
enabling the build to proceed anyway. The detection machinery was broken
in a subtle way, as was shown after glibc updated to 2.27, dropping the
`pow10` function. This caused compilation to fail.

The essential problem was that we detected whether a math function was
available by compiling and linking a small program evaluating that
function on constants. However, since gcc's optimization machinery has
special knowledge of some math functions (e.g. `pow10`), it can
optimize them away, even if they don't exist in the library and are not
linkable. That is, the following example compiles and links against
glibc 2.27, even though `pow10` has been removed:
```
int main () {
  printf("%f", pow10(0.5));
  return 0;
}
```

What?!
On the other hand, this program does not link:
```

int main () {
  double f;
  printf("%f", &f);
  printf("%f", pow10(f));
  return 0;
}
```

In the first program the call to `pow10` can be optimized away as a
constant expression. This requires GCC to know about `pow10` (which it
does!), but it does not require `pow10` to be in the library (and
actually linkable).

The solution is to use autoconf's machinery for detecting function
presence, instead of our own (buggy) machinery. This has the added
benefit of simplifying the code.

The bug was reported in issue #1659
2018-10-12 16:23:09 -04:00
Nicolas Williams b0d6d28310 Use AC_CHECK_MATH_FUNC() for all math functions 2017-05-21 01:22:39 -05:00
Nicolas Williams 18753cb7a7 Also fix jn/2 and yn/2 2017-03-30 11:46:03 -05:00
Nicolas Williams 71d4ff6ed8 Fix frexp, modf, lgamma_r (fix #1374) 2017-03-29 00:07:42 -05:00
Nicolas Williams 6878123202 Make configure.ac work for shallow clones 2017-03-04 22:57:35 -06:00
Nicolas Williams 9a0d796298 Fix --without-oniguruma build 2017-02-26 18:22:23 -06:00
Nicolas Williams 441b066dd8 Preserve precious vars in configure.ac (fix #795) 2017-02-25 21:49:38 -06:00
Nicolas Williams 2e1f2db8b5 Improve Appveyor build
Among other things, make TESTS=... breaks when using modules/oniguruma,
so set SUBDIRS= then.
2017-02-25 18:57:38 -06:00
Nicolas Williams c695f2cd9c When using builtin Oniguruma, set flags correctly
This should fix the Travis-CI build.
2017-02-25 14:11:42 -06:00
Nicolas Williams 06f20603f6 Add localtime and strflocaltime (fix #1349) 2017-02-23 22:26:53 -06:00
Nicolas Williams c6374b6a1f Allow ./configure --with-oniguruma=builtin
This allows one to force the use of jq's builtin copy of Oniguruma
(builtin as a git submodule).

We still need to fix make dist to include that copy of Oniguruma.
2017-02-23 00:30:13 -06:00
Erik Brinkman 02bad4b298 Add local oniguruma submodule
Configure should still allow use of prebuilt onigurumas (whether
system-installed or in a special prefix).  If these are not found, and
configure was not called with `--without-oniguruma`, then use the vendored
oniguruma module.  If configure was called with `--without-oniguruma`, then we
do not build regex functionality into jq.
2017-02-18 21:34:26 -05:00
Nicolas Williams 597c1f6667 Add more missing math functions 2017-02-04 00:11:46 -06:00
Nicolas Williams d228490162 Add --enable-ubsan (undefined behavior sanitizer) 2016-01-17 13:06:27 -06:00
Nicolas Williams ec07936888 Fix Windows build (fix #911) 2016-01-16 16:51:01 -06:00
David Tolnay 18b4b18b41 Support --without-oniguruma 2015-11-21 10:05:37 -08:00
Nicolas Williams 8f115e9eed Add address sanitizer (ASAN) support (fix #1002) 2015-10-27 20:06:21 -05:00
David Tolnay 0c93eb3379 Move source files to src/ 2015-08-23 20:36:11 -07:00
David Tolnay 370833d555 Sort libm functions 2015-08-22 10:54:35 -07:00
David Tolnay 8f55d6d4ab Use https where possible 2015-08-15 12:23:16 -07:00
David Tolnay 0f419563ea Remove all trailing whitespace 2015-08-13 22:39:23 -07:00
David Tolnay b9c340a211 Change homepage .com -> .io
The .com redirects to .io, but might as well have the
correct one to begin with.
2015-07-24 22:55:58 -07:00
David Tolnay 3a964e2025 Change AC bug-report parameter to point to GitHub
This affects where `make check` tells you to report failures.
2015-07-24 22:48:03 -07:00
Nicolas Williams 812703139c Use =, not ==, for shell tests 2015-07-18 21:12:08 -05:00
Nicolas Williams 1c350c67d7 Remove pow10 for now; CHECK_MATH_FUNC needs work
The CHECK_MATH_FUNC() m4 macro needs work.  It should use
AC_RUN_IFELSE(), not just AC_LINK_IFELSE(), and it should #define
_GNU_SOURCE and/or other such feature macros in the prologue to get
non-standard math functions (alternatvely jq should only support
standard math functions).
2015-07-03 21:13:13 -05:00
Nicolas Williams 6366cfd7a4 Add pow, better libm detection (fix #443) 2015-06-27 23:14:46 -05:00
David Tolnay e6371712ff flag to enable gcov and coveralls 2015-06-27 11:25:01 -07:00
David Tolnay d7e35101c5 add configure option to run tests without valgrind 2015-06-27 11:24:53 -07:00
Doug Luce 3cbefde376 Add alloca() discovery to configure.ac
The build failed on FreeBSD as there is no alloca.h.  This patch is
lifted from the autoconf documentation.
2015-06-18 19:19:15 -05:00
Nicolas Williams 8af52aaf52 Add ./configure --enable-all-static instead 2015-05-25 21:19:56 -05:00
Nicolas Williams d66e434fb4 Always add -all-static when --enable-static 2015-05-25 14:14:53 -05:00
Nicolas Williams cf1306f469 Add -all-static when --enable-static 2015-05-18 12:07:29 -05:00
Nicolas Williams 821d6404b6 Add error injection library 2015-05-11 21:36:46 -05:00
Nicolas Williams ccfba00178 Add more date builtins 2015-03-09 11:27:58 -05:00
Nicolas Williams a4b9552c82 Add date builtins (fix #364)
Windows support for strptime() is missing.  We can add a copy of one
from a BSD later.
2015-03-06 00:14:15 -06:00
Stefan Seemayer a4baac2256 Correct automake and autoconf version requirements 2015-02-18 13:15:44 +01:00
Nicolas Williams 1e5e9f3ef8 Mention --disable-maintainer-mode in bison error 2015-02-17 11:00:07 -06:00
Sebastian Freundt 10e8d34fd3 Fix oniguruma detection logic
At the moment, a failed oniguruma header check would leave
HAVE_ONIGURUMA set to 1 still, resulting in a compiler error
in builtin.c.
2015-02-16 09:01:08 +00:00
Nicolas Williams 8cef5a37ab Add --disable-maintainer-mode; make bison optional
Also flex is now optional.

The outputs of flex and bison are now committed.  By default they get
built, but users who want to build from git can now

    ./configure --disable-maintainer-mode

to turn off the dependency on bison and flex.

Maintainers must, of course, commit the bison and/or flex outputs when
they make changes to parser.y and/or lexer.l, respectively.
2015-02-15 18:34:44 -06:00
Nicolas Williams 8afdeee785 Make Oniguruma/regexp optional
Tests won't pass if built without Oniguruma.  We don't have a way to
make a test optional yet.  That will come later.  For now the ability to
reduce build-time dependencies could really help some users.
2015-02-15 18:32:01 -06:00
Nicolas Williams 157c95b988 Add mkstemp() for mingw build 2015-01-01 03:14:55 -06:00
William Langford 6744664ff4 Actually check version for bison.
Clean up oniguruma checks.
2014-08-06 12:26:34 -04:00
William Langford 38b939688a Added library system with -l, -L, and JQ_LIBRARY_PATH
Created util.[ch] to hold common utilities.
2014-07-22 22:51:11 -05:00
William Langford 8ff935c01a Added regex support as per issue #164.
jq now depends on oniguruma for regex support.
Modified configure.ac accordingly.

Added valgrind suppression file for oniguruma to prevent one-time and bounded
leaks from causing tests to fail.

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2014-06-18 21:02:47 -05:00
Nicolas Williams ea63d5d3c2 No args default w/ tty stdout, not tty stdin #220 2014-06-16 22:34:50 -05:00
Kim De Mey 20e629284f Detect endianness at configuration with Autoconf AC_C_BIGENDIAN feature 2014-06-11 10:37:32 +02:00
Nicolas Williams d65dbf89c9 Also fix configure.ac to use git describe --tags 2014-06-08 19:36:06 -05:00
Nicolas Williams 022a418894 Make pthread tls configurable for Mingw build
For the Mingw build we don't want to pull in the pthread DLL just
because we can autodetect pthread support.  That would make the jq.exe
binary not self-contained.
2014-04-17 20:17:06 -05:00