Problems with the kos-ports repo

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
Chilly Willy
DC Developer
DC Developer
Posts: 414
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Problems with the kos-ports repo

Post by Chilly Willy »

Chilly Willy wrote:When compiling the svn repo, I get this for alpng:
ake[2]: Leaving directory `/home/jlfenton/Projects/Dreamcast/kos-ports/allegro-4.2.2'
make -C alpng13
make[2]: Entering directory `/home/jlfenton/Projects/Dreamcast/kos-ports/alpng13'
kos-cc -c src/alpng_save.c -o src/alpng_save.o
src/alpng_save.c:34:21: fatal error: dcalleg.h: No such file or directory
compilation terminated.
make[2]: *** [src/alpng_save.o] Error 1
make[2]: Leaving directory `/home/jlfenton/Projects/Dreamcast/kos-ports/alpng13'
make[1]: *** [_dir_alpng13] Error 2
make[1]: Leaving directory `/home/jlfenton/Projects/Dreamcast/kos-ports'
make: *** [kos-ports_all] Error 2
While the allegro library compiled fine and can be found in the addons lib directory, the includes where apparently not copied.
This error and others like it STILL haven't been corrected in the repo. A fresh checkout of kos-ports will not make. Even if you copy the allegro includes into alpng, you still need to copy the zlib includes, then copy the allegro includes into dumb, then libgl errors out...
:(
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Problems with the kos-ports repo

Post by Chilly Willy »

Just a follow up...

In the Makefile for alpng_13, change the KOS_CFLAGS like this:

Code: Select all

KOS_CFLAGS += -DDREAMCAST -DALPNG_ZLIB=1 -O3 -ffast-math -Wall -Wno-unused -DALLEGRO_DC -Isrc -Isrc/inflate -Isrc/quantization -Isrc/wrappers -I../allegro-4.2.2/include -I../zlib-1.2.3
That's how some of the SDL libs handle includes from SDL in the repo, so I figure that should be okay. Similarly, for dumb-0.9.3 Makefile.dc, change it like this:

Code: Select all

KOS_CFLAGS += -DDUMB_DECLARE_DEPRECATED -Iinclude -I../allegro-4.2.2/include -O3 -funroll-loops -ffast-math -fomit-frame-pointer -Wall -Wno-unused -DDREAMCAST
That's the least changes to get both making. The next issue is more severe... it was with libglx, not libgl... sort of. Libglx won't compile with the GL includes in the kos-ports/include/GL directory, you need the ones from its own GL directory. However, they must be copied to the kos-ports/include/GL directory to be used. If you do that, libglx will build. However, libgl cannot use those includes! So you need both sets of includes in the kos-ports/include directory, then rename them to GL according to which library you use, libgl or libglx. I can't see an easy way around that issue.

What's the difference between the two? Libglx seems like it has more GL functionality. Since the two libs are mutually exclusive, why are they BOTH in the target list in the main kos-ports makefile?
User avatar
Indiket
DC Developer
DC Developer
Posts: 99
Joined: Sun Sep 05, 2010 5:44 am
Has thanked: 0
Been thanked: 0

Re: Problems with the kos-ports repo

Post by Indiket »

Hi Chilly Willy, how are you?

First of all, let me say that this kos-ports is not the official kos repository that BlueCrab maintains (it's the emuforge one, that's it, the "spaniards" one :-P ). Btw, I'm a contributor on it and I do small changes on it (of course, when I can...).

Next, your KOS_FLAGS solutions are clean and nice, so I'll update it asap (thanks!). About the GL and GLX, the GL is the same as the official kos-ports. But GLX is the KGLX library from Chui. They are different implementations of OpenGL, that's why they have conflict (and you have to choose like you did to compile one or another).
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Problems with the kos-ports repo

Post by Chilly Willy »

Indiket wrote:Hi Chilly Willy, how are you?
Enlightened. :grin:

First of all, let me say that this kos-ports is not the official kos repository that BlueCrab maintains (it's the emuforge one, that's it, the "spaniards" one :-P ). Btw, I'm a contributor on it and I do small changes on it (of course, when I can...).
Oh, thanks for the clarification... thought I was going crazy for a moment there. :)

Next, your KOS_FLAGS solutions are clean and nice, so I'll update it asap (thanks!).
No problem, I like to help on things like this when I can.

About the GL and GLX, the GL is the same as the official kos-ports. But GLX is the KGLX library from Chui. They are different implementations of OpenGL, that's why they have conflict (and you have to choose like you did to compile one or another).
Thanks again. I don't know how I got the idea that this kos/kos-ports was "official" - I probably should have taken the fact that there was allegro and a new GL library as a hint. :lol:

Perhaps you can change the base makefile to select gl vs glx based on an envvar... if KOS_GLX is defined, copy the glx GL includes and compile glx, and if it's not defined, copy the gl GL includes and compile gl. Something like that. Having both in the makefile will result in the build failing when it gets to one or the other depending on the includes used.
User avatar
Indiket
DC Developer
DC Developer
Posts: 99
Joined: Sun Sep 05, 2010 5:44 am
Has thanked: 0
Been thanked: 0

Re: Problems with the kos-ports repo

Post by Indiket »

So, I've just updated repository with your fixes. Notice that now it will also compile libglx without needing to choose the GL includes (check the Makefile, you will see that I redefine KOS_CFLAGS to avoid conflicts with the kos-ports include folder).
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Problems with the kos-ports repo

Post by Chilly Willy »

Ah! You did "KOS_CFLAGS = " instead of "KOS_CFLAGS += " to avoid the wrong includes. Should have thought of that myself. Nice job. :grin:
Post Reply