aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: aMule-2.2.4-universal Mac OS X 10.4+: work in progress!  (Read 7562 times)

mirko.g

  • Global Moderator
  • Full Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 188
  • Grattatio pallorum omnia mala repellent!
    • Personal WebSite
aMule-2.2.4-universal Mac OS X 10.4+: work in progress!
« on: April 21, 2009, 10:45:52 AM »

I'm working on a Universal Binary release of aMule-2.2.4! This is the log of my progress.

LAST UPDATE: May, 5th 2009

Last stable build
Yet to be released...

LOG:
GeoIP 1.4.6 has just been released and it add +universal variant.
Code: [Select]
$ sudo port info libgeoip
libgeoip @1.4.6 (devel, net)
Variants:    universal
Crypto++ portfile (libcryptopp) has not been updated yet. MacPort still provides Crypto++ 5.5.2 with no universal variant but I'm working on a self-compiled version of Crypto++ 5.6.
MacPorts' crew helped me with libgeoip, now I hope they will release a new librcryptopp too.
« Last Edit: May 05, 2009, 01:12:45 PM by mirko.g »
Logged

mirko.g

  • Global Moderator
  • Full Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 188
  • Grattatio pallorum omnia mala repellent!
    • Personal WebSite
Re: aMule-2.2.4-universal Mac OS X 10.4+: work in progress!
« Reply #1 on: May 05, 2009, 06:30:23 PM »

I installed all portfiles with +universal.
I compiled Crypto++ 5.6 Universal Binary with no errors.
I compiled wxWidgets with --enable-universal_binary.
I configured aMule with:

Code: [Select]
./configure --disable-systray --disable-gtk --enable-embedded_crypto --with-wx-config=../wxMac-2.8.10/wx-config \
--enable-optimize --with-crypto-prefix=/usr/local/cryptopp --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 --enable-geoip-static --enable-debug --enable-debug_gdb \
--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"

I got:
Code: [Select]
Configured aMule 2.2.4 for 'i686-apple-darwin9.6.0'.

  aMule enabled options:

  **** aMule Core ****
  Prefix where aMule should be installed?                    /usr/local
  Should aMule be compiled with i18n support?                yes
  Should aMule be compiled in debug mode?                    yes
  Should aMule be compiled with profiling?                   no
  Should aMule be compiled with optimizations?               yes
  Should aMule be compiled with UPnP support?                yes
  Should aMule be compiled with IP2country support?          yes
  Should aMule monolithic application be built?              yes
  Should aMule daemon version be built?                      yes
  Should aMule remote gui be built? (EXPERIMENTAL)           yes
  Crypto++ library/headers style?                            installed

  **** aMule TextClient ****
  Should aMule Command Line Client be built?                 yes

  **** aMule WebServer ****
  Should aMule WebServer be built?                           yes

  **** aMule ED2K Links Handler ****
  Should aMule ED2K Links Handler be built?                  yes

  **** aMuleLinkCreator ****
  Should aMuleLinkCreator GUI version (alc) be built?        yes
  Should aMuleLinkCreator for console (alcc) be built?       yes

  **** aMule Statistics ****
  Should C aMule Statistics (CAS) be built?                  yes
  Should aMule GUI Statistics (wxCas) be built?              yes

  **** General Libraries and Tools ****
  Should ccache support be enabled?                          no
  Libraries aMule will use to build:
                                       wxWidgets             2.8.10 (mac,static)
                                       crypto++              5.6.0 (installed, in /usr/local/cryptopp)
                                       libupnp               1.6.6
                                       regex                 system
                                       libintl               included
                                       libGeoIP              user
                                       libpng                1.2.35
                                       libgd                 2.0.35
                                       zlib                  1.2.3

I get errors about libcryptopp.a that is not of required architecture.
I didn't expect it would be such a struggle to compile Universal binary...  :-X

Any suggestion?
Logged

gtoso

  • Official MacOSX Packager
  • Full Member
  • ***
  • Karma: 24
  • Offline Offline
  • Posts: 206
Re: aMule-2.2.4-universal Mac OS X 10.4+: work in progress!
« Reply #2 on: May 14, 2009, 12:27:21 PM »

Try "file /usr/local/lib/libcryptopp.a"
if it's universal binary (ppc/i386) you should see something as:

enterprise:~ sadmin$ file /opt/local/lib/libcryptopp.a
/opt/local/lib/libcryptopp.a: Mach-O universal binary with 2 architectures
/opt/local/lib/libcryptopp.a (for architecture ppc):   current ar archive
/opt/local/lib/libcryptopp.a (for architecture i386):   current ar archive
enterprise:~ sadmin$

I used cryptopp from MacPorts, with these patches.
Logged

mirko.g

  • Global Moderator
  • Full Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 188
  • Grattatio pallorum omnia mala repellent!
    • Personal WebSite
Re: aMule-2.2.4-universal Mac OS X 10.4+: work in progress!
« Reply #3 on: May 14, 2009, 01:00:05 PM »

Try "file /usr/local/lib/libcryptopp.a"
if it's universal binary (ppc/i386) you should see something as:

enterprise:~ sadmin$ file /opt/local/lib/libcryptopp.a
/opt/local/lib/libcryptopp.a: Mach-O universal binary with 2 architectures
/opt/local/lib/libcryptopp.a (for architecture ppc):   current ar archive
/opt/local/lib/libcryptopp.a (for architecture i386):   current ar archive
enterprise:~ sadmin$

I used cryptopp from MacPorts, with these patches.

Thanks for your hints... I tried also with the Crypto++ UG but it seems no one is interested in Mac OS development...  :-\
http://groups.google.com/group/cryptopp-users/browse_thread/thread/b8fd23386cdabaf6?hl=en
Logged

gtoso

  • Official MacOSX Packager
  • Full Member
  • ***
  • Karma: 24
  • Offline Offline
  • Posts: 206
Re: aMule-2.2.4-universal Mac OS X 10.4+: work in progress!
« Reply #4 on: May 14, 2009, 02:42:52 PM »

The problem is that cryptopp GNUmakefile set CXXFLAGS to "-DNDEBUG -g -O2" regardless previous value.
Code: [Select]
CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386 -arch ppc" makedoesn't work...
Code: [Select]
make CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386 -arch ppc"or
Code: [Select]
make CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386 -arch ppc -DNDEBUG -g -O2"should work.

My GNUmakefile patch changes:
Code: [Select]
CXXFLAGS = -DNDEBUG -g -O2in:
Code: [Select]
CXXFLAGS += -DNDEBUG -g -O2so it appends to CXXFLAGS instead of replace.

If you want Tiger compatibility use -isysroot /Developer/SDKs/MacOSX10.4u.sdk or -mmacosx-version-min=10.4.

Code: [Select]
MACOSX_DEPLOYMENT_TARGET=10.4 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386 -arch ppc -mmacosx-version-min=10.4" make
Logged

mirko.g

  • Global Moderator
  • Full Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 188
  • Grattatio pallorum omnia mala repellent!
    • Personal WebSite
Re: aMule-2.2.4-universal Mac OS X 10.4+: work in progress!
« Reply #5 on: May 14, 2009, 03:47:12 PM »

Great... you definitely rocks!!!   :D
Logged

gtoso

  • Official MacOSX Packager
  • Full Member
  • ***
  • Karma: 24
  • Offline Offline
  • Posts: 206
Re: aMule-2.2.4-universal Mac OS X 10.4+: work in progress!
« Reply #6 on: May 14, 2009, 04:11:44 PM »

When you build universal binary, remember to test every binaries and library with otool to see if load the correct libraries.
And if you have problem see here.
Logged