Bug 8907 - The process of building out-of-tree VFS modules is too hard
The process of building out-of-tree VFS modules is too hard
Status: RESOLVED DUPLICATE of bug 8822
Product: Samba 3.6
Classification: Unclassified
Component: VFS Modules
All All
: P5 normal
: ---
Assigned To: Samba Bugzilla Account
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2012-04-29 17:42 UTC by Richard Sharpe
Modified: 2012-05-08 14:21 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Richard Sharpe 2012-04-29 17:42:35 UTC
When people are building out-of-tree VFS modules they have to use have an initialization entry point called samba_init_module, but if the module is ever moved into the source tree, that entry point has to change to <vfs_name>_init and the main Samba build infrastructure does the correct things for Shared modules vs statically linked modules.

This makes the process hard to describe and understand.

A simpler approach would be to change Makefile.in in examples/VFS to perform the same magic that the main build infrastructure does.

These changes are made in checkins: 1080483319d4eb7a8cdee767fc41f7258e0e2537 and a15aefea27fffcbf622f7032e5d50628189a49bd

This is the last change:

commit 1080483319d4eb7a8cdee767fc41f7258e0e2537
Author: Richard Sharpe <realrichardsharpe@gmail.com>
Date:   Fri Mar 23 21:27:41 2012 -0700

    Improve the Makefile. Use a standard make macro, not a shell command.
    Autobuild-User: Richard Sharpe <sharpe@samba.org>
    Autobuild-Date: Sat Mar 24 07:09:44 CET 2012 on sn-devel-104

diff --git a/examples/VFS/Makefile.in b/examples/VFS/Makefile.in
index 55e2c04..f9b81eb 100644
--- a/examples/VFS/Makefile.in
+++ b/examples/VFS/Makefile.in
@@ -45,7 +45,7 @@ skel_transparent.@SHLIBEXT@: skel_transparent.@OBJEXT@
        @echo "Compiling $<"
-       @$(CC) $(FLAGS) -c $< -D$(basename $@)_init=samba_init_module
+       @$(CC) $(FLAGS) -c $< -D$*_init=samba_init_module
 install: default
Comment 1 Richard Sharpe 2012-04-29 17:44:37 UTC
A similar, but slightly different change can be made to the v3-6.test branch:

--- examples/VFS/Makefile.in	2012-04-22 17:30:45.631698392 -0700
+++ examples/VFS/Makefile.in.new	2012-04-22 17:30:20.619140189 -0700
@@ -36,7 +36,7 @@
 %.$(OBJEXT): %.c
 	@echo "Compiling $<"
-	@$(CC) $(FLAGS) -c $<
+	@$(CC) $(FLAGS) -c $< -D$*_init=init_samba_module
 install: default

Please consider taking this patch for the next 3.6.x release so that the lives of VFS writers will be easier.
Comment 2 Richard Sharpe 2012-05-08 14:21:42 UTC

*** This bug has been marked as a duplicate of bug 8822 ***