Author: jelmer Date: 2004-11-14 16:51:32 +0000 (Sun, 14 Nov 2004) New Revision: 3735
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3735 Log: Allow building subsystems as static libraries (.a files). To enable this support, run SUBSYSTEM_OUTPUT_TYPE=STATIC_LIBRARY ./config.status I haven't enabled this by default because there are some circular dependencies in the makefile that have to be resolved first (LIBRPC depends on LIBSMB and LIBSMB depends on LIBRPC..) Modified: branches/SAMBA_4_0/source/build/smb_build/input.pm branches/SAMBA_4_0/source/build/smb_build/makefile.pm branches/SAMBA_4_0/source/build/smb_build/output.pm branches/SAMBA_4_0/source/libcli/auth/gensec.mk Changeset: Modified: branches/SAMBA_4_0/source/build/smb_build/input.pm =================================================================== --- branches/SAMBA_4_0/source/build/smb_build/input.pm 2004-11-14 16:34:30 UTC (rev 3734) +++ branches/SAMBA_4_0/source/build/smb_build/input.pm 2004-11-14 16:51:32 UTC (rev 3735) @@ -10,6 +10,7 @@ use strict; package input; +my $subsystem_output_type = "OBJLIST"; our $srcdir = "."; sub strtrim($) @@ -52,8 +53,7 @@ printf("Subsystem: %s disabled!\n",$subsys->{NAME}); } - # FIXME: Make this configurable (so it can be STATIC_LIBRARY, for example) - $subsys->{OUTPUT_TYPE} = "OBJLIST"; + $subsys->{OUTPUT_TYPE} = $subsystem_output_type; } sub check_module($$) @@ -89,7 +89,7 @@ $mod->{ENABLE} = "YES"; push (@{$CTX->{INPUT}{$mod->{SUBSYSTEM}}{REQUIRED_SUBSYSTEMS}}, $mod->{NAME}); printf("Module: %s...static\n",$mod->{NAME}); - $mod->{OUTPUT_TYPE} = "OBJLIST"; + $mod->{OUTPUT_TYPE} = $subsystem_output_type; } else { $mod->{ENABLE} = "NO"; printf("Module: %s...not\n",$mod->{NAME}); @@ -151,6 +151,8 @@ { my $CTX = shift; + ($subsystem_output_type = $ENV{SUBSYSTEM_OUTPUT_TYPE}) if (defined($ENV{"SUBSYSTEM_OUTPUT_TYPE"})); + foreach my $part (values %{$CTX->{INPUT}}) { ($part->{ENABLE} = "YES") if not defined($part->{ENABLE}); } Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm =================================================================== --- branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2004-11-14 16:34:30 UTC (rev 3734) +++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2004-11-14 16:51:32 UTC (rev 3735) @@ -425,13 +425,11 @@ LIBRARY_$ctx->{NAME}_DEPEND_LIST =$tmpdepend # LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST =$tmpstlink -LIBRARY_$ctx->{NAME}_STATIC_LINK_FLAGS =$tmpstflag # # Static $ctx->{LIBRARY_NAME} -bin/$ctx->{LIBRARY_NAME}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy +$ctx->{OUTPUT}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy [EMAIL PROTECTED] Linking \$\@ [EMAIL PROTECTED](STLD) \$(STLD_FLAGS) \$\@ \\ - \$(LIBRARY_$ctx->{NAME}_STATIC_LINK_FLAGS) \\ \$(LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST) library_$ctx->{NAME}: basics $tmprules Modified: branches/SAMBA_4_0/source/build/smb_build/output.pm =================================================================== --- branches/SAMBA_4_0/source/build/smb_build/output.pm 2004-11-14 16:34:30 UTC (rev 3734) +++ branches/SAMBA_4_0/source/build/smb_build/output.pm 2004-11-14 16:51:32 UTC (rev 3735) @@ -43,7 +43,7 @@ @{$lib->{LINK_LIST}} = ("\$($lib->{TYPE}_$lib->{NAME}\_OBJS)"); @{$lib->{LINK_FLAGS}} = (); - $lib->{OUTPUT} = $lib->{LIBRARY_NAME}; + $lib->{OUTPUT} = "bin/$lib->{LIBRARY_NAME}"; } sub generate_binary($) @@ -95,7 +95,7 @@ push(@{$part->{CFLAGS}}, @{$elem->{CFLAGS}}) if defined(@{$elem->{CFLAGS}}); push(@{$part->{DEPEND_LIST}}, $elem->{OUTPUT}) if defined($elem->{OUTPUT}); push(@{$part->{LINK_LIST}}, $elem->{OUTPUT}) if defined($elem->{OUTPUT}); - push(@{$part->{LINK_LIST}}, @{$elem->{LIBS}}) if defined($elem->{LIBS}); + push(@{$part->{LINK_FLAGS}}, @{$elem->{LIBS}}) if defined($elem->{LIBS}); push(@{$part->{LINK_FLAGS}},@{$elem->{LDFLAGS}}) if defined($elem->{LDFLAGS}); push(@{$part->{MODULE_INIT_FUNCTIONS}}, @{$elem->{INIT_FUNCTION}}) if Modified: branches/SAMBA_4_0/source/libcli/auth/gensec.mk =================================================================== --- branches/SAMBA_4_0/source/libcli/auth/gensec.mk 2004-11-14 16:34:30 UTC (rev 3734) +++ branches/SAMBA_4_0/source/libcli/auth/gensec.mk 2004-11-14 16:51:32 UTC (rev 3735) @@ -19,7 +19,7 @@ libcli/auth/kerberos.o \ libcli/auth/kerberos_verify.o \ libcli/auth/gssapi_parse.o -REQUIRED_SUBSYSTEMS = GENSEC EXT_LIB_KRB5 +REQUIRED_SUBSYSTEMS = EXT_LIB_KRB5 # End MODULE gensec_krb5 ################################################ @@ -31,7 +31,6 @@ INIT_OBJ_FILES = libcli/auth/spnego.o ADD_OBJ_FILES = \ libcli/auth/spnego_parse.o -REQUIRED_SUBSYSTEMS = GENSEC # End MODULE gensec_spnego ################################################ @@ -45,6 +44,6 @@ libcli/auth/ntlmssp.o \ libcli/auth/ntlmssp_parse.o \ libcli/auth/ntlmssp_sign.o -REQUIRED_SUBSYSTEMS = GENSEC AUTH +REQUIRED_SUBSYSTEMS = AUTH # End MODULE gensec_ntlmssp ################################################