[Mono-devel-list] Re: [Gtk-sharp-list] kernel support.

Carlos Perelló Marín carlos at pemas.net
Tue Jun 17 16:53:36 EDT 2003


I think that the best solution is the binfmt feature with the wrapper
that exists with Debian packages at:

http://www.debianplanet.org/mono/dists/unstable/main/source/admin/

If you want use it with Big endian machines, you should apply a patch
(http://carlos.pemas.net/debian/mono/binfmt-detector-cli.c.diff)

It works really good and lets you use wine also, it reads the .exe file
headers and check if it's a .net executable.

This way you just execute: ./my-cool-mono-application.exe and it works
without the need of any wrapper.

Cheers.


El mar, 17-06-2003 a las 22:45, Jonathan Pryor escribió:
> There's one problem with your proposed shell wrapper: it doesn't work
> correctly in the presence of symbolic links, since when invoking the
> symbolic link "$0" will be the name of the symbolic link, not the name
> of the *target* of the symbolic link.
> 
> MCS has a solution, but it depends on autoconf (mono's scripts/mcs.in
> file is processed, including the full path to mcs).  As such, it may be
> undesirable.
> 
> So, here's my attempted solution.  It checks for the presence of
> symlinks, and looks up the target of the symlink (using readlink) if
> necessary, before passing off the program to mono:
> 
>     #!/bin/sh
>     # Starts a CIL program whose name is patterned after the filename of
>     # this script.  The CIL program executed is "$0".exe.
> 
>     file=$0
> 
>     # If file is a symlink, find where it's pointing to
>     if [ -L $file ] ; then
>       if ! (readlink -f "$file") > /dev/null 2>&1; then
>         echo `basename "$0"` ": missing required program readlink!"
>         exit -1
>       fi
>       file=`readlink -f "$file"`
>     fi
> 
>     exec mono "$file.exe" "$@"
> 
> Thoughts?
> 
>  - Jon
> 
> On Tue, 2003-06-17 at 12:51, Dag Wieers wrote:
> > On 16 Jun 2003, George Farris wrote:
> > 
> > > Does anyone know what the plans are for kernel support of mono
> > > binaries?  Right now a binary mono file shows as:
> > > 
> > > MS Windows PE 32-bit Intel 80386 console executable
> > > 
> > > This of course, is totally unacceptable on a Linux machine.  I want to
> > > be able to run my binaries directly instead of through a shell script.
> > 
> > This issue is dear to me too.
> > 
> > The Debian Mono page indicates there is a workaround. A third binary that 
> > does a more conclusive check and then starts either mono or wine.
> > 
> > Which would mean that the kernel binfmt support has short-comings that can 
> > only be overcome by doing it in userspace. My first thought is that the 
> > binfmt_misc kernel-support should be fixed to be more useful.
> > 
> > Since there will not be a good solution soon, I would propose the 
> > following standard (and I took the liberty to add it to the Developer FAQ 
> > page in the Wiki already).
> > 
> > The proposal is to have a shell wrapper with the same name as the .Net 
> > binary, with the '.exe' part and would consist of the following 2 lines:
> > 
> > 	#!/bin/sh
> > 	exec mono "$0".exe $@
> > 
> > Ofcourse we could verify some things in this script (check if mono can be 
> > called, if the executable exists, etc...) But I would keep it as simple as 
> > possible, I've tested the output in various circumstances and the 
> > error-output was in each case very clear about the problem.
> > 
> > Kind regards,
> > --   dag wieers,  dag at wieers.com,  http://dag.wieers.com/   --
> > [Any errors in spelling, tact or fact are transmission errors]
> > 
> > _______________________________________________
> > Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
-- 
Carlos Perelló Marín
Debian GNU/Linux Sid (PowerPC)
Linux Registered User #121232
mailto:carlos at pemas.net || mailto:carlos at gnome.org
http://carlos.pemas.net
Valencia - Spain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
	digitalmente
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030617/aee8ebce/attachment.bin 


More information about the Mono-devel-list mailing list