]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Dh_Buildsystems.pm
cmake: Pass CPPFLAGS in CFLAGS. Closes: #668813 Thanks, Simon Ruderich for the patch...
[debhelper.git] / Debian / Debhelper / Dh_Buildsystems.pm
index f6c123c5800bad09a7e1990e701e6bc041ccd898..0a51a4d228ea6fa81cf5df75d8640d8e82f358a1 100644 (file)
@@ -20,12 +20,15 @@ use constant BUILD_STEPS => qw(configure build test install clean);
 # build systems MUST be added to the END of the list.
 our @BUILDSYSTEMS = (
        "autoconf",
+       (! compat(7) ? "perl_build" : ()),
        "perl_makemaker",
        "makefile",
        "python_distutils",
-       "perl_build",
+       (compat(7) ? "perl_build" : ()),
        "cmake",
        "ant",
+       "qmake",
+       "qmake_qt4",
 );
 
 my $opt_buildsys;
@@ -135,14 +138,14 @@ sub load_all_buildsystems {
 
 sub buildsystems_init {
        my %args=@_;
-       
-       my $max_parallel=-1; # unlimited
+
+       my $max_parallel=1;
 
        # Available command line options
        my %options = (
            "D=s" => \$opt_sourcedir,
            "sourcedirectory=s" => \$opt_sourcedir,
-       
+
            "B:s" => \$opt_builddir,
            "builddirectory:s" => \$opt_builddir,
 
@@ -152,31 +155,24 @@ sub buildsystems_init {
            "l" => \$opt_list,
            "list" => \$opt_list,
 
+           "parallel" => sub { $max_parallel = -1 },
            "max-parallel=i" => \$max_parallel,
        );
        $args{options}{$_} = $options{$_} foreach keys(%options);
        Debian::Debhelper::Dh_Lib::init(%args);
+       Debian::Debhelper::Dh_Lib::set_buildflags();
        set_parallel($max_parallel);
 }
 
 sub set_parallel {
        my $max=shift;
 
-       $opt_parallel=1;
-
-       if (exists $ENV{DEB_BUILD_OPTIONS}) {
-               # Parse parallel=n tag
-               foreach my $opt (split(/\s+/, $ENV{DEB_BUILD_OPTIONS})) {
-                       if ($opt =~ /^parallel=([-\d]+)$/) {
-                               my $n=$1;
-                               if ($n > 0 && ($max == -1 || $n < $max)) {
-                                       $opt_parallel = $n;
-                               }
-                               else {
-                                       $opt_parallel = $max;
-                               }
-                       }
-               }
+       # Get number of processes from parallel=n option, limiting it
+       # with $max if needed
+       $opt_parallel=get_buildoption("parallel") || 1;
+
+       if ($max > 0 && $opt_parallel > $max) {
+               $opt_parallel = $max;
        }
 }