]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Buildsystem.pm
support unlimited parallel jobs
[debhelper.git] / Debian / Debhelper / Buildsystem.pm
index 62c45b5d3a2ce8b0dfd42056262f8c6ec3039d63..7354963d8c5a69114d2e081d12647ed34b9b9e0d 100644 (file)
@@ -47,7 +47,9 @@ sub DEFAULT_BUILD_DIRECTORY {
 #                  specified or empty, defaults to the current directory.
 # - builddir -     specifies build directory to use. Path is relative to the
 #                  current (top) directory. If undef or empty,
-#                  DEFAULT_BUILD_DIRECTORY directory will be used. 
+#                  DEFAULT_BUILD_DIRECTORY directory will be used.
+# - parallel -     max number of parallel processes to be spawned for building
+#                  sources (-1 = unlimited; 1 = no parallel)
 # Derived class can override the constructor to initialize common object
 # parameters. Do NOT use constructor to execute commands or otherwise
 # configure/setup build environment. There is absolutely no guarantee the
@@ -58,6 +60,7 @@ sub new {
 
        my $this = bless({ sourcedir => '.',
                           builddir => undef,
+                          parallel => undef,
                           cwd => Cwd::getcwd() }, $class);
 
        if (exists $opts{sourcedir}) {
@@ -71,6 +74,9 @@ sub new {
        if (exists $opts{builddir}) {
                $this->_set_builddir($opts{builddir});
        }
+       if (defined $opts{parallel}) {
+               $this->{parallel} = $opts{parallel};
+       }
        return $this;
 }
 
@@ -243,6 +249,11 @@ sub get_source_rel2builddir {
        return $dir;
 }
 
+sub get_parallel {
+       my $this=shift;
+       return $this->{parallel};
+}
+
 # When given a relative path to the build directory, converts it
 # to the path that is relative to the source directory. If $path is
 # not given, returns a path to the build directory that is relative