Pārlūkot izejas kodu

dpkg-buildflags: use CFLAGS="-g -O3" for building ppc64 packages on Ubuntu

We're considering bringing up a ppc64 port of the Ubuntu server, and it
appears to be best to build it with -O3 rather than -O2.  (I realise
that this would be unusual in Debian and that there are more obstacles
to this than just dpkg-buildflags, and I'd like to do this differently
eventually, but this is where we are at the moment.)
Colin Watson 15 gadi atpakaļ
vecāks
revīzija
c824c49b3f
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 6 0
      scripts/Dpkg/Vendor/Ubuntu.pm

+ 6 - 0
scripts/Dpkg/Vendor/Ubuntu.pm

@@ -28,6 +28,7 @@ use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
 use Dpkg::Control::Types;
 use Dpkg::BuildOptions;
+use Dpkg::Arch qw(debarch_eq get_host_arch);
 
 use base 'Dpkg::Vendor::Debian';
 
@@ -93,6 +94,11 @@ sub run_hook {
 
     } elsif ($hook eq "update-buildflags") {
 	my $flags = shift @params;
+	if (debarch_eq(get_host_arch(), 'ppc64')) {
+	    for my $flag (qw(CFLAGS CXXFLAGS FFLAGS)) {
+		$flags->set($flag, '-g -O3', 'vendor');
+	    }
+	}
 	# Per https://wiki.ubuntu.com/DistCompilerFlags
 	$flags->set('LDFLAGS', '-Wl,-Bsymbolic-functions', 'vendor');