Add copyright notices and new function String.chomp
[ocaml.git] / config / auto-aux / hasgot
blob5014b903d7adbee9f6a8fe864157bbca050df6c6
1 #!/bin/sh
3 opts=""
4 libs="$cclibs"
5 args=$*
6 rm -f hasgot.c
7 var="x"
8 while : ; do
9 case "$1" in
10 -i) echo "#include <$2>" >> hasgot.c; shift;;
11 -t) echo "$2 $var;" >> hasgot.c; var="x$var"; shift;;
12 -l*|-L*|-F*) libs="$libs $1";;
13 -framework) libs="$libs $1 $2"; shift;;
14 -*) opts="$opts $1";;
15 *) break;;
16 esac
17 shift
18 done
20 (echo "main() {"
21 for f in $*; do echo " $f();"; done
22 echo "}") >> hasgot.c
24 if test "$verbose" = yes; then
25 echo "hasgot $args: $cc $opts -o tst hasgot.c $libs" >&2
26 exec $cc $opts -o tst hasgot.c $libs > /dev/null
27 else
28 exec $cc $opts -o tst hasgot.c $libs > /dev/null 2>/dev/null