blob: 0e9cef9b0d54785e2c8d7d7ba29113d5ef259845 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/bin/sh
#########################################################################
# #
# OCaml #
# #
# Xavier Leroy, projet Cristal, INRIA Rocquencourt #
# #
# Copyright 2011 Institut National de Recherche en Informatique et #
# en Automatique. All rights reserved. This file is distributed #
# under the terms of the GNU Library General Public License, with #
# the special exception on linking described in file ../../LICENSE. #
# #
#########################################################################
opts=""
libs="$cclibs"
args=$*
rm -f hasgot.c
var="x"
while : ; do
case "$1" in
-i) echo "#include <$2>" >> hasgot.c; shift;;
-t) echo "$2 $var;" >> hasgot.c; var="x$var"; shift;;
-l*|-L*|-F*) libs="$libs $1";;
-framework) libs="$libs $1 $2"; shift;;
-*) opts="$opts $1";;
*) break;;
esac
shift
done
(echo "main() {"
for f in $*; do echo " (void) & $f;"; done
echo "}") >> hasgot.c
if test "$verbose" = yes; then
echo "hasgot2 $args: $cc $opts -o tst hasgot.c $libs" >&2
exec $cc $opts -o tst hasgot.c $libs > /dev/null
else
exec $cc $opts -o tst hasgot.c $libs > /dev/null 2>/dev/null
fi
|