Tip to Compile iFolder Using Latest Mono

0 Likes

Leverage better performance of applications by changing to latest versions. It happens with many applications. Obviously latest versions of any software will have much more enhancements and bug fixes. We also receive better support for latest versions. Similarly I'm expecting to have better performance of iFolder Mac client if we can use latest versions of Mono.



Introduction:



iFolder is known to many of the people due to its popularity as a share and sync data application. Visit www.ifolder.com to know more details about it.



iFolder is based on back end process "Simias" that basically controls and monitors sync and connection between client and server. But Simias needs other dependencies to run the application effectively. Out of those dependencies, Mono is one among them. Mono is compiler by Novell that is compliant with .NET tools on Linux. Visit www.go-mono.com for more details about the project.



Description:



Current version of iFolder is using Mono 1.2.5 for running it. If you remember, when installing iFolder (dmg) on Mac, it checks for dependency Mono 1.2.5 to be available. But Mono 1.2.5 is quiet old one. Latest release of Mono is 2.6.1. Also Mono guys stopped supporting 1.2.5 version unless its critical or important.



Obviously Mono 2.6.1 has better options, enhancements, bug fixes etc that are comparable to Mono 1.2.5. Similarly moving to latest Mono in iFolder also helps us have better performing iFolder.



The journey started when I found a bug with iFolder while syncing files with special characters in it like "/,<,&" etc. After tracing I found that it's the bug in Mono 1.2.5 and fix for that is available in Mono 2.0 and later versions. Then I picked up Mono 2.4.2.3(see Note below why 2.4.2.3 version) and tried compiling the open sourced iFolder code (both Simias as well as UI related). But there are changes to be made in configure.in files to compile and build the iFolder application.



Note: Novell recommends iFolder server to run effectively with Mono 2.4.2.3 and that's the reason I picked same version for client also. I might pick recent release also but I'm not sure that client calls to server will work perfectly or not.


Here are the changes to be done:



If you observe the code of iFolder, there are two sources available. One is "Simias" related and other is "iFolder" related.



Simias: After downloading the source code, base folder in Simias has a file "configure.in". Apply the following patch to it.



Index: configure.in
===================================================================
--- configure.in (revision 7309)
configure.in (working copy)
@@ -50,8 50,8 @@
;;
darwin*)
SIMIAS_OS='darwin'
- AC_CHECK_PROG(CSC, mcs, mcs)
- test -z "$CSC" && AC_MSG_ERROR([no C Sharp compiler: mcs not found in \$PATH])
AC_CHECK_PROG(CSC, gmcs, gmcs)
test -z "$CSC" && AC_MSG_ERROR([no C Sharp compiler: gmcs not found in \$PATH])
export PKG_CONFIG_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig:$PKG_CONFIG_PATH"
PKG_CONFIG_DIR='lib'
;;
@@ -72,7 72,11 @@
AM_CONDITIONAL(DARWIN, test "$SIMIAS_OS" = "darwin")
AM_CONDITIONAL(DARWIN_X86, test "$host_cpu" = "i686")
if test "$runasclient" = "TRUE"; then
- AM_CONDITIONAL(MONO, test "$CSC" = "mcs")
if test "$host_os" = "darwin"; then
AM_CONDITIONAL(MONO, test "$CSC" = "gmcs")
else
AM_CONDITIONAL(MONO, test "$CSC" = "mcs")
fi
else
if pkg-config --atleast-version=2.4 mono > /dev/null 2>&1
then
@@ -157,7 161,7 @@
CSC_EXEFLAG=/target:exe
CSC_LIBFLAG=/target:library
CSC_WINEXEFLAG=/target:winexe
- CSCFLAGS='/d:MONO /warn:4 /d:TRACE'
CSCFLAGS='/d:MONO /warn:4 /d:TRACE /d:MONONATIVE'
CSCFLAGS_DEBUG="/debug /d:DEBUG"
CSCFLAGS_OPTIMIZE="/optimize "
MONO=mono


iFolder: Similarly UI code has "ifolder" directory. Inside that folder, you can find "configure.in" and apply the following patch to that file:

Index: configure.in
===================================================================
--- configure.in (revision 7292)
configure.in (working copy)
@@ -52,8 52,8 @@
;;
darwin*)
IFOLDER_OS='darwin'
- AC_CHECK_PROG(CSC, mcs, mcs)
- test -z "$CSC" && AC_MSG_ERROR([no C Sharp compiler: mcs not found in \$PATH])
AC_CHECK_PROG(CSC, gmcs, gmcs)
test -z "$CSC" && AC_MSG_ERROR([no C Sharp compiler: gmcs not found in \$PATH])
PKG_CONFIG_DIR='lib'
;;
cygwin*)
@@ -73,7 73,12 @@
AM_CONDITIONAL(LINUX, test "$IFOLDER_OS" = "linux")
AM_CONDITIONAL(WINDOWS, test "$IFOLDER_OS" = "windows")
AM_CONDITIONAL(DARWIN, test "$IFOLDER_OS" = "darwin")
-AM_CONDITIONAL(MONO, test "$CSC" = "mcs")
if test "$host_os" = "darwin"; then
AM_CONDITIONAL(MONO, test "$CSC" = "gmcs")
else
AM_CONDITIONAL(MONO, test "$CSC" = "mcs")
fi

AM_CONDITIONAL(DOTNET, test "$CSC" = "csc")


@@ -107,6 112,18 @@
#
# Mono-specific configuration
#
gmcs)
CSC_EXEFLAG=/target:exe
CSC_LIBFLAG=/target:library
CSC_WINEXEFLAG=/target:winexe
CSCFLAGS='/d:MONO /warn:4 /d:TRACE /d:MONOTRACE'
CSCFLAGS_DEBUG="/debug /d:DEBUG"
CSCFLAGS_OPTIMIZE="/optimize "
MONO=mono
MONO_DEBUG='mono --debug'
MONO_PATH="\$(subst \$(SPACE),:,\$(addprefix \$(SRCDIR)\$(SEP),iFolder)):`pkg-config --variable=libdir simias`"
SYSTEM_XML='System.Xml.dll'
;;
mcs)
CSC_EXEFLAG=/target:exe
CSC_LIBFLAG=/target:library



Conclusion:



After applying the patches, compile the code both Simias and UI related and run the application as usual. I did minimal test cases and all worked well. I don't say that this is complete solution to all its bugs, but at least fix few bugs and increases its performance.



Also I want to tell that the patch that I'm giving may/may not builds other OS clients. As I don't have other OS machines with me, I didn't test.



Let me know if any one needs clarification or help regarding iFolder Mac client.



Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended