diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-02-19 14:45:23 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-02-19 14:45:23 +1100 |
commit | e51ec1d8cfbcce0dbc1b4bbe95eef73feffbd1a1 (patch) | |
tree | 643566bbcf1312cd9ae1fed9e235d702c7281a8f /source4/build/smb_build/input.pm | |
parent | 5842df9d0fb71430d1bcda1c4c748589b38ecb00 (diff) | |
parent | 9368ea67cdbb0d1fe5ef2258cc7e8c20c66e6ecd (diff) | |
download | samba-e51ec1d8cfbcce0dbc1b4bbe95eef73feffbd1a1.tar.gz samba-e51ec1d8cfbcce0dbc1b4bbe95eef73feffbd1a1.tar.bz2 samba-e51ec1d8cfbcce0dbc1b4bbe95eef73feffbd1a1.zip |
Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-abartlet
(This used to be commit 837eb8a0bc011cd84bc7e8d2849028313d709928)
Diffstat (limited to 'source4/build/smb_build/input.pm')
-rw-r--r-- | source4/build/smb_build/input.pm | 86 |
1 files changed, 33 insertions, 53 deletions
diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 51c89a834f..da90e9db48 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -5,13 +5,10 @@ # Copyright (C) Jelmer Vernooij 2004 # Released under the GNU GPL -use smb_build::config; use strict; package smb_build::input; use File::Basename; -my $srcdir = $config::config{srcdir}; - sub strtrim($) { $_ = shift; @@ -60,14 +57,9 @@ sub check_subsystem($$$) my ($INPUT, $subsys, $default_ot) = @_; return if ($subsys->{ENABLE} ne "YES"); - unless(defined($subsys->{OUTPUT_TYPE})) { - $subsys->{OUTPUT_TYPE} = $default_ot; - } - + unless (defined($subsys->{OUTPUT_TYPE})) { $subsys->{OUTPUT_TYPE} = $default_ot; } unless (defined($subsys->{INIT_FUNCTION_TYPE})) { $subsys->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; } unless (defined($subsys->{INIT_FUNCTION_SENTINEL})) { $subsys->{INIT_FUNCTION_SENTINEL} = "NULL"; } - - add_libreplace($subsys); } sub check_module($$$) @@ -76,18 +68,16 @@ sub check_module($$$) die("Module $mod->{NAME} does not have a SUBSYSTEM set") if not defined($mod->{SUBSYSTEM}); - my $use_default = 0; - if (not exists($INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTIONS})) { $INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTIONS} = []; } if (!(defined($INPUT->{$mod->{SUBSYSTEM}}))) { - $mod->{ENABLE} = "NO"; - return; + die("Unknown subsystem $mod->{SUBSYSTEM} for module $mod->{NAME}"); } if ($INPUT->{$mod->{SUBSYSTEM}} eq "NO") { + warn("Disabling module $mod->{NAME} because subsystem $mod->{SUBSYSTEM} is disabled"); $mod->{ENABLE} = "NO"; return; } @@ -102,7 +92,7 @@ sub check_module($$$) if (not defined($mod->{OUTPUT_TYPE})) { if ($INPUT->{$mod->{SUBSYSTEM}}->{TYPE} eq "EXT_LIB") { - $mod->{OUTPUT_TYPE} = ["SHARED_LIBRARY"]; + $mod->{OUTPUT_TYPE} = undef; } else { $mod->{OUTPUT_TYPE} = $default_ot; } @@ -113,11 +103,12 @@ sub check_module($$$) $sane_subsystem =~ s/^lib//; $mod->{INSTALLDIR} = "MODULESDIR/$sane_subsystem"; push (@{$mod->{PUBLIC_DEPENDENCIES}}, $mod->{SUBSYSTEM}); + add_libreplace($mod); } - if (grep(/INTEGRATED/, @{$mod->{OUTPUT_TYPE}})) { + if (grep(/MERGED_OBJ/, @{$mod->{OUTPUT_TYPE}})) { push (@{$INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTIONS}}, $mod->{INIT_FUNCTION}) if defined($mod->{INIT_FUNCTION}); + unshift (@{$INPUT->{$mod->{SUBSYSTEM}}{PRIVATE_DEPENDENCIES}}, $mod->{NAME}); } - add_libreplace($mod); } sub check_library($$$) @@ -126,9 +117,7 @@ sub check_library($$$) return if ($lib->{ENABLE} ne "YES"); - unless (defined($lib->{OUTPUT_TYPE})) { - $lib->{OUTPUT_TYPE} = $default_ot; - } + unless (defined($lib->{OUTPUT_TYPE})) { $lib->{OUTPUT_TYPE} = $default_ot; } if (defined($lib->{VERSION}) and not defined($lib->{SO_VERSION})) { print "$lib->{NAME}: Please specify SO_VERSION when specifying VERSION\n"; @@ -141,12 +130,8 @@ sub check_library($$$) } unless (defined($lib->{INIT_FUNCTION_TYPE})) { $lib->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; } - unless (defined($lib->{INIT_FUNCTION_SENTINEL})) { $lib->{INIT_FUNCTION_SENTINEL} = "NULL"; } - - unless(defined($lib->{INSTALLDIR})) { - $lib->{INSTALLDIR} = "LIBDIR"; - } + unless (defined($lib->{INSTALLDIR})) { $lib->{INSTALLDIR} = "LIBDIR"; } add_libreplace($lib); } @@ -169,8 +154,8 @@ sub check_python($$$) $python->{OBJ_FILES} = ["$dirname$basename\_wrap.o"]; $python->{LIBRARY_REALNAME} = "_$basename.\$(SHLIBEXT)"; $python->{PYTHON_FILES} = ["$dirname$basename.py"]; - push (@{$python->{CFLAGS}}, $config::config{CFLAG_NO_UNUSED_MACROS}); - push (@{$python->{CFLAGS}}, $config::config{CFLAG_NO_CAST_QUAL}); + 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}; @@ -178,7 +163,7 @@ sub check_python($$$) $python->{LIBRARY_REALNAME} = "$basename.\$(SHLIBEXT)"; $python->{INIT_FUNCTION} = "{ (char *)\"$basename\", init$basename }"; } - push (@{$python->{CFLAGS}}, @{$INPUT->{EXT_LIB_PYTHON}->{CFLAGS}}); + push (@{$python->{CFLAGS}}, "\$(EXT_LIB_PYTHON_CFLAGS)"); $python->{SUBSYSTEM} = "LIBPYTHON"; @@ -197,25 +182,20 @@ sub check_binary($$) add_libreplace($bin); } -sub import_integrated($$) +sub add_implicit($$) { - my ($lib, $depend) = @_; - - foreach my $mod (values %$depend) { - next if(not defined($mod->{OUTPUT_TYPE})); - next if(not grep(/INTEGRATED/, @{$mod->{OUTPUT_TYPE}})); - next if(not defined($mod->{SUBSYSTEM})); - next if($mod->{SUBSYSTEM} ne $lib->{NAME}); - next if($mod->{ENABLE} ne "YES"); - - push (@{$lib->{FULL_OBJ_LIST}}, "\$($mod->{NAME}_OBJ_LIST)"); - push (@{$lib->{LINK_FLAGS}}, "\$($mod->{NAME}_LINK_FLAGS)"); - push (@{$lib->{CFLAGS}}, @{$mod->{CFLAGS}}) if defined($mod->{CFLAGS}); - push (@{$lib->{PUBLIC_DEPENDENCIES}}, @{$mod->{PUBLIC_DEPENDENCIES}}) if defined($mod->{PUBLIC_DEPENDENCIES}); - push (@{$lib->{PRIVATE_DEPENDENCIES}}, @{$mod->{PRIVATE_DEPENDENCIES}}) if defined($mod->{PRIVATE_DEPENDENCIES}); - - $mod->{ENABLE} = "NO"; - } + my ($INPUT, $n) = @_; + + $INPUT->{$n} = { + TYPE => "MAKE_RULE", + NAME => $n, + TARGET => "", + OUTPUT_TYPE => undef, + LIBS => ["\$(".uc($n)."_LIBS)"], + LDFLAGS => ["\$(".uc($n)."_LDFLAGS)"], + CFLAGS => ["\$(".uc($n)."_CFLAGS)"], + CPPFLAGS => ["\$(".uc($n)."_CPPFLAGS)"] + }; } sub calc_unique_deps($$$$$$$$) @@ -224,16 +204,19 @@ sub calc_unique_deps($$$$$$$$) my ($name, $INPUT, $deps, $udeps, $withlibs, $forward, $pubonly, $busy) = @_; foreach my $n (@$deps) { - die("Dependency unknown: $n (for $name)") unless (defined($INPUT->{$n})); - die("Recursive dependency: $n, list: " . join(',', @$busy)) if (grep (/^$n$/, @$busy)); - next if (grep /^$n$/, @$udeps); + add_implicit($INPUT, $n) unless (defined($INPUT->{$n})); my $dep = $INPUT->{$n}; + if (grep (/^$n$/, @$busy)) { + next if (@{$dep->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ"); + die("Recursive dependency: $n, list: " . join(',', @$busy)); + } + next if (grep /^$n$/, @$udeps); push (@{$udeps}, $dep->{NAME}) if $forward; if (defined ($dep->{OUTPUT_TYPE}) && ($withlibs or - (@{$dep->{OUTPUT_TYPE}}[0] eq "INTEGRATED") 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); @@ -280,9 +263,7 @@ sub check($$$$$) } } - foreach my $k (keys %$INPUT) { - my $part = $INPUT->{$k}; - + foreach my $part (values %$INPUT) { $part->{LINK_FLAGS} = []; $part->{FULL_OBJ_LIST} = ["\$($part->{NAME}_OBJ_LIST)"]; @@ -306,7 +287,6 @@ sub check($$$$$) if (defined($part->{INIT_FUNCTIONS})) { push (@{$part->{LINK_FLAGS}}, "\$(DYNEXP)"); } - import_integrated($part, $INPUT); } foreach my $part (values %$INPUT) { |