Hi,
I have a Linux system set up with KallistiOS. It works fine and the examples are also working without a problem. Now I want to use GLdc, ALdc and SDL-dreamhal instead of the default libraries that are provided in kos-ports since they seem to be "more modern". I tried to find a how to that shows how to install those libraries on it, but haven't found anything or only outdated stuff.
So is there a recommended way to install those libraries in combination with KOS?
Install GLdc, ALdc and SDL-dreamhal in KOS
-
- DCEmu Newbie
- Posts: 2
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Sun Aug 21, 2022 4:48 am
- Has thanked: 2 times
- Been thanked: 1 time
Install GLdc, ALdc and SDL-dreamhal in KOS
- These users thanked the author octoate for the post:
- Memorix101
-
- DCEmu Webmaster
- Posts: 16375
- Joined: Wed Mar 14, 2001 6:00 pm
- Location: New Orleans, LA
- Has thanked: 104 times
- Been thanked: 91 times
- Contact:
Re: Install GLdc, ALdc and SDL-dreamhal in KOS
There's a few different ways you could go about this, but this is how I would do it... assuming you're using /opt/toolchains/dc/ as the folder for all of your dcdev stuff.
I'll use ALdc as an example... Clone and build it:
Then, in your project's Makefile, add in the directories where the compiled .a file was placed, and where the headers are located...
Now add the library name in the (e.g. -lALdc) compilation target for your output ELF file, just before the $(KOS_LIBS)
Should be similar for GLdc, though you might want to be careful and uninstall the one from kos-ports in case of conflict. I haven't used SDL-dreamhal personally, there's a few repos on Ian Michaels github but they have sample folders with projects containing Makefiles so you should be able to peek in them and see what he did as a reference.
Sometime this week I'll add an article on dreamcast.wiki for this
I'll use ALdc as an example... Clone and build it:
Code: Select all
git clone https://gitlab.com/simulant/aldc.git /opt/toolchains/dc/aldc
cd /opt/toolchains/dc/aldc
mkdir builddir
cd builddir
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/Dreamcast.cmake -DCMAKE_BUILD_TYPE=Release ..
make
Code: Select all
CFLAGS += -I/opt/toolchains/dc/aldc/include
LDFLAGS += -L/opt/toolchains/dc/aldc/builddir
Code: Select all
$(TARGET): $(OBJS) romdisk.o
$(KOS_CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(KOS_START) \
$(OBJS) romdisk.o $(OBJEXTRA) -lALdc $(KOS_LIBS)
Should be similar for GLdc, though you might want to be careful and uninstall the one from kos-ports in case of conflict. I haven't used SDL-dreamhal personally, there's a few repos on Ian Michaels github but they have sample folders with projects containing Makefiles so you should be able to peek in them and see what he did as a reference.
Sometime this week I'll add an article on dreamcast.wiki for this
- These users thanked the author |darc| for the post (total 3):
- 1337 • Memorix101 • Ian Robinson
It's thinking...
-
- DCEmu Newbie
- Posts: 2
- Joined: Sun Aug 21, 2022 4:48 am
- Has thanked: 2 times
- Been thanked: 1 time
Re: Install GLdc, ALdc and SDL-dreamhal in KOS
Thanks. That works for ALdc. However that does not work with GLdc because it uses the headers of libGL of the KOS_LIBS. If I just remove or rename libGL, it is possible to compile GLdc.
Are there any libs in kos-ports that require the shipped "libGL" or is it okay to just remove the libGL folder and the symbolic link in "lib"?
Are there any libs in kos-ports that require the shipped "libGL" or is it okay to just remove the libGL folder and the symbolic link in "lib"?
That would be awesome. I guess I am not the only one who is stumbling upon this topic .Sometime this week I'll add an article on dreamcast.wiki for this