<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Raasdnil</id>
	<title>VideoLAN Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Raasdnil"/>
	<link rel="alternate" type="text/html" href="https://wiki.videolan.org/Special:Contributions/Raasdnil/"/>
	<updated>2026-11-04T19:55:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=14619</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=14619"/>
		<updated>2009-08-13T10:22:22Z</updated>

		<summary type="html">&lt;p&gt;Raasdnil: Added how to fix &amp;quot;can not find twolame&amp;quot; on Mac OSX Leopard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Compile VLC on Mac OS X ==&lt;br /&gt;
&lt;br /&gt;
Compiling {{VLC}} on Mac OS X is different from normal linux compiling and OS X compiling. We do not use Xcode, but a simple &amp;lt;code&amp;gt;./configure&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; isn&#039;t enough either. The instructions below are always for the currently unstable, non-released code.&lt;br /&gt;
&lt;br /&gt;
If you compile from [[Git]] then please remember that this code can often be in an unstable state. If you wish to develop or test please join the vlc-devel mailinglist.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t put any of the non-released test binaries or git-compiles on software sites or on user-forums. We have had bad experiences with this before and we do not appreciate it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Be sure to read the paragraph on Mac OS X Leopard before starting the compilation.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Quick Steps ==&lt;br /&gt;
  $ git clone git://git.videolan.org/vlc.git&lt;br /&gt;
  $ cd extras/contrib&lt;br /&gt;
  $ ./bootstrap&lt;br /&gt;
  $ make&lt;br /&gt;
  &lt;br /&gt;
  $ cd ../..&lt;br /&gt;
  $./bootstrap&lt;br /&gt;
  $ export CC=/Developer/usr/bin/llvm-gcc-4.2&lt;br /&gt;
  $ export CXX=/Developer/usr/bin/llvm-g++-4.2&lt;br /&gt;
  $ export OBJC=/Developer/usr/bin/llvm-gcc-4.2&lt;br /&gt;
  $ ./configure --enable-debug&lt;br /&gt;
  &lt;br /&gt;
  $ make&lt;br /&gt;
Read next section for more details.&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Please follow these steps for compiling:&lt;br /&gt;
&lt;br /&gt;
=== Set the development environment ===&lt;br /&gt;
&lt;br /&gt;
Install the Mac OS X Developer Tools from the Developer Tools CD, or get them online. &lt;br /&gt;
&lt;br /&gt;
You need at least Mac OS X 10.5 and Xcode 3.1.2 for compilation. Mac OS X 10.6 and its Xcode releases are also supported. Make sure that the LLVM GCC 4.2 compiler is installed.&lt;br /&gt;
&lt;br /&gt;
Compiling with earlier releases of Mac OS X and/or Xcode will not work.&lt;br /&gt;
&lt;br /&gt;
Additionally, you may need to install Subversion (SVN) and more importantly Git on your Mac.&lt;br /&gt;
&lt;br /&gt;
=== Get the source ===&lt;br /&gt;
Download the {{VLC}} [[GetTheSource|source code]] (using [[Git]]) as described on the [[GetTheSource| &amp;quot;Get the source&amp;quot;]] page or get a recent source tarball. Note that the 3rd party libraries will probably break a few months after the release&#039;s publication.&lt;br /&gt;
&lt;br /&gt;
=== Build external libs ===&lt;br /&gt;
&lt;br /&gt;
We now need to build the [[Contrib_Status| 3rd party libs]]. For that, you will need to:&lt;br /&gt;
* cd to the source directory with your Terminal application.&lt;br /&gt;
* If you have fink, then you will need to disable it. {{VLC}} has it&#039;s own form of Fink (in the extras/contrib subdir) and it can conflict with Fink. We use this system to generate a reliable, consistent and known amount of packages that {{VLC}} requires. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;To disable Fink comment the line: #source /sw/bin/init.csh in your .cshrc file or . /sw/bin/init.csh in your .bashrc file in your home-directory.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First fetch the contribs. Those are external libraries needed by VLC.&lt;br /&gt;
  $ cd extras/contrib&lt;br /&gt;
  $ ./bootstrap&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
The last command will download &#039;&#039;&#039;prebuilt&#039;&#039;&#039; binary contrib you can happily use to build VLC wth -- only if you&#039;re using git master branch or the bugfix branch for 0.9 / 1.0.&lt;br /&gt;
You will only have to do this once. (You can do it again if required libraries are added or updated by the team.)&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to debug these libraries or want to create a new package, you need to execute &amp;lt;code&amp;gt;make src&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note that the 10.5 SDK is used by default. If you encounter problems, make sure that the script correctly used Apple&#039;s llvm-gcc-4.2 compiler and your Xcode installation is up-to-date.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Prepare the VLC build ===&lt;br /&gt;
Now we return to VLC itself. Go back to the top level VLC source directory.  &lt;br /&gt;
  $ cd ../.. &lt;br /&gt;
  $ ./bootstrap &lt;br /&gt;
&lt;br /&gt;
This will create configure and Makefiles for {{VLC}} (snapshots and releases already include this).&lt;br /&gt;
&lt;br /&gt;
=== Setup the correct compiler ===&lt;br /&gt;
Current revisions of VLC need to be compiled using Apple&#039;s llvm-gcc-4.2 compiler in its latest version. In case of failures, make sure that the latest version of Xcode is installed.&lt;br /&gt;
To use this compiler, you need to export the respective variables. In a Bourne Shell, type this (if Xcode is installed to its default location; bash is the default shell on OS X):&lt;br /&gt;
&lt;br /&gt;
  $ export CC=/Developer/usr/bin/llvm-gcc-4.2&lt;br /&gt;
  $ export CXX=/Developer/usr/bin/llvm-g++-4.2&lt;br /&gt;
  $ export OBJC=/Developer/usr/bin/llvm-gcc-4.2&lt;br /&gt;
&lt;br /&gt;
If you are using a C-Shell, you need to use the &#039;&#039;setenv&#039;&#039; command of course.&lt;br /&gt;
&lt;br /&gt;
=== Configure the VLC build ===&lt;br /&gt;
The next step is to configure, in the top level VLC source directory.&lt;br /&gt;
&lt;br /&gt;
In current revisions, you can simply run&lt;br /&gt;
  $ ./configure --enable-debug&lt;br /&gt;
to get VLC in its default configuration. If do not want to use VLC&#039;s default configuration for Mac, be sure to add &amp;lt;code&amp;gt;--disable-macosx-defaults&amp;lt;/code&amp;gt; to your custom set. Using &amp;lt;code&amp;gt;--disable-nls&amp;lt;/code&amp;gt; will save you a lot of time, if you don&#039;t care about localised interfaces.&lt;br /&gt;
&lt;br /&gt;
When compiling earlier revisions or the 0.8.6 branch, you need to give a wide variety of configure flags to achieve a useful build. We used to use this set:&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --enable-debug --disable-x11 --disable-xvideo --disable-glx --enable-sdl --enable-mad --enable-libdvbpsi --enable-a52 --disable-dvdplay --enable-dvdnav --enable-dvdread --enable-ffmpeg --enable-faad --enable-flac --enable-vorbis --enable-speex --enable-theora --enable-ogg --enable-shout --enable-cddb --disable-cddax --enable-vcdx --disable-skins --disable-skins2 --disable-wxwidgets --enable-freetype --enable-fribidi --enable-caca --enable-live555 --enable-dca --enable-goom --enable-modplug --enable-gnutls --enable-daap --enable-ncurses --enable-libtwolame --enable-x264 --enable-png --enable-realrtsp --enable-lua --disable-libtool&amp;lt;/code&amp;gt;&lt;br /&gt;
Have a look at configure.ac for our current default configuration.&lt;br /&gt;
&lt;br /&gt;
You can add &amp;lt;code&amp;gt;--with-mozilla-sdk-path=./extras/contrib/gecko-sdk --enable-mozilla&amp;lt;/code&amp;gt; to the configure-line to enable the compilation of VLC&#039;s Safari/Firefox plugin.&lt;br /&gt;
&lt;br /&gt;
=== Build VLC ===&lt;br /&gt;
After configure is finished, we can finally build {{VLC}}. A simple &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; will do the trick. If you want to use the resulting application package on a different Mac or a different account on the same Mac, run &lt;br /&gt;
  $ make&lt;br /&gt;
  $ make VLC-release.app&lt;br /&gt;
afterwards. Use the resulting &#039;&#039;VLC-release.app&#039;&#039; for these purposes.&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image, type &lt;br /&gt;
  $ make package-macosx&lt;br /&gt;
(respectively &amp;lt;code&amp;gt;make package-macosx-plugin&amp;lt;/code&amp;gt; for the Safari/Mozilla plugin).&lt;br /&gt;
&lt;br /&gt;
=== What&#039;s wrong, if I don&#039;t succeed? ===&lt;br /&gt;
Starting with Leopard, Xcode may be installed to a custom location on the administrator&#039;s choice. While this is non-problematic for ordinary Xcode projects, VLC needs a little help. You have to place extra symbolic links in /Developer pointing to your custom location for these folders:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usr, Headers, Private, SDKs, Tools, Makefiles&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can easily create these links by executing the following command for each folder (whereas theFolder is one of these six):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s /full/path/to/Developer/theFolder /Developer/theFolder&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Additionally, make always sure that you are using the latest version of Xcode. Otherwise, VLC&#039;s compilation or behaviour at runtime won&#039;t be the way you want it to be.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== What about 64-bit? ===&lt;br /&gt;
Both the 1.0-bugfix branch and the master branch can be compiled in 64-bit mode on OS X, but it is considered experimental. This is only tested for x86_64, but PPC64 should also work. Precompiled contribs are usually available for x86_64. To see how to compile VLC this way, check the documentation of your GCC vendor, as there are known differences within the supported versions of Mac OS X, but you may try:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;After running bootstrap in extras/contrib&#039;&#039;&#039;: Replace the first line of config.mak to &amp;lt;code&amp;gt;ARCH=x86_64&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;ARCH=i386&amp;lt;/code&amp;gt;. Running &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; after only this change should cause the precompiled x86_64 contrib to be downloaded and extracted. (If you&#039;re compiling your own contrib, you should edit &amp;lt;code&amp;gt;CFLAGS_TUNING&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EXTRA_LDFLAGS&amp;lt;/code&amp;gt; to use x86_64, and you may also want to change &amp;lt;code&amp;gt;CC&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CXX&amp;lt;/code&amp;gt; to use llvm versions.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running configure&#039;&#039;&#039;: Do something like &amp;lt;code&amp;gt;./configure CFLAGS=&amp;quot;-arch x86_64&amp;quot; LDFLAGS=&amp;quot;-arch x86_64&amp;quot; OBJCFLAGS=&amp;quot;-arch x86_64&amp;quot; --build=x86_64-apple-darwin9.7.0&amp;lt;/code&amp;gt; instead. Not all these flags may be necessary.&lt;br /&gt;
&lt;br /&gt;
=== ./configure fails on needing twolame ===&lt;br /&gt;
&lt;br /&gt;
This is because either (1) you do not have twolame installed, or (2) you did not tell configure how to find twolame&lt;br /&gt;
&lt;br /&gt;
To fix the first problem, using mac ports you can do:&lt;br /&gt;
&lt;br /&gt;
 $ sudo port install twolame&lt;br /&gt;
&lt;br /&gt;
Then once this is done, re run configure after telling it to use mac ports pkg config&lt;br /&gt;
&lt;br /&gt;
 $ export PKG_CONFIG_PATH=&amp;quot;/opt/local/lib/pkgconfig&amp;quot; &lt;br /&gt;
 $ ./configure&lt;br /&gt;
&lt;br /&gt;
This should then work for you.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
Written by Jean-Alexis Montignies, [[User:Fkuehne|Felix Paul Kühne]] and [[User:The DJ|Derk-Jan Hartman]], for the VideoLAN Team.&lt;br /&gt;
Adapted to the Wiki by [[User:j-b|Jean-Baptiste Kempf]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Building]]&lt;br /&gt;
[[Category:Coding]]&lt;/div&gt;</summary>
		<author><name>Raasdnil</name></author>
	</entry>
</feed>