Ian Piumarta wrote:
Hi Brad,
I'm going thru the unix configuration doc and files to learn how it is configured for unix development. However, what if you have only Cross platform plugin files? They would go into the Cross subdirs. What have others done to create and build plugins that are cross platform?
If you don't need special treatment on Unix then all you need to do is create the Cross/plugins/Whatever/whatever.c file (and any attendant .h files) and run 'autoconf' to recreate the configure script. Thereafter 'configure' will know about the plugin and will attempt to build it.
Do you create your own hand-made Makefile (etc)?
You only need to do this if you have special compiler flags or header directories that you need to pass to the compiler on Unix. In that case look at Makefile.inc in one of the other plugin directories to see typical things that you can do. For very unusual plugins you may even need a complete 'Makefile.in' to replace the automatically generated one entirely. (The vm has its own Makefile.in, for example.)
You might also (in very demanding plugins) require configuration-time options and tests, or even to disable the plugin entirely if required libraries are not installed. If you put a file called 'acinclude.m4' in your plugin directory, autoconf will include it in the configure script at the appropriate moment. (See the other acinclude.m4 files for typical things you can do.) Of course, you need to run 'autoconf' again after every change to an acinclude.m4 file.
But normally you won't need anything special: put the .c and .h files in Cross/plugins/YourPlugin/ and run autoconf to rebuild the configure script. See the 'RePlugin' for example, which has no Unix files at all.
Thanks. I actually had it working before, but now I can't configure it. I can't remember which directory I placed the Makefile.inc!
I'm kinda having some trouble following the directions. You wrote very clear directions but probably didn't follow them well ;-) I could not get config/configure (is that what you are referring to as 'autoconfig'? Or is that a new script?) to find my makefile.inc no matter where I put the plugin directory (although it did create the Makefile. )
But anyway.... Since I don't really have a unix specific plugin, I want to put it in Cross for now and I'll try that.
Have you used VMMakerTool? If so, how do you use it to generate C files in the Cross directory?
brad
On 18-Nov-05, at 4:09 PM, Brad Fuller wrote:
But anyway.... Since I don't really have a unix specific plugin, I want to put it in Cross for now and I'll try that.
Just keep all the completely platform independent c & h files (plus I suppose other resources, though I don't recall needing anything previously) in Cross/plugins/myPluginName.
Have you used VMMakerTool? If so, how do you use it to generate C files in the Cross directory?
It doesn't normally generate the code into the same directories as the hand-written files so that it is easy to flush out the stuff that can be generated. The exception is Windows where the files are intermixed as per Andreas' wishes. On unix you'll normally find the output of the VMMaker run in 'src' or 'src32' etc. As you've undoubtedly noticed by now the build obj files and generated scripts from autoconf go in 'bld' etc.
tim
tim Rowledge wrote:
On 18-Nov-05, at 4:09 PM, Brad Fuller wrote:
But anyway.... Since I don't really have a unix specific plugin, I want to put it in Cross for now and I'll try that.
Just keep all the completely platform independent c & h files (plus I suppose other resources, though I don't recall needing anything previously) in Cross/plugins/myPluginName.
Have you used VMMakerTool? If so, how do you use it to generate C files in the Cross directory?
It doesn't normally generate the code into the same directories as the hand-written files so that it is easy to flush out the stuff that can be generated.
To me, 'Cross' would be THE most important directory that VMMakerTool would generate files to. Simply because these files would be easily prone to Slang and would be less handwritten than platform-dependent files. My mind can't understand why the author purposely left 'Cross' off the list. I'm sure there is a very good reason that is going right over my head.
brad
On Fri, Nov 18, 2005 at 04:55:18PM -0800, Brad Fuller wrote:
tim Rowledge wrote:
On 18-Nov-05, at 4:09 PM, Brad Fuller wrote:
Have you used VMMakerTool? If so, how do you use it to generate C files in the Cross directory?
It doesn't normally generate the code into the same directories as the hand-written files so that it is easy to flush out the stuff that can be generated.
To me, 'Cross' would be THE most important directory that VMMakerTool would generate files to. Simply because these files would be easily prone to Slang and would be less handwritten than platform-dependent files. My mind can't understand why the author purposely left 'Cross' off the list. I'm sure there is a very good reason that is going right over my head.
The files in 'Cross' are part of the source code in the ./platforms tree, whereas the generated C code goes elsewhere (typically in a ./src directory). You should consider the generated code in ./src to be transient output more or less equivalent to the object code generated by a C compiler.
The source code for a Squeak VM consists of the (slang) Smalltalk in the image packaged as VMMaker, along with the external support code that lives in the ./platforms tree. When you use VMMaker to generate the sources, you are producing C object files, which are later compiled into *.o object files and linked into a VM.
The part of this that can be confusing is that you might naturally want to think of the generated C files as being "source code," when in fact they are just transient files used to feed the C compiler.
Dave
vm-dev@lists.squeakfoundation.org