summaryrefslogtreecommitdiff
path: root/source4/build/smb_build/input.pl
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-05-13 10:20:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:53:36 -0500
commitf236700ef67d4f93ec56ec7808584552e94e0dfe (patch)
tree3572ba5a82860e9dc60661161997b77704867cdc /source4/build/smb_build/input.pl
parentb2d1f7890765fca5a119d43f4906e885c245005f (diff)
downloadsamba-f236700ef67d4f93ec56ec7808584552e94e0dfe.tar.gz
samba-f236700ef67d4f93ec56ec7808584552e94e0dfe.tar.bz2
samba-f236700ef67d4f93ec56ec7808584552e94e0dfe.zip
r665: merge over the new build system from my tmp branch
to the main SAMBA_4_0 tree. NOTE: that it's not completely ready, but it's functional:-) metze (This used to be commit c78a2ddb28ec50d6570a83b1f66f18a5c3621731)
Diffstat (limited to 'source4/build/smb_build/input.pl')
-rw-r--r--source4/build/smb_build/input.pl128
1 files changed, 128 insertions, 0 deletions
diff --git a/source4/build/smb_build/input.pl b/source4/build/smb_build/input.pl
new file mode 100644
index 0000000000..8b5b904f1e
--- /dev/null
+++ b/source4/build/smb_build/input.pl
@@ -0,0 +1,128 @@
+###########################################################
+### SMB Build System ###
+### - the input checking functions ###
+### ###
+### Copyright (C) Stefan (metze) Metzmacher 2004 ###
+### Released under the GNU GPL ###
+###########################################################
+
+
+sub str2array($)
+{
+ my $str = shift;
+ my @ar = ();
+
+ $str =~ s/^[\t\n ]*//g;
+
+ $str =~ s/[\t\n ]*$//g;
+
+ $str =~ s/([\t\n ]+)/ /g;
+
+ if (length($str)==0) {
+ return ();
+ }
+
+ @ar = split(/[ \t\n]/,$str);
+
+ return @ar;
+}
+
+sub _check_subsystems($)
+{
+ my $CTX = shift;
+
+ foreach my $subsys (sort keys %{$CTX->{INPUT}{SUBSYSTEMS}}) {
+ if ($CTX->{INPUT}{SUBSYSTEMS}{$subsys}{ENABLE} ne "YES") {
+ printf("Subsystem: %s disabled!\n",$CTX->{INPUT}{SUBSYSTEMS}{$subsys}{NAME});
+ next;
+ }
+ }
+
+ return;
+}
+
+sub _check_modules($)
+{
+ my $CTX = shift;
+
+ foreach my $mod (sort keys %{$CTX->{INPUT}{MODULES}}) {
+ my $subsys = $CTX->{INPUT}{MODULES}{$mod}{SUBSYSTEM};
+ my $default_build = $CTX->{INPUT}{MODULES}{$mod}{DEFAULT_BUILD};
+ my $build = $CTX->{INPUT}{MODULES}{$mod}{CHOSEN_BUILD};
+ my $use_default = 0;
+
+ if (!(defined($CTX->{INPUT}{SUBSYSTEMS}{$subsys}))) {
+ $CTX->{INPUT}{MODULES}{$mod}{BUILD} = "NOT";
+ printf("Module: %s...PARENT SUBSYSTEM DISABLED\n",$mod);
+ next;
+ }
+
+ if ($build eq "DEFAULT") {
+ $build = $default_build;
+ $use_default = 1;
+ }
+
+ if ($build eq "SHARED") {
+ $CTX->{INPUT}{MODULES}{$mod}{BUILD} = "SHARED";
+ printf("Module: %s...SHARED\n",$mod);
+ } elsif ($build eq "STATIC") {
+ $CTX->{INPUT}{MODULES}{$mod}{BUILD} = "STATIC";
+ printf("Module: %s...STATIC\n",$mod);
+ } else {
+ $CTX->{INPUT}{MODULES}{$mod}{BUILD} = "NOT";
+ printf("Module: %s...NOT\n",$mod);
+ next;
+ }
+ }
+
+ return;
+}
+
+sub _check_libraries($)
+{
+ my $CTX = shift;
+
+ foreach my $lib (sort keys %{$CTX->{INPUT}{LIBRARIES}}) {
+ if ($CTX->{INPUT}{LIBRARIES}{$lib}{ENABLE} ne "YES") {
+ printf("Library: %s disabled!\n",$CTX->{INPUT}{LIBRARIES}{$lib}{NAME});
+ next;
+ }
+ }
+
+ return;
+}
+
+sub _check_binaries($)
+{
+ my $CTX = shift;
+
+ foreach my $bin (sort keys %{$CTX->{INPUT}{BINARIES}}) {
+ if ($CTX->{INPUT}{BINARIES}{$bin}{ENABLE} ne "YES") {
+ printf("Binary: %s disabled!\n",$CTX->{INPUT}{BINARIES}{$bin}{NAME});
+ next;
+ }
+ }
+
+ return;
+}
+
+###########################################################
+# This function checks the input from the configure script
+#
+# check_input($SMB_BUILD_CTX)
+#
+# $SMB_BUILD_CTX - the global SMB_BUILD context
+sub check_input($)
+{
+ my $CTX = shift;
+
+ _check_subsystems($CTX);
+
+ _check_modules($CTX);
+
+ _check_libraries($CTX);
+
+ _check_binaries($CTX);
+
+ return;
+}