[gambit-list] Making Gambit on the DS Live again.

jonnay at jonnay.net jonnay at jonnay.net
Mon May 12 23:32:15 EDT 2008


Hi List

I've been trying to hack at Andrew Lentvorski's DS port of gambit, and
update it.

If you are interested in looking at what has been done, you can grab the
latest code from subversion:

http://bunny.jonnay.net/gambitnds/trunk/

For this to be brought back into the Gambit Scheme mainline branch, all my
hackity-hacks around the makefile need to be properly added to the
configure, and it needs to be updated to the main 4.2 branch.

The readme file follows:
This is a hackjob. It's sad but true. Well, my part in this is a hackjob
at any rate.

This project needs more then a few things done to really gain steam and
kick ass:
  1 - Better scheme<->libnds hooks
  	  This just takes time.
  2 - A much easier way to build a full DS application strictly from
within scheme, without the need of a glue c file
  	  Right now you need a very heafty C file to get everything working. 
check gsi/arm9/source/main.c for an example.  The functions and
definitions here need to move etiher A) into a scm file that can be
included, or B) into the libgambc library itself.
  3 - A way to build the libgambc.a without resorting to manually hacking
the makefiles, hopefully just using configure
  	  I don't know enough about configure/autoconf/automake to even start...
  4 - Update to gambit 4.2
  5 - A much smaller libgambc if possible

Currently, I am working on 1 and 2.

Bootstrapping:
--------------
- Install a VIRGIN gambitc v 4.20b, make and make install on your system. 
That should give you a 40b22 directory in /usr/local/Gambit-C.  This is
important, you need a working gambit toolchain and library for your
development machine, as well as your target machine.
- Install devkitpro
- Might as well install PAlib as well.  This step is not strictly needed.
- Once you've done that, you can start building this version.   Don't
worry about the --prefix.  The make file won't actually get far enough to
the install process. :P
- Try running "make" in the lib directory.  If you get a libgambc.a when
you're done, then you're cooking with gas.
  - I added a new target as well called "install-lib", it strips the
libgambc library, and moves it to the devkitpro libnds dir.  Its kinds
dumb, and you will have to at the very least change the location of the
strip executable.  (likely more.)  Either change this thing, or run
strip and copy it manually.
- If you didn't get a working libgambc, here are the steps I did to make a
working version go.
  - There is a shell script called myBuild.sh.  It sets important
environment variables, and runs configure in almost just the right way
to get a working libgambc.  Edit it to set the path to devkitpro.
  - Edit the makefile in lib, and make sure the following thigns are set:
FLAGS_OBJ = -DNDS -std=gnu99 -DUSE_DSWIFI -Wall -W -Wno-unused -Os
-fno-math-errno -fschedule-insns2 -fno-trapping-math -fno-strict-aliasing
-fwrapv -fexpensive-optimizations -fforce-addr -fpeephole2 -falign-jumps
-falign-functions -fno-function-cse -ftree-copyrename -ftree-fre
-ftree-dce -fregmove -fgcse-las -freorder-functions -fcaller-saves
-fno-if-conversion2 -foptimize-sibling-calls -fcse-skip-blocks
-funit-at-a-time -finline-functions -fmodulo-sched
-freschedule-modulo-scheduled-loops -fomit-frame-pointer -fPIC -fno-common
FLAGS_DYN = -specs=ds_arm7.specs -Wall -W -Wno-unused -Os -fno-math-errno
-fschedule-insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv
-fexpensive-optimizations -fforce-addr -fpeephole2 -falign-jumps
-falign-functions -fno-function-cse -ftree-copyrename -ftree-fre
-ftree-dce -fregmove -fgcse-las -freorder-functions -fcaller-saves
-fno-if-conversion2 -foptimize-sibling-calls -fcse-skip-blocks
-funit-at-a-time -finline-functions -fmodulo-sched
-freschedule-modulo-scheduled-loops -fomit-frame-pointer -fPIC -fno-common
-rdynamic
DEFS = -DHAVE_CONFIG -D___DEBUG
LIBS = -lm -lc -lsysbase
  - I had to add os_tcp, os_debug files to the following vars: NORMAL_C
NORMAL H NORMAL O NORMALO_PLUS NORMAL_O_COMMA MODULES_O_IN_COMPILE_ORDER
  - Finally I had to manually add targets for os_tcp and os_debug
  - Luckily all this is done for you in the makefile, so worse come to
worse, just do a diff if you managed to whack everything.
  - I added a new target as well called "install-lib", it strips the
libgambc library, and moves it to the devkitpro libnds dir.  Its kinds
dumb, and you will have to at the very least change the location of the
strip executable.  (likely more.)
  - Now you can make.  You might have to copy the gsc executable from your
virgin gambit-dir/gsc to the gsc directory here

Working with libgambc:
----------------------
Check out the gsi project.  The original is also bundled with this
project, but I wanted to update it with the more recent version of
devkitpro.
This project actually compiles, and almost-executes.  It seems to get far,
but not far enough (and it needs more work).

Additionally, look at thee-stack.  This is an attempt to make an NDS
application with scheme.


Standing on the shoulders of giants:
------------------------------------
Marc Feely - King of Gambit.
Andrew Lentvorski - This is the man who laid in all the ground work.

Any work I did is merely embellishments and hackjobs.
Jonathan Arkell   jonnay at jonnay.net






More information about the Gambit-list mailing list