diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-10-28 21:13:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:45:29 -0500 |
commit | a4e7bf3a89a986f0055bb8b6c6890449ca405f39 (patch) | |
tree | 7749f209fd32079a26abb237a2908dd4c6c51baf /source4/build | |
parent | 5a67b508d8f8761f0a73c2f7a116be1693d73395 (diff) | |
download | samba-a4e7bf3a89a986f0055bb8b6c6890449ca405f39.tar.gz samba-a4e7bf3a89a986f0055bb8b6c6890449ca405f39.tar.bz2 samba-a4e7bf3a89a986f0055bb8b6c6890449ca405f39.zip |
r11382: Require number of required M4 macros
Make MODULE handling a bit more like BINARY, LIBRARY and SUBSYSTEM
Add some more PUBLIC_HEADERS
(This used to be commit 875eb8f4cc658e6aebab070029fd499a726ad520)
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/m4/public.m4 | 33 | ||||
-rw-r--r-- | source4/build/smb_build/input.pm | 34 | ||||
-rw-r--r-- | source4/build/smb_build/main.pl | 10 | ||||
-rw-r--r-- | source4/build/smb_build/output.pm | 3 |
4 files changed, 27 insertions, 53 deletions
diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4 index 69bce86f4d..89ea0f3853 100644 --- a/source4/build/m4/public.m4 +++ b/source4/build/m4/public.m4 @@ -4,10 +4,6 @@ dnl Copyright (C) 2004 Stefan Metzmacher dnl Copyright (C) 2004-2005 Jelmer Vernooij dnl Published under the GPL dnl -dnl SMB_MODULE_DEFAULT(name,default_build) -dnl -dnl SMB_SUBSYSTEM_ENABLE(name,default_build) -dnl dnl SMB_SUBSYSTEM(name,init_obj_files,add_obj_files,required_subsystems) dnl dnl SMB_EXT_LIB_ENABLE(name,default_build) @@ -16,36 +12,15 @@ dnl SMB_EXT_LIB_FROM_PKGCONFIG(name,pkg-config name) dnl dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags) dnl -dnl SMB_BINARY_ENABLE(name,default_build) +dnl SMB_ENABLE(name,default_build) dnl dnl ####################################################### dnl ### And now the implementation ### dnl ####################################################### -dnl SMB_MODULE_DEFAULT(name,default_build) -AC_DEFUN([SMB_MODULE_DEFAULT], -[ - [SMB_MODULE_DEFAULT][$1]="$2" -SMB_INFO_ENABLES="$SMB_INFO_ENABLES -\$enabled{$1} = \"$2\";" -]) - -dnl SMB_SUBSYSTEM_ENABLE(name,default_build) -AC_DEFUN([SMB_SUBSYSTEM_ENABLE], -[ - [SMB_SUBSYSTEM_ENABLE_][$1]="$2" -SMB_INFO_ENABLES="$SMB_INFO_ENABLES -\$enabled{$1} = \"$2\";" -]) - dnl SMB_SUBSYSTEM(name,init_obj_files,add_obj_files,required_subsystems) AC_DEFUN([SMB_SUBSYSTEM], [ - - if test -z "$[SMB_SUBSYSTEM_ENABLE_][$1]"; then - [SMB_SUBSYSTEM_ENABLE_][$1]="YES"; - fi - if test -z "$[SMB_SUBSYSTEM_NOPROTO_][$1]"; then [SMB_SUBSYSTEM_NOPROTO_][$1]="NO"; fi @@ -148,10 +123,10 @@ LDFLAGS = $5 " ]) -dnl SMB_BINARY_ENABLE(name,default_build) -AC_DEFUN([SMB_BINARY_ENABLE], +dnl SMB_ENABLE(name,default_build) +AC_DEFUN([SMB_ENABLE], [ - [SMB_BINARY_ENABLE_][$1]="$2"; + [SMB_ENABLE_][$1]="$2"; SMB_INFO_ENABLES="$SMB_INFO_ENABLES \$enabled{$1} = \"$2\";" diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 88d7c24af8..5dcbb8c904 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -10,10 +10,11 @@ use strict; package smb_build::input; -use vars qw($library_output_type $subsystem_output_type); +use vars qw($library_output_type $subsystem_output_type $module_output_type); $library_output_type = "OBJ_LIST"; $subsystem_output_type = "OBJ_LIST"; +$module_output_type = "OBJ_LIST"; my $srcdir = "."; sub strtrim($) @@ -54,43 +55,32 @@ sub check_module($$) die("Module $mod->{NAME} does not have a SUBSYSTEM set") if not defined($mod->{SUBSYSTEM}); - ($mod->{DEFAULT_BUILD} = "STATIC") if not defined($mod->{DEFAULT_BUILD}); - my $use_default = 0; if (!(defined($INPUT->{$mod->{SUBSYSTEM}}))) { - $mod->{BUILD} = "NOT"; $mod->{ENABLE} = "NO"; return; } - if (($mod->{ENABLE} eq "STATIC") or - ($mod->{ENABLE} eq "NOT") or - ($mod->{ENABLE} eq "SHARED")) { - $mod->{DEFAULT_BUILD} = $mod->{ENABLE}; - } elsif ($mod->{ENABLE} ne "YES") + if ($mod->{ENABLE} ne "YES") { - $mod->{CHOSEN_BUILD} = "NOT"; + printf("Module `%s' disabled\n",$mod->{NAME}); + return; } - if (not defined($mod->{CHOSEN_BUILD}) or $mod->{CHOSEN_BUILD} eq "DEFAULT") + if (defined($mod->{CHOSEN_BUILD}) and $mod->{CHOSEN_BUILD} ne "DEFAULT") { - $mod->{CHOSEN_BUILD} = $mod->{DEFAULT_BUILD}; + $mod->{OUTPUT_TYPE} = $mod->{CHOSEN_BUILD}; + } else { + $mod->{OUTPUT_TYPE} = $module_output_type; } - if ($mod->{CHOSEN_BUILD} eq "SHARED") { - $mod->{ENABLE} = "YES"; - $mod->{OUTPUT_TYPE} = "SHARED_LIBRARY"; + if ($mod->{OUTPUT_TYPE} eq "SHARED_LIBRARY" or + $mod->{OUTPUT_TYPE} eq "STATIC_LIBRARY") { $mod->{INSTALLDIR} = "LIBDIR/$mod->{SUBSYSTEM}"; push (@{$mod->{REQUIRED_SUBSYSTEMS}}, $mod->{SUBSYSTEM}); - } elsif ($mod->{CHOSEN_BUILD} eq "STATIC") { - $mod->{ENABLE} = "YES"; - push (@{$INPUT->{$mod->{SUBSYSTEM}}{REQUIRED_SUBSYSTEMS}}, $mod->{NAME}); - $mod->{OUTPUT_TYPE} = $subsystem_output_type; } else { - $mod->{ENABLE} = "NO"; - printf("Module `%s' disabled\n",$mod->{NAME}); - return; + push (@{$INPUT->{$mod->{SUBSYSTEM}}{REQUIRED_SUBSYSTEMS}}, $mod->{NAME}); } } diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index a207062d34..1bc4d45aaa 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -37,6 +37,16 @@ if (defined($ENV{"LIBRARY_OUTPUT_TYPE"})) { $smb_build::input::library_output_type = "MERGEDOBJ"; } +if (defined($ENV{"MODULE_OUTPUT_TYPE"})) { + $smb_build::input::module_output_type = $ENV{MODULE_OUTPUT_TYPE}; +} elsif ($config::config{BLDSHARED} eq "true") { + #FIXME: This should eventually become SHARED_LIBRARY + # rather then MERGEDOBJ once I'm certain it works ok -- jelmer + $smb_build::input::module_output_type = "MERGEDOBJ"; +} elsif ($config::config{BLDMERGED} eq "true") { + $smb_build::input::module_output_type = "MERGEDOBJ"; +} + my $DEPEND = smb_build::input::check($INPUT, \%config::enabled); my $OUTPUT = output::create_output($DEPEND); my $mkenv = new smb_build::makefile(\%config::config, $mkfile); diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 2dc74562f6..d7618766f6 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -161,9 +161,8 @@ sub create_output($) push(@{$part->{DEPEND_LIST}}, $elem->{TARGET}) if defined($elem->{TARGET}); } push(@{$part->{SUBSYSTEM_INIT_FUNCTIONS}}, $elem->{INIT_FUNCTION}) if - $part->{OUTPUT_TYPE} eq "BINARY" and + #$part->{OUTPUT_TYPE} eq "BINARY" and defined($elem->{INIT_FUNCTION}) and - $elem->{INIT_FUNCTION} ne "" and $part->{OUTPUT_TYPE} ne "SHARED_LIBRARY"; } } |