Cross platform plugin dev

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Cross platform plugin dev

Brad Fuller
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?
Do you create your own hand-made Makefile (etc)?

--
Brad Fuller
(408) 799-6124
** Sonaural Audio Studios **
(408) 799-6123  West San Jose
(408) 799-6124  Cambrian
________________________________
Hear us online: www.Sonaural.com
See me on O'Reilly: http://www.oreillynet.com/pub/au/2184


Reply | Threaded
Open this post in threaded view
|

Re: Cross platform plugin dev

Brad Fuller
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


--
Brad Fuller
(408) 799-6124
** Sonaural Audio Studios **
(408) 799-6123  West San Jose
(408) 799-6124  Cambrian
________________________________
Hear us online: www.Sonaural.com
See me on O'Reilly: http://www.oreillynet.com/pub/au/2184


Reply | Threaded
Open this post in threaded view
|

Re: Cross platform plugin dev

timrowledge
In reply to this post by Brad Fuller

On 18-Nov-05, at 2:08 PM, Brad Fuller wrote:

> 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.
Correct. Take a look at plugins like RePlugin and SurfacePlugin. The  
arrangement is explained in the swiki - http://minnow.cc.gatech.edu/ 
squeak/2105 - and do please let me know of anything that isn't clear  
so I can try to improve it.


> What have others done to create and build plugins that are cross  
> platform?
Since pretty much all the plugins are cross platform I'm a touch  
puzzled by your question.

> Do you create your own hand-made Makefile (etc)?
If a plugin is added to the distribution then all platforms that can  
make use of it will need some changes to their makefiles or  
equivalent. In the case of simple plugins Ian's assorted config  
scripts might be able to work out all the details for unix systems  
and for RISC OS I can trivially add a rule, which covers pretty much  
the extremes of clever automakers and simple manual ones.



tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim



Reply | Threaded
Open this post in threaded view
|

Re: Cross platform plugin dev

timrowledge
In reply to this post by Brad Fuller

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; [hidden email]; http://www.rowledge.org/tim



Reply | Threaded
Open this post in threaded view
|

Re: Cross platform plugin dev

Brad Fuller
In reply to this post by timrowledge
tim Rowledge wrote:

>
> On 18-Nov-05, at 2:08 PM, Brad Fuller wrote:
>
>> 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.
>
> Correct. Take a look at plugins like RePlugin and SurfacePlugin. The  
> arrangement is explained in the swiki - http://minnow.cc.gatech.edu/ 
> squeak/2105 - and do please let me know of anything that isn't clear  
> so I can try to improve it.
>
>
>> What have others done to create and build plugins that are cross  
>> platform?
>
> Since pretty much all the plugins are cross platform I'm a touch  
> puzzled by your question.

Sorry.. wasn't clear. I should have said:
How does one generate .c files from slang using VMMakerTool into the
Cross directory?

What's the thinking behind this:
    platnames _ vmMaker platformRootDirectory directoryNames
copyWithoutAll: #('Cross' 'CVS').

in the platformsListMenu method in VMMakerTool? Seems that Cross would
be an important directory to generate .c files in.

--
Brad Fuller
(408) 799-6124
** Sonaural Audio Studios **
(408) 799-6123  West San Jose
(408) 799-6124  Cambrian
________________________________
Hear us online: www.Sonaural.com
See me on O'Reilly: http://www.oreillynet.com/pub/au/2184


Reply | Threaded
Open this post in threaded view
|

Re: Cross platform plugin dev

Brad Fuller
In reply to this post by timrowledge
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

Reply | Threaded
Open this post in threaded view
|

Re: Cross platform plugin dev

Brad Fuller
In reply to this post by Brad Fuller
Brad Fuller wrote:

> tim Rowledge wrote:
>
>>
>> On 18-Nov-05, at 2:08 PM, Brad Fuller wrote:
>>
>>> 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.
>>
>>
>> Correct. Take a look at plugins like RePlugin and SurfacePlugin. The  
>> arrangement is explained in the swiki - http://minnow.cc.gatech.edu/ 
>> squeak/2105 - and do please let me know of anything that isn't clear  
>> so I can try to improve it.
>>
>>
>>> What have others done to create and build plugins that are cross  
>>> platform?
>>
>>
>> Since pretty much all the plugins are cross platform I'm a touch  
>> puzzled by your question.
>
>
> Sorry.. wasn't clear. I should have said:
> How does one generate .c files from slang using VMMakerTool into the
> Cross directory?
>
> What's the thinking behind this:
>    platnames _ vmMaker platformRootDirectory directoryNames
> copyWithoutAll: #('Cross' 'CVS').
>
> in the platformsListMenu method in VMMakerTool? Seems that Cross would
> be an important directory to generate .c files in.
>
Another thing about VMMakerTool:
How can you work on one plugin (as an example) and create c code for
that one plugin without deleting all of the other plugin dirs?
I'm using the VMM38b branch and there are many plugin directories. But,
if you drag over just one plugin and generate in VMMakerTool, it blows
away all the others.

 From the help:

"The 'Generate External Plugins' button will regenerate all the plugins
in the External Plugins list. Note that 'excess' directories will be
deleted each time you generate the vm in order to reduce potential
confusion if you move a plugin from internal to external etc"
I can understand the reasoning when someone is building a complete
system and you want to generate all the plugins and destroy all of the
ones you don't want. But, it seems a bit drastic if you want to
concentrate on one plugin.

Maybe there should be a button for  "Generate Extrnl for Dev" that won't
delete all the dirs? Doesn't make sense, I guess, for internal plugins.
And maybe the other buttons should be labeled with an extra word "Deploy"

just some suggestions as I go thru this...

--
Brad Fuller
(408) 799-6124
** Sonaural Audio Studios **
(408) 799-6123  West San Jose
(408) 799-6124  Cambrian
________________________________
Hear us online: www.Sonaural.com
See me on O'Reilly: http://www.oreillynet.com/pub/au/2184


Reply | Threaded
Open this post in threaded view
|

Re: Cross platform plugin dev

Brad Fuller
tim Rowledge wrote:

>
> On 18-Nov-05, at 5:39 PM, Brad Fuller wrote:
>
>> Another thing about VMMakerTool:
>> How can you work on one plugin (as an example) and create c code  for
>> that one plugin without deleting all of the other plugin dirs?
>
>
> Easy - use the context menu in the external plugins list to generate  
> just that one plugin. Unless I've broken it recently (always some  
> possibility) that is the way to generate your single plugin so that  
> you can cycle round generate-compile-test(since it autoloads)-unload
> (with SmalltalkImage current unloadModule:'myPlugin')-rinse-and-repeat

oh.. THATS what that is!
Ok, that works!

>
>> I'm using the VMM38b branch and there are many plugin directories.  
>> But, if you drag over just one plugin and generate in VMMakerTool,  
>> it blows away all the others.
>
> Yah. It's a tricky problem of interlocks that reflects trying to make  
> a bunch of opinionated people happy some years ago. I think the help  
> text could do with a little more explanation.

Yeah.. maybe a clearer note. Now I know what "list" means in this sentence:
    "You can also generate internal or external plugins singly, using
the menus in the lists"

I'll tell you that the "Clean Out" button is a dangerous button. Hit
that accidentally and BAM your code is gone.

thanks for your help, Tim.

Now.. .working on getting config/configure to really configure all of
this. I can't get it to find things. When I get one thing pointed right,
it negates another. I'm going around in circle ;-)

--
Brad Fuller
(408) 799-6124
** Sonaural Audio Studios **
(408) 799-6123  West San Jose
(408) 799-6124  Cambrian
________________________________
Hear us online: www.Sonaural.com
See me on O'Reilly: http://www.oreillynet.com/pub/au/2184



Reply | Threaded
Open this post in threaded view
|

Re: Cross platform plugin dev

David T. Lewis
In reply to this post by Brad Fuller
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