diff options
Diffstat (limited to 'source4/build/smb_build/input.pm')
-rw-r--r-- | source4/build/smb_build/input.pm | 56 |
1 files changed, 21 insertions, 35 deletions
diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 3ca2f22f0c..a76da496d9 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -94,10 +94,8 @@ sub check_module($$$) unless (defined($mod->{INIT_FUNCTION_SENTINEL})) { $mod->{INIT_FUNCTION_SENTINEL} = "NULL"; } if (not defined($mod->{OUTPUT_TYPE})) { - if (not defined($INPUT->{$mod->{SUBSYSTEM}}->{TYPE})) { - die("Invalid type for subsystem $mod->{SUBSYSTEM}"); - } - if ($INPUT->{$mod->{SUBSYSTEM}}->{TYPE} eq "EXT_LIB") { + if ((not defined($INPUT->{$mod->{SUBSYSTEM}}->{TYPE})) or + $INPUT->{$mod->{SUBSYSTEM}}->{TYPE} eq "EXT_LIB") { $mod->{OUTPUT_TYPE} = undef; } else { $mod->{OUTPUT_TYPE} = $default_ot; @@ -140,24 +138,12 @@ sub check_python($$$) $python->{INSTALLDIR} = "PYTHONDIR"; unless (defined($python->{CFLAGS})) { $python->{CFLAGS} = []; } - if (defined($python->{SWIG_FILE})) { - my $dirname = dirname($python->{SWIG_FILE}); - my $basename = basename($python->{SWIG_FILE}, ".i"); - - $dirname .= "/" unless $dirname =~ /\/$/; - $dirname = "" if $dirname eq "./"; - - $python->{LIBRARY_REALNAME} = "_$basename.\$(SHLIBEXT)"; - $python->{PYTHON_FILES} = ["$dirname$basename.py"]; - push (@{$python->{CFLAGS}}, "\$(CFLAG_NO_UNUSED_MACROS)"); - push (@{$python->{CFLAGS}}, "\$(CFLAG_NO_CAST_QUAL)"); - $python->{INIT_FUNCTION} = "{ (char *)\"_$basename\", init_$basename }"; - } else { - my $basename = $python->{NAME}; - $basename =~ s/^python_//g; + my $basename = $python->{NAME}; + $basename =~ s/^python_//g; + unless (defined($python->{LIBRARY_REALNAME})) { $python->{LIBRARY_REALNAME} = "$basename.\$(SHLIBEXT)"; - $python->{INIT_FUNCTION} = "{ (char *)\"$basename\", init$basename }"; } + $python->{INIT_FUNCTION} = "{ (char *)\"$basename\", init$basename }"; push (@{$python->{CFLAGS}}, "\$(EXT_LIB_PYTHON_CFLAGS)"); $python->{SUBSYSTEM} = "LIBPYTHON"; @@ -172,6 +158,8 @@ sub check_binary($$) return if ($bin->{ENABLE} ne "YES"); ($bin->{BINARY} = (lc $bin->{NAME})) if not defined($bin->{BINARY}); + unless (defined($bin->{INIT_FUNCTION_SENTINEL})) { $bin->{INIT_FUNCTION_SENTINEL} = "NULL"; } + unless (defined($bin->{INIT_FUNCTION_TYPE})) { $bin->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; } $bin->{OUTPUT_TYPE} = ["BINARY"]; add_libreplace($bin); @@ -181,15 +169,13 @@ sub add_implicit($$) { my ($INPUT, $n) = @_; - $INPUT->{$n} = { - TYPE => "MAKE_RULE", - NAME => $n, - OUTPUT_TYPE => undef, - LIBS => ["\$(".uc($n)."_LIBS)"], - LDFLAGS => ["\$(".uc($n)."_LDFLAGS)"], - CFLAGS => ["\$(".uc($n)."_CFLAGS)"], - CPPFLAGS => ["\$(".uc($n)."_CPPFLAGS)"] - }; + $INPUT->{$n}->{TYPE} = "MAKE_RULE"; + $INPUT->{$n}->{NAME} = $n; + $INPUT->{$n}->{OUTPUT_TYPE} = undef; + $INPUT->{$n}->{LIBS} = ["\$(".uc($n)."_LIBS)"]; + $INPUT->{$n}->{LDFLAGS} = ["\$(".uc($n)."_LDFLAGS)"]; + $INPUT->{$n}->{CFLAGS} = ["\$(".uc($n)."_CFLAGS)"]; + $INPUT->{$n}->{CPPFLAGS} = ["\$(".uc($n)."_CPPFLAGS)"]; } sub calc_unique_deps($$$$$$$$) @@ -198,7 +184,7 @@ sub calc_unique_deps($$$$$$$$) my ($name, $INPUT, $deps, $udeps, $withlibs, $forward, $pubonly, $busy) = @_; foreach my $n (@$deps) { - add_implicit($INPUT, $n) unless (defined($INPUT->{$n})); + add_implicit($INPUT, $n) unless (defined($INPUT->{$n}) and defined($INPUT->{$n}->{TYPE})); my $dep = $INPUT->{$n}; if (grep (/^$n$/, @$busy)) { next if (@{$dep->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ"); @@ -206,19 +192,19 @@ sub calc_unique_deps($$$$$$$$) } next if (grep /^$n$/, @$udeps); - push (@{$udeps}, $dep->{NAME}) if $forward; + push (@{$udeps}, $n) if $forward; if (defined ($dep->{OUTPUT_TYPE}) && ($withlibs or (@{$dep->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ") or (@{$dep->{OUTPUT_TYPE}}[0] eq "STATIC_LIBRARY"))) { - push (@$busy, $dep->{NAME}); - calc_unique_deps($dep->{NAME}, $INPUT, $dep->{PUBLIC_DEPENDENCIES}, $udeps, $withlibs, $forward, $pubonly, $busy); - calc_unique_deps($dep->{NAME}, $INPUT, $dep->{PRIVATE_DEPENDENCIES}, $udeps, $withlibs, $forward, $pubonly, $busy) unless $pubonly; + push (@$busy, $n); + calc_unique_deps($n, $INPUT, $dep->{PUBLIC_DEPENDENCIES}, $udeps, $withlibs, $forward, $pubonly, $busy); + calc_unique_deps($n, $INPUT, $dep->{PRIVATE_DEPENDENCIES}, $udeps, $withlibs, $forward, $pubonly, $busy) unless $pubonly; pop (@$busy); } - unshift (@{$udeps}, $dep->{NAME}) unless $forward; + unshift (@{$udeps}, $n) unless $forward; } } |