r14335: Build shared modules in bin/modules/$SUBSYSTEM when in developer mode.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 13 Mar 2006 18:54:33 +0000 (18:54 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:57:13 +0000 (13:57 -0500)
source/build/smb_build/TODO
source/build/smb_build/makefile.pm
source/build/smb_build/output.pm

index b9607cd593a75ffa230be5026e745e9059c75f80..7d6999e973ae53442df63504af8638100bb50a7e 100644 (file)
@@ -1,6 +1,4 @@
 - subdir handler for install headers into a specific directory
-- hack for loading modules locally
- - create 
 - saner names for some of the .pc files
 - .pc files also when there is a public header?
 - get rid of include/structs.h and include/proto.h
@@ -11,5 +9,14 @@
   for each subsystem:
   - include line in Makefile
   - rule in Makefile
-- determine dependencies from #include lines ?
 - install (parts of ?) autogenerated headers
+
+set of test scripts that check the code:
+- configure_check_unused.pl
+- find_unused_macros.pl
+- find_unused_makefilevars.pl
+- find_unused_options.sh
+- findstatic.pl
+- minimal_includes.pl
+- check dependencies based on #include lines ?
+- check whether private headers are not used outside their own subsystem
index 7002bc8844c544fb782b5383b01cb6f9a2ce0a01..1ff2e0cfa6966919af93d1edcf4c52e82570d4db 100644 (file)
@@ -206,15 +206,15 @@ sub SharedLibrary($$)
        my $init_obj = "";
        
        if ($self->{duplicate_build}) {
-               $installdir = "bin/install";
+               $installdir = $ctx->{INSTALLDIR};
        } else {
-               $installdir = "bin";
+               $installdir = $ctx->{BUILDDIR};
        }
 
        if ($ctx->{TYPE} eq "LIBRARY") {
-               push (@{$self->{shared_libs}}, "bin/$ctx->{LIBRARY_REALNAME}");
+               push (@{$self->{shared_libs}}, "$ctx->{BUILDDIR}/$ctx->{LIBRARY_REALNAME}");
        } elsif ($ctx->{TYPE} eq "MODULE") {
-               push (@{$self->{shared_modules}}, "bin/$ctx->{LIBRARY_REALNAME}");
+               push (@{$self->{shared_modules}}, "$ctx->{BUILDDIR}/$ctx->{LIBRARY_REALNAME}");
                push (@{$self->{plugins}}, "$installdir/$ctx->{LIBRARY_REALNAME}");
 
                my $fixedname = $ctx->{NAME};
@@ -267,8 +267,9 @@ __EOD__
                $self->output(<< "__EOD__"
 #
 
-bin/$ctx->{LIBRARY_REALNAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) $init_obj
+$ctx->{TARGET}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) $init_obj
        \@echo Linking \$\@
+       \@mkdir -p $ctx->{BUILDDIR}
        \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \$(LOCAL_LINK_FLAGS) \\
                \$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) $soarg \\
                $init_obj \$($ctx->{TYPE}_$ctx->{NAME}_LINK_LIST)
index 2a0d5928954b00c55f3f956472165715099ecbda..15ce5a78b0b59aeecbe9005350eaa26e61e4ec8b 100644 (file)
@@ -58,12 +58,17 @@ sub generate_shared_library($)
                $lib_name = "lib$link_name";
        }
 
+       $lib->{BUILDDIR} = "bin";
+       $lib->{INSTALLDIR} = "bin/install";
        $lib->{LIBRARY_REALNAME} = $lib->{LIBRARY_NAME} = "$lib_name.\$(SHLIBEXT)";
+
        if (defined($lib->{VERSION})) {
                $lib->{LIBRARY_SONAME} = $lib->{LIBRARY_NAME}.".$lib->{SO_VERSION}";
                $lib->{LIBRARY_REALNAME} = $lib->{LIBRARY_NAME}.".$lib->{VERSION}";
+       } elsif ($lib->{TYPE} eq "MODULE") {
+               $lib->{BUILDDIR} = "bin/modules/$lib->{SUBSYSTEM}";
        }
-       $lib->{TARGET} = "bin/$lib->{LIBRARY_REALNAME}";
+       $lib->{TARGET} = "$lib->{BUILDDIR}/$lib->{LIBRARY_REALNAME}";
        $lib->{OUTPUT} = $lib->{TARGET};
 }
 
@@ -93,7 +98,9 @@ sub generate_binary($)
        @{$bin->{LINK_LIST}} = ("\$($bin->{TYPE}_$bin->{NAME}\_OBJ_LIST)");
        @{$bin->{LINK_FLAGS}} = ();
 
-       $bin->{TARGET} = $bin->{OUTPUT} = "bin/$bin->{NAME}";
+       $bin->{INSTALLDIR} = "bin/install";
+       $bin->{BUILDDIR} = "bin/";
+       $bin->{TARGET} = $bin->{OUTPUT} = "$bin->{BUILDDIR}/$bin->{NAME}";
        $bin->{BINARY} = $bin->{NAME};
 }