1
0
mirror of https://github.com/jqlang/jq.git synced 2025-09-21 00:02:03 +03:00

99 Commits

Author SHA1 Message Date
itchyny
abde27d0f5 Revert "Move closer to the standard autotools idiom. (#3187)" (#3255)
This partially reverts commit d8463c2549.
Revert reason: version string should be updated more often.
2025-05-07 17:26:19 +09:00
itchyny
5df471fa5b Disable Valgrind by default during testing (#3269)
Previously, the configure script automatically enables Valgrind during
testing when the valgrind command is found. However, running tests with
Valgrind is quite slow, so it is better to disable it by default, and
to enable it only when the user specifies the `--enable-valgrind` flag.
2025-03-04 22:12:25 +09:00
itchyny
972772153f Move oniguruma and decNumber to vendor directory (#3234) 2025-02-06 07:49:56 +09:00
itchyny
0d1e371e63 website: switch to custom domain jqlang.org (#3243) 2025-02-01 11:54:32 +09:00
Dag-Erling Smørgrav
d8463c2549 Move closer to the standard autotools idiom. (#3187)
* Create `src/config.h` instead of passing everything on the compiler
  command line.

* To reduce the magnitude of this change, add `--include src/config.h`
  to CFLAGS instead of adding `#include "src/config.h"` at the top of
  each source file.  Not all compilers support this, but I don't think
  we care about anything other than gcc and clang at this point.

* Rather than generate `src/config_opts.inc`, emit `JQ_CONFIG` directly
  into `src/config.h`.

* Rather than generate `src/version.h`, define `JQ_VERSION` as an alias
  for the standard `PACKAGE_VERSION`.
2025-01-25 17:10:05 +09:00
itchyny
81f4f883ac Remove non-standard pow10 filter in favor of exp10 (#3059)
The pow10 function was a glibc extension removed in 2.27. Use exp10 filter instead.
2024-03-20 18:23:08 +09:00
Emanuele Torre
c2db51eeb3 shtest+configure: remove uses of non-portable/non-standard commands
Replace deprecated test(1) parentheses and -a logical operator with two
tests command.

Replace deprecated  tail -1  with  tail -n1.

Replace non-standard egrep(1) command with  grep -E  ; this also
prevents obsolescence warnings on GNU systems.
2023-12-11 20:46:54 +01:00
Klemens Nanni
77dcaf3fdc Remove unused mkstemp()
b82c231 "Remove -i option (#704)" removed its last usage in 2015.

Spotted while looking for code could potentially write/create/modify files.
2023-10-21 23:30:36 -05:00
Nicolas Williams
11c528d04d Add setlocale() call (fix #1740) 2023-09-06 14:05:10 -05:00
Mattias Wadman
54fef09ac3 Make maintainer-mode default to disabled
This makes the standard build instructions a bit easier,
just ./configure, and also requires less tools installed (bison).

Also i think few people probably want to generate the lexer and paser code.
2023-07-24 11:26:17 -05:00
itchyny
9e4c71558a Split man.test to make tests pass without oniguruma (#2722) 2023-07-18 08:17:21 +09:00
itchyny
1cb9ba3533 Fix autoreconf warnings 2023-07-16 00:02:46 -05:00
Florian Weimer
52d5988afb C99 compatibility enhancements for the configure script (#2519)
* configure.ac: Enable system extensions

Use AC_USE_SYSTEM_EXTENSIONS to build with _GNU_SOURCE (and similar
macros on non-GNU systems), to avoid an implicit declaration of the
strptime function.  This improves compatibility with future compilers
which do not support implicit function declarations.

* configure.ac: gettimeofday lives in <sys/time.h>

The gettimeofday function is declared in <sys/time.h>, not <time.h>,
according to POSIX and actual systems.  This avoids a configure
probe failure with compilers which do not support implicit function
declarations.
2023-06-14 21:41:04 +09:00
itchyny
433b79dddf Fix version scripts for some shallow clone situations (fix #1549) (#2608) 2023-06-14 07:33:25 +09:00
Josh Soref
5cebe86a7b Fix misspellings (#2609) 2023-06-13 20:01:20 +09:00
Stephen Dolan
89caf46a5f Update URLs from stedolan to jqlang 2023-05-28 17:06:31 +01:00
Ciaran McNamara
2de3bc3732 Add large file support for 32-bit systems to fix issue 2167 2021-05-01 14:17:41 -04:00
William Langford
77417c1335 Clean up compile warnings on macOS 2020-12-19 15:18:29 -05:00
William Langford
e660003abf Use AX_PTHREAD to properly detect pthread and flags 2020-12-19 15:18:29 -05:00
William Langford
50a7022ea6 Rework pipenv requirement to be more relaxed
Keep a cached copy of the man tests that we can use when no manpage
changes are made. This allows automated systems that might not have
easy access to a pipenv to build and run tests.
2020-03-02 11:05:43 -05:00
Alanscut
5b9e63e4af fix typos 2020-01-14 10:18:22 -06:00
Richard H Lee
2065d6c3aa Differentiate WIN32 / Cygwin in configure script
shlwapi.h is present on both systems
2019-12-29 19:24:04 -06:00
William Langford
74c44bc9a3 Add configure guards around literal jv_numbers
Allow building jq in a mode that doesn't use decnumber for benchmarking
purposes. decnumber support is enabled by default, and this option is
meant to be removed once we're happy with the performance.
2019-10-22 14:11:04 -04:00
Leonid S. Usov
cf4b48c7ba Save literal value of the parsed number to preserve it for the output
Extend jv_number to use decNumber for storing number literals. Any math
operations on the numbers will truncate them to double precision.
Comparisons when both numbers are literal numbers will compare them
without truncation.

Delay conversion of numbers to doubles until a math operation is performed,
to preserve precision. A literal jv_number will only need conversion to
double once, and will reuse the resultant double on subsequent
conversions.

Outputting literal jv_numbers preserves the original precision.

Add strong pthread requirement to manage contexts/allocations for
converting numbers between their decNumber, string, and double formats.
2019-10-22 14:11:04 -04:00
Mattias Hansson
3c4fcb1594 Add pkg-config file for libjq
pkg-config is a common interface to resolve build details. It will
become easier to incorporate libjq in other projects by providing this
interface.
2019-03-29 08:16:36 -05:00
Nicolas Williams
dffba62e13 Disable docs by default; don't mantest if no docs 2019-03-24 23:36:50 -05:00
William Langford
c1f11855e3 Remove ruby dependency from website build 2019-02-26 11:10:38 -06: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