

Yes, after long last, I have finaly integrated code::blocks with everybody's favorite dreamcast environment. I will post final instructions on it later today, but let's just say, it wasn't easy.
Code: Select all
-O2 -DFRAME_POINTERS -ml -m4-single-only
-fno-optimize-sibling-calls
Code: Select all
_arch_dreamcast -D_arch_sub_pristine -Wall
_arch_dreamcast -D_arch_sub_pristine -Wall -g -fno-builtin -fno-strict-aliasing
Code: Select all
-g -fno-builtin -fno-strict-aliasing -ml -m4-single-only -Wl,-Ttext=0x8c010000
-nostartfiles -nostdlib
C:\cygwin\usr\local\dc\kos\kos\kernel\arch\dreamcast\kernel\startup.o
-Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group
Code: Select all
C:\cygwin\usr\local\dc\kos\kos-ports\include
C:\cygwin\usr\local\dc\kos\kos\include
C:\cygwin\usr\local\dc\kos\kos\kernel\arch\dreamcast\include
C:\cygwin\usr\local\dc\kos\kos\addons\include
Code: Select all
C:\cygwin\usr\local\dc\kos\kos\lib\dreamcast
C:\cygwin\usr\local\dc\kos\kos\addons\lib\dreamcast
Code: Select all
C:\cygwin\usr\local\dc\sh-elf
Code: Select all
C compiler: sh-elf-gcc.exe
C++ compiler: sh-elf-g++.exe
Dynamic Linker: sh-elf-g++.exe
Static Linker: sh-elf-ar.exe
Code: Select all
C:\cygwin\bin
Code: Select all
#include <kos.h>
int main(int argc, char **argv) {
int x, y;
/* Bother us with output only if something died */
dbglog_set_level(DBG_DEAD);
/* Set the video mode */
vid_set_mode(DM_640x480, PM_RGB565);
for (y=0; y<480; y++)
for (x=0; x<640; x++) {
int c = (x ^ y) & 255;
vram_s[y*640+x] = ((c >> 3) << 12)
| ((c >> 2) << 5)
| ((c >> 3) << 0);
}
/* Pause to see the results */
while(1);
usleep(5*1000*1000);
return 0;
}
This has what to do with setting it up under an IDE? I'm sorry, but I'm not sure why you came here to post that...ATani wrote:On linux you can create a copy of the GCC compiler settings and then set the compiler programs to use the kos gnu_wrapper scripts. No fussing with the compiler/link settings at all!
.....
The only requirement is that you have your environ.sh script executed before starting the wrapper scripts.
I will take that with a very large grain of salt... The reason why I posted that in this thread is because this thread started out with configuring code::blocks to work for DC development.pnpbios wrote: This has what to do with setting it up under an IDE? I'm sorry, but I'm not sure why you came here to post that...
Because it gives people a nice little hint about how to get it working with the Linux version of Code::Blocks (which I just did). Instead of mucking around with various command-line flags, you can just point Code::Blocks to the wrapper scripts provided in kos/utils/gnu_wrappers, which take care of calling the real compilers with the appropriate parameters. The rest of the setup (adding the include directories and so on) is pretty much the same, although not required for the compiler to function. It is required for the IDE to find the include and library files, of course. It (should) also work correctly with C++, and C/C++ mixed projects.pnpbios wrote:This has what to do with setting it up under an IDE? I'm sorry, but I'm not sure why you came here to post that...
That is an option I somehow overlooked... Cool tipBlackAura wrote:I don't know if this is present in the Windows version of Code::Blocks, but in the Linux version under Settings->Compiler, in the Other tab, there's an option labelled "Shell to run console programs". That can be set up to run your app through DCLoad by specifying DCLoad instead of a terminal app.