* s390x-codegen.h: Fix immediate checks.
[mono.git] / scripts / mono-find-provides.in
blobba46722ae679b29999d1bacbb74ce52aea687522
1 #!/bin/bash
3 # mono-find-provides
5 # Authors:
6 # Ben Maurer (bmaurer@ximian.com)
8 # (C) 2005 Novell (http://www.novell.com)
11 IFS=$'\n'
12 filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
13 monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
15 a=`which "$0"`
16 d=`dirname "$a"`
18 # Set the prefix, unless it is overriden (used when building mono rpms)
19 : ${prefix=$d/..}
21 exec_prefix=$d/..
22 libdir=$prefix/@reloc_libdir@
23 bindir=$d
25 [ -x $bindir/monodis ] || exit 0;
26 [ -f $libdir/libmono.so ] || exit 0;
29 # set LD_LIBRARY_PATH to ensure that libmono.so is found
30 export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
32 for i in "${monolist[@]}"; do
33 ($bindir/monodis --assembly $i | awk '
34 BEGIN { LIBNAME=""; VERSION=""; }
35 /^Version:/ { VERSION=$2 }
36 /^Name:/ { LIBNAME=$2 }
37 END {
38 if (LIBNAME ~ /^policy/) {
39 cnt = split(LIBNAME, toks, ".")
40 VERSION=toks[2] "." toks[3] ".0.0"
41 LIBNAME=""
42 for (i=4; i<= cnt; i++)
43 LIBNAME = (LIBNAME toks[i] ".")
44 LIBNAME=substr(LIBNAME, 1, length(LIBNAME)-1)
46 if (VERSION && LIBNAME)
47 print "mono(" LIBNAME ") = " VERSION
49 ') 2>/dev/null
50 done