X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fforeign.test.sh;h=2c5d0d309b3c2b9c4e959d671408172454a51925;hb=f31bc323d5bfc205f94164b203833f35033df3cd;hp=9fff522b47bccb278f084ba93b9b10d2f14eb924;hpb=c3ca13d2e1e75cc43399f8d290e5f8e6b8cdc08c;p=sbcl.git diff --git a/tests/foreign.test.sh b/tests/foreign.test.sh index 9fff522..2c5d0d3 100644 --- a/tests/foreign.test.sh +++ b/tests/foreign.test.sh @@ -14,7 +14,9 @@ # absolutely no warranty. See the COPYING and CREDITS files for # more information. +. ./expect.sh . ./subr.sh + use_test_subdirectory echo //entering foreign.test.sh @@ -34,14 +36,23 @@ build_so() ( CFLAGS="$CFLAGS -fPIC" ;; esac - if [ "`uname`" = Darwin ]; then - SO_FLAGS="-bundle" - if run_sbcl --eval '(sb-ext:quit :unix-status #+x86-64 0 #-x86-64 1)'; then - CFLAGS="$CFLAGS -arch x86_64" - fi - else - SO_FLAGS="-shared" - fi + case "`uname`" in + Darwin) + SO_FLAGS="-bundle" + if run_sbcl --eval '(sb-ext:quit :unix-status #+x86-64 0 #-x86-64 1)'; then + CFLAGS="$CFLAGS -arch x86_64" + fi + ;; + OpenBSD) + SO_FLAGS="-shared" + if [ "`machine -a`" = "powerpc" ]; then + CFLAGS="$CFLAGS -fPIC" + fi + ;; + *) + SO_FLAGS="-shared" + ;; + esac cc -c $1.c -o $1.o $CFLAGS ld $SO_FLAGS -o $1.so $1.o ) @@ -371,5 +382,28 @@ run_sbcl < $TEST_FILESTEM.alien.enum.lisp <