From d917dd74cfb8c78f7a99a7e02d4098866f3f763d Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 18 Sep 2017 03:02:58 +0200 Subject: dpkg-buildflags: Add support for new future feature area This new area includes an lfs feature, to be used instead of the getconf(1) interfaces which cannot support cross-building. --- scripts/Dpkg/BuildFlags.pm | 6 +++--- scripts/Dpkg/Vendor/Debian.pm | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'scripts/Dpkg') diff --git a/scripts/Dpkg/BuildFlags.pm b/scripts/Dpkg/BuildFlags.pm index b97e5c779..0533b12b5 100644 --- a/scripts/Dpkg/BuildFlags.pm +++ b/scripts/Dpkg/BuildFlags.pm @@ -237,7 +237,7 @@ sub set { Update the boolean state of whether a specific feature within a known feature area has been enabled. The only currently known feature areas -are "qa", "sanitize", "hardening" and "reproducible". +are "future", "qa", "sanitize", "hardening" and "reproducible". =cut @@ -409,8 +409,8 @@ sub is_maintainer_modified { =item $bf->has_features($area) Returns true if the given area of features is known, and false otherwise. -The only currently recognized feature areas are "qa", "sanitize", "hardening" -and "reproducible". +The only currently recognized feature areas are "future", "qa", "sanitize", +"hardening" and "reproducible". =cut diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm index 4b5436ee1..e0fd01113 100644 --- a/scripts/Dpkg/Vendor/Debian.pm +++ b/scripts/Dpkg/Vendor/Debian.pm @@ -103,6 +103,9 @@ sub _add_build_flags { # Default feature states. my %use_feature = ( + future => { + lfs => 0, + }, qa => { bug => 0, canary => 0, @@ -153,6 +156,18 @@ sub _add_build_flags { ($abi, $os, $cpu) = ('', '', ''); } + ## Area: future + + if ($use_feature{future}{lfs}) { + my ($abi_bits, $abi_endian) = Dpkg::Arch::debarch_to_abiattrs($arch); + my $cpu_bits = Dpkg::Arch::debarch_to_cpubits($arch); + + if ($abi_bits == 32 and $cpu_bits == 32) { + $flags->append('CPPFLAGS', + '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); + } + } + ## Area: qa # Warnings that detect actual bugs. -- cgit v1.2.3