56 Commits

Author SHA1 Message Date
Nick Wellnhofer
567f612d29 build: Check for declaration of glob() function
Don't rely on presence of glob.h.
2024-08-19 17:57:43 +02:00
makise-homura
5c60860905 Eliminate false positive -Warray-bounds on some compilers
This affects GCC 7.3, MinGW 7.3, and LCC 1.25 and 1.26.
In some sense it reverts ad93f087.
2024-08-16 22:35:54 +03:00
Nick Wellnhofer
e1291059af build: Don't check for pthread.h
The Autotools build still checks for pthread.h (and zlib.h and lzma.h)
but the result isn't needed in config.h.
2024-07-22 23:03:55 +02:00
Nick Wellnhofer
cc03c069f5 build: Don't check for standard POSIX headers
These headers should be available since early POSIX days and are
required no matter what.
2024-07-22 23:02:59 +02:00
Nick Wellnhofer
d7dc2eaf06 build: Don't check for dlfcn.h and dl.h
It's enough to check for symbols.
2024-07-22 21:39:54 +02:00
Nick Wellnhofer
7c10393fc0 build: Fix config.h macros
We have to emulate AC_CHECK_DECLS. Instead of leaving the macro
undefined if a symbol wasn't found, it has to be set to 0.
2024-07-22 17:41:41 +02:00
Nick Wellnhofer
0172ffa99b build: Only check for required headers 2024-07-22 17:03:27 +02:00
Nick Wellnhofer
3ef6661175 build: Rework mmap checks
Switch to AC_CHECK_DECLS/check_symbol_exists. Don't check for
sys/mman.h separately. Don't check for munmap.
2024-07-22 17:03:27 +02:00
Nick Wellnhofer
e1657f3f27 build: Use AC_CHECK_DECLS/check_symbol_exists for getentropy
This assumes that getentropy is declared in sys/random.h.

Should fix issues on iOS. See #774.
2024-07-22 17:03:27 +02:00
Andrew Potter
67fa4a43f3 meson: Disable python when python is disabled 2024-07-03 13:40:04 -07:00
Nick Wellnhofer
e2a49afe3e build: Read version number from VERSION file 2024-07-03 20:32:23 +02:00
Nick Wellnhofer
c3731347c4 build: Introduce LIBXML_MINOR_COMPAT
This is set to 0 for now but could be used to avoid ABI stability
issues.
2024-07-03 18:33:16 +02:00
Nick Wellnhofer
606310a381 meson: Set soversion 2024-07-03 18:05:05 +02:00
Chun-wei Fan
a24b08bf40 meson: Don't always assume PThreads when using threads
The libxml2 code has support for Windows threads as well, so use these
instead on Windows when building threads support,
2024-07-01 15:47:29 +08:00
Nick Wellnhofer
c195f06fac autotools: Use AX_GCC_FUNC_ATTRIBUTE from autoconf archives 2024-06-25 22:19:47 +02:00
Nick Wellnhofer
1afaa37128 build: Move definition of ATTRIBUTE_DESTRUCTOR to libxml.h 2024-06-25 22:06:36 +02:00
Nick Wellnhofer
84a4f84c1c build: Don't check for required headers and functions
Unless we are on Windows, the following POSIX headers are required.
They're part of the earliest POSIX specs and it doesn't make sense to
check for them.

- fcntl.h
- unistd.h
- sys/stat.h
- sys/time.h

On Windows, io.h, fcntl.h and sys/stat.h are always available.
2024-06-22 18:41:00 +02:00
Nick Wellnhofer
dc6f55cf6e build: Remove check for IPv6
Only check for availability of netdb.h.
2024-06-22 18:41:00 +02:00
Nick Wellnhofer
02326d72d3 build: Remove socklen_t checks
socklen_t has been mandated by POSIX for ages. Always use "socklen_t" or
"int" on Win32.
2024-06-22 00:40:40 +02:00
Rosen Penev
88cc61e3e6 meson: simplify thread_local check
Use a simple loop.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-21 14:48:31 -07:00
Rosen Penev
34fe4b8863 meson: simplify IPv6 check
We only need to find AF_INET6. Also make it a feature.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-21 14:48:30 -07:00
Rosen Penev
609c51c587 meson: simplify socklen_t check
Use a simple loop.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-21 14:39:08 -07:00
Nick Wellnhofer
c2ccbc0fed meson: Implement option dependencies
This also removes the FreeBSD hack.
2024-06-21 23:13:17 +02:00
Nick Wellnhofer
7ba6c8feea autotools: Remove libxml-2.0-uninstalled.pc 2024-06-21 13:51:09 +02:00
Rosen Penev
5803ad26b5 meson: change history to a feature
Simpler.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-21 00:12:58 +00:00
Rosen Penev
e9948ee56c meson: change readline to a feature
Simpler and easier to force enable.

Also removed wrong curses check. This is meant for static readline and
not needed with meson.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-21 00:12:58 +00:00
Heiko Becker
a4517bfeaf meson: Add libxml2 part of include dir to pc file
The autotools build results in a pkgconfig file, which looks like this:

"
...
includedir=${prefix}/include
...
Cflags: -I${includedir}/libxml2
"

The latter part is missing when built with meson.
2024-06-20 20:38:19 +00:00
Rosen Penev
1d8bd1262b meson: fix icu and iconv om BSDs again
libdir is needed when searching for iconv, not includedir.

Remove OpenBSD from the bsd list. Something is wrong there and iconv.h
is installed somewhere else.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-18 11:12:07 +00:00
Rosen Penev
f61d23b8c6 meson: only apply threads_dep to runtest
Not needed elsewhere.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-17 12:57:59 -07:00
Rosen Penev
b4b4162fc7 meson: fix compilation on BSDs with icu+iconv
on BSDs, icu is installed and included from /usr/local. When found,
libiconv headers override the normal ones and thus result in a missing
link. Work around this oddity and add the link.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-16 19:47:47 -07:00
Rosen Penev
915951b87b meson: add DEFS to CFLAGS
Adding a configuration flag as an include directory is wrong and errors
on BSDs.

ERROR: Include dir -DU_DISABLE_RENAMING=1 does not exist.

Matches the autotools build now.

Requires has_argument to fix non BSDs because of an annoying meson
quirk.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-16 19:43:44 -07:00
Nick Wellnhofer
3848802723 xmllint: Support libreadline without history 2024-06-17 00:54:47 +02:00
Nick Wellnhofer
33a1f8978d legacy: Merge SAX.c into legacy.c 2024-06-16 19:17:41 +02:00
Nick Wellnhofer
1341deac13 xmllint: Move shell to xmllint
Move source code for xmllint shell to shell.c and move it from the
libxml2 library to the xmllint executable.

Also allow shell to run without XPath and debug modules.

Add stubs for old shell API functions in legacy build mode.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
481fd6bbee tests: Remove testThreads.c
This was merged into runtest.c some time ago.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
b0fc67aa22 build: Remove --with-tree configuration option
This option would allow for a smaller, but mostly useless minimal build.
But it complicates the symbol availability logic in an insane way and
requires specialized tools like our custom C parser in doc/apibuild.py.

See #717.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
898e5a1442 build: Remove compiler TLS warning 2024-06-15 20:17:18 +02:00
Nick Wellnhofer
e714f506e4 build: Stop installing libxml.m4
This file is deprecated and unmaintained. It will be kept in the source
tree for a while.
2024-06-15 20:14:03 +02:00
Nick Wellnhofer
669bd34993 xpointer: Remove support for XPointer locations
The latest spec for what it essentially an XPath extension seems to be
this working draft from 2002:

    https://www.w3.org/TR/xptr-xpointer/

The xpointer() scheme is listed as "being reviewed" in the XPointer
registry since at least 2006. libxml2 seems to be the only modern
software that tries to implement this spec, but the code has many bugs
and quality issues.

If you configure --with-legacy, old symbols are retained for ABI
compatibility.
2024-06-12 18:20:01 +02:00
Nick Wellnhofer
dba1ed85a3 ftp: Remove FTP support
Remove the built-in FTP client. If you configure --with-legacy, old
symbols are retained for ABI compatibility.
2024-06-12 18:19:55 +02:00
Rosen Penev
f227086380 meson: convert boolean options to feature option
Simpler. Seems like they're only disabled by minimum.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-06 17:13:41 -07:00
Andrew Potter
ed3e53de0e meson: Pass LIBXML_STATIC in dependency 2024-06-06 22:27:54 +00:00
Rosen Penev
16d914a9f3 meson: fix compilation with local binaries
threads_dep is needed for runtest.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-03 17:20:10 -07:00
Rosen Penev
4b2f250a5b meson: don't use dl dependency on old meson
dl dependency was introduced with version 0.62.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-03 14:33:52 -07:00
Rosen Penev
0160127fda meson: fix usage as a subproject
include directories must be passed to that projects can use headers.

Also add override_dependencies to make sure that it's used when
available as a subproject.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-03 14:33:07 -07:00
Nick Wellnhofer
e349709ae7 build: Remove --with-fexceptions configuration option 2024-05-21 21:07:16 +02:00
Nick Wellnhofer
f524993e70 build: Clean up configuration options
Remove run-debug from meson. Fix documentation.
2024-05-21 21:05:32 +02:00
Nick Wellnhofer
11ce63f02b build: Don't check for isascii 2024-05-21 20:40:30 +02:00
Nick Wellnhofer
6f2a597383 build: Don't check for uint32_t 2024-05-21 20:40:30 +02:00
Nick Wellnhofer
e80f27fc81 build: Don't check for inttypes.h
This header isn't used.
2024-05-21 18:37:57 +02:00