Ok, so what to do with the interface files generated?

What happens now: flxg writes the file IF there is something to write into it.
It writes the file in the same location as the C++ files it generates.

Before solving, lets note the next upgrade,  if it can be done: generating
a working C/C++ interface for the library. Considering that the felix
interface looks like this (for one function):

// FELIX C FUNCTION setup3
 // binding for export cfun _i41933_f41933_setup3 as setup3
 fun setup3 : int -> int = "setup3($1)"
   requires
     header
      """
      extern "C" FLX_IMPORT int setup3(int);
      """
 ;

it's pretty clear the "header" section is already the right C/C++ interface.
In fact if we generate that, we can just include it instead of the header
section for each function.

The question is: where would it go?

To me it makes sense if the Felix and C++ interfaces live next to the generated 
binary.
So for example if you said:

        flx -c --static -od . fred.flx

then fred.o lives in the current directory, so fred_interface.flx should too, 
as should
fred_cxx_interface.hpp. If you said

        flx -c --static -ox fred fred.flx

what would one do? Or used

        flx -c --static -o fred.o fred.flx

do we strip off the ".o" to calculate the interface file names?

Or do we use another switch:

        flx -c --static -o fred.o -fi fred_interface.flx -ci 
fred_cxx_interface.hpp fred.flx

?

There's more to consider. The above is a single object file. Typically libraries
have multiple object files in them.

And there's even more. To use an actual C library, Felix has a resource manager
that checks a config database... so shouldn't we also generate

        fred.fpc

And where would we put that? How would we set up the -L and -I switches
for a package we haven't installed?

And a related problem. Suppose you use SDL2. Ok, so you have to make a package 
sdl2.fpc
and put it in the INSTALL_DIR/host/config directory. So when you do an upgrade 
from the
repository and install that .. the install deletes the INSTALL_DIR (to make 
sure it
is clean). Where do we put packages describing external libraries where Felix 
won't
delete them?

I have come to the understanding that the greatest evil for build systems is 
the existence
of file systems .. because that means you have to somehow associate distinct 
but related
files and there's no fixed way to do that.

--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to