aboutsummaryrefslogtreecommitdiff
path: root/libpkgconf/buildfile
diff options
context:
space:
mode:
Diffstat (limited to 'libpkgconf/buildfile')
-rw-r--r--libpkgconf/buildfile97
1 files changed, 97 insertions, 0 deletions
diff --git a/libpkgconf/buildfile b/libpkgconf/buildfile
new file mode 100644
index 0000000..285ff01
--- /dev/null
+++ b/libpkgconf/buildfile
@@ -0,0 +1,97 @@
+# file : libpkgconf/buildfile
+# copyright : Copyright (c) 2016-2017 Code Synthesis Ltd
+# license : ISC; see accompanying COPYING file
+
+lib{pkgconf}: {h c}{* -version} {h}{version}
+
+# 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"
+
+# The version file is an internal one (is only included from config.h) so we
+# don't distribute nor install (see below).
+#
+h{version}: in{version} $src_root/file{manifest}
+
+# 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.
+#
+# @@ We should probably allow to configure these macros via configuration
+# variables config.pkgconfig.pkg_default_path and alike.
+#
+if ($c.target.class == "windows")
+{
+ 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 it empty.
+ #
+ def_paths = ""
+}
+else
+{
+ inc_dirs = "/usr/include"
+ lib_dirs = "/usr/lib"
+
+ def_dirs = ($install.root != [null] \
+ ? "$install.resolve($install.pkgconfig)" \
+ : "")
+}
+
+c.poptions += -DPKG_DEFAULT_PATH=\"$def_dirs\" \
+ -DSYSTEM_INCLUDEDIR=\"$inc_dirs\" \
+ -DSYSTEM_LIBDIR=\"$lib_dirs\"
+
+# Disable warnings.
+#
+if ($c.target.system == "win32-msvc")
+ c.coptions += /wd4996 /wd4267
+
+if ($c.target.class == "windows")
+{
+ # See libpkgconf/libpkgconf-api.h for details.
+ #
+ objs{*}: c.poptions += -DLIBPKGCONF_EXPORT
+ obja{*}: c.poptions += -DPKGCONFIG_IS_STATIC
+ liba{pkgconf}: cc.export.poptions += -DPKGCONFIG_IS_STATIC
+
+ if ($c.target.system == "mingw32")
+ c.libs += -ladvapi32
+ else
+ c.libs += advapi32.lib
+}
+
+c.poptions =+ "-I$out_root" "-I$src_root"
+
+lib{pkgconf}: cc.export.poptions = "-I$src_root"
+
+# 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/$project/
+install.include = $install.include/pkgconf/
+
+# For the original package 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 an internal one (is
+# only included from C files) and so is not installed.
+#
+h{config}@./: install = false
+
+# Internal one (see above).
+#
+h{version}: install = false
+
+if ($c.target.class != "windows")
+ h{win-dirent}@./: install = false