<?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=Dfuhrmann</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=Dfuhrmann"/>
	<link rel="alternate" type="text/html" href="https://wiki.videolan.org/Special:Contributions/Dfuhrmann/"/>
	<updated>2026-11-04T14:52:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=62051</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=62051"/>
		<updated>2020-06-17T19:20:50Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Xcode tries to use SDK in CommandLineTools directory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase}}&lt;br /&gt;
This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(formerly known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
* Install python3 (macOS pkg installer from python.org)&lt;br /&gt;
* Java 8 JDK (needed to compile Java menu support for blurays)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
==== Developer directory test ====&lt;br /&gt;
&lt;br /&gt;
The Xcode developer directory must be used, not the command line tools developer directory, as only Xcode includes all necessary tools.&lt;br /&gt;
&lt;br /&gt;
Run the following command in Terminal:&lt;br /&gt;
&lt;br /&gt;
 xcode-select --print-path&lt;br /&gt;
&lt;br /&gt;
It needs to print out the path to your Xcode installation, like this&lt;br /&gt;
&lt;br /&gt;
 /Applications/Xcode.app/Contents/Developer&lt;br /&gt;
&lt;br /&gt;
If it prints out a path to the command line tools package, select the correct path using the xcode-select tool. See [https://wiki.videolan.org/OSXCompile/#Xcode_.27No_developer_directory.27_error here] for the correct command.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
The command line switch -c rebuilds all dependencies (contribs) from source. If you want to use a prebuild contrib package, omit the -c option.&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
== Making changes and compile again ==&lt;br /&gt;
&lt;br /&gt;
Using build.sh is the recommended way to do a fresh VLC build. Now, if you did some changes to the VLC source code, you can try to compile the change by calling build.sh again. But sometimes this is a bit cubersome, as it might take longer, and sometimes its preferred to execute some build commands directly.&lt;br /&gt;
&lt;br /&gt;
For that reason, a script called env.build.sh is included in VLC (starting with VLC 4.0 in vlc.git), which helps you setting the correct environment of your Terminal. The correct environment is needed, to make sure the right internal tools are used for the build process.&lt;br /&gt;
&lt;br /&gt;
Before you compile again with make, just source this script into the current Terminal (pay attention to the dot at the front of the command):&lt;br /&gt;
 . ../extras/package/macosx/env.build.sh&lt;br /&gt;
&lt;br /&gt;
You can also create a symlink to that script in a more convenient location, for instance into the main vlc checkout directory:&lt;br /&gt;
 # change directory to root git checkout&lt;br /&gt;
 ln -s $PWD/extras/package/macosx/env.build.sh&lt;br /&gt;
 cd build # go back to your build directory&lt;br /&gt;
 . ../env.build.sh&lt;br /&gt;
&lt;br /&gt;
Afterwards, in the same terminal, you can recompile by using the usual commands like make:&lt;br /&gt;
 make&lt;br /&gt;
 ./bin/vlc-osx-static -vv # To test compiled changes&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works. This section describes all steps which are internally done in build.sh already. Likely, they are only relevant to you if you do not want to use build.sh and env.build.sh.&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK], to support java code for libbluray.&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
== Xcode tooling tries to use SDK in CommandLineTools directory ==&lt;br /&gt;
Occasionally it has been reported that Xcode tooling tries to compile with an SDK located under the .../Developer/CommandLineTools directory, even if Xcode.app is properly installed and a suitable SDK is available inside the app.&lt;br /&gt;
&lt;br /&gt;
This problem might become visible with a similar error like this:&lt;br /&gt;
 error: SDK &amp;quot;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk&amp;quot; cannot be located.&lt;br /&gt;
&lt;br /&gt;
The root cause of this issue is now known yet and likely lies inside the apple provided tooling. One known workaround is to delete or move away the CommandLineTools directory. &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]]&lt;br /&gt;
[[Category:macOS]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=62050</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=62050"/>
		<updated>2020-06-17T19:18:44Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Xcode &amp;#039;No developer directory&amp;#039; error */ Add hint for workaround with CommandLineTools directory.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase}}&lt;br /&gt;
This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(formerly known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
* Install python3 (macOS pkg installer from python.org)&lt;br /&gt;
* Java 8 JDK (needed to compile Java menu support for blurays)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
==== Developer directory test ====&lt;br /&gt;
&lt;br /&gt;
The Xcode developer directory must be used, not the command line tools developer directory, as only Xcode includes all necessary tools.&lt;br /&gt;
&lt;br /&gt;
Run the following command in Terminal:&lt;br /&gt;
&lt;br /&gt;
 xcode-select --print-path&lt;br /&gt;
&lt;br /&gt;
It needs to print out the path to your Xcode installation, like this&lt;br /&gt;
&lt;br /&gt;
 /Applications/Xcode.app/Contents/Developer&lt;br /&gt;
&lt;br /&gt;
If it prints out a path to the command line tools package, select the correct path using the xcode-select tool. See [https://wiki.videolan.org/OSXCompile/#Xcode_.27No_developer_directory.27_error here] for the correct command.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
The command line switch -c rebuilds all dependencies (contribs) from source. If you want to use a prebuild contrib package, omit the -c option.&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
== Making changes and compile again ==&lt;br /&gt;
&lt;br /&gt;
Using build.sh is the recommended way to do a fresh VLC build. Now, if you did some changes to the VLC source code, you can try to compile the change by calling build.sh again. But sometimes this is a bit cubersome, as it might take longer, and sometimes its preferred to execute some build commands directly.&lt;br /&gt;
&lt;br /&gt;
For that reason, a script called env.build.sh is included in VLC (starting with VLC 4.0 in vlc.git), which helps you setting the correct environment of your Terminal. The correct environment is needed, to make sure the right internal tools are used for the build process.&lt;br /&gt;
&lt;br /&gt;
Before you compile again with make, just source this script into the current Terminal (pay attention to the dot at the front of the command):&lt;br /&gt;
 . ../extras/package/macosx/env.build.sh&lt;br /&gt;
&lt;br /&gt;
You can also create a symlink to that script in a more convenient location, for instance into the main vlc checkout directory:&lt;br /&gt;
 # change directory to root git checkout&lt;br /&gt;
 ln -s $PWD/extras/package/macosx/env.build.sh&lt;br /&gt;
 cd build # go back to your build directory&lt;br /&gt;
 . ../env.build.sh&lt;br /&gt;
&lt;br /&gt;
Afterwards, in the same terminal, you can recompile by using the usual commands like make:&lt;br /&gt;
 make&lt;br /&gt;
 ./bin/vlc-osx-static -vv # To test compiled changes&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works. This section describes all steps which are internally done in build.sh already. Likely, they are only relevant to you if you do not want to use build.sh and env.build.sh.&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK], to support java code for libbluray.&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
== Xcode tries to use SDK in CommandLineTools directory ==&lt;br /&gt;
Sometimes it is reported that Xcode tries to compile with an SDK located under the .../Developer/CommandLineTools directory, even if Xcode.app is properly installed and a suitable SDK is availalbe inside the app.&lt;br /&gt;
&lt;br /&gt;
This might be visible with a similar error like this:&lt;br /&gt;
 error: SDK &amp;quot;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk&amp;quot; cannot be located.&lt;br /&gt;
&lt;br /&gt;
The root cause of this issue is now known yet and likely lies inside the apple provided tooling. One known workaround is to delete or move away the CommandLineTools directory. &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]]&lt;br /&gt;
[[Category:macOS]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=61990</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=61990"/>
		<updated>2020-01-11T11:31:09Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Apple Software */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase}}&lt;br /&gt;
This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(formerly known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
* Install python3 (macOS pkg installer from python.org)&lt;br /&gt;
* Java 8 JDK (needed to compile Java menu support for blurays)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
==== Developer directory test ====&lt;br /&gt;
&lt;br /&gt;
The Xcode developer directory must be used, not the command line tools developer directory, as only Xcode includes all necessary tools.&lt;br /&gt;
&lt;br /&gt;
Run the following command in Terminal:&lt;br /&gt;
&lt;br /&gt;
 xcode-select --print-path&lt;br /&gt;
&lt;br /&gt;
It needs to print out the path to your Xcode installation, like this&lt;br /&gt;
&lt;br /&gt;
 /Applications/Xcode.app/Contents/Developer&lt;br /&gt;
&lt;br /&gt;
If it prints out a path to the command line tools package, select the correct path using the xcode-select tool. See [https://wiki.videolan.org/OSXCompile/#Xcode_.27No_developer_directory.27_error here] for the correct command.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
The command line switch -c rebuilds all dependencies (contribs) from source. If you want to use a prebuild contrib package, omit the -c option.&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
== Making changes and compile again ==&lt;br /&gt;
&lt;br /&gt;
Using build.sh is the recommended way to do a fresh VLC build. Now, if you did some changes to the VLC source code, you can try to compile the change by calling build.sh again. But sometimes this is a bit cubersome, as it might take longer, and sometimes its preferred to execute some build commands directly.&lt;br /&gt;
&lt;br /&gt;
For that reason, a script called env.build.sh is included in VLC (starting with VLC 4.0 in vlc.git), which helps you setting the correct environment of your Terminal. The correct environment is needed, to make sure the right internal tools are used for the build process.&lt;br /&gt;
&lt;br /&gt;
Before you compile again with make, just source this script into the current Terminal (pay attention to the dot at the front of the command):&lt;br /&gt;
 . ../extras/package/macosx/env.build.sh&lt;br /&gt;
&lt;br /&gt;
You can also create a symlink to that script in a more convenient location, for instance into the main vlc checkout directory:&lt;br /&gt;
 # change directory to root git checkout&lt;br /&gt;
 ln -s $PWD/extras/package/macosx/env.build.sh&lt;br /&gt;
 cd build # go back to your build directory&lt;br /&gt;
 . ../env.build.sh&lt;br /&gt;
&lt;br /&gt;
Afterwards, in the same terminal, you can recompile by using the usual commands like make:&lt;br /&gt;
 make&lt;br /&gt;
 ./bin/vlc-osx-static -vv # To test compiled changes&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works. This section describes all steps which are internally done in build.sh already. Likely, they are only relevant to you if you do not want to use build.sh and env.build.sh.&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK], to support java code for libbluray.&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]]&lt;br /&gt;
[[Category:macOS]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56414</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56414"/>
		<updated>2018-05-31T19:33:59Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Build steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
==== Developer directory test ====&lt;br /&gt;
&lt;br /&gt;
The Xcode developer directory must be used, not the command line tools developer directory, as only Xcode includes all necessary tools.&lt;br /&gt;
&lt;br /&gt;
Run the following command in Terminal:&lt;br /&gt;
&lt;br /&gt;
 xcode-select --print-path&lt;br /&gt;
&lt;br /&gt;
It needs to print out the path to your Xcode installation, like this&lt;br /&gt;
&lt;br /&gt;
 /Applications/Xcode.app/Contents/Developer&lt;br /&gt;
&lt;br /&gt;
If it prints out a path to the command line tools package, select the correct path using the xcode-select tool. See [https://wiki.videolan.org/OSXCompile/#Xcode_.27No_developer_directory.27_error here] for the correct command.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
The command line switch -c rebuilds all dependencies (contribs) from source. If you want to use a prebuild contrib package, omit the -c option.&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
== Making changes and compile again ==&lt;br /&gt;
&lt;br /&gt;
Using build.sh is the recommended way to do a fresh VLC build. Now, if you did some changes to the VLC source code, you can try to compile the change by calling build.sh again. But sometimes this is a bit cubersome, as it might take longer, and sometimes its preferred to execute some build commands directly.&lt;br /&gt;
&lt;br /&gt;
For that reason, a script called env.build.sh is included in VLC (starting with VLC 4.0 in vlc.git), which helps you setting the correct environment of your Terminal. The correct environment is needed, to make sure the right internal tools are used for the build process.&lt;br /&gt;
&lt;br /&gt;
Before you compile again with make, just source this script into the current Terminal (pay attention to the dot at the front of the command):&lt;br /&gt;
 . ../extras/package/macosx/env.build.sh&lt;br /&gt;
&lt;br /&gt;
You can also create a symlink to that script in a more convenient location, for instance into the main vlc checkout directory:&lt;br /&gt;
 # change directory to root git checkout&lt;br /&gt;
 ln -s $PWD/extras/package/macosx/env.build.sh&lt;br /&gt;
 cd build # go back to your build directory&lt;br /&gt;
 . ../env.build.sh&lt;br /&gt;
&lt;br /&gt;
Afterwards, in the same terminal, you can recompile by using the usual commands like make:&lt;br /&gt;
 make&lt;br /&gt;
 ./bin/vlc-osx-static -vv # To test compiled changes&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works. This section describes all steps which are internally done in build.sh already. Likely, they are only relevant to you if you do not want to use build.sh and env.build.sh.&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK], to support java code for libbluray.&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56413</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56413"/>
		<updated>2018-05-31T19:31:57Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Making changes and compile again */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
==== Developer directory test ====&lt;br /&gt;
&lt;br /&gt;
The Xcode developer directory must be used, not the command line tools developer directory, as only Xcode includes all necessary tools.&lt;br /&gt;
&lt;br /&gt;
Run the following command in Terminal:&lt;br /&gt;
&lt;br /&gt;
 xcode-select --print-path&lt;br /&gt;
&lt;br /&gt;
It needs to print out the path to your Xcode installation, like this&lt;br /&gt;
&lt;br /&gt;
 /Applications/Xcode.app/Contents/Developer&lt;br /&gt;
&lt;br /&gt;
If it prints out a path to the command line tools package, select the correct path using the xcode-select tool. See [https://wiki.videolan.org/OSXCompile/#Xcode_.27No_developer_directory.27_error here] for the correct command.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
The command line switch -c rebuilds all dependencies (contribs) from source. If you want to use a prebuild contrib package, omit the -c option.&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
== Making changes and compile again ==&lt;br /&gt;
&lt;br /&gt;
Using build.sh is the recommended way to do a fresh VLC build. Now, if you did some changes to the VLC source code, you can try to compile the change by calling build.sh again. But sometimes this is a bit cubersome, as it might take longer, and sometimes its preferred to execute some build commands directly.&lt;br /&gt;
&lt;br /&gt;
For that reason, a script called env.build.sh is included in VLC (starting with VLC 4.0 in vlc.git), which helps you setting the correct environment of your Terminal. The correct environment is needed, to make sure the right internal tools are used for the build process.&lt;br /&gt;
&lt;br /&gt;
Before you compile again with make, just source this script into the current Terminal (pay attention to the dot at the front of the command):&lt;br /&gt;
 . ../extras/package/macosx/env.build.sh&lt;br /&gt;
&lt;br /&gt;
You can also create a symlink to that script in a more convenient location, for instance into the main vlc checkout directory:&lt;br /&gt;
 # change directory to root git checkout&lt;br /&gt;
 ln -s $PWD/extras/package/macosx/env.build.sh&lt;br /&gt;
 cd build # go back to your build directory&lt;br /&gt;
 . ../env.build.sh&lt;br /&gt;
&lt;br /&gt;
Afterwards, in the same terminal, you can recompile by using the usual commands like make:&lt;br /&gt;
 make&lt;br /&gt;
 ./bin/vlc-osx-static -vv # To test compiled changes&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK], to support java code for libbluray.&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56412</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56412"/>
		<updated>2018-05-31T19:31:25Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Build VLC with a single command */ Add some instructions how to use env.build.sh&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
==== Developer directory test ====&lt;br /&gt;
&lt;br /&gt;
The Xcode developer directory must be used, not the command line tools developer directory, as only Xcode includes all necessary tools.&lt;br /&gt;
&lt;br /&gt;
Run the following command in Terminal:&lt;br /&gt;
&lt;br /&gt;
 xcode-select --print-path&lt;br /&gt;
&lt;br /&gt;
It needs to print out the path to your Xcode installation, like this&lt;br /&gt;
&lt;br /&gt;
 /Applications/Xcode.app/Contents/Developer&lt;br /&gt;
&lt;br /&gt;
If it prints out a path to the command line tools package, select the correct path using the xcode-select tool. See [https://wiki.videolan.org/OSXCompile/#Xcode_.27No_developer_directory.27_error here] for the correct command.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
The command line switch -c rebuilds all dependencies (contribs) from source. If you want to use a prebuild contrib package, omit the -c option.&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
== Making changes and compile again ==&lt;br /&gt;
&lt;br /&gt;
Using build.sh is the recommended way to do a fresh VLC build. Now, if you did some changes to the VLC source code, you can try to compile the change by calling build.sh again. But sometimes this is a bit cubersome, as it might take longer, and sometimes its preferred to execute some build commands directly.&lt;br /&gt;
&lt;br /&gt;
For that reason, a script called env.build.sh is included in VLC (starting with VLC 4.0 in vlc.git), which helps you setting the correct environment of your Terminal. The correct environment is needed, to make sure the right internal tools are used for the build process.&lt;br /&gt;
&lt;br /&gt;
Before you compile again with make, just source this script into the current Terminal (pay attention to the dot at the front of the command:&lt;br /&gt;
 . ../extras/package/macosx/env.build.sh&lt;br /&gt;
&lt;br /&gt;
You can also create a symlink to that script in a more convenient location, for instance into the main vlc checkout directory:&lt;br /&gt;
 # change directory to root git checkout&lt;br /&gt;
 ln -s $PWD/extras/package/macosx/env.build.sh&lt;br /&gt;
 cd build # go back to your build directory&lt;br /&gt;
 . ../env.build.sh&lt;br /&gt;
&lt;br /&gt;
Afterwards, in the same terminal, you can recompile by using the usual commands like make:&lt;br /&gt;
 make&lt;br /&gt;
 ./bin/vlc-osx-static -vv # To test compiled changes&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK], to support java code for libbluray.&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56411</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56411"/>
		<updated>2018-05-31T18:55:23Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Apple Software */ Building with developer tools only is not supported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
==== Developer directory test ====&lt;br /&gt;
&lt;br /&gt;
The Xcode developer directory must be used, not the command line tools developer directory, as only Xcode includes all necessary tools.&lt;br /&gt;
&lt;br /&gt;
Run the following command in Terminal:&lt;br /&gt;
&lt;br /&gt;
 xcode-select --print-path&lt;br /&gt;
&lt;br /&gt;
It needs to print out the path to your Xcode installation, like this&lt;br /&gt;
&lt;br /&gt;
 /Applications/Xcode.app/Contents/Developer&lt;br /&gt;
&lt;br /&gt;
If it prints out a path to the command line tools package, select the correct path using the xcode-select tool. See [https://wiki.videolan.org/OSXCompile/#Xcode_.27No_developer_directory.27_error here] for the correct command.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
The command line switch -c rebuilds all dependencies (contribs) from source. If you want to use a prebuild contrib package, omit the -c option.&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK], to support java code for libbluray.&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56410</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56410"/>
		<updated>2018-05-31T18:54:30Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported officially)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
==== Developer directory test ====&lt;br /&gt;
&lt;br /&gt;
The Xcode developer directory must be used, not the command line tools developer directory, as only Xcode includes all necessary tools.&lt;br /&gt;
&lt;br /&gt;
Run the following command in Terminal:&lt;br /&gt;
&lt;br /&gt;
 xcode-select --print-path&lt;br /&gt;
&lt;br /&gt;
It needs to print out the path to your Xcode installation, like this&lt;br /&gt;
&lt;br /&gt;
 /Applications/Xcode.app/Contents/Developer&lt;br /&gt;
&lt;br /&gt;
If it prints out a path to the command line tools package, select the correct path using the xcode-select tool. See [https://wiki.videolan.org/OSXCompile/#Xcode_.27No_developer_directory.27_error here] for the correct command.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
The command line switch -c rebuilds all dependencies (contribs) from source. If you want to use a prebuild contrib package, omit the -c option.&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK], to support java code for libbluray.&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56409</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56409"/>
		<updated>2018-05-31T18:52:29Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: Add test instructions to check that the correct developer directory is selected&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported officially)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
==== Developer directory test ====&lt;br /&gt;
&lt;br /&gt;
The Xcode developer directory must be used, not the command line tools developer directory, as only Xcode includes all necessary tools.&lt;br /&gt;
&lt;br /&gt;
Run the following command in Terminal:&lt;br /&gt;
&lt;br /&gt;
 xcode-select --print-path&lt;br /&gt;
&lt;br /&gt;
It needs to print out the path to your Xcode installation, like this&lt;br /&gt;
&lt;br /&gt;
 /Applications/Xcode.app/Contents/Developer&lt;br /&gt;
&lt;br /&gt;
If it prints out a path to the command line tools package, execute the command described [https://wiki.videolan.org/OSXCompile/#Xcode_.27No_developer_directory.27_error here].&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
The command line switch -c rebuilds all dependencies (contribs) from source. If you want to use a prebuild contrib package, omit the -c option.&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK], to support java code for libbluray.&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56408</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56408"/>
		<updated>2018-05-30T21:24:52Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Build VLC with a single command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported officially)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
The command line switch -c rebuilds all dependencies (contribs) from source. If you want to use a prebuild contrib package, omit the -c option.&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK], to support java code for libbluray.&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56407</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56407"/>
		<updated>2018-05-30T21:20:53Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Build your own libraries (not for the faint-hearted) */ Remove the warning about newest SDK, this is not valid anymore.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported officially)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK], to support java code for libbluray.&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56406</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56406"/>
		<updated>2018-05-30T21:12:03Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Build VLC with a single command */ Promote the single command version a bit more.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported officially)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
This is the most simple way to build VLC, including all its necessary dependencies. This way is highly recommended to use, as it sets up everything automatically.&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh -c&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this script (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
Note: In order to build the libraries you need to use an OS X SDK Version lower than 10.12, the 10.12 SDK causes problems&lt;br /&gt;
making it impossible to use the resulting libraries (and VLC build) on any macOS version lower than 10.12!&lt;br /&gt;
You can set the SDK Version (if it&#039;s installed) using &amp;lt;code&amp;gt;export OSX_VERSION=10.11&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK].&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56405</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56405"/>
		<updated>2018-05-30T21:09:52Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Apple Software */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current development version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported officially)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this build (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
Note: In order to build the libraries you need to use an OS X SDK Version lower than 10.12, the 10.12 SDK causes problems&lt;br /&gt;
making it impossible to use the resulting libraries (and VLC build) on any macOS version lower than 10.12!&lt;br /&gt;
You can set the SDK Version (if it&#039;s installed) using &amp;lt;code&amp;gt;export OSX_VERSION=10.11&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK].&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56404</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56404"/>
		<updated>2018-05-30T21:09:27Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Pre-requisites */ Remove developers tools test, as this is not needed if Xcode is installed.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current developement version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package is not supported officially)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this build (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
Note: In order to build the libraries you need to use an OS X SDK Version lower than 10.12, the 10.12 SDK causes problems&lt;br /&gt;
making it impossible to use the resulting libraries (and VLC build) on any macOS version lower than 10.12!&lt;br /&gt;
You can set the SDK Version (if it&#039;s installed) using &amp;lt;code&amp;gt;export OSX_VERSION=10.11&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK].&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56403</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56403"/>
		<updated>2018-05-30T20:58:31Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Apple Software */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current developement version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Installing the developer tools package is not needed, and building with that package only is not supported)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Developer tools test ====&lt;br /&gt;
&lt;br /&gt;
Make sure developer tools are installed by running&lt;br /&gt;
&lt;br /&gt;
 xcode-select --install&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if it pops up a window, click &#039;&#039;“Install”&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this build (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
Note: In order to build the libraries you need to use an OS X SDK Version lower than 10.12, the 10.12 SDK causes problems&lt;br /&gt;
making it impossible to use the resulting libraries (and VLC build) on any macOS version lower than 10.12!&lt;br /&gt;
You can set the SDK Version (if it&#039;s installed) using &amp;lt;code&amp;gt;export OSX_VERSION=10.11&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK].&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56402</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56402"/>
		<updated>2018-05-30T20:56:37Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: Update minimum build system specs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
Those are the minimum build system requirements to compile VLC 4.0 (current developement version). They are also highly recommended to compile VLC 3.0:&lt;br /&gt;
* At least &#039;&#039;&#039;macOS 10.13.4&#039;&#039;&#039;, or any later version&lt;br /&gt;
* At least &#039;&#039;&#039;Xcode 9.3&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]. (Note: Only building with developer tools package is not supported)&lt;br /&gt;
* Use at least &#039;&#039;&#039;macOS SDK 10.13&#039;&#039;&#039; (this is included and the default in Xcode 9.3)&lt;br /&gt;
&lt;br /&gt;
==== Developer tools test ====&lt;br /&gt;
&lt;br /&gt;
Make sure developer tools are installed by running&lt;br /&gt;
&lt;br /&gt;
 xcode-select --install&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if it pops up a window, click &#039;&#039;“Install”&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Compiler test  ====&lt;br /&gt;
&lt;br /&gt;
Ensure the compiler is found correctly by running&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
in the Terminal, if this outputs anything else than &amp;lt;code&amp;gt;clang: error: no input files&amp;lt;/code&amp;gt;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this build (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need a number of tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
VLC has a way to build the specific versions of these tools required from source, here is how:&lt;br /&gt;
 &lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: Add the extras/tools build results to your PATH, before doing anything else:&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party. VLC has the so-called “contribs” system to help building these libraries&lt;br /&gt;
from source. Alternatively you can use a pre-built package of these libraries provided by VideoLAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
FIXME: Add guide how to use pre-built nightly contribs:&lt;br /&gt;
&lt;br /&gt;
=== Using pre-built nightly contribs ===&lt;br /&gt;
Together with the nightly builds, the build bot does each night a new build of all of the 3rd party libraries required for VLC.&lt;br /&gt;
(Not all contribs are included in this pre-built package, as not all contribs are enabled on all OSes and required.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
Note: In order to build the libraries you need to use an OS X SDK Version lower than 10.12, the 10.12 SDK causes problems&lt;br /&gt;
making it impossible to use the resulting libraries (and VLC build) on any macOS version lower than 10.12!&lt;br /&gt;
You can set the SDK Version (if it&#039;s installed) using &amp;lt;code&amp;gt;export OSX_VERSION=10.11&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK].&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managers from your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56372</id>
		<title>MacOSCompile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MacOSCompile&amp;diff=56372"/>
		<updated>2018-03-10T13:05:16Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Apple Software */ Remove note about command line tools. They are not needed, Xcode itself is sufficient for compilation.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an &#039;&#039;&#039;howto&#039;&#039;&#039; to compile {{VLC}} on &#039;&#039;&#039;macOS&#039;&#039;&#039; &#039;&#039;(also known as Mac OS X)&#039;&#039;, focused on &#039;&#039;&#039;VLC 3.0&#039;&#039;&#039; and later. &lt;br /&gt;
&lt;br /&gt;
= Pre-requisites  =&lt;br /&gt;
&lt;br /&gt;
=== Apple Software ===&lt;br /&gt;
&lt;br /&gt;
*You need at least  macOS &#039;&#039;&#039;10.10&#039;&#039;&#039;. Any later version is strongly recommended, though. &lt;br /&gt;
*&#039;&#039;&#039;Developer Tools from Apple&#039;&#039;&#039; from [https://developer.apple.com/xcode/ developer.apple.com/xcode]&amp;lt;br&amp;gt; You need at least &#039;&#039;Xcode 7.2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Compiler test  ===&lt;br /&gt;
&lt;br /&gt;
You need to check that all is working well.&lt;br /&gt;
&lt;br /&gt;
 xcrun clang&lt;br /&gt;
&lt;br /&gt;
If this outputs anything else than &#039;clang: error: no input files&#039;, see the troubleshooting part of this document.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= [[GetTheSource|Get the source code]]  =&lt;br /&gt;
&lt;br /&gt;
  git clone git://git.videolan.org/vlc.git&lt;br /&gt;
&lt;br /&gt;
= Build VLC with a single command  =&lt;br /&gt;
&lt;br /&gt;
Setup a build folder:&lt;br /&gt;
 cd vlc &amp;amp;&amp;amp; mkdir build &amp;amp;&amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
And run the build:&lt;br /&gt;
 ../extras/package/macosx/build.sh&lt;br /&gt;
&lt;br /&gt;
Wait and you have finished.&lt;br /&gt;
&lt;br /&gt;
You can see more options for this build (change arch or sdk):&lt;br /&gt;
 ../extras/package/macosx/build.sh -h&lt;br /&gt;
&lt;br /&gt;
In case this fails, please try the step-by-step build guide below using a&lt;br /&gt;
clean checkout.&lt;br /&gt;
&lt;br /&gt;
= Build steps =&lt;br /&gt;
Now, if you prefer, you can read the following detailed information on how the build internally works:&lt;br /&gt;
&lt;br /&gt;
== Additional development tools  ==&lt;br /&gt;
&lt;br /&gt;
You need development tools, notably all the autotools, to build VLC correctly.&lt;br /&gt;
 &lt;br /&gt;
Here is how:&lt;br /&gt;
 cd extras/tools&lt;br /&gt;
 ./bootstrap &amp;amp;&amp;amp; make&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: set the new PATH, before doing anything else.&lt;br /&gt;
 export PATH=$PWD/extras/tools/build/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To compile VLC, you need lots of other libraries, called 3rd party.&lt;br /&gt;
&lt;br /&gt;
First, set the correct &#039;&#039;&#039;SDK&#039;&#039;&#039; version for the 3rd party libraries, usually your current OS X Version:&lt;br /&gt;
&lt;br /&gt;
 export OSX_VERSION=10.11&lt;br /&gt;
&lt;br /&gt;
Then, prepare the 3rd party library folder:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p contrib/contrib-osx &amp;amp;amp;&amp;amp;amp; cd contrib/contrib-osx&lt;br /&gt;
 ../bootstrap --build=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt libraries (recommended) ===&lt;br /&gt;
&lt;br /&gt;
If you want to download a prebuilt package of all the needed libraries. &lt;br /&gt;
&lt;br /&gt;
 make prebuilt&lt;br /&gt;
&lt;br /&gt;
Now you can just skip to the [[OSXCompile#Update_PATH|Update PATH]] section.&lt;br /&gt;
&lt;br /&gt;
=== Build your own libraries (not for the faint-hearted) ===&lt;br /&gt;
Note: In order to build the libraries you need to use an OS X SDK Version lower than 10.12, the 10.12 SDK causes problems&lt;br /&gt;
making it impossible to use the resulting libraries (and VLC build) on any macOS version lower than 10.12!&lt;br /&gt;
You can set the SDK Version (if it&#039;s installed) using &amp;lt;code&amp;gt;export OSX_VERSION=10.11&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You need to install the [http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html Java JDK].&lt;br /&gt;
&lt;br /&gt;
If you want to build contribs from source, you first need to make gettext, which is needed for some other contrib libraries to build: &lt;br /&gt;
&lt;br /&gt;
 make -j4 .gettext&lt;br /&gt;
&lt;br /&gt;
Now you need to update your path for the gettext tools to be usable later on, see the [[#Update_PATH|Update PATH]] section above.&lt;br /&gt;
&lt;br /&gt;
Then fetch contrib sources: &lt;br /&gt;
&lt;br /&gt;
 make fetch&lt;br /&gt;
&lt;br /&gt;
and build them with:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
If you had no errors, the 3rd party libraries (contrib) are built correctly and you can proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Update PATH  ===&lt;br /&gt;
&lt;br /&gt;
First we go back to the source directory:&lt;br /&gt;
&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
And now we still need to add the contribs to our path, so they can be found:&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PWD/contrib/x86_64-apple-darwin15/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Bootstrap VLC  ==&lt;br /&gt;
&lt;br /&gt;
This will create the configure script: &lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
Check that there are no obvious errors at this stage, like missing gettext or an error at exit.&lt;br /&gt;
&lt;br /&gt;
== Configure the VLC build  ==&lt;br /&gt;
&lt;br /&gt;
Create a build folder: &lt;br /&gt;
&lt;br /&gt;
 mkdir -p build &amp;amp;amp;&amp;amp;amp; cd build&lt;br /&gt;
&lt;br /&gt;
To list the different options of configure: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --help&lt;br /&gt;
&lt;br /&gt;
To build a binary with the previously installed x86_64-apple-darwin15 contrib: &lt;br /&gt;
&lt;br /&gt;
 ../extras/package/macosx/configure.sh --enable-debug --host=x86_64-apple-darwin15&lt;br /&gt;
&lt;br /&gt;
By default it will not use the installed SDK, like Xcode does, but use System Root. This means that if you built contribs on your own, the configure script might behave unexpectedly, for example enabling functions which are not present in a given operating system version. To work around this and build against the latest installed SDK, you can use:&lt;br /&gt;
&lt;br /&gt;
 --with-macosx-sdk=`xcrun --show-sdk-path`&lt;br /&gt;
&lt;br /&gt;
If you want to use a different SDK, you can list all installed SDKs with &amp;lt;code&amp;gt;xcodebuild -showsdks&amp;lt;/code&amp;gt; and to get the path for it, you can use the following command &amp;lt;code&amp;gt;xcodebuild -version &amp;lt;SDK Flag from before&amp;gt; Path&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;xcodebuild -version -sdk macosx10.11 Path&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build VLC  ==&lt;br /&gt;
&lt;br /&gt;
Just do:&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
and wait...&lt;br /&gt;
&lt;br /&gt;
== Run VLC  ==&lt;br /&gt;
After &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;, you can just run VLC like so:&lt;br /&gt;
&lt;br /&gt;
 ./bin/vlc-osx-static&lt;br /&gt;
&lt;br /&gt;
If you want a VLC app bundle, just do&lt;br /&gt;
 &lt;br /&gt;
 make VLC.app&lt;br /&gt;
&lt;br /&gt;
And use it like a normal .app bundle.&lt;br /&gt;
&lt;br /&gt;
== Package VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want a disk-image: &lt;br /&gt;
&lt;br /&gt;
 make package-macosx&lt;br /&gt;
&lt;br /&gt;
Note: If you want a more fancy disk image, you need the [https://bitbucket.org/al45tair/dmgbuild dmgbuild] tool, which can be installed using &amp;lt;code&amp;gt;pip install dmgbuild&amp;lt;/code&amp;gt; if you have&lt;br /&gt;
python installed using [https://brew.sh Homebrew].&lt;br /&gt;
&lt;br /&gt;
== Sign VLC Application for Mac  ==&lt;br /&gt;
&lt;br /&gt;
If you want to sign your application with a certificate, for example for Gatekeeper, you need to run:&lt;br /&gt;
&lt;br /&gt;
 extras/package/macosx/codesign.sh -i &amp;quot;certificate name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting  =&lt;br /&gt;
&lt;br /&gt;
== 3rd party packagers and PATH  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pay careful attention to remove any reference to 3rd party package managersfrom your environment.&#039;&#039;&#039; This is important to avoid conflicts between your package manager (homebrew, fink, macports...) and the contrib package manager we use to build our contrib. &lt;br /&gt;
&lt;br /&gt;
It shouldn&#039;t be necessary, but it can happen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;git must still be accessible though!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 unset PKG_CONFIG_PATH&lt;br /&gt;
 unset PKG_CONFIG_LIBDIR&lt;br /&gt;
 export PATH=$PWD/build/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin&lt;br /&gt;
&lt;br /&gt;
== Xcode &#039;No developer directory&#039; error ==&lt;br /&gt;
When running &amp;lt;code&amp;gt;xcrun clang&amp;lt;/code&amp;gt;, if you see&lt;br /&gt;
&lt;br /&gt;
 Error: No developer directory...&lt;br /&gt;
&lt;br /&gt;
then use xcode-select to select the developer directory within the Xcode package, to point to your xcode developer directory.&lt;br /&gt;
&lt;br /&gt;
something like:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer  &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]] [[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VSG:ResetPrefs&amp;diff=30253</id>
		<title>VSG:ResetPrefs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VSG:ResetPrefs&amp;diff=30253"/>
		<updated>2015-09-08T18:24:30Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: /* Manual deletion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Many problems with VLC are due to incorrect settings or a broken plugin cache. You can solve these by deleting VLC&#039;s preferences and cache.&lt;br /&gt;
&lt;br /&gt;
= Reset preferences from VLC =&lt;br /&gt;
&lt;br /&gt;
=== Using VLC within preferences ===&lt;br /&gt;
If you can launch VLC, in the preferences dialog, from the Tools menu, you can hit the &amp;quot;Reset preferences&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB:&#039;&#039;&#039; This might not solve all your issues, all the time; so if you still have issues, then see the rest of this article.&lt;br /&gt;
&lt;br /&gt;
= Reset preferences and cache =&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
=== Using the shortcut in the start menu ===&lt;br /&gt;
If you installed VLC properly you can delete the preferences and cache by simply opening the shortcut you can find in your start menu:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;All programs &amp;gt; VideoLAN &amp;gt; Reset VLC media player preferences and cache files&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Deleting the files manually ===&lt;br /&gt;
Open the explorer and type &#039;&#039;%APPDATA%&#039;&#039; into the address bar and hit enter. This should lead you to the AppData folder of your user.&lt;br /&gt;
&lt;br /&gt;
Therein you should find a folder named &#039;&#039;vlc&#039;&#039;. Delete that folder and you&#039;re done.&lt;br /&gt;
[[File:Windows_Deleting_Prefs_Folder.png|center]]&lt;br /&gt;
&lt;br /&gt;
== Mac OS X ==&lt;br /&gt;
&lt;br /&gt;
=== Using VLC ===&lt;br /&gt;
In case VLC still launches, open it. Select &amp;quot;VLC&amp;quot; menu -&amp;gt; &amp;quot;Preferences&amp;quot; and hit &amp;quot;Reset All&amp;quot; in the bottom left corner. VLC will ask for confirmation, reset and restart itself.&lt;br /&gt;
&lt;br /&gt;
=== Manual deletion ===&lt;br /&gt;
&lt;br /&gt;
1) Quit the VLC application.&lt;br /&gt;
&lt;br /&gt;
2) Use a Terminal and enter the following command: &#039;&#039;defaults delete org.videolan.vlc&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3) Remove everything from ~/Library/Preferences called &amp;quot;org.videolan.vlc.*&amp;quot;. Use &amp;quot;Go To Folder&amp;quot; within the Finder&#039;s &amp;quot;Go&amp;quot; menu to show this folder.&lt;br /&gt;
&lt;br /&gt;
== GNU/Linux ==&lt;br /&gt;
Delete the &amp;lt;code&amp;gt;~/.config/vlc&amp;lt;/code&amp;gt; and  &amp;lt;code&amp;gt;~/.cache/vlc&amp;lt;/code&amp;gt; folders or execute &#039;&#039;&#039;vlc --reset-config&#039;&#039;&#039; in a terminal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Old versions of VLC had the data stored in &amp;lt;code&amp;gt;~/.vlc&amp;lt;/code&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== BeOS ==&lt;br /&gt;
Delete the &amp;lt;code&amp;gt;config/settings/vlcrc&amp;lt;/code&amp;gt; folders.&lt;br /&gt;
&lt;br /&gt;
== iOS ==&lt;br /&gt;
Delete the app from SpringBoard and re-download it from the App Store to fully reset the media library and settings.&lt;br /&gt;
&lt;br /&gt;
== Android ==&lt;br /&gt;
=== From the settings ===&lt;br /&gt;
In &#039;&#039;Settings&#039;&#039;, go to &#039;&#039;Applications&#039;&#039; → &#039;&#039;VLC&#039;&#039; → &#039;&#039;&#039;Clear data&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Within the application ===&lt;br /&gt;
Go to &#039;&#039;Preferences&#039;&#039; → &#039;&#039;Other&#039;&#039; to clean the history and the media database.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[VLC HowTo]]&lt;br /&gt;
* [[VSG:Main|VLC Support Guide]]&lt;br /&gt;
&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
{{VSG}}&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VSG:ResetPrefs&amp;diff=30252</id>
		<title>VSG:ResetPrefs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VSG:ResetPrefs&amp;diff=30252"/>
		<updated>2015-09-08T18:23:45Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Many problems with VLC are due to incorrect settings or a broken plugin cache. You can solve these by deleting VLC&#039;s preferences and cache.&lt;br /&gt;
&lt;br /&gt;
= Reset preferences from VLC =&lt;br /&gt;
&lt;br /&gt;
=== Using VLC within preferences ===&lt;br /&gt;
If you can launch VLC, in the preferences dialog, from the Tools menu, you can hit the &amp;quot;Reset preferences&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB:&#039;&#039;&#039; This might not solve all your issues, all the time; so if you still have issues, then see the rest of this article.&lt;br /&gt;
&lt;br /&gt;
= Reset preferences and cache =&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
=== Using the shortcut in the start menu ===&lt;br /&gt;
If you installed VLC properly you can delete the preferences and cache by simply opening the shortcut you can find in your start menu:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;All programs &amp;gt; VideoLAN &amp;gt; Reset VLC media player preferences and cache files&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Deleting the files manually ===&lt;br /&gt;
Open the explorer and type &#039;&#039;%APPDATA%&#039;&#039; into the address bar and hit enter. This should lead you to the AppData folder of your user.&lt;br /&gt;
&lt;br /&gt;
Therein you should find a folder named &#039;&#039;vlc&#039;&#039;. Delete that folder and you&#039;re done.&lt;br /&gt;
[[File:Windows_Deleting_Prefs_Folder.png|center]]&lt;br /&gt;
&lt;br /&gt;
== Mac OS X ==&lt;br /&gt;
&lt;br /&gt;
=== Using VLC ===&lt;br /&gt;
In case VLC still launches, open it. Select &amp;quot;VLC&amp;quot; menu -&amp;gt; &amp;quot;Preferences&amp;quot; and hit &amp;quot;Reset All&amp;quot; in the bottom left corner. VLC will ask for confirmation, reset and restart itself.&lt;br /&gt;
&lt;br /&gt;
=== Manual deletion ===&lt;br /&gt;
&lt;br /&gt;
First, use a Terminal and enter the following command: &#039;&#039;defaults delete org.videolan.vlc&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Then, remove everything from ~/Library/Preferences called &amp;quot;org.videolan.vlc.*&amp;quot;. Use &amp;quot;Go To Folder&amp;quot; within the Finder&#039;s &amp;quot;Go&amp;quot; menu to show this folder.&lt;br /&gt;
&lt;br /&gt;
== GNU/Linux ==&lt;br /&gt;
Delete the &amp;lt;code&amp;gt;~/.config/vlc&amp;lt;/code&amp;gt; and  &amp;lt;code&amp;gt;~/.cache/vlc&amp;lt;/code&amp;gt; folders or execute &#039;&#039;&#039;vlc --reset-config&#039;&#039;&#039; in a terminal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Old versions of VLC had the data stored in &amp;lt;code&amp;gt;~/.vlc&amp;lt;/code&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== BeOS ==&lt;br /&gt;
Delete the &amp;lt;code&amp;gt;config/settings/vlcrc&amp;lt;/code&amp;gt; folders.&lt;br /&gt;
&lt;br /&gt;
== iOS ==&lt;br /&gt;
Delete the app from SpringBoard and re-download it from the App Store to fully reset the media library and settings.&lt;br /&gt;
&lt;br /&gt;
== Android ==&lt;br /&gt;
=== From the settings ===&lt;br /&gt;
In &#039;&#039;Settings&#039;&#039;, go to &#039;&#039;Applications&#039;&#039; → &#039;&#039;VLC&#039;&#039; → &#039;&#039;&#039;Clear data&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Within the application ===&lt;br /&gt;
Go to &#039;&#039;Preferences&#039;&#039; → &#039;&#039;Other&#039;&#039; to clean the history and the media database.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[VLC HowTo]]&lt;br /&gt;
* [[VSG:Main|VLC Support Guide]]&lt;br /&gt;
&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
{{VSG}}&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VDD15/Attendees&amp;diff=30222</id>
		<title>VDD15/Attendees</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VDD15/Attendees&amp;diff=30222"/>
		<updated>2015-09-04T15:37:07Z</updated>

		<summary type="html">&lt;p&gt;Dfuhrmann: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Arrivals =&lt;br /&gt;
Please order chronologically by time of arrival.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! IRC&lt;br /&gt;
! Time&lt;br /&gt;
! Port&lt;br /&gt;
! Vessel&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Tim Miller&lt;br /&gt;
| drasticactions&lt;br /&gt;
| 2015-09-17 08:35&lt;br /&gt;
| CDG airport&lt;br /&gt;
| DL 243 (AF 3655)&lt;br /&gt;
| from BOS&lt;br /&gt;
|-&lt;br /&gt;
| Rostislav Pehlivanov&lt;br /&gt;
| atomnuker&lt;br /&gt;
| 2015-09-17 10:17&lt;br /&gt;
| Gare du Nord&lt;br /&gt;
| TGV TMST&lt;br /&gt;
| from London&lt;br /&gt;
|-&lt;br /&gt;
| David Fuhrmann&lt;br /&gt;
| d-fu&lt;br /&gt;
| 2015-09-17 20:54&lt;br /&gt;
| Gare de Est&lt;br /&gt;
| TGV 9552&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Francois Cartegnie&lt;br /&gt;
| &lt;br /&gt;
| 2015-09-17 21:16&lt;br /&gt;
| Gare de Lyon&lt;br /&gt;
| TGV 6198&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Konstantin Pavlov&lt;br /&gt;
| thresh&lt;br /&gt;
| 2015-09-17 22:30&lt;br /&gt;
| CDG airport T2C&lt;br /&gt;
| SU 2460&lt;br /&gt;
| from Moscow/SVO&lt;br /&gt;
|-&lt;br /&gt;
| Ronald S. Bultje&lt;br /&gt;
| BBB&lt;br /&gt;
| 2015-09-18 9:20&lt;br /&gt;
| CDG airport&lt;br /&gt;
| DL 400 (AF 3577)&lt;br /&gt;
| from NY/JFK&lt;br /&gt;
|-&lt;br /&gt;
| Thierry Foucu&lt;br /&gt;
| lotharkript&lt;br /&gt;
| 2015-09-18 10:45&lt;br /&gt;
| CDG airport&lt;br /&gt;
| UA 990&lt;br /&gt;
| from SFO&lt;br /&gt;
|-&lt;br /&gt;
| Federico Hlawaczek&lt;br /&gt;
| &lt;br /&gt;
| 2015-09-18 10:45&lt;br /&gt;
| CDG airport&lt;br /&gt;
| UA 990&lt;br /&gt;
| from SFO&lt;br /&gt;
|-&lt;br /&gt;
| Rémi Denis-Courmont&lt;br /&gt;
| courmisch&lt;br /&gt;
| 2015-09-18 21:35&lt;br /&gt;
| CDG airport T2D&lt;br /&gt;
| AY 877&lt;br /&gt;
| from Helsinki&lt;br /&gt;
|-&lt;br /&gt;
| Janne Grunau&lt;br /&gt;
| jannau&lt;br /&gt;
| 2015-09-18 22:35&lt;br /&gt;
| Gare de l&#039;Est&lt;br /&gt;
| TGV 9570&lt;br /&gt;
| from Karlsruhe&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Departures =&lt;br /&gt;
Please order chronologically by time of departure.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! IRC&lt;br /&gt;
! Time&lt;br /&gt;
! Port&lt;br /&gt;
! Vessel&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Mc Fly Marty&lt;br /&gt;
| mcfly&lt;br /&gt;
| 1985-10-26 01:22&lt;br /&gt;
| Hill Valley, California&lt;br /&gt;
| DeLorean OUTATIME&lt;br /&gt;
| to Hill Valley&lt;br /&gt;
|-&lt;br /&gt;
| Tim Miller&lt;br /&gt;
| drasticactions&lt;br /&gt;
| 2015-09-20 16:45&lt;br /&gt;
| CDG airport&lt;br /&gt;
| AF 338&lt;br /&gt;
| to BOS&lt;br /&gt;
|-&lt;br /&gt;
| Janne Grunau&lt;br /&gt;
| jannau&lt;br /&gt;
| 2015-09-20 17:25&lt;br /&gt;
| Gare de l&#039;Est&lt;br /&gt;
| TGV 9577&lt;br /&gt;
| to Karlsruhe&lt;br /&gt;
|-&lt;br /&gt;
| David Fuhrmann&lt;br /&gt;
| d-fu&lt;br /&gt;
| 2015-09-20 17:25&lt;br /&gt;
| Match found&lt;br /&gt;
| -- same train --&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Francois Cartegnie&lt;br /&gt;
| &lt;br /&gt;
| 2015-09-20 17:49&lt;br /&gt;
| Gare de Lyon&lt;br /&gt;
| TGV 6949&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Rémi Denis-Courmont&lt;br /&gt;
| courmisch&lt;br /&gt;
| 2015-09-20 19:00&lt;br /&gt;
| CDG airport T2D&lt;br /&gt;
| AY 874&lt;br /&gt;
| to Helsinki&lt;br /&gt;
|-&lt;br /&gt;
| Rostislav Pehlivanov&lt;br /&gt;
| atomnuker&lt;br /&gt;
| 2015-09-21 10:13&lt;br /&gt;
| Gare du Nord&lt;br /&gt;
| TGV TMST&lt;br /&gt;
| to London&lt;br /&gt;
|-&lt;br /&gt;
| Konstantin Pavlov&lt;br /&gt;
| thresh&lt;br /&gt;
| 2015-09-21 10:40&lt;br /&gt;
| CDG airport T2E&lt;br /&gt;
| AF 84&lt;br /&gt;
| to SFO&lt;br /&gt;
|-&lt;br /&gt;
| Ronald S. Bultje&lt;br /&gt;
| BBB&lt;br /&gt;
| 2015-09-21 14:00&lt;br /&gt;
| CDG airport&lt;br /&gt;
| AF 6&lt;br /&gt;
| to NY/JFK&lt;br /&gt;
|-&lt;br /&gt;
| Thierry Foucu&lt;br /&gt;
| lotharkript&lt;br /&gt;
| 2015-09-22 10:05&lt;br /&gt;
| CDG airport&lt;br /&gt;
| UA 991&lt;br /&gt;
| to SFO&lt;br /&gt;
|-&lt;br /&gt;
| Federico Hlawaczek&lt;br /&gt;
| &lt;br /&gt;
| 2015-09-21 10:05&lt;br /&gt;
| CDG airport&lt;br /&gt;
| UA 991&lt;br /&gt;
| to SFO&lt;br /&gt;
|-&lt;br /&gt;
| Ben littler&lt;br /&gt;
| compn&lt;br /&gt;
| 2015-09-21 13:30&lt;br /&gt;
| CDG airport&lt;br /&gt;
| AF 378&lt;br /&gt;
| to DTW&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Locals =&lt;br /&gt;
People who do not need to travel:&lt;/div&gt;</summary>
		<author><name>Dfuhrmann</name></author>
	</entry>
</feed>