User Tools

Site Tools


compilingonmac

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
compilingonmac [2012/01/07 22:44] – [Installing extra packages in Macports] glaubitzcompilingonmac [2012/10/09 22:19] glaubitz
Line 12: Line 12:
   * for MacOS 10.5 the latest version is 3.1.4: xcode314_2809_developerdvd.dmg   * for MacOS 10.5 the latest version is 3.1.4: xcode314_2809_developerdvd.dmg
   * for MacOS 10.6 the latest (free) version is 3.2.6: xcode_3.2.6_and_ios_sdk_4.3_final.dmg   * for MacOS 10.6 the latest (free) version is 3.2.6: xcode_3.2.6_and_ios_sdk_4.3_final.dmg
-  * for MacOS 10.7 the latest version is 4.2 and can be downloaded through the Mac App Store+  * for MacOS 10.7/10.8 the latest version is 4.2 and can be downloaded through the Mac App Store
  
-If you're using MacOS 10.6, you can also buy XCode (4.x) in the Mac App Store (free for 10.7).+If you're using MacOS 10.6, you can also buy XCode (4.x) in the Mac App Store (free for 10.7/10.8).
  
 ==== Then, download and install the Qt development libraries and headers for your version of MacOS ==== ==== Then, download and install the Qt development libraries and headers for your version of MacOS ====
Line 30: Line 30:
 [[http://www.macports.org]] [[http://www.macports.org]]
  
-After installing macports, make sure that "/opt/local/bin" is in your path by adding the file //macports// in your //paths.d// folder, in terminal (Applications->Utilities->Terminal), as normal user, type:+After installing macports, make sure that you can run the //port// command. To test this, open a terminal (Applications->Utilities->Terminal) and type //port//. If you get a "command not found" error, "/opt/local/bin" has to be added to your path by adding the file //macports// in your //paths.d// folder, in the same terminal, as normal user, type:
  
 <code> <code>
Line 41: Line 41:
  
 <code> <code>
-sudo port install glib2 libmad git-core sox libgcrypt taglib libid3tag libusb-devel+sudo port install glib2 libmad git-core sox libgcrypt taglib libid3tag libusb
 </code> </code>
  
-You will need to type your password to authenticate the //sudo//. Please be aware, that the //port// command will take quite an amount of time when you run it the first time since MacPorts has to compile all necessary packages from source. Especially on older PowerPC machines, the compilation of the code can take several hours (around 5 hours on a Mac Mini G4). It's highly recommended to let this step run over night on older machines.+You will need to type your password to authenticate the //sudo//. Please be aware, that the //port// command will take quite an amount of time when you run it the first time since MacPorts has to compile all necessary packages from source. Especially on older PowerPC machines, the compilation of the code can take several hours (measured 3 hours on a PowerMac G4 with 867 MHz and 1GB RAM). It's highly recommended to let this step run over night on older machines.
  
-==== Building and installing Qt4 ====+==== Building and installing Qt4 through Macports ====
  
 To install Qt4 through Macports, type: To install Qt4 through Macports, type:
Line 54: Line 54:
 </code> </code>
  
-**NOTE:** //qt4-mac// is a very large package and takes hours to compile. Be prepared to have your computer compile for at least 12~24 hours. Not recommended on machines below 1 GHz. Please consider installing the pre-compiled Qt 4.6.4 binaries in this case (see above).+**NOTE:** //qt4-mac// is a very large package and takes hours to compile. Be prepared to have your computer compile for at least 12~24 hours. Not recommended on machines below 1 GHz. Please consider installing the pre-compiled Qt 4.6.4 binaries in this case (see above). Alternatively, you can cross-compile for PPC on an i386 host (see below).
 ===== Getting the code ===== ===== Getting the code =====
  
Line 144: Line 144:
 to the project files. to the project files.
  
 +===== Cross-compiling for PPC on i386 (on MacOS 10.5) =====
 +
 +It is possible to cross-compile Macports and the MiniDisc software for PPC on an i386 host. This is very convenient as it dramatically speeds up building the software for PPC since the fastest PPC Macs are much slower than current Intel machines.
 +
 +First, install XCode and Macports as described above, but do not install Qt as it will be installed through Macports.
 +
 +After installing Macports, edit the //macports.conf// (in /opt/local/etc/macports) configuration file to set the build rchitecture to PPC:
 +
 +<code>
 +build_arch                      ppc
 +</code>
 +
 +Then, edit the portfile for libffi to fix a problem with cross-compilation. Type "port edit libffi" and add:
 +
 +<code>
 +configure.args --build=powerpc-apple-darwin9.8.0 --with-gcc-arch=ppc
 +</code>
 +
 +Other ports to be patched: //libmad//, //orc//.
 +
 +For //orc//, comment the first line shown here out (prepend the hash sign) and add the second one:
 +
 +<code>
 +#configure.optflags-append -Xarch_i386 -O1
 +configure.args --build=powerpc-apple-darwin9.8.0
 +</code>
 +
 +For //libmad// and //fftw-3//, just add:
 +
 +<code>
 +configure.args --build=powerpc-apple-darwin9.8.0
 +</code>
 +
 +For //fftw-3//, comment out all lines containing references to "sse2".
 +
 +Finally, for //xorg-libXrandr//, add:
 +
 +<code>
 +configure.ldflags -Wl,-headerpad_max_install_names
 +</code>
 +
 +Now, install the dependencies as usual, but include //qt4-mac//:
 +
 +<code>
 +sudo port install glib2 libmad git-core sox libgcrypt taglib libid3tag libusb-devel qt4-mac
 +</code>
 +
 +Finally, edit the qmake project file of linux-minidisc, //md.pro// by adding the following two lines:
 +
 +<code>
 +CONFIG += ppc
 +CONFIG -= i386
 +</code>
 +
 +Then, build as described above.
 ===== Important Notes ===== ===== Important Notes =====
  
compilingonmac.txt · Last modified: 2017/10/01 09:04 by thp

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki