X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fforeign.test.sh;h=045d36bb63f1e900d40a3665d6645df8459570bf;hb=7e24349c17298e2959e853ea411b5f65d9f7f332;hp=40ed2aea64e5c5e5b823f9ceb52316172a38fd59;hpb=a8781d6c5b68a6b08315e98f70a407d992e07363;p=sbcl.git diff --git a/tests/foreign.test.sh b/tests/foreign.test.sh index 40ed2ae..045d36b 100644 --- a/tests/foreign.test.sh +++ b/tests/foreign.test.sh @@ -23,28 +23,78 @@ PUNT=104 testfilestem=${TMPDIR:-/tmp}/sbcl-foreign-test-$$ -## Make a little shared object files to test with. +## Make some shared object files to test with. build_so() { echo building $1.so - if [ "$(uname -m)" = x86_64 ]; then + if [ "`uname -m`" = x86_64 ]; then CFLAGS="$CFLAGS -fPIC" fi - if [ "$(uname)" = Darwin ]; then + if [ "`uname`" = Darwin ]; then SO_FLAGS="-bundle" else SO_FLAGS="-shared" fi cc -c $1.c -o $1.o $CFLAGS - ld $SO_FLAGS -o $1.so $1.o + ld $SO_FLAGS -o $1.so $1.o } -echo 'int summish(int x, int y) { return 1 + x + y; }' > $testfilestem.c -echo 'int numberish = 42;' >> $testfilestem.c -echo 'int nummish(int x) { return numberish + x; }' >> $testfilestem.c -echo 'short negative_short() { return -1; }' >> $testfilestem.c -echo 'int negative_int() { return -2; }' >> $testfilestem.c -echo 'long negative_long() { return -3; }' >> $testfilestem.c +cat > $testfilestem.c < $testfilestem-b.c @@ -84,6 +134,14 @@ cat > $testfilestem.def.lisp < $testfilestem.test.lisp <