[Mono-devel-list] Re: [Gtk-sharp-list] kernel support.
Carlos Perelló Marín
carlos@pemas.net
17 Jun 2003 22:53:36 +0200
--=-nn6amvT5ik9YttnCi8FS
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: quoted-printable
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=F3:
> 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.
>=20
> 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.
>=20
> 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:
>=20
> #!/bin/sh
> # Starts a CIL program whose name is patterned after the filename of
> # this script. The CIL program executed is "$0".exe.
>=20
> file=3D$0
>=20
> # 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=3D`readlink -f "$file"`
> fi
>=20
> exec mono "$file.exe" "$@"
>=20
> Thoughts?
>=20
> - Jon
>=20
> On Tue, 2003-06-17 at 12:51, Dag Wieers wrote:
> > On 16 Jun 2003, George Farris wrote:
> >=20
> > > Does anyone know what the plans are for kernel support of mono
> > > binaries? Right now a binary mono file shows as:
> > >=20
> > > MS Windows PE 32-bit Intel 80386 console executable
> > >=20
> > > This of course, is totally unacceptable on a Linux machine. I want t=
o
> > > be able to run my binaries directly instead of through a shell script=
.
> >=20
> > This issue is dear to me too.
> >=20
> > The Debian Mono page indicates there is a workaround. A third binary th=
at=20
> > does a more conclusive check and then starts either mono or wine.
> >=20
> > Which would mean that the kernel binfmt support has short-comings that =
can=20
> > only be overcome by doing it in userspace. My first thought is that the=
=20
> > binfmt_misc kernel-support should be fixed to be more useful.
> >=20
> > Since there will not be a good solution soon, I would propose the=20
> > following standard (and I took the liberty to add it to the Developer F=
AQ=20
> > page in the Wiki already).
> >=20
> > The proposal is to have a shell wrapper with the same name as the .Net=20
> > binary, with the '.exe' part and would consist of the following 2 lines=
:
> >=20
> > #!/bin/sh
> > exec mono "$0".exe $@
> >=20
> > Ofcourse we could verify some things in this script (check if mono can =
be=20
> > called, if the executable exists, etc...) But I would keep it as simple=
as=20
> > possible, I've tested the output in various circumstances and the=20
> > error-output was in each case very clear about the problem.
> >=20
> > Kind regards,
> > -- dag wieers, dag@wieers.com, http://dag.wieers.com/ --
> > [Any errors in spelling, tact or fact are transmission errors]
> >=20
> > _______________________________________________
> > Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>=20
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
--=20
Carlos Perell=F3 Mar=EDn
Debian GNU/Linux Sid (PowerPC)
Linux Registered User #121232
mailto:carlos@pemas.net || mailto:carlos@gnome.org
http://carlos.pemas.net
Valencia - Spain
--=-nn6amvT5ik9YttnCi8FS
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
digitalmente
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQA+73/PEuPMamD5V9cRAnRBAKCHSnhTTMzyQ448i8rhidtICgnniwCeNvAl
KNNlNNZOq6bXGuWiBFv0p7s=
=ATKI
-----END PGP SIGNATURE-----
--=-nn6amvT5ik9YttnCi8FS--