I'd like to start working on the DC in linux

This forum is for discussion pertaining to homebrew and indie software for the Dreamcast, such as homebrew games, emulators/interpreters, and other homebrew software/applications. Porting requests and developmental ideas are not to be made here; you can make those here. If you need any help burning discs for homebrew software, this is the place to ask as well.
User avatar
JS Lemming
Insane DCEmu
Insane DCEmu
Posts: 202
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Mon Apr 04, 2005 8:08 am
Location: C:\CON\CON
Has thanked: 0
Been thanked: 0
Contact:

Post by JS Lemming »

Well, I'm back and ready to try again. I followed this guide exactly except instead of kos_root="/home/foobert/dc" I used kos_root="/home/travis/dc/kos/kos-1.3.0" but I don't think that matters and the compilation failed.

Logs generated: build-binutils-arm-elf-2.15.log and build-binutils-sh-elf-2.15.log

This is what the Terminal said:
travis@travis-desktop:~/Desktop/dc-chain-0.1-gcc346$ make CC=gcc-3.4
cd gcc-3.4.6; patch -p1 < /home/travis/Desktop/dc-chain-0.1-gcc346/patches/gcc-3.4.6.diff
patching file gcc/config/sh/kos.h
patching file gcc/config/sh/t-sh
patching file gcc/config.gcc
patching file libstdc++-v3/config/cpu/generic/atomicity.h
patching file libstdc++-v3/config/cpu/sh4/atomicity.h
patching file libstdc++-v3/config/cpu/sh4/atomic_word.h
patching file libstdc++-v3/configure
patching file libstdc++-v3/crossconfig.m4
cd newlib-1.12.0; patch -p1 < /home/travis/Desktop/dc-chain-0.1-gcc346/patches/newlib-1.12.0-kos.diff
patching file config-ml.in
patching file newlib/configure.host
patching file newlib/libc/sys/sh/ftruncate.c
patching file newlib/libc/sys/sh/sys/_types.h
patching file newlib/libc/sys/sh/sys/lock.h
patching file newlib/libc/sys/sh/syscalls.c
patching file newlib/libc/sys/sh/trap.S
patching file newlib/libc/sys/sh/truncate.c
+++ Building binutils-2.15 to build-binutils-sh-elf-2.15...
mkdir -p build-binutils-sh-elf-2.15
> /home/travis/Desktop/dc-chain-0.1-gcc346/logs/build-binutils-sh-elf-2.15.log
cd build-binutils-sh-elf-2.15; ../binutils-2.15/configure --target=sh-elf --prefix=/usr/local/dc/sh-elf >> /home/travis/Desktop/dc-chain-0.1-gcc346/logs/build-binutils-sh-elf-2.15.log 2>&1
make -C build-binutils-sh-elf-2.15 all install >> /home/travis/Desktop/dc-chain-0.1-gcc346/logs/build-binutils-sh-elf-2.15.log 2>&1
make: *** [build-sh4-binutils] Error 2
travis@travis-desktop:~/Desktop/dc-chain-0.1-gcc346$
From what I can tell from the logs, it appears that a command called "lex" doesn't exist... Anyone have a clue?
User avatar
henzenmann
Insane DCEmu
Insane DCEmu
Posts: 186
Joined: Wed Jul 12, 2006 4:58 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by henzenmann »

JS Lemming wrote:From what I can tell from the logs, it appears that a command called "lex" doesn't exist... Anyone have a clue?
You need to install "flex". I should update the guide...
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Has thanked: 0
Been thanked: 0
Contact:

Post by emptythought »

Let me know if you update it so I can update the one on Consolevision.
User avatar
JS Lemming
Insane DCEmu
Insane DCEmu
Posts: 202
Joined: Mon Apr 04, 2005 8:08 am
Location: C:\CON\CON
Has thanked: 0
Been thanked: 0
Contact:

Post by JS Lemming »

I have installed flex and it still gives the same error when I try to compile even though I am able to use flex in the terminal myself.

After posting this I will restart my computer and retry. BTW, just in case you were wondering, I am making sure to run unpack.sh after each attempt.

EDIT: As expected, restarting changed nothing. Still exact same error as before. I guess "restarting" the computer is an old habbit I got from Windows when things don't work... Those were the bad old days.
jstookey
DCEmu Newbie
DCEmu Newbie
Posts: 4
Joined: Mon Sep 25, 2006 8:51 am
Has thanked: 0
Been thanked: 0
Contact:

Post by jstookey »

This may not be much help, but another script you can try is available from here:

http://stalin.thegypsy.com/

I used it the other day to get a development environment running under Linux. Pretty much all it took was the following command:

./buildcross.sh dreamcast -dc
User avatar
JS Lemming
Insane DCEmu
Insane DCEmu
Posts: 202
Joined: Mon Apr 04, 2005 8:08 am
Location: C:\CON\CON
Has thanked: 0
Been thanked: 0
Contact:

Post by JS Lemming »

Thanks, I'll give that a whirl.
User avatar
henzenmann
Insane DCEmu
Insane DCEmu
Posts: 186
Joined: Wed Jul 12, 2006 4:58 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by henzenmann »

I really think that your flex installation is still not correct, and if I'm right Harley's build script won't help you much.

Here is what the relevant part from build-binutils-sh-elf-2.15.log looks like on my system:

Code: Select all

[ ... ]
checking for bison... bison -y
checking for flex... flex
checking for flex... (cached) flex
checking for yywrap in -lfl... yes
checking lex output file root... lex.yy
checking whether yytext is a pointer... yes
[ ... ]
You are using Ubuntu, right? Try the commands "dpkg -l flex" and "dpkg -L flex". The output should look somewhat like this:

Code: Select all

$ dpkg -l flex
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                             Version                          Description
+++-================================-================================-================================================================================
ii  flex                             2.5.33-10                        A fast lexical analyzer generator.

Code: Select all

$ dpkg -L flex
/.
/usr
/usr/bin
/usr/bin/flex
/usr/lib
/usr/lib/libfl.a
/usr/lib/libfl.so
/usr/lib/libfl_pic.a
/usr/share
[...]
/usr/include
/usr/include/FlexLexer.h
/usr/bin/flex++
/usr/bin/lex
/usr/lib/libl.a
[...]
User avatar
henzenmann
Insane DCEmu
Insane DCEmu
Posts: 186
Joined: Wed Jul 12, 2006 4:58 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by henzenmann »

Oh, and by the way, why don't you just use the binaries instead? Thats what they are there for.
User avatar
JS Lemming
Insane DCEmu
Insane DCEmu
Posts: 202
Joined: Mon Apr 04, 2005 8:08 am
Location: C:\CON\CON
Has thanked: 0
Been thanked: 0
Contact:

Post by JS Lemming »

henzenmann wrote:I really think that your flex installation is still not correct, and if I'm right Harley's build script won't help you much.
Harley's build script worked like a charm.
henzenmann wrote:You are using Ubuntu, right? Try the commands "dpkg -l flex" and "dpkg -L flex". The output should look somewhat like this:
Yes, I'm using Ubuntu. When I try those commands, they output exactly what the output on your system.m They are working perfectly.
henzenmann wrote:Oh, and by the way, why don't you just use the binaries instead? Thats what they are there for.
You need to understand that I know very little about all this stuff. The only thing I'm half good at is writting logical code. I'm like an aborted baby on crack when it comes to everything else such as setting up a compilor unless there is exact step by step instructions.... And now that you mentioned it, I went back to that tutorial you wrote and I see why I didn't use your binaries. Down the page it says "A pre-built toolchain for i386 machines..." and I didn't know what a i386 machine was so I googled it and didn't get a good answer. I assumed I didn't have an i386 machine because I had never heard of that anywhere before. I know I know, that was really stupid of me, but I'm like that sometimes.

Now, the present. I assume I have a working environment now, however, I cannot "make" anything. No examples, no previous projects of mine, nothing. I get a response of:

Code: Select all

Makefile:13: *** multiple target patterns.  Stop.
Or

Code: Select all

make: *** No rule to make target `/Makefile.rules'.  Stop.
or someother random nonsense.

The question now is, should I restart and go with your binaries OR bug you fine people until I get my make problems solved... ORRRRRR will using your binaries not fix the make problem at all, that the real problem is me not understanding how to deal with "make".

If I go with your binaries will I be able to "make" anything I want instantly? Or is there tweaking yet to be done?
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Has thanked: 0
Been thanked: 0
Contact:

Post by emptythought »

i386 is just another way of saying x86.
User avatar
henzenmann
Insane DCEmu
Insane DCEmu
Posts: 186
Joined: Wed Jul 12, 2006 4:58 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by henzenmann »

JS Lemming wrote:
henzenmann wrote:I really think that your flex installation is still not correct, and if I'm right Harley's build script won't help you much.
Harley's build script worked like a charm.
henzenmann wrote:You are using Ubuntu, right? Try the commands "dpkg -l flex" and "dpkg -L flex". The output should look somewhat like this:
Yes, I'm using Ubuntu. When I try those commands, they output exactly what the output on your system.m They are working perfectly.
In that case, the dc-chain build script should have worked as well. There must have been some stale configuration left over from the previous attempt. I guess the "build-*" folders should be deleted as well.
JS Lemming wrote:
henzenmann wrote:Oh, and by the way, why don't you just use the binaries instead? Thats what they are there for.
You need to understand that I know very little about all this stuff. The only thing I'm half good at is writting logical code. I'm like an aborted baby on crack when it comes to everything else such as setting up a compilor unless there is exact step by step instructions.... And now that you mentioned it, I went back to that tutorial you wrote and I see why I didn't use your binaries. Down the page it says "A pre-built toolchain for i386 machines..." and I didn't know what a i386 machine was so I googled it and didn't get a good answer. I assumed I didn't have an i386 machine because I had never heard of that anywhere before. I know I know, that was really stupid of me, but I'm like that sometimes.
As fackue already mentioned, i368 specifies the processor type. It basically means PC compatible (the Intel 80386 was the first 32 bit processor in the x86 line, today's Pentium and Athlon processors are still compatible with it). It was such an obvious term to me that I did not even think about explaining it. Another TODO for the next revision of the tutorial :-)
JS Lemming wrote: Now, the present. I assume I have a working environment now, however, I cannot "make" anything. No examples, no previous projects of mine, nothing. I get a response of:

Code: Select all

Makefile:13: *** multiple target patterns.  Stop.
Or

Code: Select all

make: *** No rule to make target `/Makefile.rules'.  Stop.
or someother random nonsense.
This indicates that the environment variable KOS_ROOT is not set. Did you remember to set up the environ.sh script? Check out the part "Setting up KOS" in my tutorial (this has nothing to do with the toolchain itself, but you may need to adjust the parameters so they match Harley's toolchain installation).
User avatar
JS Lemming
Insane DCEmu
Insane DCEmu
Posts: 202
Joined: Mon Apr 04, 2005 8:08 am
Location: C:\CON\CON
Has thanked: 0
Been thanked: 0
Contact:

Post by JS Lemming »

Random question. When something asks me to point to where kos is.... Do I point it to the dirrectory called kos that contains a folder called kos-1.3.0 or do I point to the folder inside kos-1.3.0 that is also called kos? Whoever named those folders should be shot.

Anywho, so I copied your environ.sh script from your thing and put it in a dirrectory in kos that resembles the place I copied it from. And I ran it. It didn't produce any output (I don't think it's supposed to). Andd... still the same results when I try make. I have a feeling that isn't what I was supposed to do.

Seriously... Should I just delete everything and download your binaries? Is there some crazy drawback to doing that?

EDIT: Oh.... I guess I was supposed to read first.... That's a novel idea. BAH! It still is too different from yours... As soon as you give your opinion, I'm deleting and downloading your binaries.
User avatar
henzenmann
Insane DCEmu
Insane DCEmu
Posts: 186
Joined: Wed Jul 12, 2006 4:58 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by henzenmann »

You cannot just run the environ.sh script, you need to "source" it. You'll know if it worked if the command "echo $KOS_BASE" prints something other than an empty line. Check the tutorial again, it is all in there.

At this point, the only benefit of installing the binaries would be that you can follow the example in the tutorial. But I would recommend to just set the parameters in environ.sh to point to where Harley's toolchain was installed. You really need to become more familiar with how this stuff works, otherwise this whole setup will be of little use to you.
User avatar
JS Lemming
Insane DCEmu
Insane DCEmu
Posts: 202
Joined: Mon Apr 04, 2005 8:08 am
Location: C:\CON\CON
Has thanked: 0
Been thanked: 0
Contact:

Post by JS Lemming »

I deleted my dc folder. Started spanken fresh. Followed your tutorial with just a few tweaks here and there. Everything worked perfectly...... My apologies for acting a foo. I'm usually not that dumb. I must have had some crazy version of kos before because the directories were structured like kos/kos-1.3.0/kos/kos-ports.... and it was confusing as heck. Not sure how that happened but I want to forget it!

So anyway, thanks for the help! Now I will observe the examples and learn how things work and such.

Good-day.
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Has thanked: 0
Been thanked: 0
Contact:

Post by emptythought »

DC Dev ISO R1 has KOS named like that.
Post Reply