Is it possible to build only certain parts of Gambit, eg. libgambc? The reason I ask is that I'm following Sean Chapel's Android example project on GitHub [1] and have to run `make' which breaks, but only after building libgambc, which is all I need. Happy coincidence. If the build order ever changes this fragile solution will stop working, so it would be nice to be able to specify libgambc as the `make' target ie. `make libgambc' or similar.
Also, Sean's example doesn't first do a `make bootstrap' and `make bootclean' to remove stale .c files. Not sure if this would be possible anyway since `./configure' would have to be run again after `make bootclean' with `--host=arm-linux-eabi'. Anyone?
Afficher les réponses par date
Forgot to include the link. Here it is:
On 2013-04-30, at 10:04 AM, Ralph Möritz ralph.moeritz@outlook.com wrote:
Is it possible to build only certain parts of Gambit, eg. libgambc? The reason I ask is that I'm following Sean Chapel's Android example project on GitHub [1] and have to run `make' which breaks, but only after building libgambc, which is all I need. Happy coincidence. If the build order ever changes this fragile solution will stop working, so it would be nice to be able to specify libgambc as the `make' target ie. `make libgambc' or similar.
How about a "cd lib;make" ?
Also, Sean's example doesn't first do a `make bootstrap' and `make bootclean' to remove stale .c files. Not sure if this would be possible anyway since `./configure' would have to be run again after `make bootclean' with `--host=arm-linux-eabi'. Anyone?
It is best to build Gambit for your host platform with a "make bootstrap". This will give you a Gambit compiler (gsc-boot) which works on your development platform. Then, create a separate directory (e.g. clone Gambit's github repo), copy gsc-boot to the root of that directory, and then configure Gambit for your android development environment. If you ever change some .scm files, the gsc-boot compiler will translate them to the appropriate .c file. Note that this works because the Gambit compiler, when generating .c files from .scm files, has no dependencies on the target platform.
Also, you might want to use the misc/build-gambit-android script that automates the building of an android Gambit.
Marc
Is it possible to build only certain parts of Gambit, eg. libgambc? The reason I ask is that I'm following Sean Chapel's Android example project on GitHub [1] and have to run `make' which breaks, but only after building libgambc, which is all I need. Happy coincidence. If the build order ever changes this fragile solution will stop working, so it would be nice to be able to specify libgambc as the `make' target ie. `make libgambc' or similar.
How about a "cd lib;make" ?
That would do it!
Also, Sean's example doesn't first do a `make bootstrap' and `make bootclean' to remove stale .c files. Not sure if this would be possible anyway since `./configure' would have to be run again after `make bootclean' with `--host=arm-linux-eabi'. Anyone?
It is best to build Gambit for your host platform with a "make bootstrap". This will give you a Gambit compiler (gsc-boot) which works on your development platform. Then, create a separate directory (e.g. clone Gambit's github repo), copy gsc-boot to the root of that directory, and then configure Gambit for your android development environment. If you ever change some .scm files, the gsc-boot compiler will translate them to the appropriate .c file. Note that this works because the Gambit compiler, when generating .c files from .scm files, has no dependencies on the target platform.
Interesting.
Also, you might want to use the misc/build-gambit-android script that automates the building of an android Gambit.
Aha! I have been enlightened. Thank you.
On Tue, 30 Apr 2013 16:25:32 +0200, Marc Feeley feeley@iro.umontreal.ca wrote:
Also, you might want to use the misc/build-gambit-android script that automates the building of an android Gambit.
This didn't work for me; I'll post details soon. (It's late) In the meantime I've created a small script that does what I want. Just posting it here in the interim.
I'm building libgambc for Android/ARM as follows: (On Windows)
1. Launch MinGW Bash and build gsc-boot the usual way, being sure to do a `make bootclean' afterwards. 2. Create a standalone NDK toolchain targetting ARM if you don't already have one. 3. Run the script below from Cygwin's Bash (I can't get the toolchain to work from MinGW for some reason. Again, I'll provide details ASAP)
#!/bin/sh
export ANDROID_TOOLCHAIN_ROOT=/cygdrive/c/Android/android-ndk-toolchain-arm-gcc47 export PATH=$PATH:$ANDROID_TOOLCHAIN_ROOT/bin export PREFIX=/cygdrive/c/Gambit-C/trunk
export LD=arm-linux-androideabi-ld export AR=arm-linux-androideabi-ar export STRIP=arm-linux-androideabi-strip export RANLIB=arm-linux-androideabi-ranlib export CC=arm-linux-androideabi-gcc export CXX=arm-linux-androideabi-g++
./configure --enable-single-host --enable-c-opt --enable-gcc-opts --enable-multiple-versions --prefix=$PREFIX --host=arm-linux-eabi CPPFLAGS="-DANDROID -I$ANDROID_TOOLCHAIN_ROOT/sysroot/usr/include/ -fno-short-enums" CFLAGS="-DANDROID -fno-short-enums -I$ANDROID_TOOLCHAIN_ROOT/sysroot/usr/include/ -nostdlib" LDFLAGS="-Wl,-rpath-link=$ANDROID_TOOLCHAIN_ROOT/sysroot/usr/lib/ -L$ANDROID_TOOLCHAIN_ROOT/sysroot/usr/lib" LIBS="-lc -ldl" && cd lib; make