[AD] Darwin/MacOS X port

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Jeremiah Blanchard sent me two days ago several files needed to let Allegro
compile under Darwin/MacOS X with X Window (sorry, Unix gurus, it seems
Jeremiah would rather mail to a single guy than to the [AL] list).

The original files are available at:
http://www.multimania.com/ebotcazou/dev/allegro_jeremiah.zip

I've merged his 'fixdarwin.sh' script into the standard configure system
(not yet got feedback from Jeremiah on that though), the result is at:
http://www.multimania.com/ebotcazou/dev/allegro_darwin.zip

Jeremiah came across an interesting problem: Apple doesn't use GNU 'ar'
as the library archiver, but a customized version of GNU ld. As a result, ld
complains when a symbol is multiply defined, in the program to be linked and
in the library to be imported.

Now, Allegro has got a built-in main() function on Unix systems
(src/unix/umain.c), so when USE_CONSOLE is defined on MacOS X, the
compilation aborts at the linking stage because of the duplicated _main
symbol.

Therefore I'm proposing to borrow the solution of the Windows port (for
4.1.x of course): renaming Allegro's main() to _main(), adding the main()
function to the END_OF_MAIN() macro and making it pass the _mangled_main()
address to the _main() function (see include/allegro/platfrom/alwin.h)

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/