0ba0760820cd216c2dabd53db61088244c0ac2c0
[sbcl.git] / tools-for-build / grovel-features.sh
1 # Automated platform feature testing 
2
3 DIR=tools-for-build
4
5 # FIXME: Use this to test for dlopen presence and hence
6 # load-shared-object buildability
7
8 # $1 feature
9 # $2 additional flags
10 #
11 # Assumes the presence of $1-test.c, which when built and
12 # run should return with 104 if the feature is present.
13 #
14 featurep() {
15     bin="$DIR/$1-test"
16     rm -f $bin
17     cc $DIR/$1-test.c $2 -o $bin > /dev/null 2>&1 && $bin > /dev/null 2>&1
18     if [ "$?" = 104 ]
19     then
20         printf " :$1"
21     fi
22     rm -f $bin
23 }
24
25 featurep os-provides-dladdr -ldl