Begin to do small ports
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Posts: 2053 from 2003/4/10
    From: France

    i would like to begin to do small ports for MorphOS.

    For example, to begin i would like to compile last version of pngcrush:

    I have installed last SDK and tried:

    make -f makefile but without success.

    [EDIT] i saw BeWorld has already compiled it...but i would like understand better :-)

    I have edited the makefile, compiled with gcc and i obtain a pngcrush executable but it show:

    CPU time decode 0.0000, encode 0.0000...

    Any ideas?
  • »01.11.23 - 20:14
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Posts: 179 from 2009/9/20
    Works without problems here You must be doing something wrong.
    And the Makefile should be named with capital M by convention. Then simply type make without the -f part.
  • »01.11.23 - 23:51
    Profile Visit Website
  • Moderator
    Posts: 2243 from 2003/2/24
    You failed to give essential information:
    - did you give executable the right parameters
    - did it produce the expected result but failed to calculate a time

    Once you checked that add plenty printf() to the code to detect where things break apart.

    Not gonna get more specific or look into the code as you are doing it to learn something which when it coms to debugging can only be done by doing it…..
  • »02.11.23 - 02:49
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Posts: 513 from 2003/2/25
    From: France
    I would for a start:

    - read a lot about makefile.
    - read a lot about programming.
    - write some small programs to make use of what you understood with previous reading.

    At least, that will give you some understanding of how to fix your own errors.

    Then, I would proceed to port things.

    Some hints:
    - some project do not make use of make but another build tool (cmake, ninja, etc...) which can make the port a bit more complex (ie: extract a working makefile from the build tool that will work with make).

    - sometime there is a configure script that must be run before doing make. Again, you can run in various trouble here. Fun fact: sometime the configure script is larger than the whole project.

    - sometime the configure script accepts arguments. You have to figure them out first.

    - sometime the project is configured with a config.h (or other filename...) where you define optional things in.

    - sometime MorphOS simply lacks whatever is needed to compile the program. For example, if the program relies on QT(4|5|6) or KDE GUI toolkit, do not expect porting the stuff without major PITA as you'll have to also port dependencies, or if the program is well architectured, write your own GUI with MUI...

    - sometime, you'll have to modify the program to make it work by replacing some missing bits.

    - you'll have to figure out the difference between libnix and ixemul binaries and how to compile things with or without -noixemul flag.

    - you'll have to take care of license too. Some allows binary distribution without sharing your modifications, while some other licenses enforce source distribution.

    All those things are the tip of the iceberg. Good luck soldier. You're about to enter an extrem minefield. :)
    Quelque soit le chemin que tu prendras dans la vie, sache que tu auras des ampoules aux pieds.
    I need to practice my Kung Fu.
  • »02.11.23 - 05:37
    Profile Visit Website