HowTo compile on Mac

From AMule Project FAQ
Revision as of 23:01, 9 May 2005 by M2kio (Talk | contribs)

Jump to: navigation, search

How to get and install aMule on Apple Mac OSX.

  1. You can simply download the finished application ('binary release') or
  2. you compile it from a cvs source snapshot.

The preceding version of this page covering aMule 2.0.0rc8 and earlier is archived here.

Binary releases

If you don't want to bother with installing and compiling all those tools and sources, then get one of the pre-compiled aMule applications. The official release is considered 'stable', but every now and then applications are built from the current source to allow more people to test new features or the like.

  1. latest official binary release: aMule-2.0.0-Mac
  2. periodically compiled binary from cvs: amule forum

Compiling from source

Compiling from source allows most current bug reports, because you can compile and test the cvs snapshot of the very day.

To compile aMule from source you need some development tools, the wxWidgets library and the aMule source.

Get the sources and development tools

Xcode

'XCode' is Apple's development environment. We need it for the gcc compiler. You may have XCode on CD/DVD, e.g. it is on the OSX10.4 DVD. Else you can download it from Apple, but you must sign up for a free-of-charge developer account first.

  1. Get XCode from http://developer.apple.com/tools/download
  2. "Member Site"->"Log In"->"Download Software"->"Developer Tools"->"Download Xcode Tools last release">"Install"


Fink

'Fink' is an open source (OS) installer for lots of OS tools ported to Mac OSX. We need it to install the OS tool 'gettext'.

  1. Get Fink from http://fink.sourceforge.net/download
  2. Read Fink's installation guide to learn how to install applications through Fink.


gettext

'gettext' is an OS library for text internationalization. This library is used to make aMule multi-lingual.

  1. get and install the 'gettext' library with 'Fink'. The package name is 'gettext'.


wxMac

'wxMac' is the port of the 'wxWidgets' library for Mac OSX. This library is used to make aMule 'multi-platform'.

  1. Get the source from: http://prdownloads.sourceforge.net/wxwindows/wxMac-2.6.0.tar.gz
  2. Extract the archive. (just double-click it.)

Or get the current cvs snapshot. Warning: the wxMac cvs is frequently in a bad condition.

    bash: cd ~/Desktop
    bash: cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
    Note: password is 'anoncvs'
    bash: cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout wxMac


aMule itself

  1. Get latest daily cvs source snapshot: aMule CVS
  2. Extract the archive. (just double-click it.)


Compile the sources

Put the amule folder and the wxMac folder at the same place, e.g. on the desktop.

Important: If you use XCode 2.0 then your default compiler is gcc 4.0. Currently (2005-05-09) wxMac then only compiles with patches, and the CryptoPP library does not compile at all. Therefore, if you use XCode 2.0 then you must switch back to gcc 3.3 first. First check the version of your current default gcc with gcc --version and then switch to version 3.3 if required:

    bash: gcc --version
    bash: sudo gcc_select 3.3


Compile wxMac

This step is only needed once, even if you later download and compile a newer version of the aMule cvs source.

The following assumes that you have placed the above packages on your Desktop.
'cd' into the wxMac folder, 'configure' and 'make':

    bash: cd ~/Desktop/wxMac-2.6.0/build
    bash: ../configure --disable-shared --enable-unicode 
    bash: make

This took approx. 30 minutes on my G4 at 1 GHz.

Compile aMule

Now 'cd' into the amule folder, 'configure' and 'make':
((note: you can copy&paste the 4 lines for './configure' in one go))

    bash: cd ~/Desktop/aMule
    bash: ./configure --disable-systray --disable-gtk     \
            --with-wx-prefix=../wxMac-2.6.0/build/lib/     \
            --with-wx-config=../wxMac-2.6.0/build/wx-config \
            --enable-debug --disable-optimise                    <-- OPTIONAL
          
    bash: make
    bash: strip src/amule                                        <-- OPTIONAL
    bash: mv src/amule aMule.app/Contents/MacOS/

the two lines marked as OPTIONAL are optional, that is, the last two options to ./configure and the strip command. They result in a dramatically reduced file size (approx. 3 MB instead of 50 MB) but disable all possibilities to submit a helpful stacktrace if amule crashes or a sample if it hangs to the aMule developers.



Problems and solutions

  • If Fink reports something like: After unpacking 11.2GB will be freed, don't be afraid. Fink has evolved into a different way of managing packet's size and some old ("old": at least some months old) packages' sizes aren't handled correctly on the output. If this is your case, devide the number by 1024. So, what the above example really means is: After unpacking 11.2MB will be freed.
  • If you get an error like this: You cannot open the application "amule" because it may be damaged or incomplete, right click on amule, then click on Show Packages Contents, go to "Contents">"MacOS"> and double click on amule. Next time you start from aMule.app it will run fine. If you still get the same error, move aMule.app to the desktop and run it from there.