aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Understanding OS X dev of aMule [Part 2: Universal Binary]  (Read 4396 times)

mirko.g

  • Global Moderator
  • Full Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 188
  • Grattatio pallorum omnia mala repellent!
    • Personal WebSite
Understanding OS X dev of aMule [Part 2: Universal Binary]
« on: August 26, 2009, 03:00:06 PM »

Two days from now Apple will release Snow Leopard: first version of OS X not supporting PPC anymore. Sorry for PPC owner, but it will make easier development.

However, I would like to understand how to build a working universal binary aMule.

AFAIR we already talked about it... Portfiles must be installed invoking +universal variant. Crypto++ version provided by MacPorts has no universal variant so it must be compiled from sources using something similar to
Code: [Select]
CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386 -arch ppc" make(-mmacosx-version-min=10.4 to grant Tiger compatibility).

That's all? :-)
Logged

mr_hyde

  • Global Moderator
  • Full Member
  • *****
  • Karma: 12
  • Offline Offline
  • Posts: 105
Re: Understanding OS X dev of aMule [Part 2: Universal Binary]
« Reply #1 on: August 31, 2009, 09:24:31 PM »

equest for "experts": check the following post  ;)

Here follows what I did to build a universal-binary version (EDIT: I did this on a Mac Leopard 10.5.8)
1) installed XCode
2) installed MacPorts (I'm just trying to update to 1.8 version...)
3) launched the following script to build requested packages with MacPorts
Code: [Select]
port install automake +universal
port install flex +universal
port install gettext +universal
port install libpng +universal
port install jpeg +universal
port install gd2 +no_x11 +universal
port install libcryptopp +universal
port install libgeoip +universal
port install libupnp +universal
port install pkgconfig +universal
4) downloaded Cryptopp-5.5.2 (saved in Desktop) and modified Makefile so it appears as the attached file
5) built cryptopp (using the modified GNUMakefile)
6) downloaded wxWidgets 2.8.10 (saved in Desktop), patched as described in http://wiki.amule.org/index.php/HowTo_compile_on_Mac
then built it
7) donloaded (saved in desktop) aMule sources

At this point, in Desktop, there are 3 dirs:
- wxMac-2.8.10
- cryptopp552
- aMule

and I open a shell, go in aMule dir, and use the following:
A) ./autogen.sh (not needed if in sources you already have "configure"... Well, I *suppose* that it is not needed in this case)
B) use the following script to configure and build
Code: [Select]
./configure \
--with-wx-config=/Users/mrhyde/Desktop/wxMac-2.8.10/wx-config  \
--with-wxdir=/Users/mrhyde/Desktop/wxMac-2.8.10  \
--enable-optimize --disable-debug \
--with-crypto-prefix=/Users/mrhyde/Desktop/cryptopp552 \
--with-gdlib-config=/opt/local/bin/gdlib-config  \
--with-libiconv-prefix=/opt/local \
--enable-cas \
--enable-webserver \
--enable-amulecmd \
--enable-amule-gui \
--enable-wxcas \
--enable-alc \
--enable-alcc \
--enable-amule-daemon \
--enable-geoip \
--with-geoip-lib=/opt/local/lib \
--with-geoip-headers=/opt/local/include \
--disable-dependency-tracking \
CFLAGS="-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk" \
CXXFLAGS="-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk" \
LDFLAGS="-headerpad_max_install_names -L/Users/mrhyde/Desktop/cryptopp552 -L/opt/local/lib"

Remember that "/Users/mrhyde/Desktop" is the name of the directory of Desktop for my user on my PC.

I was forgetting: after the "make" it is also necessary to operate some changes on the script mac_packager (this is required for the libs built by MacPorts).
At moment I don't find the script that I use, anyway I suggest to give a look to gtoso's build procedure (see http://gtoso.tor.it/pub/amule/osx/svn/OSXBuild/)
Bye,
  Mr Hyde
« Last Edit: August 31, 2009, 09:38:37 PM by mr_hyde »
Logged