OSDN Git Service

BuildSystem:
authorkonablend <konablend@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 3 Mar 2009 02:49:54 +0000 (02:49 +0000)
committerkonablend <konablend@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 3 Mar 2009 02:49:54 +0000 (02:49 +0000)
- fixed OSX + Xcode to support parallel builds
- enhanced OSX + Xcode to use proper pass-thru for all make targets
- added global target --> install
- added install: test.install
- added install: gtk.install
- updated pre-generated building guides (these will go away when wiki is updated)
- updated xml2wiki script to spit out heading

git-svn-id: svn://localhost/HandBrake/trunk@2205 b64f7644-9d1e-0410-96f1-a4d463321fa5

24 files changed:
00-Building.cygwin.txt [moved from 00.Building.cygwin.txt with 89% similarity]
00-Building.linux.txt [moved from 00.Building.linux.txt with 77% similarity]
00-Building.osx.txt [moved from 00.Building.osx.txt with 82% similarity]
AUTHORS
doc/module.defs
doc/module.rules
doc/texi/Building.osx.texi
doc/texi/building/chapter.via.terminal.texi
doc/texi/building/chapter.via.xcode.texi
doc/xml2wiki.py
gtk/module.rules
libhb/module.rules
macosx/HandBrake.xcodeproj/project.pbxproj
macosx/module.defs
macosx/module.rules
macosx/module.xcode [new file with mode: 0644]
make/configure.py
make/include/base.defs
make/include/base.rules [new file with mode: 0644]
make/include/main.defs
make/include/main.rules
make/xcodemake.sh [new file with mode: 0644]
test/module.defs
test/module.rules

similarity index 89%
rename from 00.Building.cygwin.txt
rename to 00-Building.cygwin.txt
index b11b43c..b0c5717 100644 (file)
@@ -1,4 +1,4 @@
-Guide to Building HandBrake svn2194 (2009030201) on Cygwin
+Guide to Building HandBrake svn2204 (2009030201) on Cygwin
 **********************************************************
 
 Table of Contents
@@ -17,6 +17,7 @@ Table of Contents
     5.4.2 General Modules
     5.4.3 Contrib Modules
     5.4.4 Contrib Aggregates
+  5.5 Customizing Make
 
 
 1 Introduction
@@ -239,6 +240,11 @@ period.
      Build main product. All necessary dependencies are also built if
      required.
 
+`make install'
+     Perform final product(s) install.  This will install build
+     products to a standard directory or one specified via `configure
+     --prefix' option.
+
 `make clean'
      Clean all build output excluding contrib modules. Configuration is
      retained.
@@ -327,3 +333,23 @@ modules' respective targets together:
 
    * make contrib.xclean
 
+5.5 Customizing Make
+====================
+
+If the need arises to override settings in the build system
+(essentially gnu-make variables) the recommended method is to
+create/edit the optional include file `build/GNUmakefile.custom' which
+sits adjacent to the top-level makefile. Do not check this file into
+the respository. The sole purpose is to allow a place to store local
+build settings for testing, tweaking, and experimenting with build
+configuration without losing your settings if `configure' is invoked;
+ie: `configure' would overwrite `GNUmakefile' and any customizations
+contained therein would be lost. Here is a short example of what the
+contents of `build/GNUmakefile.custom' might contain:
+
+     ## bump to gcc-4.2 in current path
+     GCC.gcc = gcc-4.2
+
+     ## replace optimize for 'speed' with more agressive settings
+     GCC.args.O.speed = -O3 -fomit-frame-pointer -msse4.2
+
similarity index 77%
rename from 00.Building.linux.txt
rename to 00-Building.linux.txt
index 255acd4..a2e2d0b 100644 (file)
@@ -1,4 +1,4 @@
-Guide to Building HandBrake svn2194 (2009030201) on Linux
+Guide to Building HandBrake svn2204 (2009030201) on Linux
 *********************************************************
 
 Table of Contents
@@ -17,6 +17,7 @@ Table of Contents
     5.4.2 General Modules
     5.4.3 Contrib Modules
     5.4.4 Contrib Aggregates
+  5.5 Customizing Make
 
 
 1 Introduction
@@ -34,9 +35,11 @@ Linux; but is not necessarily the only configuration that is possible:
 
    * Intel 32-bit or 64-bit kernel
 
-   * Fedora 8, gcc 4.1.2, yasm 0.6.2.1985
+   * Ubuntu 8.0.4, gcc 4.3.0, yasm 0.7.1.2093
 
-   * Fedora 9, gcc 4.3.0, yasm 0.6.2.1985
+   * Ubuntu 8.10, gcc 4.3.2, yasm 0.7.1.2093
+
+   * Fedora 9, gcc 4.3.0, yasm 0.7.1.2093
 
    * Fedora 10, gcc 4.3.2, yasm 0.7.1.2093
 
@@ -49,56 +52,96 @@ Linux; but is not necessarily the only configuration that is possible:
      unbundled compilers, but be aware it is generally unsupported and
      left as an exercise to the reader.
 
+The following general tools are used on various platforms and it is
+recommended you use these versions or similar:
+
+   * subversion - 1.5.5
+
+   * python - Python 2.4.6
+
+   * curl - curl 7.19.3 (or wget)
+
+   * m4 - GNU M4 1.4.6
+
+   * make - GNU Make 3.81
+
+   * patch - Patch 2.5.8
+
+   * tar - GNU tar 1.15.1
+
+   * wget - GNU Wget 1.11.4 (or curl)
+
 The GTK UI introduces some significant extra build requirements. If you
 intend to disable building the GUI with `configure --disable-gtk' you
-may not need any of these packages installed:
+will not need many of these packages installed:
 
+Ubuntu 8.10 packages:
    * build-essential
 
-   * autoconf
+   * autoconf (gui)
 
-   * intltool
+   * intltool (gui)
 
-   * libtool
+   * libtool (gui)
 
-   * zlib1g-dev
+   * zlib1g-dev (gui)
 
    * libbz2-dev
 
-   * libglib2.0-dev
+   * libglib2.0-dev (gui)
 
-   * libdbus-glib-1-dev
+   * libdbus-glib-1-dev (gui)
 
-   * libgtk2.0-dev
+   * libgtk2.0-dev (gui)
 
-   * libhal-dev
+   * libhal-dev (gui)
 
-   * libhal-storage-dev
+   * libhal-storage-dev (gui)
 
-   * libgtkhtml3.14-dev
+   * libgtkhtml3.14-dev (gui)
 
-   * libgstreamer0.10-dev
+   * libgstreamer0.10-dev (gui)
 
-   * libgstreamer-plugins-base0.10-dev
+   * libgstreamer-plugins-base0.10-dev (gui)
 
-The following general tools are used on various platforms and it is
-recommended you use these versions or similar:
+To install these packages:
+     sudo apt-get install subversion yasm build-essential \
+     autoconf intltool libtool zlib1g-dev libbz2-dev libglib2.0-dev \
+     libdbus-glib-1-dev libgtk2.0-dev libhal-dev libhal-storage-dev \
+     libgtkhtml3.14-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
 
-   * subversion - 1.5.5
+Fedora 10 package groups:
+   * Development Tools
 
-   * python - Python 2.4.6
+   * Development Libraries
 
-   * curl - curl 7.19.3 (or wget)
+   * X Software Development (gui)
 
-   * m4 - GNU M4 1.4.6
+   * GNOME Software Development (gui)
 
-   * make - GNU Make 3.81
+To install these package groups:
+     sudo yum groupinstall "Development Tools" "Development Libraries" \
+     "X Software Development" "GNOME Software Development"
 
-   * patch - Patch 2.5.8
+Additional Fedora 10 packages:
+   * zlib-devel (gui)
 
-   * tar - GNU tar 1.15.1
+   * bzip2-devel
 
-   * wget - GNU Wget 1.11.4 (or curl)
+   * dbus-glib-devel (gui)
+
+   * hal-devel (gui)
+
+   * gtkhtml3-devel (gui)
+
+   * gstreamer-devel (gui)
+
+   * gstreamer-plugins-base-devel (gui)
+
+To install these packages:
+     sudo yum install yasm zlib-devel bzip2-devel \
+     dbus-glib-devel hal-devel gtkhtml3-devel \
+     gstreamer-devel gstreamer-plugins-base-devel
 
 3 QuickStart
 ************
@@ -263,6 +306,11 @@ period.
      Build main product. All necessary dependencies are also built if
      required.
 
+`make install'
+     Perform final product(s) install.  This will install build
+     products to a standard directory or one specified via `configure
+     --prefix' option.
+
 `make clean'
      Clean all build output excluding contrib modules. Configuration is
      retained.
@@ -351,3 +399,23 @@ modules' respective targets together:
 
    * make contrib.xclean
 
+5.5 Customizing Make
+====================
+
+If the need arises to override settings in the build system
+(essentially gnu-make variables) the recommended method is to
+create/edit the optional include file `build/GNUmakefile.custom' which
+sits adjacent to the top-level makefile. Do not check this file into
+the respository. The sole purpose is to allow a place to store local
+build settings for testing, tweaking, and experimenting with build
+configuration without losing your settings if `configure' is invoked;
+ie: `configure' would overwrite `GNUmakefile' and any customizations
+contained therein would be lost. Here is a short example of what the
+contents of `build/GNUmakefile.custom' might contain:
+
+     ## bump to gcc-4.2 in current path
+     GCC.gcc = gcc-4.2
+
+     ## replace optimize for 'speed' with more agressive settings
+     GCC.args.O.speed = -O3 -fomit-frame-pointer -msse4.2
+
similarity index 82%
rename from 00.Building.osx.txt
rename to 00-Building.osx.txt
index 5f6ef10..dc7c0a5 100644 (file)
@@ -1,12 +1,6 @@
-Guide to Building HandBrake svn2194 (2009030201) on Mac OS X
+Guide to Building HandBrake svn2204 (2009030201) on Mac OS X
 ************************************************************
 
-     Warning: Parallel builds on Mac OS X are currently broken when
-     building in a terminal with Xcode. You must not use the `make -jN'
-     jobs option. A workaround is available if you do not need to build
-     HandBrake.app (MacGUI): use `configure --disable-xcode' to disable
-     Xcode.
-
 Table of Contents
 *****************
 
@@ -23,9 +17,11 @@ Table of Contents
     5.4.2 General Modules
     5.4.3 Contrib Modules
     5.4.4 Contrib Aggregates
+  5.5 Customizing Make
 6 Building via Xcode
   6.1 Checkout Sources
   6.2 Build
+  6.3 User-Defined Settings
 
 
 1 Introduction
@@ -245,6 +241,11 @@ period.
      Build main product. All necessary dependencies are also built if
      required.
 
+`make install'
+     Perform final product(s) install.  This will install build
+     products to a standard directory or one specified via `configure
+     --prefix' option.
+
 `make clean'
      Clean all build output excluding contrib modules. Configuration is
      retained.
@@ -333,6 +334,26 @@ modules' respective targets together:
 
    * make contrib.xclean
 
+5.5 Customizing Make
+====================
+
+If the need arises to override settings in the build system
+(essentially gnu-make variables) the recommended method is to
+create/edit the optional include file `build/GNUmakefile.custom' which
+sits adjacent to the top-level makefile. Do not check this file into
+the respository. The sole purpose is to allow a place to store local
+build settings for testing, tweaking, and experimenting with build
+configuration without losing your settings if `configure' is invoked;
+ie: `configure' would overwrite `GNUmakefile' and any customizations
+contained therein would be lost. Here is a short example of what the
+contents of `build/GNUmakefile.custom' might contain:
+
+     ## bump to gcc-4.2 in current path
+     GCC.gcc = gcc-4.2
+
+     ## replace optimize for 'speed' with more agressive settings
+     GCC.args.O.speed = -O3 -fomit-frame-pointer -msse4.2
+
 6 Building via Xcode
 ********************
 
@@ -365,13 +386,15 @@ In Xcode perform the following steps to build the default configuration:
 
    * click Build or Build and Go
 
-The first time it builds will take a bit of time. You may use the Build
-Results window to watch it progress. A large partof the build is
-invoking the external build system which poduces quite a lot of log
-output. Much of that output are warnings and errors that are part of
-the normal build process for 3rd-party contributed modules so in
-general you need not do anything. However, if Xcode itself reports the
-build failed, then you must take corrective action.
+The first build (on an empty `build' directory) will take a bit of
+time. You may use the Build Results window to observe progress. The
+most time-consuming part of the build is when the external build system
+(essentially the terminal method) is triggered by Xcode and a
+substantial amount of log transcript ensues. Much of that transcript
+are warnings and errors that are part of the normal build process for
+3rd-party contributed modules so in general you need not do anything.
+However, if Xcode itself reports the build failed, then you must take
+corrective action.
 
 Unfortunately, due to limitations of Xcode we do not have hooks in
 place to offer finer-grained control over per-module make actions for
@@ -418,3 +441,28 @@ follows:
      This configuration is used to build for the ppc64 architecture.
      Build directory is `build.standard.ppc64' .
 
+6.3 User-Defined Settings
+=========================
+
+The following user defined settings are used in Xcode project for the
+external build system:
+
+`EXTERNAL_BUILD'
+     Specifies the build location for each configuration.  It is highly
+     recommended the locations always evaluate to a unique pathname
+     when factoring the configuration name.
+
+`EXTERNAL_JOBS'
+     Specifies the concurrency factor for the external build system
+     when builds are launched from within Xcode.  This variable is
+     meant to be customized by the developer for faster builds if the
+     host supports it.
+
+`EXTERNAL_METHOD'
+     This variable is used for internal/external build coordination and
+     must always be `xcode'.
+
+`EXTERNAL_PROJECT'
+     Specifies the directory which is top of HandBrake source tree.
+
+
diff --git a/AUTHORS b/AUTHORS
index bb3b24f..497b01a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -104,3 +104,6 @@ Chris Thoman <cthoman@gmail.com> (huevos_rancheros)
 Mark Krenek <markkrenek@mac.com> (travistex)
  + Mac OS X GUI enhancements
  + Mac OS X GUI Queueing system
+
+Kona 'mike' Blend <Kona8lend@gmail.com> (KonaBlend)
+ + Build System and related guides
index 468196c..e7e4260 100644 (file)
@@ -44,5 +44,5 @@ MAKEINFO.flags.xml  = --xml --output-indent=4
 MAKEINFO            = $(MAKEINFO.exe) $(MAKEINFO.flags) $(MAKEINFO.flags.$(1)) $(2) -o $(3)
 
 XML2WIKI.exe   = python3.0 $(DOC.in/)xml2wiki.py
-XML2WIKI.flags = --date --toc
+XML2WIKI.flags = --toc
 XML2WIKI       = $(XML2WIKI.exe) $(XML2WIKI.flags) $(1) > $(2)
index 22d97e6..d4cc7b7 100644 (file)
@@ -3,6 +3,7 @@ $(eval $(call import.MODULE.rules,DOC))
 doc: doc.txt
 
 doc.txt: $(DOC.texi2txt.out)
+doc.xml: $(DOC.texi2xml.out)
 doc.wiki: $(DOC.xml2wiki.out)
 
 doc.clean:
@@ -30,8 +31,3 @@ $(DOC.m4.out): | $(dir $(DOC.m4.out))
 $(DOC.m4.out): $(DOC.M4.deps)
 $(DOC.m4.out): $(DOC.out/)%: $(DOC.in/)%.m4
        $(call DOC.M4,$@,$<)
-
-mike:
-       @echo $(DOC.texi2xml.out)
-       @echo $(DOC.xml2wiki.out)
-       @echo ok
index 00501c4..a554f7a 100644 (file)
 
 @majorheading Guide to Building @value{HB.title} on @value{OS.@value{BG.platform}}
 
-@quotation Warning
-Parallel builds on @value{OS.osx} are currently broken when building in a @b{terminal} with Xcode. You @b{must not use} the @command{make -jN} jobs option. A workaround is available if you do not need to build HandBrake.app (MacGUI): use @command{configure --disable-xcode} to disable Xcode.
-@end quotation
-
 @contents
 @include building/chapter.introduction.texi
 
index 5f2135a..88cb3b4 100644 (file)
@@ -92,6 +92,10 @@ Alias for @samp{make build}.
 @item make build
 Build main product. All necessary dependencies are also built if required.
 
+@item make install
+Perform final product(s) install.
+This will install build products to a standard directory or one specified via @command{configure --prefix} option.
+
 @item make clean
 Clean all build output excluding contrib modules. Configuration is retained.
 
@@ -170,3 +174,16 @@ For convenience, the following targets aggregate the all contrib modules' respec
 @item make contrib.clean
 @item make contrib.xclean
 @end itemize
+
+@c %**-------------------------------------------------------------------------
+@anchor{terminal.customizing}
+@section Customizing Make
+If the need arises to override settings in the build system (essentially gnu-make variables) the recommended method is to create/edit the optional include file @file{build/GNUmakefile.custom} which sits adjacent to the top-level makefile. @b{Do not check this file into the respository}. The sole purpose is to allow a place to store local build settings for testing, tweaking, and experimenting with build configuration without losing your settings if @command{configure} is invoked; ie: @command{configure} would overwrite @file{GNUmakefile} and any customizations contained therein would be lost. Here is a short example of what the contents of @file{build/GNUmakefile.custom} might contain:
+
+@example
+## bump to gcc-4.2 in current path
+GCC.gcc = gcc-4.2
+
+## replace optimize for 'speed' with more agressive settings
+GCC.args.O.speed = -O3 -fomit-frame-pointer -msse4.2
+@end example
index f018745..9983c94 100644 (file)
@@ -18,7 +18,7 @@ In Xcode perform the following steps to build the default configuration:
 @item click @b{Build} or @b{Build and Go}
 @end itemize
 
-The first time it builds will take a bit of time. You may use the Build Results window to watch it progress. A large partof the build is invoking the external build system which poduces quite a lot of log output. Much of that output are warnings and errors that are part of the normal build process for 3rd-party contributed modules so in general you need not do anything. However, if Xcode itself reports the build failed, then you must take corrective action.
+The first build (on an empty @file{build} directory) will take a bit of time. You may use the Build Results window to observe progress. The most time-consuming part of the build is when the external build system (essentially the @b{terminal} method) is triggered by Xcode and a substantial amount of log transcript ensues. Much of that transcript are warnings and errors that are part of the normal build process for 3rd-party contributed modules so in general you need not do anything. However, if Xcode itself reports the build failed, then you must take corrective action.
 
 Unfortunately, due to limitations of Xcode we do not have hooks in place to offer finer-grained control over per-module make actions for the (external) build system. Thus, you will have to use @b{terminal} to accomplish those tasks. Just @command{cd} into the build directory which is associated with your active configuration and perform any necessary @command{make} commands. @b{Be careful not to issue commands from the terminal simultaneously with Xcode tasks} as that will confuse both Xcode and make and likely corrupt your build directory.
 
@@ -47,3 +47,25 @@ This configuration is used to build for the ppc architecture. Build directory is
 @item standard.ppc64
 This configuration is used to build for the ppc64 architecture. Build directory is @file{build.standard.ppc64} .
 @end table
+
+@c %**-------------------------------------------------------------------------
+@anchor{xcode.userdefined}
+@section User-Defined Settings
+The following user defined settings are used in Xcode project for the external build system:
+
+@table @samp
+@item EXTERNAL_BUILD
+Specifies the build location for each configuration.
+It is highly recommended the locations always evaluate to a unique pathname when factoring the configuration name.
+
+@item EXTERNAL_JOBS
+Specifies the concurrency factor for the external build system when builds are launched from within Xcode.
+This variable is meant to be customized by the developer for faster builds if the host supports it.
+
+@item EXTERNAL_METHOD
+This variable is used for internal/external build coordination and must always be @samp{xcode}.
+
+@item EXTERNAL_PROJECT
+Specifies the directory which is top of @value{HB.name} source tree.
+
+@end table
index 96651c2..2b7eb48 100755 (executable)
@@ -16,7 +16,7 @@ class StreamEntry:
     def __init__( self, object, isElement ):
         self.object    = object
         self.isElement = isElement
-    
+
 ###############################################################################
 
 class Element:
@@ -64,10 +64,7 @@ class Document( Element ):
         self._chapterLevel = 0
         self._sectionLevel = 0
         self._dividerCount = 0
-
-        #self._pragmaSummary = PragmaElement( self, 'summary' )
-        #self._pragmaLabels = PragmaElement( self, 'labels' )
-        #self._pragmaLabels._addText( 'xml2wiki,Distribution,Featured' )
+        self._majorHeading = Element( self, delimBegin='= ', delimEnd=' =\n\n' )
 
     def _pop( self ):
         self._stack.pop()
@@ -94,13 +91,8 @@ class Document( Element ):
         self._sectionLevel = self._sectionLevel - 1
 
     def _write( self, file ):
-        #self._pragmaSummary.write( file )
-        #file.write( '\n' )
-        #self._pragmaLabels.write( file )
         if options.date:
             file.write( "\n\n  ===== `[`generated by xml2wiki on %s`]` =====" % (time.strftime( '%c' ) ))
-        #if options.toc:
-        #    file.write( '\n\n<wiki:toc max_depth="3" />' )
         Element._write( self, file )
         file.write( '\n' )
 
@@ -135,9 +127,9 @@ class Document( Element ):
             e = ItemizeElement( self._pending )
         elif name == 'item':
             e = ItemElement( self._pending )
-        #elif name == 'majorheading':
-        #    e = self._pragmaSummary
-        #    shouldAdd = False
+        elif name == 'majorheading':
+            e = self._majorHeading
+            shouldAdd = False
         elif name == 'para':
             e = ParagraphElement( self._pending )
         elif name == 'quotation':
@@ -388,8 +380,8 @@ with open( args[0], 'rb' ) as fin:
 
 writer = IndentedWriter( 4, sys.stdout )
 
+doc._majorHeading.write( writer )
 if options.toc:
     for e in toc:
         writer.write( '%s* [#%s %s]\n' % ('  ' * e._level,e._anchor,e._stream[0].object) )
-
 doc.write( writer )
index 224f5a8..8cea29f 100644 (file)
@@ -1,6 +1,7 @@
 $(eval $(call import.MODULE.rules,GTK))
 
 build: gtk.build
+install: gtk.install
 clean: gtk.clean
 xclean: gtk.xclean
 
index 91e47a4..396deb0 100644 (file)
@@ -26,3 +26,4 @@ libhb.clean:
 ###############################################################################
 
 clean: libhb.clean
+build: libhb.build
index 34862da..ead3788 100644 (file)
@@ -6,32 +6,6 @@
        objectVersion = 45;
        objects = {
 
-/* Begin PBXAggregateTarget section */
-               27C7D1020F58AEC400974730 /* configure */ = {
-                       isa = PBXAggregateTarget;
-                       buildConfigurationList = 27C7D1050F58AEE300974730 /* Build configuration list for PBXAggregateTarget "configure" */;
-                       buildPhases = (
-                               27C7D1010F58AEC400974730 /* ShellScript */,
-                       );
-                       dependencies = (
-                       );
-                       name = configure;
-                       productName = configure;
-               };
-               27C7D1160F58B0AF00974730 /* make.libhb */ = {
-                       isa = PBXAggregateTarget;
-                       buildConfigurationList = 27C7D1180F58B0AF00974730 /* Build configuration list for PBXAggregateTarget "make.libhb" */;
-                       buildPhases = (
-                               27C7D1170F58B0AF00974730 /* ShellScript */,
-                       );
-                       dependencies = (
-                               27ED6AB70F58CA0A00C905EE /* PBXTargetDependency */,
-                       );
-                       name = make.libhb;
-                       productName = configure;
-               };
-/* End PBXAggregateTarget section */
-
 /* Begin PBXBuildFile section */
                0DFA5C7B0B8DD1E90020BC09 /* HandBrake.icns in Resources */ = {isa = PBXBuildFile; fileRef = 0DFA5C7A0B8DD1E90020BC09 /* HandBrake.icns */; };
                0DFF0C100B6BCEE800549488 /* test.c in Sources */ = {isa = PBXBuildFile; fileRef = 526FBC760B4CA8F40064E04C /* test.c */; };
@@ -41,6 +15,7 @@
                253886180BFE0C160064E995 /* HBOutputPanelController.m in Sources */ = {isa = PBXBuildFile; fileRef = 253886160BFE0C160064E995 /* HBOutputPanelController.m */; };
                25DE1FB60C169A0C00F01FC8 /* HBPreferencesController.h in Headers */ = {isa = PBXBuildFile; fileRef = 25DE1FB40C169A0C00F01FC8 /* HBPreferencesController.h */; };
                25DE1FB70C169A0C00F01FC8 /* HBPreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 25DE1FB50C169A0C00F01FC8 /* HBPreferencesController.m */; };
+               278070240F5C261300699207 /* ChapterTitles.h in Headers */ = {isa = PBXBuildFile; fileRef = 593034E90BBA39A100172349 /* ChapterTitles.h */; };
                27AC71850F5A0AF600053B83 /* fakexcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27AC71840F5A0AF600053B83 /* fakexcode.cpp */; };
                4D1125D809D72FD200E0657B /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D1125D709D72FD200E0657B /* libz.dylib */; };
                4DD93F8F082036E8008E1322 /* Controller.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF3C8CB052889CD00A80101 /* Controller.h */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
-               27ED6A910F58BEE900C905EE /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 27C7D1160F58B0AF00974730;
-                       remoteInfo = make;
-               };
-               27ED6AB60F58CA0A00C905EE /* PBXContainerItemProxy */ = {
+               27774C2A0F5CB1D600897477 /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                        containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
                        proxyType = 1;
-                       remoteGlobalIDString = 27C7D1020F58AEC400974730;
-                       remoteInfo = configure;
+                       remoteGlobalIDString = 278071070F5C9C2C00699207;
+                       remoteInfo = libhb;
                };
-               27ED6AC60F58CE8400C905EE /* PBXContainerItemProxy */ = {
+               27774C2C0F5CB1DD00897477 /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                        containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
                        proxyType = 1;
-                       remoteGlobalIDString = 27C7D1160F58B0AF00974730;
-                       remoteInfo = make;
+                       remoteGlobalIDString = 278071070F5C9C2C00699207;
+                       remoteInfo = libhb;
                };
 /* End PBXContainerItemProxy section */
 
                        dstPath = "";
                        dstSubfolderSpec = 10;
                        files = (
-                               A2D0A0BF0D3E596F002D57CB /* Sparkle.framework in CopyFiles */,
                                A29E058B0BE12889000533F5 /* Growl.framework in CopyFiles */,
+                               A2D0A0BF0D3E596F002D57CB /* Sparkle.framework in CopyFiles */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
                0D6E35760B6BD4F0005AABB3 /* HandBrake.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HandBrake.app; sourceTree = BUILT_PRODUCTS_DIR; };
                0DFA5C7A0B8DD1E90020BC09 /* HandBrake.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = HandBrake.icns; sourceTree = "<group>"; };
-               0DFA5C7E0B8DD3B60020BC09 /* declpcm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = declpcm.c; path = ../libhb/declpcm.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C7F0B8DD3B60020BC09 /* decmpeg2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = decmpeg2.c; path = ../libhb/decmpeg2.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C800B8DD3B60020BC09 /* decsub.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = decsub.c; path = ../libhb/decsub.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C810B8DD3B60020BC09 /* demuxmpeg.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = demuxmpeg.c; path = ../libhb/demuxmpeg.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C820B8DD3B60020BC09 /* dvd.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dvd.c; path = ../libhb/dvd.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C830B8DD3B60020BC09 /* encavcodec.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = encavcodec.c; path = ../libhb/encavcodec.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C840B8DD3B60020BC09 /* encfaac.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = encfaac.c; path = ../libhb/encfaac.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C850B8DD3B60020BC09 /* enclame.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = enclame.c; path = ../libhb/enclame.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C860B8DD3B60020BC09 /* encvorbis.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = encvorbis.c; path = ../libhb/encvorbis.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C870B8DD3B60020BC09 /* encx264.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = encx264.c; path = ../libhb/encx264.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C880B8DD3B60020BC09 /* encxvid.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = encxvid.c; path = ../libhb/encxvid.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C890B8DD3B60020BC09 /* fifo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fifo.c; path = ../libhb/fifo.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C8A0B8DD3B60020BC09 /* hb.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hb.c; path = ../libhb/hb.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C910B8DD3B60020BC09 /* muxavi.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = muxavi.c; path = ../libhb/muxavi.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C920B8DD3B60020BC09 /* muxcommon.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = muxcommon.c; path = ../libhb/muxcommon.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C930B8DD3B60020BC09 /* muxmp4.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = muxmp4.c; path = ../libhb/muxmp4.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C940B8DD3B60020BC09 /* muxogm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = muxogm.c; path = ../libhb/muxogm.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C950B8DD3B60020BC09 /* ports.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ports.c; path = ../libhb/ports.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C970B8DD3B60020BC09 /* reader.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = reader.c; path = ../libhb/reader.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C980B8DD3B60020BC09 /* render.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = render.c; path = ../libhb/render.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C990B8DD3B60020BC09 /* scan.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = scan.c; path = ../libhb/scan.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C9A0B8DD3B60020BC09 /* sync.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sync.c; path = ../libhb/sync.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C9B0B8DD3B60020BC09 /* update.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = update.c; path = ../libhb/update.c; sourceTree = SOURCE_ROOT; };
-               0DFA5C9C0B8DD3B60020BC09 /* work.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = work.c; path = ../libhb/work.c; sourceTree = SOURCE_ROOT; };
                0DFF0C0A0B6BCEC200549488 /* HandBrakeCLI */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = HandBrakeCLI; sourceTree = BUILT_PRODUCTS_DIR; };
                1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
                253885FF0BFE0A5B0064E995 /* HBOutputRedirect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HBOutputRedirect.h; sourceTree = "<group>"; };
                4DF3C8CB052889CD00A80101 /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Controller.h; sourceTree = "<group>"; };
                4DF3C8CC052889CD00A80101 /* Controller.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = Controller.mm; sourceTree = "<group>"; };
                526FBC760B4CA8F40064E04C /* test.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 30; name = test.c; path = ../test/test.c; sourceTree = SOURCE_ROOT; };
-               526FBC9B0B4CAB100064E04C /* common.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = common.c; path = ../libhb/common.c; sourceTree = SOURCE_ROOT; };
-               526FBC9D0B4CAB100064E04C /* deca52.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = deca52.c; path = ../libhb/deca52.c; sourceTree = SOURCE_ROOT; };
-               526FBC9E0B4CAB100064E04C /* decavcodec.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = decavcodec.c; path = ../libhb/decavcodec.c; sourceTree = SOURCE_ROOT; };
-               5558B5680BE3BADF00E15E27 /* decdca.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = decdca.c; path = ../libhb/decdca.c; sourceTree = SOURCE_ROOT; };
                593034E90BBA39A100172349 /* ChapterTitles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChapterTitles.h; sourceTree = "<group>"; };
                593034EA0BBA39A100172349 /* ChapterTitles.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChapterTitles.m; sourceTree = "<group>"; };
                59CBD2360BBB44DA004A3BE3 /* parsecsv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = parsecsv.c; path = ../test/parsecsv.c; sourceTree = SOURCE_ROOT; };
-               7497010E0DC281BB009200D8 /* decomb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = decomb.c; path = ../libhb/decomb.c; sourceTree = SOURCE_ROOT; };
                A20F46DB0EBB5E7A005B861B /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = "<absolute>"; };
                A20F47000EBB5EC2005B861B /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = "<absolute>"; };
                A22C85EA0D05D35000C10E36 /* HBPresets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBPresets.h; sourceTree = "<group>"; };
                A22C85EB0D05D35000C10E36 /* HBPresets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBPresets.m; sourceTree = "<group>"; };
-               A25289E50D87A27D00461D5B /* enctheora.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = enctheora.c; path = ../libhb/enctheora.c; sourceTree = SOURCE_ROOT; };
                A25962E00F15077500B3BF4E /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = /System/Library/Frameworks/Quartz.framework; sourceTree = "<absolute>"; };
                A26601990F2A1DC0007EA355 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PictureFilters.xib; sourceTree = "<group>"; };
                A273E04A0C57B39A00493A45 /* Pause.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Pause.tiff; sourceTree = "<group>"; };
                A273E04B0C57B39A00493A45 /* Play.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Play.tiff; sourceTree = "<group>"; };
                A273E04C0C57B39A00493A45 /* Stop.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Stop.tiff; sourceTree = "<group>"; };
-               A273E0950C57C19500493A45 /* muxmkv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = muxmkv.c; path = ../libhb/muxmkv.c; sourceTree = SOURCE_ROOT; };
                A27BB4E90EFAB9310027CDF9 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PicturePreview.xib; sourceTree = "<group>"; };
                A29E057F0BE1283E000533F5 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Growl.framework; sourceTree = "<group>"; };
                A2A1EC300C76C35E00827E0D /* HBDVDDetector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HBDVDDetector.h; sourceTree = "<group>"; };
                A2D7AD660C998AD30082CA33 /* Source.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Source.tiff; sourceTree = "<group>"; };
                A9AC41DD0C918DB500DDF9B8 /* HBAdvancedController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = HBAdvancedController.m; sourceTree = "<group>"; };
                A9AC41DE0C918DB500DDF9B8 /* HBAdvancedController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HBAdvancedController.h; sourceTree = "<group>"; };
-               B45342080EE3619C005D6F26 /* decmetadata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = decmetadata.c; path = ../libhb/decmetadata.c; sourceTree = SOURCE_ROOT; };
-               B48359A70C82960500E04440 /* lang.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lang.c; path = ../libhb/lang.c; sourceTree = SOURCE_ROOT; };
                D289A9F20DBBE7AC00CE614B /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
                E3003C7E0C88505D0072F2A8 /* DeleteHighlightPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DeleteHighlightPressed.png; sourceTree = "<group>"; };
                E3003CB40C8852B70072F2A8 /* DeletePressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DeletePressed.png; sourceTree = "<group>"; };
                E3C844F50CA6B3F90013B683 /* Reveal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Reveal.png; sourceTree = "<group>"; };
                E3C845860CA6E9080013B683 /* EncodeComplete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = EncodeComplete.png; sourceTree = "<group>"; };
                E3FC10900D1611EC00470E7B /* EncodeCanceled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = EncodeCanceled.png; sourceTree = "<group>"; };
-               EAA526920C3B25D200944FF2 /* stream.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = stream.c; path = ../libhb/stream.c; sourceTree = SOURCE_ROOT; };
-               FC85194C0C59A02C0073812C /* denoise.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = denoise.c; path = ../libhb/denoise.c; sourceTree = SOURCE_ROOT; };
-               FC85194D0C59A02C0073812C /* deinterlace.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = deinterlace.c; path = ../libhb/deinterlace.c; sourceTree = SOURCE_ROOT; };
-               FC85194E0C59A02C0073812C /* deblock.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = deblock.c; path = ../libhb/deblock.c; sourceTree = SOURCE_ROOT; };
-               FC85194F0C59A02C0073812C /* detelecine.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = detelecine.c; path = ../libhb/detelecine.c; sourceTree = SOURCE_ROOT; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
-                               D289AAC40DBBF3F100CE614B /* IOKit.framework in Frameworks */,
                                D289A9F30DBBE7AC00CE614B /* CoreServices.framework in Frameworks */,
+                               D289AAC40DBBF3F100CE614B /* IOKit.framework in Frameworks */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        buildActionMask = 2147483647;
                        files = (
                                4DD93FA2082036E8008E1322 /* Cocoa.framework in Frameworks */,
-                               4DD93FA3082036E8008E1322 /* IOKit.framework in Frameworks */,
+                               A25962E10F15077500B3BF4E /* Quartz.framework in Frameworks */,
+                               A20F47010EBB5EC2005B861B /* QTKit.framework in Frameworks */,
                                4DD93FA4082036E8008E1322 /* OpenGL.framework in Frameworks */,
+                               4DD93FA3082036E8008E1322 /* IOKit.framework in Frameworks */,
                                4D1125D809D72FD200E0657B /* libz.dylib in Frameworks */,
                                A29E05800BE1283E000533F5 /* Growl.framework in Frameworks */,
                                A2D0A0AB0D3E5929002D57CB /* Sparkle.framework in Frameworks */,
-                               A20F47010EBB5EC2005B861B /* QTKit.framework in Frameworks */,
-                               A25962E10F15077500B3BF4E /* Quartz.framework in Frameworks */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        children = (
                                526FBC930B4CAA260064E04C /* HandBrake Sources */,
                                526FBC920B4CAA120064E04C /* HandBrakeCLI Sources */,
-                               526FBC8D0B4CA9F90064E04C /* libhb Sources */,
-                               29B97315FDCFA39411CA2CEA /* Other Sources */,
                                29B97317FDCFA39411CA2CEA /* Resources */,
                                089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
                                29B97323FDCFA39411CA2CEA /* Frameworks */,
                        name = HandBrake;
                        sourceTree = "<group>";
                };
-               29B97315FDCFA39411CA2CEA /* Other Sources */ = {
-                       isa = PBXGroup;
-                       children = (
-                               29B97316FDCFA39411CA2CEA /* main.mm */,
-                       );
-                       name = "Other Sources";
-                       sourceTree = "<group>";
-               };
                29B97317FDCFA39411CA2CEA /* Resources */ = {
                        isa = PBXGroup;
                        children = (
                        name = Frameworks;
                        sourceTree = "<group>";
                };
-               526FBC8D0B4CA9F90064E04C /* libhb Sources */ = {
-                       isa = PBXGroup;
-                       children = (
-                               B45342080EE3619C005D6F26 /* decmetadata.c */,
-                               A25289E50D87A27D00461D5B /* enctheora.c */,
-                               7497010E0DC281BB009200D8 /* decomb.c */,
-                               B48359A70C82960500E04440 /* lang.c */,
-                               EAA526920C3B25D200944FF2 /* stream.c */,
-                               0DFA5C7E0B8DD3B60020BC09 /* declpcm.c */,
-                               0DFA5C7F0B8DD3B60020BC09 /* decmpeg2.c */,
-                               0DFA5C800B8DD3B60020BC09 /* decsub.c */,
-                               0DFA5C810B8DD3B60020BC09 /* demuxmpeg.c */,
-                               0DFA5C820B8DD3B60020BC09 /* dvd.c */,
-                               0DFA5C830B8DD3B60020BC09 /* encavcodec.c */,
-                               0DFA5C840B8DD3B60020BC09 /* encfaac.c */,
-                               0DFA5C850B8DD3B60020BC09 /* enclame.c */,
-                               0DFA5C860B8DD3B60020BC09 /* encvorbis.c */,
-                               FC85194C0C59A02C0073812C /* denoise.c */,
-                               FC85194D0C59A02C0073812C /* deinterlace.c */,
-                               FC85194E0C59A02C0073812C /* deblock.c */,
-                               FC85194F0C59A02C0073812C /* detelecine.c */,
-                               0DFA5C870B8DD3B60020BC09 /* encx264.c */,
-                               0DFA5C880B8DD3B60020BC09 /* encxvid.c */,
-                               0DFA5C890B8DD3B60020BC09 /* fifo.c */,
-                               0DFA5C8A0B8DD3B60020BC09 /* hb.c */,
-                               0DFA5C920B8DD3B60020BC09 /* muxcommon.c */,
-                               A273E0950C57C19500493A45 /* muxmkv.c */,
-                               0DFA5C930B8DD3B60020BC09 /* muxmp4.c */,
-                               0DFA5C910B8DD3B60020BC09 /* muxavi.c */,
-                               0DFA5C940B8DD3B60020BC09 /* muxogm.c */,
-                               0DFA5C950B8DD3B60020BC09 /* ports.c */,
-                               0DFA5C970B8DD3B60020BC09 /* reader.c */,
-                               0DFA5C980B8DD3B60020BC09 /* render.c */,
-                               0DFA5C990B8DD3B60020BC09 /* scan.c */,
-                               0DFA5C9A0B8DD3B60020BC09 /* sync.c */,
-                               0DFA5C9B0B8DD3B60020BC09 /* update.c */,
-                               0DFA5C9C0B8DD3B60020BC09 /* work.c */,
-                               526FBC9B0B4CAB100064E04C /* common.c */,
-                               526FBC9D0B4CAB100064E04C /* deca52.c */,
-                               5558B5680BE3BADF00E15E27 /* decdca.c */,
-                               526FBC9E0B4CAB100064E04C /* decavcodec.c */,
-                       );
-                       name = "libhb Sources";
-                       sourceTree = "<group>";
-               };
                526FBC920B4CAA120064E04C /* HandBrakeCLI Sources */ = {
                        isa = PBXGroup;
                        children = (
                                A9AC41DD0C918DB500DDF9B8 /* HBAdvancedController.m */,
                                E37172660C977D340072B384 /* HBImageAndTextCell.h */,
                                E37172650C977D340072B384 /* HBImageAndTextCell.m */,
+                               29B97316FDCFA39411CA2CEA /* main.mm */,
                        );
                        name = "HandBrake Sources";
                        sourceTree = "<group>";
                                A22C85EC0D05D35000C10E36 /* HBPresets.h in Headers */,
                                A2BF08050EFAB5D400C0E025 /* HBFilterController.h in Headers */,
                                A2BEA5FB0F2A1ED1001CE7A1 /* PictureController.h in Headers */,
+                               278070240F5C261300699207 /* ChapterTitles.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
 /* End PBXHeadersBuildPhase section */
 
+/* Begin PBXLegacyTarget section */
+               278070E10F5C7F9E00699207 /* contrib */ = {
+                       isa = PBXLegacyTarget;
+                       buildArgumentsString = "$EXTERNAL_PROJECT/make/xcodemake.sh $(PRODUCT_NAME) $(ACTION)";
+                       buildConfigurationList = 278070E20F5C7F9E00699207 /* Build configuration list for PBXLegacyTarget "contrib" */;
+                       buildPhases = (
+                       );
+                       buildToolPath = /bin/sh;
+                       buildWorkingDirectory = "";
+                       comments = "This target represents tie-in to the make-based build system for HandBrake.\nFrom Xcode's perspective we term it the 'external' build system.\n\n- building this target maps to --> make contrib.install\n- cleaning this target maps to --> make contrib.clean";
+                       dependencies = (
+                       );
+                       name = contrib;
+                       passBuildSettingsInEnvironment = 1;
+                       productName = external.invoke;
+               };
+               278071070F5C9C2C00699207 /* libhb */ = {
+                       isa = PBXLegacyTarget;
+                       buildArgumentsString = "$EXTERNAL_PROJECT/make/xcodemake.sh $(PRODUCT_NAME) $(ACTION)";
+                       buildConfigurationList = 278071080F5C9C2C00699207 /* Build configuration list for PBXLegacyTarget "libhb" */;
+                       buildPhases = (
+                       );
+                       buildToolPath = /bin/sh;
+                       buildWorkingDirectory = "";
+                       comments = "This target represents tie-in to the make-based build system for HandBrake.\nFrom Xcode's perspective we term it the 'external' build system.\n\n- building this target maps to --> make libhb.build\n- cleaning this target maps to --> make libhb.clean";
+                       dependencies = (
+                       );
+                       name = libhb;
+                       passBuildSettingsInEnvironment = 1;
+                       productName = external.invoke;
+               };
+/* End PBXLegacyTarget section */
+
 /* Begin PBXNativeTarget section */
                0DFF0C090B6BCEC200549488 /* HandBrakeCLI */ = {
                        isa = PBXNativeTarget;
                        buildRules = (
                        );
                        dependencies = (
-                               27ED6A920F58BEE900C905EE /* PBXTargetDependency */,
+                               27774C2B0F5CB1D600897477 /* PBXTargetDependency */,
                        );
                        name = HandBrakeCLI;
                        productName = HandBrakeCLI;
                        buildRules = (
                        );
                        dependencies = (
-                               27ED6AC70F58CE8400C905EE /* PBXTargetDependency */,
+                               27774C2D0F5CB1DD00897477 /* PBXTargetDependency */,
                        );
                        name = HandBrake;
                        productName = HandBrake;
                        targets = (
                                4DD93F8D082036E8008E1322 /* HandBrake */,
                                0DFF0C090B6BCEC200549488 /* HandBrakeCLI */,
-                               27C7D1160F58B0AF00974730 /* make.libhb */,
-                               27C7D1020F58AEC400974730 /* configure */,
+                               278071070F5C9C2C00699207 /* libhb */,
+                               278070E10F5C7F9E00699207 /* contrib */,
                        );
                };
 /* End PBXProject section */
                };
 /* End PBXResourcesBuildPhase section */
 
-/* Begin PBXShellScriptBuildPhase section */
-               27C7D1010F58AEC400974730 /* ShellScript */ = {
-                       isa = PBXShellScriptBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       inputPaths = (
-                       );
-                       outputPaths = (
-                               "$(EXTERNAL_BUILD)/GNUmakefile",
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "set -e\nmkdir -p $EXTERNAL_BUILD\ncd $EXTERNAL_BUILD\n\ncase \"$CONFIGURATION\" in\n    *.i386)\n        args=\"--arch=i386\"\n        ;;\n    *.x86_64)\n        args=\"--arch=x86_64\"\n        ;;\n    *.ppc)\n        args=\"--arch=ppc\"\n        ;;\n    *.ppc64)\n        args=\"--arch=ppc64\"\n        ;;\n    *)\n        args=\"\"\n        ;;\nesac\n\nif [ -z \"$args\" ]; then\n    exec $EXTERNAL_PROJECT/configure\nelse\n    exec $EXTERNAL_PROJECT/configure \"$args\"\nfi";
-                       showEnvVarsInLog = 0;
-               };
-               27C7D1170F58B0AF00974730 /* ShellScript */ = {
-                       isa = PBXShellScriptBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       inputPaths = (
-                       );
-                       outputPaths = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "make -C $EXTERNAL_BUILD macosx.fromxcode";
-                       showEnvVarsInLog = 0;
-               };
-/* End PBXShellScriptBuildPhase section */
-
 /* Begin PBXSourcesBuildPhase section */
                0DFF0C070B6BCEC200549488 /* Sources */ = {
                        isa = PBXSourcesBuildPhase;
 /* End PBXSourcesBuildPhase section */
 
 /* Begin PBXTargetDependency section */
-               27ED6A920F58BEE900C905EE /* PBXTargetDependency */ = {
+               27774C2B0F5CB1D600897477 /* PBXTargetDependency */ = {
                        isa = PBXTargetDependency;
-                       target = 27C7D1160F58B0AF00974730 /* make.libhb */;
-                       targetProxy = 27ED6A910F58BEE900C905EE /* PBXContainerItemProxy */;
+                       target = 278071070F5C9C2C00699207 /* libhb */;
+                       targetProxy = 27774C2A0F5CB1D600897477 /* PBXContainerItemProxy */;
                };
-               27ED6AB70F58CA0A00C905EE /* PBXTargetDependency */ = {
+               27774C2D0F5CB1DD00897477 /* PBXTargetDependency */ = {
                        isa = PBXTargetDependency;
-                       target = 27C7D1020F58AEC400974730 /* configure */;
-                       targetProxy = 27ED6AB60F58CA0A00C905EE /* PBXContainerItemProxy */;
-               };
-               27ED6AC70F58CE8400C905EE /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 27C7D1160F58B0AF00974730 /* make.libhb */;
-                       targetProxy = 27ED6AC60F58CE8400C905EE /* PBXContainerItemProxy */;
+                       target = 278071070F5C9C2C00699207 /* libhb */;
+                       targetProxy = 27774C2C0F5CB1DD00897477 /* PBXContainerItemProxy */;
                };
 /* End PBXTargetDependency section */
 
                        };
                        name = standard;
                };
-               27C7D1030F58AEC500974730 /* debug */ = {
+               278070E30F5C7F9E00699207 /* standard */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               COPY_PHASE_STRIP = NO;
-                               GCC_DYNAMIC_NO_PIC = NO;
-                               GCC_OPTIMIZATION_LEVEL = 0;
-                               PRODUCT_NAME = configure;
+                               PRODUCT_NAME = contrib;
+                       };
+                       name = standard;
+               };
+               278070E40F5C7F9E00699207 /* debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = external.invoke;
                        };
                        name = debug;
                };
-               27C7D1040F58AEC500974730 /* standard */ = {
+               278070E50F5C7F9E00699207 /* standard.i386 */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = external.invoke;
+                       };
+                       name = standard.i386;
+               };
+               278070E60F5C7F9E00699207 /* standard.x86_64 */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = external.invoke;
+                       };
+                       name = standard.x86_64;
+               };
+               278070E70F5C7F9E00699207 /* standard.ppc */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               PRODUCT_NAME = configure;
-                               ZERO_LINK = NO;
+                               PRODUCT_NAME = external.invoke;
+                       };
+                       name = standard.ppc;
+               };
+               278070E80F5C7F9E00699207 /* standard.ppc64 */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = external.invoke;
+                       };
+                       name = standard.ppc64;
+               };
+               278071090F5C9C2C00699207 /* standard */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = libhb;
                        };
                        name = standard;
                };
-               27C7D1190F58B0AF00974730 /* debug */ = {
+               2780710A0F5C9C2C00699207 /* debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               COPY_PHASE_STRIP = NO;
-                               GCC_DYNAMIC_NO_PIC = NO;
-                               GCC_OPTIMIZATION_LEVEL = 0;
-                               PRODUCT_NAME = configure;
+                               PRODUCT_NAME = external.invoke;
                        };
                        name = debug;
                };
-               27C7D11A0F58B0AF00974730 /* standard */ = {
+               2780710B0F5C9C2C00699207 /* standard.i386 */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               PRODUCT_NAME = configure;
-                               ZERO_LINK = NO;
+                               PRODUCT_NAME = external.invoke;
                        };
-                       name = standard;
+                       name = standard.i386;
+               };
+               2780710C0F5C9C2C00699207 /* standard.x86_64 */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = external.invoke;
+                       };
+                       name = standard.x86_64;
+               };
+               2780710D0F5C9C2C00699207 /* standard.ppc */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = external.invoke;
+                       };
+                       name = standard.ppc;
+               };
+               2780710E0F5C9C2C00699207 /* standard.ppc64 */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = external.invoke;
+                       };
+                       name = standard.ppc64;
                };
                27ED6ADB0F58D7F100C905EE /* standard.i386 */ = {
                        isa = XCBuildConfiguration;
                                CONFIGURATION_BUILD_DIR = "$(EXTERNAL_BUILD)";
                                CONFIGURATION_TEMP_DIR = "$(SYMROOT)";
                                EXTERNAL_BUILD = "$(EXTERNAL_PROJECT)/build.$(CONFIGURATION)";
+                               EXTERNAL_JOBS = 1;
+                               EXTERNAL_METHOD = xcode;
                                EXTERNAL_PROJECT = ..;
                                GCC_DYNAMIC_NO_PIC = YES;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
                        };
                        name = standard.i386;
                };
-               27ED6ADC0F58D7F100C905EE /* standard.i386 */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               PRODUCT_NAME = configure;
-                               ZERO_LINK = NO;
-                       };
-                       name = standard.i386;
-               };
-               27ED6ADD0F58D7F100C905EE /* standard.i386 */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               PRODUCT_NAME = configure;
-                               ZERO_LINK = NO;
-                       };
-                       name = standard.i386;
-               };
                27ED6ADE0F58D7F100C905EE /* standard.i386 */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                CONFIGURATION_BUILD_DIR = "$(EXTERNAL_BUILD)";
                                CONFIGURATION_TEMP_DIR = "$(SYMROOT)";
                                EXTERNAL_BUILD = "$(EXTERNAL_PROJECT)/build.$(CONFIGURATION)";
+                               EXTERNAL_JOBS = 1;
+                               EXTERNAL_METHOD = xcode;
                                EXTERNAL_PROJECT = ..;
                                GCC_DYNAMIC_NO_PIC = YES;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
                        };
                        name = standard.ppc;
                };
-               27ED6AE40F58D8F200C905EE /* standard.ppc */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               PRODUCT_NAME = configure;
-                               ZERO_LINK = NO;
-                       };
-                       name = standard.ppc;
-               };
-               27ED6AE50F58D8F200C905EE /* standard.ppc */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               PRODUCT_NAME = configure;
-                               ZERO_LINK = NO;
-                       };
-                       name = standard.ppc;
-               };
                27ED6AE60F58D8F200C905EE /* standard.ppc */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                CONFIGURATION_BUILD_DIR = "$(EXTERNAL_BUILD)";
                                CONFIGURATION_TEMP_DIR = "$(SYMROOT)";
                                EXTERNAL_BUILD = "$(EXTERNAL_PROJECT)/build.$(CONFIGURATION)";
+                               EXTERNAL_JOBS = 1;
+                               EXTERNAL_METHOD = xcode;
                                EXTERNAL_PROJECT = ..;
                                GCC_DYNAMIC_NO_PIC = YES;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
                        };
                        name = standard.x86_64;
                };
-               27ED6B000F58DE7400C905EE /* standard.x86_64 */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               PRODUCT_NAME = configure;
-                               ZERO_LINK = NO;
-                       };
-                       name = standard.x86_64;
-               };
-               27ED6B010F58DE7400C905EE /* standard.x86_64 */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               PRODUCT_NAME = configure;
-                               ZERO_LINK = NO;
-                       };
-                       name = standard.x86_64;
-               };
                27ED6B020F58DE7400C905EE /* standard.x86_64 */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                CONFIGURATION_BUILD_DIR = "$(EXTERNAL_BUILD)";
                                CONFIGURATION_TEMP_DIR = "$(SYMROOT)";
                                EXTERNAL_BUILD = "$(EXTERNAL_PROJECT)/build.$(CONFIGURATION)";
+                               EXTERNAL_JOBS = 1;
+                               EXTERNAL_METHOD = xcode;
                                EXTERNAL_PROJECT = ..;
                                GCC_DYNAMIC_NO_PIC = YES;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
                        };
                        name = standard.ppc64;
                };
-               27ED6B050F58DE7600C905EE /* standard.ppc64 */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               PRODUCT_NAME = configure;
-                               ZERO_LINK = NO;
-                       };
-                       name = standard.ppc64;
-               };
-               27ED6B060F58DE7600C905EE /* standard.ppc64 */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               PRODUCT_NAME = configure;
-                               ZERO_LINK = NO;
-                       };
-                       name = standard.ppc64;
-               };
                27ED6B070F58DE7600C905EE /* standard.ppc64 */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                COPY_PHASE_STRIP = NO;
                                DEBUG_INFORMATION_FORMAT = dwarf;
                                EXTERNAL_BUILD = "$(EXTERNAL_PROJECT)/build.$(CONFIGURATION)";
+                               EXTERNAL_JOBS = 1;
+                               EXTERNAL_METHOD = xcode;
                                EXTERNAL_PROJECT = ..;
                                GCC_DYNAMIC_NO_PIC = YES;
                                GCC_ENABLE_FIX_AND_CONTINUE = YES;
                                CONFIGURATION_BUILD_DIR = "$(EXTERNAL_BUILD)";
                                CONFIGURATION_TEMP_DIR = "$(SYMROOT)";
                                EXTERNAL_BUILD = "$(EXTERNAL_PROJECT)/build.$(CONFIGURATION)";
+                               EXTERNAL_JOBS = 1;
+                               EXTERNAL_METHOD = xcode;
                                EXTERNAL_PROJECT = ..;
                                GCC_DYNAMIC_NO_PIC = YES;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = standard;
                };
-               27C7D1050F58AEE300974730 /* Build configuration list for PBXAggregateTarget "configure" */ = {
+               278070E20F5C7F9E00699207 /* Build configuration list for PBXLegacyTarget "contrib" */ = {
                        isa = XCConfigurationList;
                        buildConfigurations = (
-                               27C7D1040F58AEC500974730 /* standard */,
-                               27C7D1030F58AEC500974730 /* debug */,
-                               27ED6ADC0F58D7F100C905EE /* standard.i386 */,
-                               27ED6B000F58DE7400C905EE /* standard.x86_64 */,
-                               27ED6AE40F58D8F200C905EE /* standard.ppc */,
-                               27ED6B050F58DE7600C905EE /* standard.ppc64 */,
+                               278070E30F5C7F9E00699207 /* standard */,
+                               278070E40F5C7F9E00699207 /* debug */,
+                               278070E50F5C7F9E00699207 /* standard.i386 */,
+                               278070E60F5C7F9E00699207 /* standard.x86_64 */,
+                               278070E70F5C7F9E00699207 /* standard.ppc */,
+                               278070E80F5C7F9E00699207 /* standard.ppc64 */,
                        );
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = standard;
                };
-               27C7D1180F58B0AF00974730 /* Build configuration list for PBXAggregateTarget "make.libhb" */ = {
+               278071080F5C9C2C00699207 /* Build configuration list for PBXLegacyTarget "libhb" */ = {
                        isa = XCConfigurationList;
                        buildConfigurations = (
-                               27C7D11A0F58B0AF00974730 /* standard */,
-                               27C7D1190F58B0AF00974730 /* debug */,
-                               27ED6ADD0F58D7F100C905EE /* standard.i386 */,
-                               27ED6B010F58DE7400C905EE /* standard.x86_64 */,
-                               27ED6AE50F58D8F200C905EE /* standard.ppc */,
-                               27ED6B060F58DE7600C905EE /* standard.ppc64 */,
+                               278071090F5C9C2C00699207 /* standard */,
+                               2780710A0F5C9C2C00699207 /* debug */,
+                               2780710B0F5C9C2C00699207 /* standard.i386 */,
+                               2780710C0F5C9C2C00699207 /* standard.x86_64 */,
+                               2780710D0F5C9C2C00699207 /* standard.ppc */,
+                               2780710E0F5C9C2C00699207 /* standard.ppc64 */,
                        );
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = standard;
index c13958d..2b525ac 100644 (file)
@@ -20,10 +20,25 @@ MACOSX.XCODE.project = HandBrake.xcodeproj
 
 MACOSX.XCODE = $(strip \
     cd $(MACOSX.src/) && \
-    $(MACOSX.XCODE.exe) \
-            -project $(MACOSX.XCODE.project) \
-            -configuration $(MACOSX.conf) \
-            $(foreach t,$(MACOSX.targs),-target $t) \
-            EXTERNAL_BUILD=$(CURDIR) \
-            EXTERNAL_PROJECT=$(PROJECT/) \
-            $(1) )
+       $(MACOSX.XCODE.exe) \
+        -project $(MACOSX.XCODE.project) \
+        -configuration $(MACOSX.conf) \
+        $(foreach t,$(MACOSX.targs),-target $t) \
+        EXTERNAL_BUILD='$(CURDIR)' \
+        EXTERNAL_JOBS='$(BUILD.jobs)' \
+        EXTERNAL_METHOD='$(CONF.method)' \
+        EXTERNAL_PROJECT='$(PROJECT/)' \
+        $(1) )
+
+MACOSX.XCODE.PASSTHRU = $(strip \
+    cd $(MACOSX.src/) && \
+       $(MACOSX.XCODE.exe) \
+        -project $(MACOSX.XCODE.project) \
+        -configuration $(MACOSX.conf) \
+        -target libhb \
+        EXTERNAL_BUILD='$(CURDIR)' \
+        EXTERNAL_JOBS='$(BUILD.jobs)' \
+        EXTERNAL_METHOD='$(CONF.method)' \
+        EXTERNAL_PROJECT='$(PROJECT/)' \
+        EXTERNAL_GOALS='$(1)' \
+        build )
index 94df665..9873e90 100644 (file)
@@ -1,20 +1,13 @@
 $(eval $(call import.MODULE.rules,MACOSX))
 
-build: macosx.build
-clean: macosx.clean
-
-.PHONY: macosx.build macosx.clean
-
 macosx.build: $(MACOSX.m4.out)
-       +$(call MACOSX.XCODE,build)
-
-macosx.clean:
-       $(call MACOSX.XCODE,clean)
 
 $(MACOSX.m4.out): $(BUILD/)project/handbrake.m4
 $(MACOSX.m4.out): | $(dir $(MACOSX.m4.out))
 $(MACOSX.m4.out): $(MACOSX.build/)%: $(MACOSX.src/)%.m4
        $(M4.exe) -Iproject $< > $@
 
-## target used by Xcode when launching as external build
-macosx.fromxcode: $(MACOSX.m4.out) $(LIBHB.a)
+###############################################################################
+
+clean: macosx.clean
+build: macosx.build
diff --git a/macosx/module.xcode b/macosx/module.xcode
new file mode 100644 (file)
index 0000000..8bfd15d
--- /dev/null
@@ -0,0 +1,15 @@
+## This rules file is processed only when xcode=1 method=terminal
+## which hands-off the build to Xcode which in turn may callback this
+## build system.
+
+build:
+       $(call MACOSX.XCODE,build)
+
+clean:
+       $(call MACOSX.XCODE,clean)
+
+$(MAKECMDGOALS): __goals__
+       @true
+
+__goals__:
+       $(call MACOSX.XCODE.PASSTHRU,$(MAKECMDGOALS))
index ace634d..839077a 100644 (file)
@@ -55,7 +55,7 @@ def findExecutable( name ):
 
 ###############################################################################
 
-def computeDefaultMakeJobs():
+def computeNumCPU():
     ## good for darwin9.6.0 and linux
     try:
         n = os.sysconf( 'SC_NPROCESSORS_ONLN' )
@@ -103,6 +103,7 @@ for i in range( 2 ):
     project_dir = os.path.dirname( project_dir )
 if len( project_dir ) == 0:
     project_dir = os.curdir
+initial_project_dir = project_dir
 
 ###############################################################################
 
@@ -304,6 +305,10 @@ else:
 ## create parser
 parser = OptionParser( 'Usage: %prog' )
 
+## add hidden options
+parser.add_option( '', '--conf-method', default='terminal', action='store', help=optparse.SUPPRESS_HELP )
+
+## add install options
 group = OptionGroup( parser, 'Installation Options' )
 group.add_option( '', '--prefix', default=d_prefix, action='store',
     help='specify destination for final products (%s)' % (d_prefix) )
@@ -348,7 +353,13 @@ for tool in tools.items:
     tool.addToGroup( group )
 parser.add_option_group( group )
 
-(options, args) = parser.parse_args()
+(options,args) = parser.parse_args()
+
+exports = []
+for arg in args:
+    m = re.match( '([^=]+)=(.*)', arg )
+    if m:
+        exports.append( m.groups() )
 
 ## recompute values when launch mode
 if options.launch:
@@ -359,7 +370,7 @@ if options.launch:
     else:
         project_dir = os.path.normpath( relpath( project_dir, build_dir ))
     if options.launch_jobs == 0:
-        options.launch_jobs = computeDefaultMakeJobs()
+        options.launch_jobs = computeNumCPU()
     if options.launch_jobs < 1:
         options.launch_jobs = 1
     elif options.launch_jobs > 8:
@@ -420,7 +431,7 @@ class Repository:
         self.type      = 'unofficial'
 
         # parse output: svnversion PROJECT_DIR
-        cmd = 'svnversion ' + project_dir
+        cmd = 'svnversion ' + initial_project_dir
         print 'running: %s' % (cmd)
         try:
             p = subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
@@ -431,7 +442,7 @@ class Repository:
             pass
 
         # parse output: svn info PROJECT_DIR
-        cmd = 'svn info ' + project_dir
+        cmd = 'svn info ' + initial_project_dir
         print 'running: %s' % (cmd)
         try:
             p = subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
@@ -584,11 +595,9 @@ class Config:
 ## create configure line, stripping arg --launch, quoting others
 configure = []
 for arg in sys.argv[1:]:
-    #if arg.find( '--launch' ) == 0:
-    #    continue
     if arg == '--launch':
         continue
-    configure.append( '"%s"' % (arg.replace('"', '\\"')) )
+    configure.append( "'%s'" % (arg.replace("'", '%c%c%c%c%c' % (0x27,0x22,0x27,0x22,0x27))) )
 
 ## create singletones
 repo = Repository()
@@ -640,6 +649,7 @@ config.add( 'HOST.systemc', guessHost.systemc )
 config.add( 'HOST.release', guessHost.release )
 config.add( 'HOST.title',   '%s %s' % (guessHost.systemc,archMode.default) )
 config.add( 'HOST.extra',   guessHost.extra )
+config.add( 'HOST.ncpu',    computeNumCPU() )
 
 config.addBlank()
 config.add( 'BUILD.spec',    guessBuild )
@@ -650,9 +660,14 @@ config.add( 'BUILD.systemc', guessBuild.systemc )
 config.add( 'BUILD.release', guessBuild.release )
 config.add( 'BUILD.title',   '%s %s' % (guessBuild.systemc,archMode.mode) )
 config.add( 'BUILD.extra',   guessBuild.extra )
+config.add( 'BUILD.method',  'terminal' )
 config.add( 'BUILD.cross',   guessBuild.cross )
 config.add( 'BUILD.date',    time.strftime('%c') )
 config.add( 'BUILD.arch',    archMode.mode )
+config.add( 'BUILD.jobs',    computeNumCPU() )
+
+config.addBlank()
+config.add( 'CONF.method', options.conf_method )
 
 config.addBlank()
 config.add( 'BUILD/',   os.curdir + os.sep )
@@ -679,6 +694,11 @@ config.add( 'GCC.archs', archMode.mode if guessBuild.cross else '' )
 config.add( 'GCC.g', options.debug )
 config.add( 'GCC.O', options.optimize )
 
+if len(exports):
+    config.addBlank()
+    for nv in exports:
+        config.add( nv[0], nv[1] )
+
 config.addMake( '' )
 config.addMake( '## include (optional) customization file' )
 config.addMake( '-include $(BUID/)GNUmakefile.custom' )
index 3b4e666..4e6da0e 100644 (file)
@@ -24,6 +24,8 @@ endef
 ## $(1) module name (uppercase)
 ##
 define import.MODULE.rules
+.PHONY: $($(1).name).build $($(1).name).clean 
+
 $($(1).name).report:
        @$(MAKE) report.true REPORT=module REPORT.module=$(1)
 
@@ -31,20 +33,3 @@ $($(1).name).report:
 report.modules:: $($(1).name).report
 
 endef
-
-.PHONY: report.main report.gcc report.modules
-
-report.modules::
-
-.PHONY: report.main
-report.main:
-       @$(MAKE) report.true REPORT=main
-
-.PHONY: report.gcc
-report.gcc:
-       @$(MAKE) report.true REPORT=gcc
-
-## needed for nested make (which drives each report)
-.PHONY: report.true
-report.true:
-       @true
diff --git a/make/include/base.rules b/make/include/base.rules
new file mode 100644 (file)
index 0000000..f128864
--- /dev/null
@@ -0,0 +1,16 @@
+.PHONY: report.main report.gcc report.modules
+
+report.modules::
+
+.PHONY: report.main
+report.main:
+       @$(MAKE) report.true REPORT=main
+
+.PHONY: report.gcc
+report.gcc:
+       @$(MAKE) report.true REPORT=gcc
+
+## needed for nested make (which drives each report)
+.PHONY: report.true
+report.true:
+       @true
index 45fb178..93271a3 100644 (file)
@@ -1,11 +1,3 @@
-.DELETE_ON_ERROR:
-.SUFFIXES:
-
-.PHONY: build
-build:
-
-###############################################################################
-
 include $(PROJECT/)make/include/base.defs
 include $(PROJECT/)make/include/contrib.defs
 include $(PROJECT/)make/include/function.defs
index b389022..1f996cd 100644 (file)
@@ -1,3 +1,13 @@
+.DELETE_ON_ERROR:
+.SUFFIXES:
+
+###############################################################################
+
+## file-wide conditional to use xcode rules if xcode=1 method=terminal
+ifeq ($(FEATURE.xcode):$(BUILD.method),1:terminal)
+    include $(PROJECT/)macosx/module.xcode
+else
+
 ## only included using special report targets
 ifneq (,$(REPORT))
     include $(PROJECT/)make/include/report.defs
@@ -5,8 +15,10 @@ endif
 
 ###############################################################################
 
-.PHONY: clean xclean doc report
+.PHONY: build install clean xclean doc report
 
+build:
+install:
 clean:
 xclean: contrib.xclean clean
 doc:
@@ -37,3 +49,5 @@ reconfigure:
 ## target to build all dependency dirs
 $(sort $(dir $(BUILD.out))):
        $(MKDIR.exe) -p $@
+
+endif ## xcode=1 method=terminal
diff --git a/make/xcodemake.sh b/make/xcodemake.sh
new file mode 100644 (file)
index 0000000..5354b54
--- /dev/null
@@ -0,0 +1,75 @@
+#!/bin/sh -ex
+#
+
+## This script is invoked by Xcode external targets.
+##
+## We must guarantee no jobserver is passed through since the file-descriptors
+## have been clobbered by Xcode. If this is not done then make behaves as if
+## it is allowed to run an infinite number of jobs.
+##
+MAKEFLAGS=
+
+cd $EXTERNAL_BUILD
+
+## re/configure if not configured by Xcode or if missing top-makefile
+if [ $EXTERNAL_METHOD != 'xcode' -o ! -f $EXTERNAL_BUILD/GNUmakefile ]; then
+    ## compute --arch value based on Xcode configuration naming convention
+    case "$CONFIGURATION" in
+    *.i386)
+        args="--arch=i386"
+        ;;
+    *.x86_64)
+        args="--arch=x86_64"
+        ;;
+    *.ppc)
+        args="--arch=ppc"
+        ;;
+    *.ppc64)
+        args="--arch=ppc64"
+        ;;
+    *)
+        args=
+        ;;
+    esac
+
+    ## invoke configure with (hidden) option which indicates conf performed by xcode
+    $EXTERNAL_PROJECT/configure PATH=$PATH --conf-method=xcode $args
+fi
+
+## safeguard against passing blank value which would result in unlimited jobs
+if [ -z "$EXTERNAL_JOBS" ]; then
+    jobs=
+else
+    jobs=--jobs=$EXTERNAL_JOBS
+fi
+
+## compute target
+case "$1:$2" in
+contrib:clean)
+    target=contrib.xclean
+    ;;
+contrib:*)
+    target=contrib.install
+    ;;
+*:clean)
+    target=clean
+    ;;
+libhb:'')
+    if [ -z "$EXTERNAL_GOALS" ]; then
+        target=build
+    else
+        target="$EXTERNAL_GOALS"
+    fi
+    ;;
+*:'')
+    target=build
+    ;;
+*)
+    echo "usage: $0 PRODUCT ACTION"
+    exit 1
+    ;;
+esac
+
+## handoff
+set -x
+exec make -C $EXTERNAL_BUILD BUILD.method=xcode $jobs $target
index 3eda795..a0ab7d0 100644 (file)
@@ -14,6 +14,8 @@ TEST.libs = $(LIBHB.a) $(foreach n, \
         ogg samplerate swscale theora vorbis vorbisenc x264 xvidcore, \
         $(CONTRIB.build/)lib/lib$(n).a )
 
+TEST.install.exe = $(INSTALL.prefix/)bin/$(notdir $(TEST.exe))
+
 ## add libs from optional modules
 ifeq (1,$(BZIP2.enabled))
     TEST.libs += $(CONTRIB.build/)lib/libbz2.a
@@ -26,6 +28,7 @@ endif
 
 TEST.out += $(TEST.c.o)
 TEST.out += $(TEST.exe)
+TEST.out += $(TEST.install.exe)
 
 BUILD.out += $(TEST.out)
 
index 34004b9..2a18db9 100644 (file)
@@ -18,3 +18,15 @@ test.clean:
 
 build: test.build
 clean: test.clean
+
+###############################################################################
+
+## avoid installing CLI on darwin
+ifneq ($(BUILD.system),darwin)
+
+install: test.install
+
+test.install: | $(dir $(TEST.install.exe))
+       $(CP.exe) $(TEST.exe) $(TEST.install.exe)
+
+endif