Announcement

Collapse
No announcement yet.

Natively porting civctp/A brief summary

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Natively porting civctp/A brief summary

    Hi,

    i have had a brief look at the source; for porting civctp2 (I'd like to concentrate on linux and perhaps on generic portability stuff), there is quite some work to be done.

    So far i read about port wishes to linux and macos x in this forum.

    I sorted by complexity of the problem (most complex problem first).

    1. getting rid of COM:
    COM is a proprietary component framework by microsoft used heavily within the source. It is unportable to other platforms than windows and COM-based applications are known to even cause heavy problems under wine (don't run, random crashes, etc.).

    If we want to keep a component based architecture, a replacement for COM has to be found. These options apply:
    a) another portable component framework with compatible licence
    b) reducing to some sort of contract programming (note: we'd need rtti for dynamic_casts which reduces portability heavily)
    c) using no component framework at all

    For a) i just have heard of XPCOM and UNO so far. Licensing would need checking.

    For b), we'd need some design; clean handling of references often is a problem.

    For c) and plugin handling of the mapsgen, a simple solution would be an abstract class defining a plugins interfaces, where each plugins impl has a c creation function which creates a new instance of the implementation.

    I hope we don't need a component framework or somebody has an alternative we may choose.

    2. porting DirectX calls:
    DirectX replacement by SDL has already be discussed. On windows, still DirectX would be needed, because SDL calls the host systems native functions.

    3. porting sound calls:
    As discussed, the miless calls would need to be ported to sdl and maybe openal.

    4. porting system specific stuff:
    a) First of all, shared libraries handling can get rather complex:
    Using shared libraries across platforms.

    Libtool provides solutions for most of these problems; within libtool ltdl provides is an interface which abstracts accessing shared libs from within your programs (both LGPL).

    That way, linux, macos x and windows shared library handling would be adressed.
    For cygwin, we may need dlltool, but i'm not sure about this.

    b) Other system related stuff:
    For supporting other platforms than linux and windows on x86 (e.g. ppc), using autoconf/automake would ease things a lot.

    Both are under GPL. Distributing source of these generators is allowed under the licence of its input, too (i.e. the EULA).

    This not only allows a much simplified Makefile handling, but also eases other system dependent stuff a lot (mainly handling conditioned system programming stuff and corresponding headers), though providing a unique configuration mechanism.

    I could also work on this part.

    See: GPL FAQ
    Distributing configure scripts
    Distributing Makefile.ins

    A very good point to start:
    Autobook

    5. Writing portable c++ code:
    There are several guides, but most of my links are outdated because i learned the part i wanted to know meanwhile.

    Still a good point to start is:
    Writing portable c++ code.

    Ok., i'm not through the source completly, perhaps there's something i missed.

    So far i don't know how the linux port progressed. I hope i get access to the modifications soon, so i can start at some point.

    Ciao
    Holger

  • #2
    Nice job Holger

    i didnt know half of those issues so please continue your good work

    Klaus

    Comment


    • #3
      update on COM usage

      Hi,

      i completed sighting the source for COM occurences (other than mm related calls to be replaced by sdl),and that's what came out:

      COM is mainly used for reference handling.

      The only parts where capabilities of components are tested are mapgen and wldgen.
      Within all other parts, i see that references to a components implementation are held directly, and even by partly using extern references.

      Now the question open is: Is COM used/needed for access through network/external applications (what i can't see in the code)?

      If not, this would be a solution getting rid of COM (1.c):
      The com bloated code in gs/outcom, robotcom and some minor others could be rewritten using a base class CTP2Object, disposing itself when Release() decremented its refcounter to zero.

      Btw. wondering why the robotcom part is not used.


      Ciao
      Holger

      PS: Regarding XP component frameworks/object models
      I found nothing compatible with the licence (XPCOM is NPL+MPL+GPL).

      Comment


      • #4
        Hi,

        ok, finally the com replacement itself is implemented (for in process components/shared lib components using libtool ltdl).
        The info/model is posted at the linux port thread:

        Compile: Linux Port

        Ciao
        Holger

        Comment

        Working...
        X