X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fforeign.test.sh;h=045d36bb63f1e900d40a3665d6645df8459570bf;hb=1dc3a468ba32755c51747d6e85ed32d989f2dd49;hp=35efc19849e067440f011c0d56b7f2d4c3d23533;hpb=c4e725639ba67b17664700c96d04746f97c8075c;p=sbcl.git diff --git a/tests/foreign.test.sh b/tests/foreign.test.sh index 35efc19..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 < $testfilestem.test.lisp <