I need to revise Hans Ulrich Niedermann wrote:
> However, src/GUI/libGUI.a is linked against plib - and plib choses at > compile time which backend it will use. FG CVS does that via AC_DEFINEs > in configure.ac (PU_USE_GLUT, PU_USE_SDL, PU_USE_NATIVE), i.e. via > #defines in config.h. > > For compiling libGUI-FOO.a, one can just use the proper > libGUI-FOO_a_CPPFLAGS definitions, but having all three libGUI-FOO.a > statically linked to the same executable for the "chose-at-runtime" > scenario will almost certainly not work. After Tim and me have taken a more detailed look at plib/pu.h, it looks like we could just use the run-time decision after all by calling puInitSDL(), puInitGLUT(), puInitNativ() instead of puInit(). These three functions cannot go away without plib breaking binary compatibility, and plib development is not very daring these days, so using these functions directly is not very risky. That would probably make having multiple libGUI.a redundant, and the only code which would still be different for the GLUT/SDL/osgViewer versions is fg_os*.cxx, which can be solved by encapsulating the stuff into proper classes. There would need to be a new command line or config file parameter which choses the "version". Building that one-fgfs-executable-fits-all would need little change to configure.ac/Makefile.am logic: One would still need to decide at compile time which of the three versions one wants to include in the code (any one of them, any two of them, or all three of them). One would need to define a default. All in all, I like it. The less code one decides to leave out at compile time, the less code remains untested. I'll try whether this works. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel