summaryrefslogtreecommitdiff
path: root/libpkgconf/libpkgconf
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-07-09 22:02:41 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-07-11 15:45:23 +0300
commita0cb8991b2cb61e9c0f3d8075759939cc61d57f0 (patch)
tree07349d877ea962acc800bdad2695417d10c99330 /libpkgconf/libpkgconf
parent6ef6c9d2da661bc315d4e690120db9079bfe0b9b (diff)
Add implementation
Diffstat (limited to 'libpkgconf/libpkgconf')
-rw-r--r--libpkgconf/libpkgconf/.gitignore3
l---------libpkgconf/libpkgconf/argvsplit.c1
l---------libpkgconf/libpkgconf/audit.c1
l---------libpkgconf/libpkgconf/bsdstubs.c1
l---------libpkgconf/libpkgconf/bsdstubs.h1
-rw-r--r--libpkgconf/libpkgconf/buildfile155
l---------libpkgconf/libpkgconf/cache.c1
l---------libpkgconf/libpkgconf/client.c1
-rw-r--r--libpkgconf/libpkgconf/config.h56
l---------libpkgconf/libpkgconf/config.h.cmake.in.orig1
l---------libpkgconf/libpkgconf/dependency.c1
l---------libpkgconf/libpkgconf/fileio.c1
l---------libpkgconf/libpkgconf/fragment.c1
l---------libpkgconf/libpkgconf/iter.h1
l---------libpkgconf/libpkgconf/libpkgconf-api.h1
l---------libpkgconf/libpkgconf/libpkgconf.h1
l---------libpkgconf/libpkgconf/parser.c1
l---------libpkgconf/libpkgconf/path.c1
l---------libpkgconf/libpkgconf/personality.c1
l---------libpkgconf/libpkgconf/pkg.c1
l---------libpkgconf/libpkgconf/queue.c1
l---------libpkgconf/libpkgconf/stdinc.h1
l---------libpkgconf/libpkgconf/tuple.c1
-rw-r--r--libpkgconf/libpkgconf/version.h.in10
l---------libpkgconf/libpkgconf/win-dirent.h1
25 files changed, 245 insertions, 0 deletions
diff --git a/libpkgconf/libpkgconf/.gitignore b/libpkgconf/libpkgconf/.gitignore
new file mode 100644
index 0000000..620b4c8
--- /dev/null
+++ b/libpkgconf/libpkgconf/.gitignore
@@ -0,0 +1,3 @@
+# Generated version.h.
+#
+version.h
diff --git a/libpkgconf/libpkgconf/argvsplit.c b/libpkgconf/libpkgconf/argvsplit.c
new file mode 120000
index 0000000..fb0efa4
--- /dev/null
+++ b/libpkgconf/libpkgconf/argvsplit.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/argvsplit.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/audit.c b/libpkgconf/libpkgconf/audit.c
new file mode 120000
index 0000000..88bb679
--- /dev/null
+++ b/libpkgconf/libpkgconf/audit.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/audit.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/bsdstubs.c b/libpkgconf/libpkgconf/bsdstubs.c
new file mode 120000
index 0000000..40fea4e
--- /dev/null
+++ b/libpkgconf/libpkgconf/bsdstubs.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/bsdstubs.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/bsdstubs.h b/libpkgconf/libpkgconf/bsdstubs.h
new file mode 120000
index 0000000..25da14c
--- /dev/null
+++ b/libpkgconf/libpkgconf/bsdstubs.h
@@ -0,0 +1 @@
+../../upstream/libpkgconf/bsdstubs.h \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/buildfile b/libpkgconf/libpkgconf/buildfile
new file mode 100644
index 0000000..5131874
--- /dev/null
+++ b/libpkgconf/libpkgconf/buildfile
@@ -0,0 +1,155 @@
+# file : libpkgconf/buildfile
+# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+# license : ISC; see accompanying COPYING file
+
+lib{pkgconf}: {h c}{* -version} {h}{version}
+
+tclass = $c.target.class
+
+bsd = ($tclass == 'bsd')
+macos = ($tclass == 'macos')
+windows = ($tclass == 'windows')
+
+msvc = ($c.class == 'msvc')
+
+# The version file is internal (it is only included from the internal
+# config.h) so we don't distribute nor install it (see below).
+#
+h{version}: in{version} $src_root/manifest
+
+# Build options.
+#
+# Note that we have to add "-I$src_root" for the headers auto-generating
+# machinery to work properly.
+#
+c.poptions =+ "-I$out_root" "-I$src_root"
+
+# Define the PKG_DEFAULT_PATH, SYSTEM_INCLUDEDIR and SYSTEM_LIBDIR macros.
+# The whole idea feels utterly broken (hello cross-compilation) so we will
+# just do bare minimum and wait and see.
+#
+# There is also PERSONALITY_PATH macro added in 1.5.1. It looks like the
+# personality files are invented to fix cross-compilation but are unlikely to
+# have any noticeable distribution yet. Normally these files are located in
+# the personality.d/ subdirectory of the .pc files directory.
+#
+# @@ We should probably allow to configure these macros via configuration
+# variables config.pkgconfig.pkg_default_path and alike.
+#
+if! $windows
+{
+ inc_dirs = "/usr/include"
+ lib_dirs = "/usr/lib"
+
+ if ($install.root != [null])
+ {
+ def_dirs = "$install.resolve($install.pkgconfig)"
+ personality_dirs = "$def_dirs/personality.d"
+ }
+ else
+ {
+ def_dirs = ""
+ personality_dirs = ""
+ }
+}
+else
+{
+ inc_dirs = ""
+ lib_dirs = ""
+
+ # Note that on Windows PKG_DEFAULT_PATH macros is internally redefined as
+ # "../lib/pkgconfig;../share/pkgconfig" and is used as a fallback. Normally
+ # the default path is relative to the program's (that link the library)
+ # directory and has the following format:
+ #
+ # <dir>/../lib/pkgconfig;<dir>/../share/pkgconfig
+ #
+ # So we keep the macros empty.
+ #
+ def_paths = ""
+ personality_dirs = ""
+}
+
+c.poptions += -DPKG_DEFAULT_PATH=\"$def_dirs\" \
+ -DSYSTEM_INCLUDEDIR=\"$inc_dirs\" \
+ -DSYSTEM_LIBDIR=\"$lib_dirs\" \
+ -DPERSONALITY_PATH=\"$personality_dirs\"
+
+# Disable warnings.
+#
+if $msvc
+ c.coptions += /wd4996 /wd4267
+
+# Note: this should go last as it adds obj target-specific options.
+#
+if! $windows
+{
+ # Upstream package compiles the source files with -std=gnu99 option to allow
+ # some GNU deviations from the ISO C99 standard. We will compile with
+ # -std=c9x option (is implied by c.std=99 in root.build) and define
+ # _GNU_SOURCE for the source files that require such deviations. This macro
+ # also re-enables definitions of POSIX macros (specifically PATH_MAX) that
+ # are disabled by -std=c9x.
+ #
+ # Note that on FreeBSD and MacOS -D_POSIX_C_SOURCE disables declarations of
+ # strndup(), strlcpy() and alike, that are not POSIX. Not very consistent
+ # given that they are also not C99. Luckily, -std=c9x doesn't disable
+ # PATH_MAX on these OSes, so we just don't define the macro for them.
+ #
+ # @@ It all becomes a bit hairy. Should we just undefine the corresponding
+ # HAVE_* macros in config.h, so the custom function implementations are
+ # picked up? Alternatively, can we stop specifying the C standard and
+ # defining _POSIX_C_SOURCE macro altogether?
+ #
+ if! ($bsd || $macos)
+ c.poptions += -D_POSIX_C_SOURCE=200112L
+
+ obj{client fragment path personality pkg queue tuple}: \
+ c.poptions += -D_GNU_SOURCE
+}
+else
+{
+ cc.poptions += -DWIN32 -D_WINDOWS -D_MBCS
+
+ if $msvc
+ cc.coptions += /GS /fp:precise /Zc:wchar_t /Zc:forScope
+
+ # See libpkgconf-api.h for details.
+ #
+ objs{*}: c.poptions += -DLIBPKGCONF_EXPORT
+ obja{*}: c.poptions += -DPKGCONFIG_IS_STATIC
+
+ c.libs += $regex.apply(advapi32, '(.+)', $msvc ? '\1.lib' : '-l\1')
+}
+
+# Export options.
+#
+lib{pkgconf}: cc.export.poptions = "-I$src_root"
+liba{pkgconf}: cc.export.poptions += -DPKGCONFIG_IS_STATIC
+
+# See bootstrap.build for details.
+#
+if $version.pre_release
+ lib{pkgconf}: bin.lib.version = @"-$version.project_id"
+else
+ lib{pkgconf}: bin.lib.version = @"-$release_num"
+
+# Install into the pkgconf/libpkgconf/ subdirectory of, say, /usr/include/.
+# Also make sure Cflags is properly set in .pc files to pkgconfig/.
+#
+h{*}: install = include/libpkgconf/
+install.include = $install.include/pkgconf/
+
+# Internal auto-generated header (see above).
+#
+h{version}: install = false
+
+# Implementation details.
+#
+# The upstream's config.h is generated during the configuration phase. We
+# distribute a custom one with a minimal set of macro definitions required to
+# build the project. Note that the file is internal (is only included from C
+# files) and so is not installed.
+#
+for h: config stdinc win-dirent
+ h{$h}@./: install = false
diff --git a/libpkgconf/libpkgconf/cache.c b/libpkgconf/libpkgconf/cache.c
new file mode 120000
index 0000000..96149ad
--- /dev/null
+++ b/libpkgconf/libpkgconf/cache.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/cache.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/client.c b/libpkgconf/libpkgconf/client.c
new file mode 120000
index 0000000..6421e39
--- /dev/null
+++ b/libpkgconf/libpkgconf/client.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/client.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/config.h b/libpkgconf/libpkgconf/config.h
new file mode 100644
index 0000000..c8d5cd5
--- /dev/null
+++ b/libpkgconf/libpkgconf/config.h
@@ -0,0 +1,56 @@
+/* file : libpkgconf/config.h -*- C -*-
+ * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+ * license : ISC; see accompanying COPYING file
+ */
+#ifndef LIBPKGCONF_CONFIG_H
+#define LIBPKGCONF_CONFIG_H
+
+/*
+ * For the semantics of the following macros refer to config.h.cmake.in.orig
+ * and upstream's CMakeList.txt.
+ *
+ * Note that we will explicitly undefine macros that are present in the
+ * libpkgconf source code but should not be defined. While this is not
+ * technically required, it simplifies the change tracking (see README-DEV).
+ * As a bonus we also make sure that they are not get eventually defined by
+ * some system headers.
+ */
+
+/*
+ * Auto-generated. Defines the following configuration macros:
+
+#define PACKAGE_VERSION
+
+ * Keep all the macros listed (in this exact form) for the change tracking
+ * (see README-DEV).
+ */
+#include <libpkgconf/version.h>
+
+/*
+ * strndup() is not present on Windows, for gcc and clang if compile with
+ * -std=C99, except for FreeBSD and MacOS.
+ *
+ * strl*() are only present on FreeBSD and MacOS.
+ */
+#if defined(__FreeBSD__) || defined(__APPLE__)
+# define HAVE_STRNDUP 1
+# define HAVE_STRLCPY 1
+# define HAVE_STRLCAT 1
+#endif
+
+/*
+ * Let's assume cygwin_conv_path() is always available if compile with MSYS
+ * gcc.
+ */
+#if defined(__MSYS__)
+# define HAVE_CYGWIN_CONV_PATH 1
+#endif
+
+/*
+ * We don't consider such an outdated environments.
+ */
+#define HAVE_SYS_STAT_H 1
+
+#define PACKAGE_BUGREPORT "https://git.dereferenced.org/pkgconf/pkgconf/issues"
+
+#endif /* LIBPKGCONF_CONFIG_H */
diff --git a/libpkgconf/libpkgconf/config.h.cmake.in.orig b/libpkgconf/libpkgconf/config.h.cmake.in.orig
new file mode 120000
index 0000000..e991bcb
--- /dev/null
+++ b/libpkgconf/libpkgconf/config.h.cmake.in.orig
@@ -0,0 +1 @@
+../../upstream/libpkgconf/config.h.cmake.in \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/dependency.c b/libpkgconf/libpkgconf/dependency.c
new file mode 120000
index 0000000..12b2e16
--- /dev/null
+++ b/libpkgconf/libpkgconf/dependency.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/dependency.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/fileio.c b/libpkgconf/libpkgconf/fileio.c
new file mode 120000
index 0000000..fdbc8e3
--- /dev/null
+++ b/libpkgconf/libpkgconf/fileio.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/fileio.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/fragment.c b/libpkgconf/libpkgconf/fragment.c
new file mode 120000
index 0000000..ccec352
--- /dev/null
+++ b/libpkgconf/libpkgconf/fragment.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/fragment.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/iter.h b/libpkgconf/libpkgconf/iter.h
new file mode 120000
index 0000000..34e65e0
--- /dev/null
+++ b/libpkgconf/libpkgconf/iter.h
@@ -0,0 +1 @@
+../../upstream/libpkgconf/iter.h \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/libpkgconf-api.h b/libpkgconf/libpkgconf/libpkgconf-api.h
new file mode 120000
index 0000000..037d133
--- /dev/null
+++ b/libpkgconf/libpkgconf/libpkgconf-api.h
@@ -0,0 +1 @@
+../../upstream/libpkgconf/libpkgconf-api.h \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/libpkgconf.h b/libpkgconf/libpkgconf/libpkgconf.h
new file mode 120000
index 0000000..b885e88
--- /dev/null
+++ b/libpkgconf/libpkgconf/libpkgconf.h
@@ -0,0 +1 @@
+../../upstream/libpkgconf/libpkgconf.h \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/parser.c b/libpkgconf/libpkgconf/parser.c
new file mode 120000
index 0000000..e37a0c5
--- /dev/null
+++ b/libpkgconf/libpkgconf/parser.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/parser.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/path.c b/libpkgconf/libpkgconf/path.c
new file mode 120000
index 0000000..9dd7e6f
--- /dev/null
+++ b/libpkgconf/libpkgconf/path.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/path.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/personality.c b/libpkgconf/libpkgconf/personality.c
new file mode 120000
index 0000000..4d70904
--- /dev/null
+++ b/libpkgconf/libpkgconf/personality.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/personality.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/pkg.c b/libpkgconf/libpkgconf/pkg.c
new file mode 120000
index 0000000..ea9e3fd
--- /dev/null
+++ b/libpkgconf/libpkgconf/pkg.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/pkg.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/queue.c b/libpkgconf/libpkgconf/queue.c
new file mode 120000
index 0000000..f8945af
--- /dev/null
+++ b/libpkgconf/libpkgconf/queue.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/queue.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/stdinc.h b/libpkgconf/libpkgconf/stdinc.h
new file mode 120000
index 0000000..a0d601c
--- /dev/null
+++ b/libpkgconf/libpkgconf/stdinc.h
@@ -0,0 +1 @@
+../../upstream/libpkgconf/stdinc.h \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/tuple.c b/libpkgconf/libpkgconf/tuple.c
new file mode 120000
index 0000000..3ec7f18
--- /dev/null
+++ b/libpkgconf/libpkgconf/tuple.c
@@ -0,0 +1 @@
+../../upstream/libpkgconf/tuple.c \ No newline at end of file
diff --git a/libpkgconf/libpkgconf/version.h.in b/libpkgconf/libpkgconf/version.h.in
new file mode 100644
index 0000000..6b30948
--- /dev/null
+++ b/libpkgconf/libpkgconf/version.h.in
@@ -0,0 +1,10 @@
+/* file : libpkgconf/version.h.in -*- C -*-
+ * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+ * license : ISC; see accompanying COPYING file
+ */
+
+#ifndef PACKAGE_VERSION /* Note: using the version macro itself. */
+
+#define PACKAGE_VERSION "$libpkgconf.version.project_id$"
+
+#endif /* PACKAGE_VERSION */
diff --git a/libpkgconf/libpkgconf/win-dirent.h b/libpkgconf/libpkgconf/win-dirent.h
new file mode 120000
index 0000000..d001518
--- /dev/null
+++ b/libpkgconf/libpkgconf/win-dirent.h
@@ -0,0 +1 @@
+../../upstream/libpkgconf/win-dirent.h \ No newline at end of file