Apply "search for cp" patch by Hraban Luyat
[sbcl.git] / tools-for-build / grovel-features.sh
blob522ebc58c987934e631640054f1b4012f7f68aab
1 # Automated platform feature testing
2 cd ./tools-for-build > /dev/null
3 . ./android_run.sh
5 # FIXME: Use this to test for dlopen presence and hence
6 # load-shared-object buildability
8 # Assumes the presence of $1-test.c, which when built and
9 # run should return with 104 if the feature is present.
10 # We presumes that the build machine matches the target machine
11 # in terms of a whether each feature presence test should pass.
12 featurep() {
13 bin="$1-test"
14 featurename=${2:-$1}
15 rm -f $bin
16 if $android
17 then
18 $CC -I../src/runtime -ldl -o $bin $bin.c > /dev/null 2>&1
19 exit_code=`android_run_for_exit_code $bin`
20 else
21 $GNUMAKE $bin -I ../src/runtime > /dev/null 2>&1 && echo "input" | ./$bin> /dev/null 2>&1
22 exit_code="$?"
24 if [ "$exit_code" -eq 104 ]
25 then
26 printf " :$featurename"
28 rm -f $bin
31 # Adding a nonexistent link library to Config.*-win32 will fail,
32 # so we pass -lSynchronization to the featurep test specifically
33 # and not in the general make rule.
34 # It will get added in by Config.*-win32 only if LISP_FEATURE_SB_FUTEX.
35 if [ "$sbcl_os" = win32 ] ; then
36 LOADLIBES=-lSynchronization featurep os-provides-wakebyaddr sb-futex
39 featurep os-provides-dlopen
41 featurep os-provides-dladdr
43 featurep os-provides-blksize-t
45 featurep os-provides-suseconds-t
47 featurep os-provides-getprotoby-r
49 featurep os-provides-poll
51 featurep os-provides-close-range-wrapper
53 featurep os-provides-posix-spawn
55 if [ "$sbcl_arch" = arm ] ; then
56 featurep arm-softfp