X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fforeign.test.sh;h=2d7865f86b0bbf437ef450379a04f631006e29ff;hb=7c7e6276719b8d40fddec2070cad81064a25c8ed;hp=bd91bfe5dd3db4d8214a628adec40ab05061aa24;hpb=c3334d2307b721cfcea29e6abcd33e48487fb1ea;p=sbcl.git diff --git a/tests/foreign.test.sh b/tests/foreign.test.sh index bd91bfe..2d7865f 100644 --- a/tests/foreign.test.sh +++ b/tests/foreign.test.sh @@ -27,16 +27,24 @@ testfilestem=${TMPDIR:-/tmp}/sbcl-foreign-test-$$ build_so() { echo building $1.so - if [ $(uname -p) = x86_64 ]; then + if [ $(uname -m) = x86_64 ]; then CFLAGS="$CFLAGS -fPIC" fi + if [ $(uname) = Darwin ]; then + SO_FLAGS="-bundle" + else + SO_FLAGS="-shared" + fi cc -c $1.c -o $1.o $CFLAGS - ld -shared -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 build_so $testfilestem echo 'int foo = 13;' > $testfilestem-b.c @@ -72,6 +80,10 @@ cat > $testfilestem.def.lisp < $testfilestem.def.lisp < $testfilestem.test.lisp <