Difference between revisions of "HowTo compile on Mac"

From AMule Project FAQ
Jump to: navigation, search
Line 1: Line 1:
The following is the commands you should type to install [[aMule]] on [http://www.apple.com/macosx MacOS X].<br>
+
The following steps will lead you to install [[aMule]] in your [http://www.apple.com/macosx MacOS X] box.
This HowTo is written to install [[aMule]] cvs but should work for any other version. Please note that you should always download the latest [[aMule]] version available.<br>
+
Whenever ''[http://curl.haxx.se curl]'' is used, if it isn't installed on your system, just download the file manually.
+
Lines beginning with a ''#'' character are comments on what the following lines do.
+
  
''<pre>
+
This HowTo is written to install [[aMule]] 2.0.0-rc7 but should work for any other version. Please note that you should always download the latest [[aMule]] version available.
# install Xcode Tools
+
# http://developer.apple.com/tools/download/
+
# Getting ADC ID > Log In > Download Software > Developer Tools > Download Xcode Tools last release > Install
+
  
# install Fink too, since gettext is needed
+
'''NOTE:''' This document explains how to download files using [http://curl.haxx.se curl]. However, [http://curl.haxx.se curl] might not be installed on your system: either install it (you can use [http://fink.sourceforge.net Fink] to instal it) or download the files with whatever application you want (maybe your web browser), but place then in the directory that's being used on each part of the guide, otherwise the commands that are shown here will not work.
# http://fink.sourceforge.net
+
# read the info at http://fink.sourceforge.net/download to learn how to install gettext
+
  
# make amule dir in home
+
# Install [http://developer.apple.com/tools/xcode Xcode Tools] from http://developer.apple.com/tools/download
cd ~
+
# "Getting ADC ID"->"Log In"->"Download Software"->"Developer Tools"->"Download Xcode Tools last release">"Install"
mkdir amule
+
# Install (or verify installation if already installed) [http://fink.sourceforge.net Fink], since [http://www.gnu.org/software/gettext gettext] and [[wxMac]] are installed along with [http://fink.sourceforge.net Fink], from http://fink.sourceforge.net/download
cd amule
+
# Install [http://www.gnu.org/software/gettext gettext] and [[wxMac]] ([[wxMac]] is only available through [http://fink.sourceforge.net Fink] unstable on [http://www.apple.com/macosx MacOS] 10.3. If you are using [http://fink.sourceforge.net Fink] stable or [http://www.apple.com/macosx MacOS] 10.2 or earlier, either upgrade [http://fink.sourceforge.net Fink] to unstable and/or [http://www.apple.com/macosx MacOS] to 10.3, or check the  [[#Installing [[wxMac]] form sources|Installing [[wxMac]] form sources section]] of this document adn then go on with this section) through [http://fink.sourceforge.net Fink]. Read [http://fink.sourceforge.net/download Fink's installation guide] to learn how to install applications through [http://fink.sourceforge.net Fink] (the [http://www.gnu.org/software/gettext gettext] package is ''gettext'' and the [[wxMac]] package is ''wxmac'' and ''wxmac-shlibs''),
 +
# Read the documentation at http://fink.sourceforge.net/download to learn how to install [[wxMac]].
 +
# Make ''amule'' dir in your home directory: ''mkdir ~/amule''
 +
# Enter the ''amule'' directory you just created: ''cd ~/amule''
 +
# Get [[aMule]]'s latest source code (aMule 2.0.0-rc7 sourcecode: [http://download.berlios.de/amule/aMule-2.0.0rc7.tar.bz2 http://download.berlios.de/amule/aMule-2.0.0rc7.tar.bz2]) and place it in your ''~/amule'' directory: curl -O http://download.berlios.de/amule/aMule-2.0.0rc7.tar.bz2
 +
# Extract it: ''tar -xjf aMule-2.0.0rc7.tar.bz2''
 +
# Enter [[aMule]]'s sources directory: ''cd aMule-2.0.0rc7''
 +
# Prepare the compilation: ''./configure --disable-systray  --disable-gtk --enable-embedded_crypto''
 +
# And compile it: ''make''
 +
# '''Optional:''' You can reduce the size of [[aMule]] from 44MB to 3MB by doing the following (anyway, this will make the [[aMule]] binnary loose debug info, so you'll be unable to report problems to the [[aMule devs|aMule Team]] to make [[aMule]] a better program, which it is not recommended): ''strip src/amule''
 +
# Get back to your ''amule'' directory: ''cd ~/amule''
 +
# Download [http://download.berlios.de/amule/aMule-App-Container.tar.bz2 aMule's app-Container]: ''curl -O http://download.berlios.de/amule/aMule-App-Container.tar.bz2''
 +
# Extract it: ''tar -xjf aMule-App-Container.tar.bz2''
 +
# Copy the ''amule'' binnary to the app-Container directory: ''cp aMule-2.0.0rc7/src/amule amule.app/Contents/MacOS/''
 +
# And move ''amule.app'' directory to your Applications folder: ''mv amule.app /Applications''
 +
# If everything went ok, you can safely remove the downloaded packages:
 +
## Remove [[aMule]]'s sources package: ''rm ~/amule/aMule-2.0.0rc7.tar.bz2''
 +
## Remove the app-Container package: ''rm aMule-App-Container.tar.bz2''
 +
## Optionally remove the extracted [[aMule]] sources (not recommended, since you might want to compile it again someday): ''rm -r ~/amule/aMule-2.0.0rc7''
 +
## Optionally, if you if you decided to remove the extracted [[aMule]] sources, remove the ''~/amule'' directory (which should be empty by now): ''rmdir ~/amule''
  
# get source from the internet and unpack it
+
== Installing [[wxMac]] form sources ==
curl -O http://heanet.dl.sourceforge.net/sourceforge/wxwindows/wxMac-2.5.3.tar.gz
+
curl -O http://download.berlios.de/amule/aMule-2.0.0rc7.tar.bz2
+
tar -xzf wxMac-2.5.3.tar.gz
+
tar -xjf aMule-2.0.0rc7.tar.bz2
+
  
# remove downloaded archives after unpacking
+
Only follow this part of the guide if [[wxMac]] is not available through your [http://fink.sourceforge.net Fink] installation or if you really know what you're doing. In any other case, just jump to the next section.
rm wxMac-2.5.3.tar.gz aMule-2.0.0rc7.tar.bz2
+
  
# install wxMac
+
# Create a directory where all the work will be done: ''mkdir ~/wxmac''
cd wxMac-2.5.3
+
# Enter that directory: ''cd ~/wxmac''
# directory "build" should already be there. if not, create it with  
+
# Download [[wxMac]] sources: ''curl -O http://heanet.dl.sourceforge.net/sourceforge/wxwindows/wxMac-2.5.3.tar.gz''
# "mkdir build":
+
# Extract the file: ''tar -xzf wxMac-2.5.3.tar.gz''
cd build
+
# Enter the extracted sources' directory: ''cd wxMac-2.5.3''
../configure
+
# Directory ''build'' should already be there. If not, create it with: ''mkdir build''
make
+
# Now enter ''build'' directory: ''cd build''
sudo make install
+
# Prepare the compilation: ''../configure''
cd ..
+
# And compile: ''make''
cd ..
+
# Now install [[wxMac]] compilation: ''sudo make install''
 +
# Get back to your home directory, you're done: ''cd ~''
 +
# If everything went ok, you can safely remove:
 +
## [[wxMac]]'s sources package: ''rm wxMac-2.5.3.tar.gz''
 +
## Optionally remove the extracted [[wxMac]] sources (not recommended, since you might want to compile it again someday): ''rm -r ~/wxmac
  
# compile aMule
+
== Problems and solutions ==
cd aMule-2.0.0rc7
+
./configure --disable-systray  --disable-gtk --enable-embedded_crypto --with-wx-prefix=/usr/local --with-wx-config=/usr/local/bin/wx-config
+
make
+
  
# optional: reduce size of amule from 44 MB to 3 MB while loosing
+
*If the app-Container failed to extract try running this command instead of the app-Container extraction step: ''mkdir -p amule.app/Contents/MacOS''
# debug info :-(
+
strip src/amule
+
  
cd ..
+
*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.
 
+
# create app-Container
+
curl -O http://download.berlios.de/amule/aMule-App-Container.tar.bz2
+
tar -xjf aMule-App-Container.tar.bz2
+
rm aMule-App-Container.tar.bz2
+
# the following line is just in case the app container failed to extract
+
mkdir -p amule.app/Contents/MacOS/
+
cp aMule-2.0.0rc7/src/amule amule.app/Contents/MacOS/
+
 
+
# move amule to your Applications folder
+
mv amule.app /Applications
+
 
+
</pre>''
+
 
+
 
+
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.
+

Revision as of 17:45, 15 November 2004

The following steps will lead you to install aMule in your MacOS X box.

This HowTo is written to install aMule 2.0.0-rc7 but should work for any other version. Please note that you should always download the latest aMule version available.

NOTE: This document explains how to download files using curl. However, curl might not be installed on your system: either install it (you can use Fink to instal it) or download the files with whatever application you want (maybe your web browser), but place then in the directory that's being used on each part of the guide, otherwise the commands that are shown here will not work.

  1. Install Xcode Tools from http://developer.apple.com/tools/download
  2. "Getting ADC ID"->"Log In"->"Download Software"->"Developer Tools"->"Download Xcode Tools last release">"Install"
  3. Install (or verify installation if already installed) Fink, since gettext and wxMac are installed along with Fink, from http://fink.sourceforge.net/download
  4. Install gettext and wxMac (wxMac is only available through Fink unstable on MacOS 10.3. If you are using Fink stable or MacOS 10.2 or earlier, either upgrade Fink to unstable and/or MacOS to 10.3, or check the [[#Installing wxMac form sources|Installing wxMac form sources section]] of this document adn then go on with this section) through Fink. Read Fink's installation guide to learn how to install applications through Fink (the gettext package is gettext and the wxMac package is wxmac and wxmac-shlibs),
  5. Read the documentation at http://fink.sourceforge.net/download to learn how to install wxMac.
  6. Make amule dir in your home directory: mkdir ~/amule
  7. Enter the amule directory you just created: cd ~/amule
  8. Get aMule's latest source code (aMule 2.0.0-rc7 sourcecode: http://download.berlios.de/amule/aMule-2.0.0rc7.tar.bz2) and place it in your ~/amule directory: curl -O http://download.berlios.de/amule/aMule-2.0.0rc7.tar.bz2
  9. Extract it: tar -xjf aMule-2.0.0rc7.tar.bz2
  10. Enter aMule's sources directory: cd aMule-2.0.0rc7
  11. Prepare the compilation: ./configure --disable-systray --disable-gtk --enable-embedded_crypto
  12. And compile it: make
  13. Optional: You can reduce the size of aMule from 44MB to 3MB by doing the following (anyway, this will make the aMule binnary loose debug info, so you'll be unable to report problems to the aMule Team to make aMule a better program, which it is not recommended): strip src/amule
  14. Get back to your amule directory: cd ~/amule
  15. Download aMule's app-Container: curl -O http://download.berlios.de/amule/aMule-App-Container.tar.bz2
  16. Extract it: tar -xjf aMule-App-Container.tar.bz2
  17. Copy the amule binnary to the app-Container directory: cp aMule-2.0.0rc7/src/amule amule.app/Contents/MacOS/
  18. And move amule.app directory to your Applications folder: mv amule.app /Applications
  19. If everything went ok, you can safely remove the downloaded packages:
    1. Remove aMule's sources package: rm ~/amule/aMule-2.0.0rc7.tar.bz2
    2. Remove the app-Container package: rm aMule-App-Container.tar.bz2
    3. Optionally remove the extracted aMule sources (not recommended, since you might want to compile it again someday): rm -r ~/amule/aMule-2.0.0rc7
    4. Optionally, if you if you decided to remove the extracted aMule sources, remove the ~/amule directory (which should be empty by now): rmdir ~/amule

Installing wxMac form sources

Only follow this part of the guide if wxMac is not available through your Fink installation or if you really know what you're doing. In any other case, just jump to the next section.

  1. Create a directory where all the work will be done: mkdir ~/wxmac
  2. Enter that directory: cd ~/wxmac
  3. Download wxMac sources: curl -O http://heanet.dl.sourceforge.net/sourceforge/wxwindows/wxMac-2.5.3.tar.gz
  4. Extract the file: tar -xzf wxMac-2.5.3.tar.gz
  5. Enter the extracted sources' directory: cd wxMac-2.5.3
  6. Directory build should already be there. If not, create it with: mkdir build
  7. Now enter build directory: cd build
  8. Prepare the compilation: ../configure
  9. And compile: make
  10. Now install wxMac compilation: sudo make install
  11. Get back to your home directory, you're done: cd ~
  12. If everything went ok, you can safely remove:
    1. wxMac's sources package: rm wxMac-2.5.3.tar.gz
    2. Optionally remove the extracted wxMac sources (not recommended, since you might want to compile it again someday): rm -r ~/wxmac

Problems and solutions

  • If the app-Container failed to extract try running this command instead of the app-Container extraction step: mkdir -p amule.app/Contents/MacOS
  • 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.