Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

288
scripts/Makefile.am Normal file
View File

@@ -0,0 +1,288 @@
#
# Scripts that we install
#
# Starting with Mono 2.0, the majority of the tools default to the
# 2.0 profile. Commands that support the 1.0 toolchain and must
# run under 1.0 have the number 1 appended to their command names
# (for example mcs1 is the C# 1.0 compiler) and are listed in the
# scripts_1_0 compat variable.
#
# To preserve compatibility with old Makefiles and tools we keep the
# command names that had the suffix 2 (like wsdl2)
#
if USE_BATCH_FILES
SCRIPT_IN=script.bat.in
FILTER=sed -e 's,\.bat\.exe,\.exe,g' -e 's,/,\\,g'
SCRIPT_SUFFIX=.bat
else
SCRIPT_IN=script.in
FILTER=cat
SCRIPT_SUFFIX=
endif
COMPAT_1_0_SUFFIX=1$(SCRIPT_SUFFIX)
COMPAT_2_0_SUFFIX=2$(SCRIPT_SUFFIX)
COMPAT_4_0_SUFFIX=4$(SCRIPT_SUFFIX)
bin_SCRIPTS = \
$(scripts_4_0_umask) \
$(scripts_defaults) \
$(scripts_2_0) \
$(scripts_service) \
$(scripts_nunit) \
$(scripts_rpmhelpers) \
$(MDOC_SUBCOMMANDS) \
$(MDOC_COMPAT) \
mono-test-install \
peverify \
mcs \
gmcs \
mono-heapviz \
$(scripts_mono_configuration_crypto)
if INSTALL_4_0
bin_SCRIPTS += $(scripts_4_0)
bin_SCRIPTS += dmcs
endif
if INSTALL_4_5
bin_SCRIPTS += xbuild
endif
scripts_4_0_umask = \
makecert$(SCRIPT_SUFFIX) \
sn$(SCRIPT_SUFFIX)
deprecated = \
cilc(SCRIPT_SUFFIX) \
mjs(SCRIPT_SUFFIX)
scripts_2_0 = \
al2$(SCRIPT_SUFFIX) \
gacutil2$(SCRIPT_SUFFIX) \
monop2$(SCRIPT_SUFFIX) \
resgen2$(SCRIPT_SUFFIX) \
wsdl2$(SCRIPT_SUFFIX)
scripts_4_0 = \
disco$(SCRIPT_SUFFIX) \
dtd2xsd$(SCRIPT_SUFFIX) \
dtd2rng$(SCRIPT_SUFFIX) \
installvst$(SCRIPT_SUFFIX) \
genxs$(SCRIPT_SUFFIX) \
macpack$(SCRIPT_SUFFIX) \
mdoc$(SCRIPT_SUFFIX) \
mono-cil-strip$(SCRIPT_SUFFIX) \
prj2make$(SCRIPT_SUFFIX) \
soapsuds$(SCRIPT_SUFFIX) \
caspol$(SCRIPT_SUFFIX) \
cert2spc$(SCRIPT_SUFFIX) \
certmgr$(SCRIPT_SUFFIX) \
chktrust$(SCRIPT_SUFFIX) \
crlupdate$(SCRIPT_SUFFIX) \
csharp$(SCRIPT_SUFFIX) \
httpcfg$(SCRIPT_SUFFIX) \
lc$(SCRIPT_SUFFIX) \
mconfig$(SCRIPT_SUFFIX) \
mod$(SCRIPT_SUFFIX) \
monolinker$(SCRIPT_SUFFIX) \
mono-api-info$(SCRIPT_SUFFIX) \
mono-shlib-cop$(SCRIPT_SUFFIX) \
mozroots$(SCRIPT_SUFFIX) \
permview$(SCRIPT_SUFFIX) \
pdb2mdb$(SCRIPT_SUFFIX) \
xsd$(SCRIPT_SUFFIX) \
mono-xmltool$(SCRIPT_SUFFIX) \
setreg$(SCRIPT_SUFFIX) \
secutil$(SCRIPT_SUFFIX) \
signcode$(SCRIPT_SUFFIX) \
sgen$(SCRIPT_SUFFIX) \
sqlmetal$(SCRIPT_SUFFIX) \
sqlsharp$(SCRIPT_SUFFIX) \
svcutil$(SCRIPT_SUFFIX) \
ccrewrite$(SCRIPT_SUFFIX) \
cccheck$(SCRIPT_SUFFIX) \
mdbrebase$(SCRIPT_SUFFIX) \
ikdasm$(SCRIPT_SUFFIX)
MDOC_SUBCOMMANDS = \
mdoc-assemble \
mdoc-export-html \
mdoc-export-msxdoc \
mdoc-update \
mdoc-validate
MDOC_COMPAT = \
mdassembler \
mdvalidater \
monodocer \
monodocs2html \
monodocs2slashdoc
#
# these are the new defaults, 2.0 profile-based commands
#
# we can move scripts_1_0 scripts here as we see fit, if we need to
# keep a 1.0 command available, we should additionally put it on
# the scripts_1_0_compat list
#
scripts_defaults = \
al$(SCRIPT_SUFFIX) \
ilasm$(SCRIPT_SUFFIX) \
gacutil$(SCRIPT_SUFFIX) \
mkbundle$(SCRIPT_SUFFIX) \
monop$(SCRIPT_SUFFIX) \
resgen$(SCRIPT_SUFFIX) \
wsdl$(SCRIPT_SUFFIX)
scripts_service = mono-service mono-service2
scripts_nunit = nunit-console$(SCRIPT_SUFFIX) nunit-console2$(SCRIPT_SUFFIX) nunit-console4$(SCRIPT_SUFFIX)
scripts_rpmhelpers = mono-find-provides mono-find-requires
scripts_mono_configuration_crypto = mono-configuration-crypto$(SCRIPT_SUFFIX)
CLEANFILES = $(scripts_mono_configuration_crypto) $(scripts_4_0_umask) $(scripts_2_0) $(scripts_defaults) $(scripts_4_0) mono-service mono-service2 nunit-console nunit-console2 nunit-console4 mono-find-provides mono-find-requires mod $(MDOC_SUBCOMMANDS)
DISTCLEANFILES = $(pkgconfig_DATA) $(scripts_rpmhelpers)
EXTRA_DIST = \
script.in \
script.bat.in \
script_umask.in \
script_umask.bat.in \
mod.in \
mono-service.in \
mono-find-provides.in \
mono-find-requires.in \
peverify.in \
xbuild.in \
update_submodules \
mcs.in \
gmcs.in \
dmcs.in \
mono-test-install \
mono-heapviz \
$(MDOC_COMPAT) \
get-cygwin-deps.sh \
mono-configuration-crypto.in
if USE_JIT
mono_interp = mono
else
mono_interp = mint
endif
if HOST_WIN32
if CROSS_COMPILING
plat_bindir = $(bindir)
mono_instdir = $(prefix)/lib/mono
else
plat_bindir = $(shell cygpath -m $(libdir))
mono_instdir = $(shell cygpath -m $(libdir))/mono
endif
else
plat_bindir = $(bindir)
mono_instdir = $(prefix)/lib/mono
endif
REWRITE_COMMON = sed \
-e 's,@''bindir@,$(bindir),g' \
-e 's,@''plat_bindir@,$(plat_bindir),g' \
-e 's,@''mono_instdir@,$(mono_instdir),g' \
-e 's,@''gtkdir@,$(gtkdir),g'
REWRITE = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp),g'
REWRITE_DEBUG = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp) --debug,g'
REWRITE2_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,2.0,g'
REWRITE2 = $(REWRITE) -e 's,@''framework_version@,2.0,g'
REWRITE2_1 = $(REWRITE) -e 's,@''framework_version@,2.1,g'
if INSTALL_4_5
REWRITE4 = $(REWRITE) -e 's,@''framework_version@,4.5,g'
REWRITE4_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,4.5,g'
else
if INSTALL_4_0
REWRITE4 = $(REWRITE) -e 's,@''framework_version@,4.0,g'
REWRITE4_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,4.0,g'
else
REWRITE4 = $(REWRITE) -e 's,@''framework_version@,2.0,g'
REWRITE4_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,2.0,g'
endif
endif
peverify: peverify.in Makefile
$(REWRITE_COMMON) $(srcdir)/peverify.in > $@.tmp
mv -f $@.tmp $@
mcs: mcs.in Makefile
$(REWRITE_COMMON) $(srcdir)/mcs.in > $@.tmp
mv -f $@.tmp $@
gmcs: gmcs.in Makefile
$(REWRITE_COMMON) $(srcdir)/gmcs.in > $@.tmp
mv -f $@.tmp $@
dmcs: dmcs.in Makefile
$(REWRITE_COMMON) $(srcdir)/dmcs.in > $@.tmp
mv -f $@.tmp $@
mono-service: mono-service.in Makefile
$(REWRITE4) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
mv -f $@.tmp $@
mono-service2: mono-service.in Makefile
$(REWRITE2) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
mv -f $@.tmp $@
nunit-console$(SCRIPT_SUFFIX): $(SCRIPT_IN) Makefile
$(REWRITE2_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
mv -f $@.tmp $@
nunit-console2$(SCRIPT_SUFFIX): $(SCRIPT_IN) Makefile
$(REWRITE2_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
mv -f $@.tmp $@
nunit-console4$(SCRIPT_SUFFIX): $(SCRIPT_IN) Makefile
$(REWRITE4_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
mv -f $@.tmp $@
xbuild: xbuild.in Makefile
$(REWRITE_COMMON) $(srcdir)/xbuild.in > $@.tmp
mv -f $@.tmp $@
#FIXME: this is not the correct rule for mod.bat.
mod$(SCRIPT_SUFFIX): mod.in Makefile
$(REWRITE2) -e "s,@""exe_name@,mod,g" $(srcdir)/mod.in > $@.tmp
mv -f $@.tmp $@
#FIXME: this is not the correct rule for bat files.
$(scripts_4_0_umask): script_umask.in Makefile
n=`echo $@ | sed 's,$(COMPAT_4_0_SUFFIX)$$,,'`; \
$(REWRITE4) -e "s,@""exe_name@,$$n,g" $(srcdir)/script_umask.in | $(FILTER) > $@.tmp
mv -f $@.tmp $@
$(scripts_defaults): $(SCRIPT_IN) Makefile
n=`echo $@ | sed 's,$(COMPAT_4_0_SUFFIX)$$,,'`; \
$(REWRITE4) -e "s,@""exe_name@,$$n,g" $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
mv -f $@.tmp $@
$(scripts_2_0): $(SCRIPT_IN) Makefile
n=`echo $@ | sed 's,$(COMPAT_2_0_SUFFIX)$$,,'`; \
$(REWRITE2) -e "s,@""exe_name@,$$n,g" $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
mv -f $@.tmp $@
$(scripts_4_0): $(SCRIPT_IN) Makefile
n=`echo $@ | sed 's,$(COMPAT_4_0_SUFFIX)$$,,'`; \
$(REWRITE4) -e "s,@""exe_name@,$$n,g" $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
mv -f $@.tmp $@
$(scripts_mono_configuration_crypto): mono-configuration-crypto.in
$(REWRITE4) -e "s,@exe_name@,mono-configuration-crypto,g" $(srcdir)/mono-configuration-crypto.in > $@.tmp
mv -f $@.tmp $@
$(MDOC_SUBCOMMANDS): Makefile
for script in $(MDOC_SUBCOMMANDS) ; do \
cmd=`echo $$script | sed 's/mdoc-//'` ; \
echo "#!/bin/sh" > $$script ; \
echo "exec mdoc $$cmd \"\$$@\"" >> $$script; \
done

834
scripts/Makefile.in Normal file

File diff suppressed because it is too large Load Diff

2
scripts/dmcs.in Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.5/mcs.exe -sdk:4 "$@"

58
scripts/get-cygwin-deps.sh Executable file
View File

@@ -0,0 +1,58 @@
#!/bin/bash
#
# This script will download and install the dependencies needed for compiling
# mono on cygwin
#
# Check for required packages
commands="wget unzip automake autoconf libtool make bison"
failed=0
for i in $commands; do
if ! which $i > /dev/null 2>&1; then
echo "You must have the '$i' package installed."
failed=1
fi
done
if [ $failed = 1 ]; then
exit 1
fi
dir=cygwin-deps
mkdir -p $dir
echo -n "Downloading deps... "
if [ ! -f $dir/gettext-runtime-0.17-1.zip ]; then
wget -P $dir http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-0.17-1.zip
fi
if [ ! -f $dir/libiconv-1.13-mingw32-dev.tar.gz ]; then
wget -P $dir http://sourceforge.net/projects/mingw/files/MinGW/libiconv/libiconv-1.13/libiconv-1.13-mingw32-dev.tar.gz/download
fi
echo "done."
echo -n "Extracting to cygwin-deps/ ..."
(cd $dir && for i in *.zip; do unzip -oq $i || exit 1; done) || exit 1
# This is needed because windows can't use dll's without an x flag.
chmod a+x $dir/bin/*.dll
echo "done."
echo -n "Patching PC files... "
prefix=$PWD/$dir
find $dir -name "*.pc" > $dir/pc-files
for i in `cat $dir/pc-files`; do
(sed -e "s,^prefix=.*,prefix=$prefix,g" < $i > $i.tmp && mv $i.tmp $i) || exit 1
done
rm -f $dir/pc-files
echo "done."
# Create an environment shell file
rm -f $dir/env.sh
echo "export PKG_CONFIG_PATH=\"$PWD/$dir/lib/pkgconfig:\$PKG_CONFIG\"" >> $dir/env.sh
echo "export PATH=\"$PWD/$dir/bin:\$PATH\"" >> $dir/env.sh
echo "Source $dir/env.sh into your environment using:"
echo ". $dir/env.sh"
echo "Then run mono's configure."

2
scripts/gmcs.in Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.5/mcs.exe -sdk:2 "$@"

2
scripts/mcs.in Normal file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.5/mcs.exe "$@"

16
scripts/mdassembler Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
cmd_line=
for option do
case "$option" in
--ecma | --ecmaspec | --error | --man | --simple | --xhtml | --hb)
format=`echo $option | sed 's/^--//'`
cmd_line="$cmd_line --format=$format"
;;
*)
cmd_line="$cmd_line $option"
;;
esac
done
exec mdoc assemble $cmd_line

3
scripts/mdvalidater Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec mdoc validate --format "$@"

21
scripts/mod.in Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
prefix=@prefix@
exec_prefix=@exec_prefix@
monodocdir=@monodocdir@
if test "x$1" = x; then
echo Usage is: mod TOPIC
exit 1;
fi
MOD="@bindir@/@mono_interp@ $MONO_OPTIONS @mono_instdir@/@framework_version@/@exe_name@.exe"
if `which lynx >/dev/null 2>&1` > /dev/null; then
$MOD "$1" | lynx -dump -stdin -force_html | ${PAGER:-more}
else
tmp=$HOME/.monodoc-tmp-$$
$MOD "$1" > $tmp
links -dump -force-html $tmp | ${PAGER:-more}
rm $tmp
fi

View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec @bindir@/@mono_interp@ $MONO_OPTIONS @mono_instdir@/mono-configuration-crypto/@framework_version@/@exe_name@.exe "$@"

View File

@@ -0,0 +1,56 @@
#!/bin/bash
#
# mono-find-provides
#
# Authors:
# Ben Maurer (bmaurer@ximian.com)
#
# (C) 2005 Novell (http://www.novell.com)
#
IFS=$'\n'
filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
# Only include files with /gac/ in path
# (Allows packages to contain private assemblies that don't conflict with other packages)
#monolist=($(printf "%s\n" "${monolist[@]}" | egrep "/gac/"))
# Disabled... see ChangeLog
# Set the prefix, unless it is overriden (used when building mono rpms)
: ${prefix=@prefix@}
libdir=$prefix/@reloc_libdir@
bindir=$prefix/bin
# Bail out if monodis or libmono is missing
if [ ! -x $bindir/monodis ] || [ ! -f $libdir/libmono-2.0.so.1 ] ; then
echo "monodis missing or unusable, exiting..." 1>&2
exit 1
fi
# set LD_LIBRARY_PATH to ensure that libmono is found
export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
# and set MONO_PATH to ensure that mscorlib.dll can be found
export MONO_PATH=$prefix/lib/mono/2.0
for i in "${monolist[@]}"; do
($bindir/monodis --assembly $i | awk '
BEGIN { LIBNAME=""; VERSION=""; }
/^Version:/ { VERSION=$2 }
/^Name:/ { LIBNAME=$2 }
END {
if (LIBNAME ~ /^policy/) {
cnt = split(LIBNAME, toks, ".")
VERSION=toks[2] "." toks[3] ".0.0"
LIBNAME=""
for (i=4; i<= cnt; i++)
LIBNAME = (LIBNAME toks[i] ".")
LIBNAME=substr(LIBNAME, 1, length(LIBNAME)-1)
}
if (VERSION && LIBNAME)
print "mono(" LIBNAME ") = " VERSION
}
') 2>/dev/null
done

View File

@@ -0,0 +1,190 @@
#!/bin/bash
#
# mono-find-requires
#
# Authors:
# Ben Maurer (bmaurer@ximian.com)
# Wade Berrier (wberrier@novell.com)
#
# (C) 2008 Novell (http://www.novell.com)
#
IFS=$'\n'
filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
# parse .config files to find which native libraries to depend on
# (target attribute must have double quotes for this to work, ie: target="file" )
# Add /etc/mono/config ?
configlist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.config\$"))
# Set the prefix, unless it is overriden (used when building mono rpms)
: ${prefix=@prefix@}
# Can override .config scanning if specified
: ${IGNORE_CONFIG_SCAN=0}
libdir=$prefix/@reloc_libdir@
bindir=$prefix/bin
# Bail out if monodis or libmono is missing
if [ ! -x $bindir/monodis ] || [ ! -f $libdir/libmono-2.0.so.1 ] ; then
echo "monodis missing or unusable, exiting..." 1>&2
exit 1
fi
# special case for 64bit archs
if test "x@reloc_libdir@" = "xlib64" ; then
libext="()(64bit)"
else
# (note, this works on ppc64 since we only have 32bit mono)
libext=""
fi
# Exceptions:
case `uname -m` in
# ia64 doesn't use lib64 for 'libdir' (sles 9 rpm used to provide both... no longer)
ia64) libext="()(64bit)" ;;
esac
# set LD_LIBRARY_PATH to ensure that libmono is found
export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
# and set MONO_PATH to ensure that mscorlib.dll can be found
export MONO_PATH=$prefix/lib/mono/2.0
REQUIRES=$(
for i in "${monolist[@]}"; do
($bindir/monodis --assemblyref $i | awk '
BEGIN { START=0; LIBNAME=""; VERSION=""; }
(START==0) && /^[0-9]+: Version=/ {
START=1;
sub(/Version=/, "", $2);
VERSION=$2
}
(START==1) && /^\tName=/ {
sub(/Name=/, "", $1);
LIBNAME=$1
# Allow rpm deps to be resolved for 1.0 profile version
if (VERSION=="1.0.3300.0")
OP=">="
else
OP="="
print "mono(" LIBNAME ") " OP " " VERSION
START=0
}
') 2> /dev/null
done
)
if [ $IGNORE_CONFIG_SCAN -eq 0 ] ; then
rpm_config_REQUIRES=$(
# Parse the xml .config files to see what native binaries we call into
# TODO: also check monodis --moduleref
for i in "${configlist[@]}"; do
awk 'match($_, /<dllmap .*target=.*/) {
ignore=0
req=""
split($_, toks, "\"")
toks_size=0
for(tok in toks) { toks_size++ }
for(i=1; i <= toks_size; i++) {
if(toks[i] ~ /target=/) {
req=toks[i+1]
}
if(toks[i] ~ /os=/) {
negate=0
found=0
attr=toks[i+1]
if(attr ~ /^!/) {
attr=substr(attr, 2, length(attr)-1)
negate=1
}
split(attr, os_targets, ",")
os_targets_size=0
for(os_target in os_targets) { os_targets_size++ }
for(j=1; j <= os_targets_size; j++) {
if(os_targets[j] == "linux") {
found=1
}
}
if(negate) {
found=!found
}
if (!found) {
ignore=1
}
}
}
if(!ignore) {
print req"'$libext'"
}
} ' $i 2>/dev/null
done
)
# Resolve provides to packages, warning on missing to stderr
config_REQUIRES=$(
first=1 # avoid an empty line if no .config reqs are found
for i in ${rpm_config_REQUIRES[@]} ; do
out=$(rpm -q --whatprovides --queryformat "%{NAME}\n" $i)
if [ $? -eq 0 ] ; then
if [ $first -eq 1 ] ; then
echo ""
first=0
fi
echo $out
else
# echo to stderr
echo "mono-find-requires: Warning, could not find package that provides: $i" >&2
fi
done
)
fi
# Note about above:
# Use to do: system("rpm -q --whatprovides --queryformat \"%{NAME}\n\" ""\""req"'$libext'""\"")
# rpmlint prefers to have lib names instead of package names. There was a reason I was using package names but it slips me now...
# Ah... now I remember... it's for noarch packs. The noarch packages can be built on either 32 or 64 bit... so we have to depend
# on the package name instead.
PROVIDES=$(
for i in "${monolist[@]}"; do
($bindir/monodis --assembly $i | awk '
BEGIN { LIBNAME=""; VERSION=""; }
/^Version:/ { VERSION=$2 }
/^Name:/ { LIBNAME=$2 }
END {
if (VERSION && LIBNAME)
print "mono(" LIBNAME ") = " VERSION
}
') 2>/dev/null
done
)
#
# This is a little magic trick to get all REQUIRES that are not
# in PROVIDES. While RPM functions correctly when such deps exist,
# they make the metadata a bit bloated.
#
# TODO: make this use the mono-find-provides script, to share code
# Filter out dups from both lists
REQUIRES=$(echo "$REQUIRES $config_REQUIRES" | sort | uniq)
PROVIDES=$(echo "$PROVIDES" | sort | uniq)
#
# Get a list of elements that exist in exactly one of PROVIDES or REQUIRES
#
UNIQ=$(echo "$PROVIDES
$REQUIRES" | sort | uniq -u)
#
# Of those, only choose the ones that are in REQUIRES
#
echo "$UNIQ
$REQUIRES" | sort | uniq -d

283
scripts/mono-heapviz Executable file
View File

@@ -0,0 +1,283 @@
#!/usr/bin/env python
# Generate a heap visualization for SGen from the heap dump written by
# mono if the MONO_GC_DEBUG is set to something like
# "heap-dump=/path/to/file". This script accepts the file as stdin
# and generates HTML and PNG files.
from __future__ import print_function
import sys, os
import Image, ImageDraw
from xml.sax import ContentHandler, make_parser
from xml.sax.handler import feature_namespaces
from optparse import OptionParser
chunk_size = 1024 # number of bytes in a chunk
chunk_pixel_size = 2 # a chunk is a square with this side length
large_sections = False
def mark_chunk (img_draw, i, color, section_width):
row = i / section_width
col = i % section_width
pixel_col = col * chunk_pixel_size
pixel_row = row * chunk_pixel_size
img_draw.rectangle ([(pixel_col, pixel_row), (pixel_col + chunk_pixel_size - 1, pixel_row + chunk_pixel_size - 1)], fill = color)
class Range:
pass
class OccupiedRange (Range):
def __init__ (self, offset, size):
self.offset = offset
self.size = size
def mark (self, img_draw, color, section_width):
start = self.offset / chunk_size
end = (self.offset + self.size - 1) / chunk_size
for i in range (start, end + 1):
mark_chunk (img_draw, i, color, section_width)
class ObjectRange (OccupiedRange):
def __init__ (self, klass, offset, size):
OccupiedRange.__init__ (self, offset, size)
self.klass = klass;
class SectionHandler:
def __init__ (self, width):
self.width = width
self.ranges = []
self.size = 0
self.used = 0
def add_object (self, klass, offset, size):
self.ranges.append (ObjectRange (klass, offset, size))
self.used += size
def add_occupied (self, offset, size):
self.ranges.append (OccupiedRange (offset, size))
self.used += size
def draw (self):
height = (((self.size / chunk_size) + (self.width - 1)) / self.width) * chunk_pixel_size
color_background = (255, 255, 255)
color_free = (0, 0, 0)
color_occupied = (0, 255, 0)
img = Image.new ('RGB', (self.width * chunk_pixel_size, height), color_free)
img_draw = ImageDraw.Draw (img)
#FIXME: remove filling after end of heap
for r in self.ranges:
r.mark (img_draw, color_occupied, self.width)
return img
def emit (self, collection_file, collection_kind, collection_num, section_num):
print ('<h2>%s</h2>' % self.header (), file = collection_file)
print ('<p>Size %d kB - ' % (self.size / 1024), file = collection_file)
print ('used %d kB</p>' % (self.used / 1024), file = collection_file)
filename = '%s_%d_%d.png' % (collection_kind, collection_num, section_num)
print ('<p><img src="%s"></img></p>' % filename, file = collection_file)
img = self.draw ()
img.save (filename)
class SmallSectionHandler (SectionHandler):
def __init__ (self):
SectionHandler.__init__ (self, -1)
self.offset = 0
def start_section (self, kind, size):
assert kind == 'old'
if self.width <= 0:
self.width = (size + chunk_size - 1) / chunk_size
if self.width < 128:
self.width = 512
self.current_section_size = size
else:
self.current_section_size = self.width * chunk_size
self.size += size
def add_object (self, klass, offset, size):
SectionHandler.add_object (self, klass, self.offset + offset, size)
def add_occupied (self, offset, size):
SectionHandler.add_occupied (self, self.offset + offset, size)
def end_section (self):
self.offset += self.current_section_size
def header (self):
return 'old sections'
class LargeSectionHandler (SectionHandler):
def __init__ (self):
SectionHandler.__init__ (self, 512)
def start_section (self, kind, size):
self.kind = kind
self.ranges = []
self.size = size
self.used = 0
def end_section (self):
pass
def header (self):
return self.kind + ' section'
class DocHandler (ContentHandler):
def start (self):
self.collection_index = 0
self.index_file = open ('index.html', 'w')
print ('<html><body>', file = self.index_file)
def end (self):
print ('</body></html>', file = self.index_file)
self.index_file.close ()
def startElement (self, name, attrs):
if name == 'collection':
self.collection_kind = attrs.get('type', None)
self.collection_num = int(attrs.get('num', None))
reason = attrs.get('reason', None)
if reason:
reason = ' (%s)' % reason
else:
reason = ''
self.section_num = 0
filename = 'collection_%d.html' % self.collection_index
print ('<a href="%s">%s%s collection %d</a>' % (filename, self.collection_kind, reason, self.collection_num), file = self.index_file)
self.collection_file = open (filename, 'w')
print ('<html><body>', file = self.collection_file)
print ('<p><a href="collection_%d.html">Prev</a> <a href="collection_%d.html">Next</a> <a href="index.html">Index</a></p>' % (self.collection_index - 1, self.collection_index + 1), file = self.collection_file)
print ('<h1>%s collection %d</h1>' % (self.collection_kind, self.collection_num), file = self.collection_file)
self.usage = {}
self.los_usage = {}
self.pinned_usage = {}
self.occupancies = {}
self.in_los = False
self.in_pinned = False
self.heap_used = 0
self.heap_size = 0
self.los_size = 0
if large_sections:
self.section_handler = LargeSectionHandler ()
else:
self.section_handler = self.small_section_handler = SmallSectionHandler ()
elif name == 'pinned':
kind = attrs.get('type', None)
bytes = int(attrs.get('bytes', None))
print ('Pinned from %s: %d kB<br>' % (kind, bytes / 1024), file = self.collection_file)
elif name == 'occupancy':
size = int (attrs.get ('size', None))
available = int (attrs.get ('available', None))
used = int (attrs.get ('used', None))
unused = available - used
print ('Occupancy of %d byte slots: %d / %d (%d kB / %d%% wasted)<br>' % (size, used, available, unused * size / 1024, unused * 100 / available), file = self.collection_file)
elif name == 'section':
kind = attrs.get('type', None)
size = int(attrs.get('size', None))
self.heap_size += size
if not large_sections:
if kind == 'nursery':
self.section_handler = LargeSectionHandler ()
else:
self.section_handler = self.small_section_handler
self.section_handler.start_section (kind, size)
elif name == 'object':
klass = attrs.get('class', None)
size = int(attrs.get('size', None))
if self.in_los:
usage_dict = self.los_usage
self.los_size += size
elif self.in_pinned:
location = attrs.get('location', None)
if location not in self.pinned_usage:
self.pinned_usage[location] = {}
usage_dict = self.pinned_usage[location]
else:
usage_dict = self.usage
offset = int(attrs.get('offset', None))
self.section_handler.add_object (klass, offset, size)
self.heap_used += size
if not (klass in usage_dict):
usage_dict [klass] = (0, 0)
usage = usage_dict [klass]
usage_dict [klass] = (usage [0] + 1, usage [1] + size)
elif name == 'occupied':
offset = int(attrs.get('offset', None))
size = int(attrs.get('size', None))
self.section_handler.add_occupied (offset, size)
self.heap_used += size
elif name == 'los':
self.in_los = True
elif name == 'pinned-objects':
self.in_pinned = True
def dump_usage (self, usage_dict, limit):
klasses = sorted (usage_dict.keys (), lambda x, y: usage_dict [y][1] - usage_dict [x][1])
if limit:
klasses = klasses [0:limit]
for klass in klasses:
usage = usage_dict [klass]
if usage [1] < 100000:
print ('%s %d bytes' % (klass, usage [1]), file = self.collection_file)
else:
print ('%s %d kB' % (klass, usage [1] / 1024), file = self.collection_file)
print (' (%d)<br>' % usage [0], file = self.collection_file)
def endElement (self, name):
if name == 'section':
self.section_handler.end_section ()
if large_sections or self.section_handler != self.small_section_handler:
self.section_handler.emit (self.collection_file, self.collection_kind, self.collection_num, self.section_num)
self.section_num += 1
elif name == 'collection':
if not large_sections:
self.small_section_handler.emit (self.collection_file, self.collection_kind, self.collection_num, self.section_num)
self.dump_usage (self.usage, 10)
print ('<h3>LOS</h3>', file = self.collection_file)
self.dump_usage (self.los_usage, None)
print ('<h3>Pinned</h3>', file = self.collection_file)
for location in sorted (self.pinned_usage.keys ()):
print ('<h4>%s</h4>' % location, file = self.collection_file)
self.dump_usage (self.pinned_usage[location], None)
print ('</body></html>', file = self.collection_file)
print (' - %d kB / %d kB (%d%%) - %d kB LOS</a><br>' % (self.heap_used / 1024, self.heap_size / 1024, int(100.0 * self.heap_used / self.heap_size), self.los_size / 1024), file = self.index_file)
self.collection_file.close ()
self.collection_index += 1
elif name == 'los':
self.in_los = False
elif name == 'pinned-objects':
self.in_pinned = False
def main ():
usage = "usage: %prog [options]"
parser = OptionParser (usage)
parser.add_option ("-l", "--large-sections", action = "store_true", dest = "large_sections")
parser.add_option ("-s", "--small-sections", action = "store_false", dest = "large_sections")
(options, args) = parser.parse_args ()
if options.large_sections:
large_sections = True
dh = DocHandler ()
parser = make_parser ()
parser.setFeature (feature_namespaces, 0)
parser.setContentHandler (dh)
dh.start ()
parser.parse (sys.stdin)
dh.end ()
if __name__ == "__main__":
main ()

41
scripts/mono-service.in Normal file
View File

@@ -0,0 +1,41 @@
#!/bin/sh
args=""
assembly=
debug=false
while test x$1 != x; do
case $1 in
-[ldnm]:*) args="$args$1 " ;;
--debug) debug=true ;;
--no-daemon) debug=true ;;
*) assembly=$1; args="$args$assembly ";;
esac
shift
done
if test x$assembly = x; then
echo You must specify at least the assembly name
echo
echo "Usage is: $0 [options] service"
echo
echo ' -d:<directory> Working directory'
echo ' -l:<lock file> Lock file (default is /tmp/<service>.lock)'
echo ' -m:<syslog name> Name to show in syslog'
echo ' -n:<service name> Name of service to start (default is first defined)'
echo ' --debug Do not send to background nor redirect input/output'
echo ' --no-daemon Do not send to background nor redirect input/output'
echo
echo Controlling the service:
echo
echo ' kill -USR1 `cat <lock file>` Pausing service'
echo ' kill -USR2 `cat <lock file>` Continuing service'
echo ' kill `cat <lock file>` Ending service'
echo
exit 1
fi
export MONO_DISABLE_SHM=1
if $debug; then
exec @bindir@/@mono_interp@ $MONO_OPTIONS @mono_instdir@/@framework_version@/mono-service.exe $args
else
exec @bindir@/@mono_interp@ $MONO_OPTIONS @mono_instdir@/@framework_version@/mono-service.exe $args </dev/null >/dev/null 2>&1 &
fi

177
scripts/mono-test-install Executable file
View File

@@ -0,0 +1,177 @@
#!/usr/bin/env bash
#
# Does various checks for people that we can use to diagnose
# an end user installation
#
temp_cs=temp$$.cs
temp_exe=temp$$.exe
if test -f $temp_cs; then
echo Error: need a temporary file name, and $temp_cs already exists
echo Run this program from a different directory, or delete the file and try again.
exit 1
fi
set `echo $PATH | sed 's/:/ /g'`
while test x$1 != x; do
if test -x $1/mono; then
if test x$monocmd = x; then
monocmd=$1/mono
else
other_monos="$1/mono $other_monos"
fi
fi
shift
done
echo Active Mono: $monocmd
if test "x$other_monos" != x; then
echo "Other Mono executables: $other_monos"
fi
#
# Check that the pkg-config mono points to this mono
#
if pkg-config --modversion mono >& /dev/null; then
pkg_config_mono=`(cd \`pkg-config --variable prefix mono\`/bin; pwd)`/mono
if test $pkg_config_mono != $monocmd; then
echo "Error: pkg-config Mono installation points to a different install"
echo " than the Mono found:"
echo " Mono on PATH: $monocmd"
echo " Mono from pkg-config: $pkg_config_mono"
fi
else
echo "Warning: pkg-config could not find mono installed on this system"
fi
##########################################################################################
#
# Tests below this point require the dotnet install
#
#
#
# Check that -pkg:dotnet is available
#
if pkg-config --modversion dotnet >& /dev/null; then
echo ""
else
echo "No dotnet pkgconfig found, Windows.Forms, System.Drawing and others will not work"
exit 1
fi
case `uname` in
Darwin)
macos=true
libgdiplus=libgdiplus.dylib
LD_PATH=DYLD_LIBRARY_PATH
;;
*)
macos=false;
libgdiplus=libgdiplus.so
LD_PATH=LD_LIBRARY_PATH
;;
esac
search_libgdiplus_on_path()
{
libgdiplus_found=false
if $macos; then
set `echo $DYLD_LIBRARY_PATH | sed 's/:/ /g'`
else
set `echo $LD_LIBRARY_PATH | sed 's/:/ /g'`
fi
while test x$1 != x; do
if test -e $1/$libgdiplus; then
echo " The $libgdiplus is found on $libdir/$libgdiplus"
libgdiplus_found=true
libgdiplus_path=$1/$libgdiplus
break
fi
shift
done
}
#
# Check GDI+ installation
#
cat > $temp_cs <<EOF
using System;
using System.Drawing;
class X {
static void Main ()
{
Bitmap b = new Bitmap (100, 100);
}
}
EOF
if mcs -pkg:dotnet $temp_cs >& /dev/null; then
if mono $temp_exe >& /dev/null; then
echo Your have a working System.Drawing setup
else
echo Your system has a broken System.Drawing setup
if mono $temp_exe 2>&1 | grep 'System.DllNotFoundException: gdiplus.dll' > /dev/null; then
echo " your gdiplus.dll can not be loaded"
libdir=`dirname $monocmd`/../lib
if test -f $libdir/$libgdiplus; then
echo " The $libgdiplus is found on $libdir/$libgdiplus"
if test -e $libdir/$libgdiplus; then
libgdiplus_path=$libdir/$libgdiplus
libgdiplus_found=true
else
echo " but it seems to be a broken link"
fi
else
search_libgdiplus_on_path
fi
if $libgdiplus_found; then
echo ssss
if which ldd >/dev/null; then
LANG=C dirs=`ldd $libgdiplus_path | grep 'not found'`
if echo $dirs | grep 'not found' >& /dev/null; then
echo " libgdiplus is missing the following dependencies to run:"
echo $dirs | sed 's/^/ /'
fi
fi
else
echo " No libgdiplus was found on your $LD_PATH"
fi
fi
fi
else
echo Failed to compile sample System.Drawing program, your installation is broken
exit 1
fi
cat > $temp_cs <<EOF
using System;
using System.Reflection;
using System.IO;
class Program {
public static void Main()
{
object watcher = new FileSystemWatcher()
.GetType ()
.GetField ("watcher", BindingFlags.NonPublic | BindingFlags.Static)
.GetValue (null);
Console.WriteLine ("Your file system watcher is: {0}",
watcher != null
? watcher.GetType ().FullName
: "unknown");
}
}
EOF
if mcs $temp_cs >& /dev/null; then
mono $temp_exe
else
echo Failed to compile sample test program, your installation is broken
exit 1
fi

64
scripts/monodocer Executable file
View File

@@ -0,0 +1,64 @@
#!/bin/sh
cmd_line=
for option do
case "$option" in
-assembly:*)
a=`echo "$option" | sed 's/^-assembly://'`
cmd_line="$cmd_line $a"
;;
-delete)
cmd_line="$cmd_line --delete"
;;
-ignoremembers)
# ignore
;;
-import:*)
a=`echo "$option" | sed 's/^-import://'`
cmd_line="$cmd_line -i $a"
;;
-importecmadoc:*)
a=`echo "$option" | sed 's/^-importecmadoc://'`
cmd_line="$cmd_line -i $a"
;;
-importslashdoc:*)
a=`echo "$option" | sed 's/^-importslashdoc://'`
cmd_line="$cmd_line -i $a"
;;
-name:*)
# ignore
;;
-namespace:*)
# ignore
;;
-overrides:*)
# ignore
;;
-path:*)
a=`echo "$option" | sed 's/^-path://'`
cmd_line="$cmd_line -o $a"
;;
-pretty)
# ignore
;;
-since:*)
a=`echo "$option" | sed 's/^-since://'`
cmd_line="$cmd_line --since $a"
;;
-type:*)
a=`echo "$option" | sed 's/^-type://'`
cmd_line="$cmd_line --since $a"
;;
-updateto:*)
# ignore
;;
-V | -version)
# ignore
;;
*)
cmd_line="$cmd_line $option"
;;
esac
done
exec mdoc update $cmd_line

37
scripts/monodocs2html Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/sh
cmd_line=
for option do
case "$option" in
-dest:*)
dir=`echo "$option" | sed 's/^-dest://'`
cmd_line="$cmd_line -o \"$dir\""
;;
-dumptemplate)
cmd_line="$cmd_line --default-template"
;;
-ext:*)
ext=`echo "$option" | sed 's/^-ext://'`
cmd_line="$cmd_line --ext=$ext"
;;
-onlytype*)
# compat; ignore
;;
-source:*)
s=`echo "$option" | sed 's/^-source://'`
cmd_line="$cmd_line $s"
;;
-template:*)
template=`echo "$option" | sed 's/^-template://'`
cmd_line="$cmd_line --template=$template"
;;
-V | -version)
# compat; ignore
;;
*)
cmd_line="$cmd_line $option"
;;
esac
done
exec mdoc export-html $cmd_line

3
scripts/monodocs2slashdoc Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec mdoc export-msxdoc "$@"

2
scripts/peverify.in Normal file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec @bindir@/pedump $MONO_OPTIONS --verify metadata,code "$@"

2
scripts/script.bat.in Normal file
View File

@@ -0,0 +1,2 @@
@echo off
@bindir@\@mono_interp@ %MONO_OPTIONS% @mono_instdir@\@framework_version@\@exe_name@.exe %1 %2 %3 %4 %5 %6 %7 %8 %9

Some files were not shown because too many files have changed in this diff Show More