aboutsummaryrefslogtreecommitdiff
path: root/bpkg/buildfile
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/buildfile')
-rw-r--r--bpkg/buildfile89
1 files changed, 77 insertions, 12 deletions
diff --git a/bpkg/buildfile b/bpkg/buildfile
index a3ecd89..0ba60dc 100644
--- a/bpkg/buildfile
+++ b/bpkg/buildfile
@@ -8,17 +8,33 @@
define xml: file
xml{*}: extension = xml
-import libs = libbpkg%lib{bpkg}
+import libs = build2%lib{build2}
+
+# NOTE: see also module loading in bpkg.cxx if adding anything here.
+#
+for m: bash bin c cc cli cxx in version
+ import libs += build2%lib{build2-$m}
+
+import libs += libbpkg%lib{bpkg}
import libs += libbutl%lib{butl}
import libs += libodb%lib{odb}
import libs += libodb-sqlite%lib{odb-sqlite}
+# @@ TMP Only required for the database migrations to schema versions 13 and
+# 14.
+#
+import libs += libsqlite3%lib{sqlite3}
+
options_topics = \
bpkg-options \
cfg-create-options \
+cfg-info-options \
+cfg-link-options \
+cfg-unlink-options \
common-options \
configuration-options \
help-options \
+pkg-bindist-options \
pkg-build-options \
pkg-checkout-options \
pkg-clean-options \
@@ -82,7 +98,13 @@ for t: cxx{**.test...}
# Build options.
#
-obj{utility}: cxx.poptions += -DBPKG_EXE_SUFFIX='"'$bin.exe.suffix'"'
+
+#cxx.poptions += -DBPKG_OUTPROC_CONFIGURE
+
+obj{utility}: cxx.poptions += \
+"-DBPKG_EXE_PREFIX=\"$bin.exe.prefix\"" \
+"-DBPKG_EXE_SUFFIX=\"$bin.exe.suffix\"" \
+"-DBPKG_HOST_TRIPLET=\"$cxx.target\""
# Pass the copyright notice extracted from the LICENSE file.
#
@@ -91,7 +113,7 @@ copyright = $process.run_regex( \
'Copyright \(c\) (.+) \(see the AUTHORS and LEGAL files\)\.', \
'\1')
-obj{bpkg}: cxx.poptions += -DBPKG_COPYRIGHT=\"$copyright\"
+obj{bpkg}: cxx.poptions += "-DBPKG_COPYRIGHT=\"$copyright\""
# Disable "unknown pragma" warnings.
#
@@ -109,10 +131,34 @@ switch $cxx.class
if ($cxx.id == 'msvc' && $cxx.version.major == 19 && $cxx.version.minor < 10)
cxx.coptions += /wd4503
-# Make sure backtrace includes function names.
+# Similar option to the build system driver.
#
-if ($cxx.target.class == 'linux')
- cxx.loptions += -rdynamic
+switch $cxx.target.class
+{
+ case 'linux'
+ {
+ # Make sure backtrace includes function names.
+ #
+ if ($cc.stdlib == 'glibc')
+ cxx.loptions += -rdynamic
+
+ # Make sure we use RPATH and not RUNPATH since the latter messes up
+ # dlopen().
+ #
+ cxx.loptions += -Wl,--disable-new-dtags
+ }
+ case 'windows'
+ {
+ # Adjust stack size (affects all threads).
+ #
+ # 8M 4M
+ stack_size = ($cxx.target.cpu == "x86_64" ? 8388608 : 4194304)
+
+ cxx.loptions += ($cxx.target.system == 'win32-msvc' \
+ ? "/STACK:$stack_size" \
+ : "-Wl,--stack,$stack_size")
+ }
+}
# Generated options parser.
#
@@ -130,6 +176,7 @@ if $cli.configured
# pkg-* command.
#
+ cli.cxx{pkg-bindist-options}: cli{pkg-bindist}
cli.cxx{pkg-build-options}: cli{pkg-build}
cli.cxx{pkg-checkout-options}: cli{pkg-checkout}
cli.cxx{pkg-clean-options}: cli{pkg-clean}
@@ -149,6 +196,9 @@ if $cli.configured
# cfg-* command.
#
cli.cxx{cfg-create-options}: cli{cfg-create}
+ cli.cxx{cfg-info-options}: cli{cfg-info}
+ cli.cxx{cfg-link-options}: cli{cfg-link}
+ cli.cxx{cfg-unlink-options}: cli{cfg-unlink}
# rep-* command.
#
@@ -168,21 +218,36 @@ if $cli.configured
# Option length must be the same to get commands/topics/options aligned.
#
+ # Need global --suppress-undocumented because of few undocumented options
+ # in common.cli.
+ #
+ #
cli.options += --std c++11 -I $src_root --include-with-brackets \
--include-prefix bpkg --guard-prefix BPKG \
--cxx-prologue "#include <bpkg/types-parsers.hxx>" --cli-namespace bpkg::cli \
--generate-vector-scanner --generate-file-scanner --generate-group-scanner \
--keep-separator --generate-specifier --generate-parse --generate-merge \
---page-usage 'bpkg::print_$name$_' --ansi-color --include-base-last \
---option-length 24
+--page-usage 'bpkg::print_$name$_' --ansi-color --ascii-tree \
+--include-base-last --suppress-undocumented --option-length 25
- cli.cxx{common-options}: cli.options += --short-usage --long-usage # Both.
- cli.cxx{bpkg-options}: cli.options += --short-usage --suppress-undocumented
+ # Both --*-usage options.
+ #
+ cli.cxx{common-options}: cli.options += --short-usage --long-usage \
+--generate-modifier
+
+ cli.cxx{bpkg-options}: cli.options += --short-usage
cli.options += --long-usage # All other pages -- long usage.
- cli.cxx{pkg-build-options}: cli.options += --class-doc \
-bpkg::pkg_build_pkg_options=exclude-base --generate-modifier
+ cli.cxx{pkg-build-options}: cli.options += --generate-modifier \
+--class-doc bpkg::pkg_build_pkg_options=exclude-base
+
+ cli.cxx{pkg-bindist-options}: cli.options += \
+--class-doc bpkg::pkg_bindist_common_options=exclude-base \
+--class-doc bpkg::pkg_bindist_debian_options=exclude-base \
+--class-doc bpkg::pkg_bindist_fedora_options=exclude-base \
+--class-doc bpkg::pkg_bindist_archive_options=exclude-base \
+--omit-link-check --link-regex '%#.+%%'
# Avoid generating CLI runtime and empty inline file for help topics.
#