X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fforeign.test.sh;h=2d7865f86b0bbf437ef450379a04f631006e29ff;hb=3fdb572dad102d87f196f39a680967874025682e;hp=f3d12b8ee4a47efeeadc38f4809cf1dc2894bfa2;hpb=dcb7dbc4a93f413d7ce2cd0d05e13c2a7e785e79;p=sbcl.git diff --git a/tests/foreign.test.sh b/tests/foreign.test.sh index f3d12b8..2d7865f 100644 --- a/tests/foreign.test.sh +++ b/tests/foreign.test.sh @@ -27,11 +27,16 @@ 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 @@ -93,7 +98,7 @@ cat > $testfilestem.def.lisp <