[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-osx
Subject:    Re: [Mono-osx] Redistributable Mac OSX app without mono using
From:       Laurent Etiemble <laurent.etiemble () gmail ! com>
Date:       2010-05-17 13:04:15
Message-ID: AANLkTinYgt-akY-k62V26hd3URx2a965KyIs6nlpztXJ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

Preliminary question: why don't you use the NAnt tasks (<mkappl/> and
<mkbundle/>) available in Monobjc ? They are supposed to do all the dirty
stuff for you (native library gathering, relocation, remapping, etc.). There
is even a tutorial for that:
http://www.monobjc.net/index.php?page=redistribution

For the GLib problem, this is a regression from 2.6.3. The pkg-config file
for Mono is incomplete, as the 2.6 branch still depends on GLib. You can
quick-fix this issue by copying the "mono.pc" file from the 2.6.3
installation.

Regards, Laurent Etiemble.

2010/5/14 dgdw <david.drysdale-wilson@linn.co.uk>

> 
> Hi,
> 
> I am in the process of trying to produce a Mac application that can be run
> without the need for our users to first install mono - However I am running
> into a lot of issues and I hope that someone here will be able ti give me
> some pointers as to what I am doing wrong.
> 
> My development environment is a Mac with Snow Leopard 10.6.3, Mono 2.6.4
> and
> Monobjc 2.0.492.0 and XCode 3.2.1.
> 
> So far I have managed to create a working Mac application by creating the
> appropriate .app directory structure, populated it with the required
> assemblies, exe, pInfo and shell script (which invokes my exe with mono).
> The next step is to remove the need to have mono installed.
> 
> The first issue I had with mkbundle2 is that the compilation of the auto
> generated assembly fails with the following errors,
> 
> as -o temp.o temp.s
> temp.s:2:unknown section type: symbol_stubs
> temp.s:2:Rest of line ignored. 1st junk character valued at 112 (p).
> <snip>
> 
> I saw a post about this issue (it appears to be an issue of the assembler
> requiring information about the architecture to compile against), so I set
> the AS environment variable to 'as -arch i386'. Next the compilation fails
> with the following errors,
> 
> cc -g a.out -Wall temp.c 'pkg-config --cflags --libs mono'  temp.o
> temp.c: In function 'install_dll_config_files':
> temp.c:47: warning: pointer targets in passing argument 2 of
> 'mono_register_config_for_assembly' differ in signedness
> ld: warning: in
> /Library/Frameworks/Mono.framework/Versions/2.6.4/lib/libmono.dylib, file
> is
> not of required architecture
> <snip>
> 
> So I set the CC environment variable to 'cc -arch i386'. Now the
> compilation
> fails with the following errors,
> 
> cc -g a.out -Wall temp.c 'pkg-config --cflags --libs mono'  temp.o
> In file included from temp.c:2
> 
> /Library/Frameworks/Mono.framework/Versions/2.6.4/include/mono-1.0/mono/metadata/assembly.h:4:18:
>                 
> error: glib.h: No such file or directory
> <snip>
> 
> The output from 'pkg-config --cflags --libs mono' gives,
> 
> -D_THREAD_SAFE
> -I/Library/Frameworks/Mono.framework/Versions/2.6.4/include/mono-1.0
> -pthread -L/Library/Frameworks/Mono.framework/Versions/2.6.4/lib/ -lmono
> -lpthread -lm
> 
> No mention of glib, so I looked in the mono.pc file in
> /Library/Frameworks/Mono.framework/Versions/2.6.4/lib/pkgconfig/ and
> discovered the line 'Requires: glib-2.0 gthread-2.0 was commented out. I
> uncommented the line and finally mkbundle2 produces a compiled version of
> my
> exe.
> 
> The next step is the use otool to get a list of the mono libraries my
> compiled executable is dependent on, move them to the Frameworks directory
> in my .app directory and fix up the libraries and compiled executable
> library references using install_name_tool.
> 
> I theory this .app should now run without mono installed. On launching the
> application I get a brief glimpse of the main form and then it closes, so I
> am close but not there yet. On launching from a terminal it appears that my
> application depends on libgdiplus.dylib - However otool does not show this
> to be the case, so I am now completely stumped as to what the next step is
> in order to get this external dependency resolved. Does anyone have any
> idea
> of how to correct this problem or a work around?
> 
> Thanks for any help,
> David
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Redistributable-Mac-OSX-app-without-mono-using-mkbundle2-tp2216423p2216423.html
>  Sent from the Mono - OSX mailing list archive at Nabble.com.
> _______________________________________________
> Mono-osx mailing list
> Mono-osx@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
> 


[Attachment #5 (text/html)]

Hello,<div><br></div><div>Preliminary question: why don&#39;t you use the NAnt tasks \
(&lt;mkappl/&gt; and &lt;mkbundle/&gt;) available in Monobjc ? They are supposed to \
do all the dirty stuff for you (native library gathering, relocation, remapping, \
etc.). There is even a tutorial for that: <a \
href="http://www.monobjc.net/index.php?page=redistribution">http://www.monobjc.net/index.php?page=redistribution</a></div>


<div><br></div><div>For the GLib problem, this is a regression from 2.6.3. The \
pkg-config file for Mono is incomplete, as the 2.6 branch still depends on GLib. You \
can quick-fix this issue by copying the &quot;mono.pc&quot; file from the 2.6.3 \
installation.</div>

<div><br></div><div>Regards, Laurent Etiemble.<br><br><div \
class="gmail_quote">2010/5/14 dgdw <span dir="ltr">&lt;<a \
href="mailto:david.drysdale-wilson@linn.co.uk">david.drysdale-wilson@linn.co.uk</a>&gt;</span><br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;">

<br>
Hi,<br>
<br>
I am in the process of trying to produce a Mac application that can be run<br>
without the need for our users to first install mono - However I am running<br>
into a lot of issues and I hope that someone here will be able ti give me<br>
some pointers as to what I am doing wrong.<br>
<br>
My development environment is a Mac with Snow Leopard 10.6.3, Mono 2.6.4 and<br>
Monobjc 2.0.492.0 and XCode 3.2.1.<br>
<br>
So far I have managed to create a working Mac application by creating the<br>
appropriate .app directory structure, populated it with the required<br>
assemblies, exe, pInfo and shell script (which invokes my exe with mono).<br>
The next step is to remove the need to have mono installed.<br>
<br>
The first issue I had with mkbundle2 is that the compilation of the auto<br>
generated assembly fails with the following errors,<br>
<br>
as -o temp.o temp.s<br>
temp.s:2:unknown section type: symbol_stubs<br>
temp.s:2:Rest of line ignored. 1st junk character valued at 112 (p).<br>
&lt;snip&gt;<br>
<br>
I saw a post about this issue (it appears to be an issue of the assembler<br>
requiring information about the architecture to compile against), so I set<br>
the AS environment variable to &#39;as -arch i386&#39;. Next the compilation \
fails<br> with the following errors,<br>
<br>
cc -g a.out -Wall temp.c &#39;pkg-config --cflags --libs mono&#39;  temp.o<br>
temp.c: In function &#39;install_dll_config_files&#39;:<br>
temp.c:47: warning: pointer targets in passing argument 2 of<br>
&#39;mono_register_config_for_assembly&#39; differ in signedness<br>
ld: warning: in<br>
/Library/Frameworks/Mono.framework/Versions/2.6.4/lib/libmono.dylib, file is<br>
not of required architecture<br>
&lt;snip&gt;<br>
<br>
So I set the CC environment variable to &#39;cc -arch i386&#39;. Now the \
compilation<br> fails with the following errors,<br>
<br>
cc -g a.out -Wall temp.c &#39;pkg-config --cflags --libs mono&#39;  temp.o<br>
In file included from temp.c:2<br>
/Library/Frameworks/Mono.framework/Versions/2.6.4/include/mono-1.0/mono/metadata/assembly.h:4:18:<br>
                
error: glib.h: No such file or directory<br>
&lt;snip&gt;<br>
<br>
The output from &#39;pkg-config --cflags --libs mono&#39; gives,<br>
<br>
-D_THREAD_SAFE<br>
-I/Library/Frameworks/Mono.framework/Versions/2.6.4/include/mono-1.0<br>
-pthread -L/Library/Frameworks/Mono.framework/Versions/2.6.4/lib/ -lmono<br>
-lpthread -lm<br>
<br>
No mention of glib, so I looked in the mono.pc file in<br>
/Library/Frameworks/Mono.framework/Versions/2.6.4/lib/pkgconfig/ and<br>
discovered the line &#39;Requires: glib-2.0 gthread-2.0 was commented out. I<br>
uncommented the line and finally mkbundle2 produces a compiled version of my<br>
exe.<br>
<br>
The next step is the use otool to get a list of the mono libraries my<br>
compiled executable is dependent on, move them to the Frameworks directory<br>
in my .app directory and fix up the libraries and compiled executable<br>
library references using install_name_tool.<br>
<br>
I theory this .app should now run without mono installed. On launching the<br>
application I get a brief glimpse of the main form and then it closes, so I<br>
am close but not there yet. On launching from a terminal it appears that my<br>
application depends on libgdiplus.dylib - However otool does not show this<br>
to be the case, so I am now completely stumped as to what the next step is<br>
in order to get this external dependency resolved. Does anyone have any idea<br>
of how to correct this problem or a work around?<br>
<br>
Thanks for any help,<br>
David<br>
<font color="#888888">--<br>
View this message in context: <a \
href="http://mono.1490590.n4.nabble.com/Redistributable-Mac-OSX-app-without-mono-using-mkbundle2-tp2216423p2216423.html" \
target="_blank">http://mono.1490590.n4.nabble.com/Redistributable-Mac-OSX-app-without-mono-using-mkbundle2-tp2216423p2216423.html</a><br>



Sent from the Mono - OSX mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Mono-osx mailing list<br>
<a href="mailto:Mono-osx@lists.ximian.com">Mono-osx@lists.ximian.com</a><br>
<a href="http://lists.ximian.com/mailman/listinfo/mono-osx" \
target="_blank">http://lists.ximian.com/mailman/listinfo/mono-osx</a><br> \
</font></blockquote></div><br></div>



_______________________________________________
Mono-osx mailing list
Mono-osx@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-osx


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic