Compare commits

...

16 Commits

Author SHA1 Message Date
Ariadne Conill 21ffd343e1 CI: woodpecker: use matrix builds
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-26 03:11:36 +00:00
Ariadne Conill a441455bf4 CI: add woodpecker config 2022-06-26 03:11:36 +00:00
Ariadne Conill cf48b61a59 stdinc: include strings.h on POSIX 2022-02-21 04:42:26 -06:00
Ariadne Conill 40131312ec meson: check for strdup, strcasecmp, strncasecmp 2022-02-21 04:41:08 -06:00
Ariadne Conill cc4ccc1429 meson: use _BSD_SOURCE for checking for symbols 2022-02-21 04:39:49 -06:00
Ariadne Conill ac964d13f3
Merge pull request #240 from Tachi107/readme-meson
docs: mention Meson instead of CMake for Win build
2022-02-21 04:27:20 -06:00
Ariadne Conill 0995e49977
Merge branch 'master' into readme-meson 2022-02-21 04:27:11 -06:00
Ariadne Conill 820af53a2d
Merge pull request #241 from Olf0/patch-1
Re-do MR #235, i.e. the vanished commit fe98e1b
2022-02-21 04:25:48 -06:00
Ariadne Conill a45dbccc01
Merge pull request #242 from data-man/dirent_latest
Update dirent.h to latest
2022-02-21 04:25:36 -06:00
Ariadne Conill c6cfca6730
Merge pull request #245 from dcbaker/submit/remove-const
libpkgconf: remove const modifier from error_handler data pointer
2022-02-21 04:25:26 -06:00
Ariadne Conill aaabc2cb15
Merge pull request #246 from dcbaker/submit/personality-deinit
personality: use an unsigned to track initializations instead of a bool.
2022-02-21 04:25:14 -06:00
Dylan Baker c581e24a67 personality: use an unsigned to track initializations
Instead of a bool. The latter will result in de-initing leaving the
library unable to init again, which works out for the cli, but is
problematic for other consumers (meson++ and muon).

v2: - Add docs that the functions are not thread safe
2022-02-14 21:22:05 -08:00
Dylan Baker f5d6bb71f8 libpkgconf: remove const modifier from error_handler data pointer
Currently, the data pointer is `const void *`, which means that the
handler can't modify the data without casting away the constness.
2022-02-07 09:34:09 -08:00
data-man b132ce8317 Update dirent.h to latest 2022-01-08 10:55:28 +05:00
olf ae3a9c5440
Re-do MR #235, i.e. the vanished commit fe98e1b 2021-12-11 22:56:31 +01:00
Andrea Pappacoda 6109e06089
docs: mention Meson instead of CMake for Win build
Fixes #233
2021-12-11 14:49:19 +01:00
10 changed files with 815 additions and 631 deletions

60
.woodpecker.yml Normal file
View File

@ -0,0 +1,60 @@
pipeline:
debian-meson:
image: debian
commands:
- apt-get update
- apt-get install -y kyua atf-sh build-essential meson
- meson _build
- meson compile -C _build
- meson test -v -C _build
when:
matrix:
IMAGE: debian
BUILD: meson
debian-autotools:
image: debian
commands:
- apt-get update
- apt-get install -y kyua atf-sh build-essential autoconf libtool
- ./autogen.sh
- ./configure
- make -j
- make distcheck
when:
matrix:
IMAGE: debian
BUILD: autotools
alpine-meson:
image: alpine
commands:
- apk add -U --no-cache kyua atf build-base meson
- meson _build
- meson compile -C _build
- meson test -v -C _build
when:
matrix:
IMAGE: alpine
BUILD: meson
alpine-autotools:
image: alpine
commands:
- apk add -U --no-cache kyua atf build-base autoconf automake libtool xz gzip
- ./autogen.sh
- ./configure
- make -j
- make distcheck
when:
matrix:
IMAGE: alpine
BUILD: autotools
matrix:
IMAGE:
- debian
- alpine
BUILD:
- meson
- autotools

View File

@ -3,9 +3,9 @@
`pkgconf` is a program which helps to configure compiler and linker flags for
development libraries. It is similar to pkg-config from freedesktop.org.
`libpkgconf` is a library which provides access to most of `pkgconf`'s functionality, to allow
other tooling such as compilers and IDEs to discover and use libraries configured by
pkgconf.
`libpkgconf` is a library which provides access to most of `pkgconf`'s functionality,
to allow other tooling such as compilers and IDEs to discover and use libraries
configured by pkgconf.
## using `pkgconf` with autotools
@ -71,16 +71,17 @@ do let us know, but also make sure that the .pc files are valid and follow the r
the [pkg-config tutorial][fd-tut], as most likely fixing them to follow the specified
rules will solve the problem.
Additionally, **we do not consider pkgconf doing what you tell it to do, when pkg-config
fails to do so, to be a bug**.
Additionally, **we do not consider pkgconf doing what you tell it to do, in cases for
which pkg-config fails to do so, to be a bug**.
If, for example, you use environment variables such as `PKG_CONFIG_SYSTEM_[INCLUDE|LIBRARY]_PATH`
and then find yourself surprised that `pkgconf` is stripping `-I` and `-L` flags relating
to those paths, it's not a `pkgconf` problem -- `pkgconf` is doing exactly what you told
to those paths, it is not a `pkgconf` problem -- `pkgconf` is doing exactly what you told
it to do.
We will reject bugs like this, and if you choose to violate our [Code of Conduct](CODE_OF_CONDUCT.md)
by demanding we fix your non-bug, we will fix the problem by banning you from the repo instead.
We will reject bugs like this, and if someone insists on fixing such a non-bug, this
constitutes a violation of our [Code of Conduct](CODE_OF_CONDUCT.md), which may be
addressed by banning from this repository.
## debug output
@ -111,17 +112,16 @@ flags like so:
$ make
$ sudo make install
## compiling `pkgconf` and `libpkgconf` with CMake (usually for Windows)
## compiling `pkgconf` and `libpkgconf` with Meson (usually for Windows)
pkgconf is compiled using CMake on Windows. In theory, you could also use CMake to build
on UNIX, but this is not recommended at this time as it pkgconf is typically built much earlier
than CMake.
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
pkgconf is compiled using [Meson](https://mesonbuild.com) on Windows. In theory, you could also use
Meson to build on UNIX, but this is not recommended at this time as it pkgconf is typically built
much earlier than Meson.
$ meson setup build -Dtests=false
$ meson compile -C build
$ meson install -C build
There are a few defines such as SYSTEM_LIBDIR, PKGCONFIGDIR and SYSTEM_INCLUDEDIR.
However, on Windows, the default PKGCONFIGDIR value is usually overridden at runtime based

View File

@ -85,7 +85,7 @@ FILE *error_msgout = NULL;
FILE *logfile_out = NULL;
static bool
error_handler(const char *msg, const pkgconf_client_t *client, const void *data)
error_handler(const char *msg, const pkgconf_client_t *client, void *data)
{
(void) client;
(void) data;

View File

@ -401,7 +401,7 @@ pkgconf_trace(const pkgconf_client_t *client, const char *filename, size_t linen
* :rtype: bool
*/
bool
pkgconf_default_error_handler(const char *msg, const pkgconf_client_t *client, const void *data)
pkgconf_default_error_handler(const char *msg, const pkgconf_client_t *client, void *data)
{
(void) msg;
(void) client;

View File

@ -2,8 +2,7 @@
#define LIBPKGCONF_LIBPKGCONF_API_H
/* Makefile.am specifies visibility using the libtool option -export-symbols-regex '^pkgconf_'
* Unfortunately, that is not available when building with cmake, so use attributes instead,
* in a way that doesn't depend on any cmake magic.
* Unfortunately, that is not available when building with meson, so use attributes instead.
*/
#if defined(PKGCONFIG_IS_STATIC)
# define PKGCONF_API

View File

@ -167,7 +167,7 @@ struct pkgconf_pkg_ {
typedef bool (*pkgconf_pkg_iteration_func_t)(const pkgconf_pkg_t *pkg, void *data);
typedef void (*pkgconf_pkg_traverse_func_t)(pkgconf_client_t *client, pkgconf_pkg_t *pkg, void *data);
typedef bool (*pkgconf_queue_apply_func_t)(pkgconf_client_t *client, pkgconf_pkg_t *world, void *data, int maxdepth);
typedef bool (*pkgconf_error_handler_func_t)(const char *msg, const pkgconf_client_t *client, const void *data);
typedef bool (*pkgconf_error_handler_func_t)(const char *msg, const pkgconf_client_t *client, void *data);
struct pkgconf_client_ {
pkgconf_list_t dir_list;
@ -289,7 +289,7 @@ PKGCONF_API void pkgconf_parser_parse(FILE *f, void *data, const pkgconf_parser_
PKGCONF_API bool pkgconf_error(const pkgconf_client_t *client, const char *format, ...) PRINTFLIKE(2, 3);
PKGCONF_API bool pkgconf_warn(const pkgconf_client_t *client, const char *format, ...) PRINTFLIKE(2, 3);
PKGCONF_API bool pkgconf_trace(const pkgconf_client_t *client, const char *filename, size_t lineno, const char *funcname, const char *format, ...) PRINTFLIKE(5, 6);
PKGCONF_API bool pkgconf_default_error_handler(const char *msg, const pkgconf_client_t *client, const void *data);
PKGCONF_API bool pkgconf_default_error_handler(const char *msg, const pkgconf_client_t *client, void *data);
#ifndef PKGCONF_LITE
#if defined(__GNUC__) || defined(__INTEL_COMPILER)

View File

@ -21,7 +21,13 @@
# define strcasecmp _stricmp
#endif
static bool default_personality_init = false;
/*
* Increment each time the default personality is inited, decrement each time
* it's deinited. Whenever it is 0, then the deinit frees the personality. In
* that case an additional call to init will create it anew.
*/
static unsigned default_personality_init = 0;
static pkgconf_cross_personality_t default_personality = {
.name = "default",
#ifdef _WIN32
@ -85,30 +91,47 @@ build_default_search_path(pkgconf_list_t* dirlist)
*
* Returns the default cross-compile personality.
*
* Not thread safe.
*
* :rtype: pkgconf_cross_personality_t*
* :return: the default cross-compile personality
*/
pkgconf_cross_personality_t *
pkgconf_cross_personality_default(void)
{
if (default_personality_init)
if (default_personality_init) {
++default_personality_init;
return &default_personality;
}
build_default_search_path(&default_personality.dir_list);
pkgconf_path_split(SYSTEM_LIBDIR, &default_personality.filter_libdirs, false);
pkgconf_path_split(SYSTEM_INCLUDEDIR, &default_personality.filter_includedirs, false);
default_personality_init = true;
++default_personality_init;
return &default_personality;
}
/*
* !doc
*
* .. c:function:: void pkgconf_cross_personality_deinit(pkgconf_cross_personality_t *)
*
* Decrements the count of default cross personality instances.
*
* Not thread safe.
*
* :rtype: void
*/
void
pkgconf_cross_personality_deinit(pkgconf_cross_personality_t *personality)
{
pkgconf_path_free(&personality->dir_list);
pkgconf_path_free(&personality->filter_libdirs);
pkgconf_path_free(&personality->filter_includedirs);
if (--default_personality_init == 0) {
pkgconf_path_free(&personality->dir_list);
pkgconf_path_free(&personality->filter_libdirs);
pkgconf_path_free(&personality->filter_includedirs);
}
}
#ifndef PKGCONF_LITE

View File

@ -59,6 +59,7 @@
# include <dirent.h>
# include <unistd.h>
# include <limits.h>
# include <strings.h>
# ifdef PATH_MAX
# define PKGCONF_ITEM_SIZE (PATH_MAX + 1024)
# else

File diff suppressed because it is too large Load Diff

View File

@ -13,10 +13,13 @@ check_functions = [
['HAVE_STRLCAT', 'strlcat', 'string.h'],
['HAVE_STRLCPY', 'strlcpy', 'string.h'],
['HAVE_STRNDUP', 'strndup', 'string.h'],
['HAVE_STRDUP', 'strdup', 'string.h'],
['HAVE_STRNCASECMP', 'strncasecmp', 'strings.h'],
['HAVE_STRCASECMP', 'strcasecmp', 'strings.h'],
]
foreach f : check_functions
if cc.has_function(f.get(1), prefix : '#include <' + f.get(2) + '>') and cc.has_header_symbol(f.get(2), f.get(1))
if cc.has_function(f.get(1), prefix : '#define _BSD_SOURCE\n#include <' + f.get(2) + '>') and cc.has_header_symbol(f.get(2), f.get(1), prefix : '#define _BSD_SOURCE')
cdata.set(f.get(0), 1)
endif
endforeach