mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
Merge env.pm into makefile.pm.
This commit is contained in:
parent
e33f357fb0
commit
28bbd54619
@ -1,57 +0,0 @@
|
|||||||
# Environment class
|
|
||||||
#
|
|
||||||
# Samba Build Environment
|
|
||||||
#
|
|
||||||
# (C) 2005 Jelmer Vernooij <jelmer@samba.org>
|
|
||||||
#
|
|
||||||
# Published under the GNU GPL
|
|
||||||
|
|
||||||
package smb_build::env;
|
|
||||||
use smb_build::input;
|
|
||||||
use File::Path;
|
|
||||||
use File::Basename;
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
|
|
||||||
sub new($$)
|
|
||||||
{
|
|
||||||
my ($name, $config) = @_;
|
|
||||||
my $self = { };
|
|
||||||
bless $self, $name;
|
|
||||||
|
|
||||||
$self->{items} = {};
|
|
||||||
$self->{info} = {};
|
|
||||||
|
|
||||||
$self->_set_config($config);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub _set_config($$)
|
|
||||||
{
|
|
||||||
my ($self, $config) = @_;
|
|
||||||
|
|
||||||
$self->{config} = $config;
|
|
||||||
|
|
||||||
if (not defined($self->{config}->{srcdir})) {
|
|
||||||
$self->{config}->{srcdir} = '.';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (not defined($self->{config}->{builddir})) {
|
|
||||||
$self->{config}->{builddir} = '.';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($self->{config}->{prefix} eq "NONE") {
|
|
||||||
$self->{config}->{prefix} = $self->{config}->{ac_default_prefix};
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($self->{config}->{exec_prefix} eq "NONE") {
|
|
||||||
$self->{config}->{exec_prefix} = $self->{config}->{prefix};
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{developer} = ($self->{config}->{developer} eq "yes");
|
|
||||||
$self->{gnu_make} = ($self->{config}->{GNU_MAKE} eq "yes");
|
|
||||||
$self->{automatic_deps} = ($self->{config}->{automatic_dependencies} eq "yes");
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
@ -10,7 +10,6 @@ use smb_build::header;
|
|||||||
use smb_build::input;
|
use smb_build::input;
|
||||||
use smb_build::config_mk;
|
use smb_build::config_mk;
|
||||||
use smb_build::output;
|
use smb_build::output;
|
||||||
use smb_build::env;
|
|
||||||
use smb_build::cflags;
|
use smb_build::cflags;
|
||||||
use smb_build::summary;
|
use smb_build::summary;
|
||||||
use smb_build::config;
|
use smb_build::config;
|
||||||
|
@ -6,21 +6,21 @@
|
|||||||
# Released under the GNU GPL
|
# Released under the GNU GPL
|
||||||
|
|
||||||
package smb_build::makefile;
|
package smb_build::makefile;
|
||||||
use smb_build::env;
|
|
||||||
use smb_build::output;
|
use smb_build::output;
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
use base 'smb_build::env';
|
|
||||||
use Cwd 'abs_path';
|
use Cwd 'abs_path';
|
||||||
|
|
||||||
sub new($$$)
|
sub new($$$)
|
||||||
{
|
{
|
||||||
my ($myname, $config, $mkfile) = @_;
|
my ($myname, $config, $mkfile) = @_;
|
||||||
my $self = new smb_build::env($config);
|
my $self = {};
|
||||||
|
|
||||||
bless($self, $myname);
|
bless($self, $myname);
|
||||||
|
|
||||||
|
$self->_set_config($config);
|
||||||
|
|
||||||
$self->{output} = "";
|
$self->{output} = "";
|
||||||
|
|
||||||
$self->{mkfile} = $mkfile;
|
$self->{mkfile} = $mkfile;
|
||||||
@ -38,6 +38,29 @@ sub new($$$)
|
|||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub _set_config($$)
|
||||||
|
{
|
||||||
|
my ($self, $config) = @_;
|
||||||
|
|
||||||
|
$self->{config} = $config;
|
||||||
|
|
||||||
|
if (not defined($self->{config}->{srcdir})) {
|
||||||
|
$self->{config}->{srcdir} = '.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (not defined($self->{config}->{builddir})) {
|
||||||
|
$self->{config}->{builddir} = '.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($self->{config}->{prefix} eq "NONE") {
|
||||||
|
$self->{config}->{prefix} = $self->{config}->{ac_default_prefix};
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($self->{config}->{exec_prefix} eq "NONE") {
|
||||||
|
$self->{config}->{exec_prefix} = $self->{config}->{prefix};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub output($$)
|
sub output($$)
|
||||||
{
|
{
|
||||||
my ($self, $text) = @_;
|
my ($self, $text) = @_;
|
||||||
|
Loading…
Reference in New Issue
Block a user