Changes To XVFS Build Walkthrough

Changes to "XVFS Build Walkthrough" between 2019-09-17 19:45:16 and 2019-09-17 19:53:08

72
73
74
75
76
77
78
79
80




81
82
83
84
85
86
87
88
89

90
91
92
93
94


95
96
97


98
99
100
101
102

103
104
105
106
107
108
109
72
73
74
75
76
77
78


79
80
81
82
83
84
85
86
87
88
89
90

91
92
93
94


95
96



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111







-
-
+
+
+
+








-
+



-
-
+
+
-
-
-
+
+





+







    0000000000000ed5 T Xvfs_example_Init
                     U memcmp
                     U strlen

## "Standalone"
### Description

The "Standalone" mode is a combined "Client" and "Server" mode.  It does not check for anything
already handling "`//xvfs:/`" and always registers its own `Tcl_Filesystem` handling `//xvfs:/<name>`.
The "Standalone" mode is a logically combined "Client" and "Server" mode.  However, it does not check
for anything already handling "`//xvfs:/`" and always registers its own `Tcl_Filesystem`
handling only `//xvfs:/<name>`.  It does not export an `Xvfs_Register()` function and is
completely standalone (hence the name).

It will work and can be `[load]d` on any version of Tcl, the same as "Client" mode but with no external
dependencies on the "Server" mode.

The "Standalone" mode thus exports a single symbol, `Xvfs_<name>_Init()`.

### Build Output

    $ make example.so
    $ make example-standalone.so
    ./xvfs-create --directory example --name example > example.c.new
    mv example.c.new example.c
    
    cc -I. -DUSE_TCL_STUBS=1 -DXVFS_DEBUG -I/usr/include  -DXVFS_MODE_FLEXIBLE -fPIC -g3 -ggdb3 -Wall  -o example.o -c example.c
    cc -fPIC -g3 -ggdb3 -Wall   -shared -o example.so example.o -L/usr/lib64 -ltclstub8.6
    cc -I. -DUSE_TCL_STUBS=1 -DXVFS_DEBUG -I/usr/include  -DXVFS_MODE_STANDALONE -fPIC -g3 -ggdb3 -Wall  -o example-standalone.o -c example.c
    cc -fPIC -g3 -ggdb3 -Wall   -shared -o example-standalone.so example-standalone.o -L/usr/lib64 -ltclstub8.6
    
    $ nm -D example.so | grep ' [TU] '
    00000000000050c8 T Xvfs_example_Init
    $ nm -D example-standalone.so | grep ' [TU] '
    0000000000004d26 T Xvfs_example_Init
                     U fprintf
                     U memcmp
                     U memcpy
                     U stderr
                     U strlen

## "Flexible"
### Description

The "Flexible" mode is a combination of "Standalone" and "Client modes.  It will search for an existing
handler of "`//xvfs:/`" and if so call that handler's `Xvfs_Register()` function.  If no such handler exists
it will invoke the same handler as "Standalone" mode and register its own `Tcl_Filesystem`.