Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#3 Cross-compilation patch 1 of 6

open
nobody
None
5
2005-10-31
2005-10-31
No

With these patches i've compiled the library and
the tests on my linux box. Because the content of
makefiles changed significantly, i've cut the
complete patch into small pieces for clarity. This is
the first patch in the set. It is made against CVS.
Other patches are made against local source tree.
All these patches should be applied sequentially.

This patch replaces DOS/Windows commands with
POSIX equivalents.

Discussion

  • Cross-compilation patch 1 of 6

     
    Attachments
  • Peter Kuemmel
    Peter Kuemmel
    2005-11-22

    Logged In: YES
    user_id=1159765

    I see no problem with the patches eof, windres,
    slash (but it don't cares under windows) and
    extra-incpath-libs and case.

    But if we apply posix-command the makefile will
    not work under windows, so we maybe have to add
    something like Makefile.cross, or is there a way
    to ifdef/else in a makefile?

    Peter

     
  • Logged In: YES
    user_id=1236265

    Yes, it will not work under windows if mingw is used
    stand-alone. But i cannot imagine that because it would be
    impossible to build most of the open source software (of
    course, here i mean portable software) -- most of build
    systems they use rely on posix (for example,
    autoconf/automake). So de-facto it is required that mingw
    should be used together with msys which provides minimal
    posix system on windows.

    I don't know how to handle the situation when msys or some
    port of unix commands is missing. Ifdefs could be used but
    how to determine the host system the make is running on?
    From the Makefile it is impossible to do. Ask the user is a
    bad idea. Create another makefiles is a worse idea: you'll
    have to maintain both. IMHO, the user simply should have
    required toolchain.

    Alexander

     
  • Peter Kuemmel
    Peter Kuemmel
    2005-11-23

    Logged In: YES
    user_id=1159765

    I favor adding additional makefiles and maintaining them
    over introducing a addiditional dependencies under windows
    (msys).

    At the moment smartwin works out of the box witk Dev-C++ and
    a mingw installation without msys.

    I've never cross-compiled, so what's are the advantage? Why
    do you cross-compile?

    Regards,
    Peter

     
  • Logged In: YES
    user_id=1236265

    Ok, i think it would be better to leave DOS commands in
    makefiles and create a script which spawns make with
    redefined commands for cross-compilation. I'll try to do it
    at weekend.

    The advantage of cross-compilation is that GCC works much,
    much faster on unix. Another advantage is that it's possible
    to setup automated build on the unix server. And personally,
    i'm even do not have windows at home where i'm nevertheless
    writing some windows software.

     
  • Peter Kuemmel
    Peter Kuemmel
    2005-11-24

    Logged In: YES
    user_id=1159765

    I'm not 100% sure, but I think you could do a #ifdef in a
    makefile, so we can pass a macro definition (something like
    SMARTWIN_CROSSCOMPILE) to the makefile and so get the
    correct commands.

    Additionally we could add one Makefile.cross master makefile
    which calls the mingw makefile with the macro definition.

    Peter