xmake revision 919
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# Use is subject to license terms.
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# Permission is hereby granted, free of charge, to any person obtaining a
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# copy of this software and associated documentation files (the "Software"),
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# to deal in the Software without restriction, including without limitation
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# the rights to use, copy, modify, merge, publish, distribute, sublicense,
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# and/or sell copies of the Software, and to permit persons to whom the
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# Software is furnished to do so, subject to the following conditions:
088fa5d9eaa83bf4b3d59a64c0519f42a143aaa9Alin Brici# The above copyright notice and this permission notice (including the next
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# paragraph) shall be included in all copies or substantial portions of the
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
4d154727feb7fbe69dd1451fa5462f558e7165c7Brendan Mmiller# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
088fa5d9eaa83bf4b3d59a64c0519f42a143aaa9Alin Brici# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
088fa5d9eaa83bf4b3d59a64c0519f42a143aaa9Alin Brici# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# DEALINGS IN THE SOFTWARE.
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# Arguments: (envvar, defval)
4d154727feb7fbe69dd1451fa5462f558e7165c7Brendan Mmiller# If environment variable 'envvar' is not set, set it to 'defval'
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay my $program = shift @_;
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay or die "$0: exec of $program failed: $OS_ERROR";
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# save full path to current directory
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemaymy $startdir = File::Spec->rel2abs(File::Spec->curdir());
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# climb the tree to find the open-src module directory we're in
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay if (-f File::Spec->catfile( @dirtree[0..$n], 'common/Makefile.inc')) {
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay if (-f File::Spec->catfile( @dirtree[0..($n-1)],
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay die "$0: Cannot find path to open-src/common/Makefile.inc from here";
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay# Use dmake unless user environment overrides
102cd62c1b6b55d0dee627930d058a8cc36e2b4fJason Lemay # Set dmake environment for parallel builds by default
last;
last;
$max_jobs = 0;
$max_jobs++;
my $dmake_odir =
chdir $moduledir