Compare commits
16 Commits
6c9a12172d
...
21ffd343e1
Author | SHA1 | Date |
---|---|---|
Ariadne Conill | 21ffd343e1 | |
Ariadne Conill | a441455bf4 | |
Ariadne Conill | cf48b61a59 | |
Ariadne Conill | 40131312ec | |
Ariadne Conill | cc4ccc1429 | |
Ariadne Conill | ac964d13f3 | |
Ariadne Conill | 0995e49977 | |
Ariadne Conill | 820af53a2d | |
Ariadne Conill | a45dbccc01 | |
Ariadne Conill | c6cfca6730 | |
Ariadne Conill | aaabc2cb15 | |
Dylan Baker | c581e24a67 | |
Dylan Baker | f5d6bb71f8 | |
data-man | b132ce8317 | |
olf | ae3a9c5440 | |
Andrea Pappacoda | 6109e06089 |
|
@ -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
|
34
README.md
34
README.md
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue