diff options
Diffstat (limited to 'source4/build/smb_build/main.pl')
-rw-r--r-- | source4/build/smb_build/main.pl | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 14897840a6..88289af26d 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -6,16 +6,27 @@ # Released under the GNU GPL use smb_build::makefile; -use smb_build::header; use smb_build::input; use smb_build::config_mk; use smb_build::output; use smb_build::summary; use smb_build::config; +use Getopt::Long; use strict; +my $output_file = "data.mk"; + +my $result = GetOptions ( + 'output=s' => \$output_file); + +if (not $result) { + exit(1); +} + +my $input_file = shift @ARGV; + my $INPUT = {}; -my $mkfile = smb_build::config_mk::run_config_mk($INPUT, $config::config{srcdir}, $config::config{builddir}, "main.mk"); +my $mkfile = smb_build::config_mk::run_config_mk($INPUT, $config::config{srcdir}, $config::config{builddir}, $input_file); my $subsys_output_type = ["MERGED_OBJ"]; @@ -44,27 +55,24 @@ my $mkenv = new smb_build::makefile(\%config::config, $mkfile); my $shared_libs_used = 0; foreach my $key (values %$OUTPUT) { + next if ($key->{ENABLE} ne "YES"); push(@{$mkenv->{all_objs}}, "\$($key->{NAME}_OBJ_FILES)"); } foreach my $key (values %$OUTPUT) { next unless defined $key->{OUTPUT_TYPE}; + $mkenv->StaticLibraryPrimitives($key) if grep(/STATIC_LIBRARY/, @{$key->{OUTPUT_TYPE}}); $mkenv->MergedObj($key) if grep(/MERGED_OBJ/, @{$key->{OUTPUT_TYPE}}); - $mkenv->StaticLibraryPrimitives($key) if grep(/STATIC_LIBRARY/, @{$key->{OUTPUT_TYPE}}); - if (defined($key->{PC_FILE})) { - $mkenv->output("PC_FILES += $key->{BASEDIR}/$key->{PC_FILE}\n"); - } $mkenv->SharedLibraryPrimitives($key) if ($key->{TYPE} eq "LIBRARY") and grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); if ($key->{TYPE} eq "LIBRARY" and ${$key->{OUTPUT_TYPE}}[0] eq "SHARED_LIBRARY") { $shared_libs_used = 1; } - $mkenv->SharedModulePrimitives($key) if ($key->{TYPE} eq "MODULE" or - $key->{TYPE} eq "PYTHON") and - grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); - $mkenv->PythonFiles($key) if defined($key->{PYTHON_FILES}); + if ($key->{TYPE} eq "MODULE" and @{$key->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ" and defined($key->{INIT_FUNCTION})) { + $mkenv->output("$key->{SUBSYSTEM}_INIT_FUNCTIONS += $key->{INIT_FUNCTION},\n"); + } $mkenv->CFlags($key); } @@ -80,15 +88,14 @@ foreach my $key (values %$OUTPUT) { $mkenv->SharedLibrary($key) if ($key->{TYPE} eq "LIBRARY") and grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); - $mkenv->SharedModule($key) if ($key->{TYPE} eq "MODULE" or - $key->{TYPE} eq "PYTHON") and - grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); + $mkenv->SharedModule($key) if ($key->{TYPE} eq "MODULE" and + grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}})); + $mkenv->PythonModule($key) if ($key->{TYPE} eq "PYTHON"); $mkenv->Binary($key) if grep(/BINARY/, @{$key->{OUTPUT_TYPE}}); - $mkenv->ProtoHeader($key) if defined($key->{PRIVATE_PROTO_HEADER}); + $mkenv->InitFunctions($key) if defined($key->{INIT_FUNCTIONS}); } -$mkenv->write("data.mk"); -header::create_smb_build_h($OUTPUT, "include/build.h"); +$mkenv->write($output_file); summary::show($OUTPUT, \%config::config); |