diff options
Diffstat (limited to 'bpkg/buildfile')
-rw-r--r-- | bpkg/buildfile | 100 |
1 files changed, 85 insertions, 15 deletions
diff --git a/bpkg/buildfile b/bpkg/buildfile index 4814720..8836712 100644 --- a/bpkg/buildfile +++ b/bpkg/buildfile @@ -1,5 +1,4 @@ # file : bpkg/buildfile -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # @@ ODB: these are ODB changelogs that are both generated and stored in the @@ -9,17 +8,30 @@ 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} + +# @@ TMP we require libsqlite3 to be interface dependency of libbut-odb only +# for the database migrations to schema versions 13 and 14. +# +import libs += libbpkg%lib{bpkg} import libs += libbutl%lib{butl} -import libs += libodb%lib{odb} -import libs += libodb-sqlite%lib{odb-sqlite} +import libs += libbutl%lib{butl-odb} 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 \ @@ -83,6 +95,23 @@ for t: cxx{**.test...} # Build options. # + +#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. +# +copyright = $process.run_regex( \ + cat $src_root/LICENSE, \ + 'Copyright \(c\) (.+) \(see the AUTHORS and LEGAL files\)\.', \ + '\1') + +obj{bpkg}: cxx.poptions += "-DBPKG_COPYRIGHT=\"$copyright\"" + # Disable "unknown pragma" warnings. # switch $cxx.class @@ -99,12 +128,34 @@ switch $cxx.class if ($cxx.id == 'msvc' && $cxx.version.major == 19 && $cxx.version.minor < 10) cxx.coptions += /wd4503 -obj{utility}: cxx.poptions += -DBPKG_EXE_SUFFIX='"'$bin.exe.suffix'"' - -# 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. # @@ -122,6 +173,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} @@ -141,6 +193,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. # @@ -160,21 +215,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. # |