X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fforeign.test.sh;h=40ed2aea64e5c5e5b823f9ceb52316172a38fd59;hb=2fb5b174f6acb88a85c86aa4cd753ddefaccc987;hp=f3d12b8ee4a47efeeadc38f4809cf1dc2894bfa2;hpb=dcb7dbc4a93f413d7ce2cd0d05e13c2a7e785e79;p=sbcl.git diff --git a/tests/foreign.test.sh b/tests/foreign.test.sh index f3d12b8..40ed2ae 100644 --- a/tests/foreign.test.sh +++ b/tests/foreign.test.sh @@ -9,7 +9,7 @@ # While most of SBCL is derived from the CMU CL system, the test # files (like this one) were written from scratch after the fork # from CMU CL. -# +# # This software is in the public domain and is provided with # absolutely no warranty. See the COPYING and CREDITS files for # more information. @@ -27,13 +27,18 @@ 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 @@ -79,8 +84,12 @@ cat > $testfilestem.def.lisp < $testfilestem.def.lisp < $testfilestem.test.lisp < $testfilestem.test.lisp <