Issues compiling KOS

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
Jae686
Insane DCEmu
Insane DCEmu
Posts: 112
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sat Sep 22, 2007 9:43 pm
Location: Braga - Portugal
Has thanked: 0
Been thanked: 0

Issues compiling KOS

Post by Jae686 »

Good afternoon.

I've pulled the latest version from KOS by :

Code: Select all

git fetch --all
git reset --hard origin/master
After make I get the following error :

Code: Select all

kos-cc  -c banner.c -o banner.o
In file included from banner.c:7:0:
banner.h:2:1: warning: missing terminating " character [enabled by default]
banner.h:2:1: error: missing terminating " character
banner.h:3:1: warning: missing terminating " character [enabled by default]
banner.h:3:1: error: missing terminating " character
banner.h:4:1: warning: missing terminating " character [enabled by default]
banner.h:4:1: error: missing terminating " character
banner.h:5:1: warning: missing terminating " character [enabled by default]
banner.h:5:1: error: missing terminating " character
banner.h:6:1: error: expected expression before ‘;’ token
banner.c: In function ‘kos_get_banner’:
banner.c:38:54: error: ‘authors’ undeclared (first use in this function)
banner.c:38:54: note: each undeclared identifier is reported only once for each function it appears in
banner.c: In function ‘kos_get_authors’:
banner.c:47:12: error: ‘authors’ undeclared (first use in this function)
make[4]: *** [banner.o] Error 1
make[4]: Leaving directory `/home/jaerder/development/Tools/dreamcast/kallistios/kernel/arch/dreamcast/kernel'
make[3]: *** [_dir_kernel] Error 2
make[3]: Leaving directory `/home/jaerder/development/Tools/dreamcast/kallistios/kernel/arch/dreamcast'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/jaerder/development/Tools/dreamcast/kallistios/kernel/arch'
make[1]: *** [_dir_arch] Error 2
make[1]: Leaving directory `/home/jaerder/development/Tools/dreamcast/kallistios/kernel'
/bin/sh: 1: exit: Illegal number: -1
make: *** [all] Error 2
jaerder@jaerder-G50V ~/development/Tools/dreamcast/kallistios $ 

Any thoughts ?

EDIT :

Even if I clone the repo into another directory, I get the same error.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5661
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Issues compiling KOS

Post by BlueCrab »

That sounds like the banner script didn't run properly. Can you open up the kernel/arch/dreamcast/kernel/banner.h file and paste it here?

Actually, on second thought, change the first line to say the following, and try again first:

Code: Select all

#!/bin/bash
I'm pretty sure that the script does require Bash, and someone changed it to just use sh...

EDIT: Yes it does require bash on some (all) OSes where /bin/sh is POSIX-compliant (echo doesn't have a -n flag in such implementations, as it is not specified by POSIX). I've gone ahead and reverted the bad commit, so doing a new git pull from the repository should fix it.
Jae686
Insane DCEmu
Insane DCEmu
Posts: 112
Joined: Sat Sep 22, 2007 9:43 pm
Location: Braga - Portugal
Has thanked: 0
Been thanked: 0

Re: Issues compiling KOS

Post by Jae686 »

Thank you Bluecrab, the issue is now fixed.
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Issues compiling KOS

Post by Chilly Willy »

Bash is not standard on some distros. For example, Ubuntu has been using DASH instead for a year or two now. Some bash scripts are not *nix compliant, using bash-specific extensions. Those will not work on systems using a "standard" shell, like dash. I worked out a bunch of bash-specific issues with the PS3 toolkit earlier in the year. But I don't remember having a problem in compiling KOS - at least not one involving bash. I might try it again now that you've changed the repo and see if it still works.

Note: Debian got rid of bash long ago specifically because of the non-standard behavior. Dash is the Debian replacement for bash, and is standard on most Debian-based distros.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5661
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Issues compiling KOS

Post by BlueCrab »

Yes, that script does indeed use Bash extensions. I'll look into rewriting it to not use them, since it shouldn't be that big of a deal.

That said, every Debian-based box I've ever touched has had Bash installed on it, or at least acted like it did (i.e, there was a bash binary somewhere in the path).

EDIT: There... Now make_banner.sh doesn't require bash. It should work fine on any relatively POSIX-compliant shell (assuming that either it has a working printf command built-in or you have a POSIX-compliant printf utility).
Post Reply