]> granicus.if.org Git - handbrake/commitdiff
build: add cmake contrib for building x265 on osx
authorjstebbins <jstebbins.hb@gmail.com>
Wed, 20 Aug 2014 17:44:07 +0000 (17:44 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Wed, 20 Aug 2014 17:44:07 +0000 (17:44 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6328 b64f7644-9d1e-0410-96f1-a4d463321fa5

contrib/cmake/module.defs [new file with mode: 0644]
contrib/cmake/module.rules [new file with mode: 0644]
contrib/x265/module.defs
make/configure.py
make/include/gcc.defs
make/include/main.defs

diff --git a/contrib/cmake/module.defs b/contrib/cmake/module.defs
new file mode 100644 (file)
index 0000000..c4f0ddf
--- /dev/null
@@ -0,0 +1,9 @@
+$(eval $(call import.MODULE.defs,CMAKE,cmake))
+$(eval $(call import.CONTRIB.defs,CMAKE))
+
+CMAKE.FETCH.url = http://download.handbrake.fr/handbrake/contrib/cmake-3.0.1.tar.gz
+
+CMAKE.CONFIGURE.deps =
+CMAKE.CONFIGURE.shared =
+CMAKE.CONFIGURE.static =
+CMAKE.CONFIGURE.extra = --no-qt-gui
diff --git a/contrib/cmake/module.rules b/contrib/cmake/module.rules
new file mode 100644 (file)
index 0000000..fb046bd
--- /dev/null
@@ -0,0 +1,2 @@
+$(eval $(call import.MODULE.rules,CMAKE))
+$(eval $(call import.CONTRIB.rules,CMAKE))
index 89e7171bfd76061cb2e5c4608a612ef40f0fa13c..33d73625c1706a01fd0b0f72f729b83dee29975b 100644 (file)
@@ -1,4 +1,5 @@
-$(eval $(call import.MODULE.defs,X265,x265,YASM))
+__deps__ := YASM CMAKE
+$(eval $(call import.MODULE.defs,X265,x265,$(__deps__)))
 $(eval $(call import.CONTRIB.defs,X265))
 
 X265.FETCH.url = http://download.handbrake.fr/contrib/x265-7246-d6257335c537-1.2.tar.bz2
index 571093e243e18923f639b9d8396802c0e6bf93cd..89a1edec6642aeef689c72cd52dd4bd0f13f895e 100644 (file)
@@ -1248,6 +1248,8 @@ def createCLI():
     grp.add_option( '--enable-local-yasm', default=False, action='store_true', help=h )
     h = IfHost( 'Build and use local autotools', '*-*-*', none=optparse.SUPPRESS_HELP ).value
     grp.add_option( '--enable-local-autotools', default=False, action='store_true', help=h )
+    h = IfHost( 'Build and use local cmake', '*-*-*', none=optparse.SUPPRESS_HELP ).value
+    grp.add_option( '--enable-local-cmake', default=False, action='store_true', help=h )
     h = IfHost( 'Build and use local pkg-config', '*-*-darwin*', none=optparse.SUPPRESS_HELP ).value
     grp.add_option( '--enable-local-pkgconfig', default=False, action='store_true', help=h )
 
@@ -1419,6 +1421,7 @@ try:
         yasm     = ToolProbe( 'YASM.exe',     'yasm', abort=False, minversion=[1,2,0] )
         autoconf = ToolProbe( 'AUTOCONF.exe', 'autoconf', abort=False )
         automake = ToolProbe( 'AUTOMAKE.exe', 'automake', abort=False )
+        cmake    = ToolProbe( 'CMAKE.exe',    'cmake', abort=False )
         libtool  = ToolProbe( 'LIBTOOL.exe',  'libtool', abort=False )
         pkgconfig = ToolProbe( 'PKGCONFIG.exe', 'pkg-config', abort=False )
 
@@ -1492,6 +1495,11 @@ try:
         stdout.write( 'note: enabling local autotools\n' )
         options.enable_local_autotools = True
 
+    ## enable local cmake when cmake probe fails
+    if not options.enable_local_cmake and (Tools.cmake.fail):
+        stdout.write( 'note: enabling local cmake\n' )
+        options.enable_local_cmake = True
+
     ## enable local pkg-config when probe fails
     if not options.enable_local_pkgconfig and Tools.pkgconfig.fail:
         stdout.write( 'note: enabling local pkgconfig\n' )
@@ -1660,6 +1668,7 @@ int main ()
     doc.addBlank()
     doc.add( 'FEATURE.local_yasm', int( options.enable_local_yasm ))
     doc.add( 'FEATURE.local_autotools', int( options.enable_local_autotools ))
+    doc.add( 'FEATURE.local_cmake', int( options.enable_local_cmake ))
     doc.add( 'FEATURE.local_pkgconfig', int( options.enable_local_pkgconfig ))
     doc.add( 'FEATURE.asm',        'disabled' )
     doc.add( 'FEATURE.gtk',        int( not options.disable_gtk ))
index e6695c329bb9ab42a3cc68ea4ad649255655d3f8..b27c4a6ced2810bc3a415581cdac9f2742a3be32 100644 (file)
@@ -83,7 +83,7 @@ GCC.args.extra.exe++   = $(LDFLAGS)
 
 define import.GCC
     $(1).GCC.gcc = $$(GCC.gcc)
-    $(1).GCC.gxx = $$(dir $$($(1).GCC.gcc))$$(subst gcc,g++,$$(notdir $$($(1).GCC.gcc)))
+    $(1).GCC.gxx = $$(dir $$($(1).GCC.gcc))$$(subst clang,clang++,$$(subst gcc,g++,$$(notdir $$($(1).GCC.gcc))))
 
     $(1).GCC.pipe    = $$(GCC.pipe)
     $(1).GCC.c_std   = $$(GCC.c_std)
index 504d814cc8b24471a38e67b5097a8fa8600377fe..a6ea8a4cd0aba3db7311d381b6c9d7c570410915 100644 (file)
@@ -12,17 +12,27 @@ ifeq (1,$(FEATURE.local_pkgconfig))
     MODULES += contrib/pkgconfig
 endif
 
+HB_TOOLS_PATH =
+ifeq (1,$(FEATURE.local_cmake))
+    MODULES += contrib/cmake
+    HB_TOOLS_PATH = $(call fn.ABSOLUTE,$(CONTRIB.build/)bin)
+endif
+
 ifeq (1,$(FEATURE.local_autotools))
     MODULES += contrib/autoconf
     MODULES += contrib/automake
     MODULES += contrib/libtool
     MODULES += contrib/m4
     AUTOTOOL_MODULES = AUTOCONF AUTOMAKE LIBTOOL M4
-    PATH := $(call fn.ABSOLUTE,$(CONTRIB.build/)bin):$(PATH)
+    HB_TOOLS_PATH = $(call fn.ABSOLUTE,$(CONTRIB.build/)bin)
 else
     AUTOTOOL_MODULES =
 endif
 
+ifneq (,$(HB_TOOLS_PATH))
+    PATH := $(HB_TOOLS_PATH):$(PATH)
+endif
+
 ifneq (,$(filter $(BUILD.system),cygwin mingw))
 ifneq ($(HAS.bz2),1)
     MODULES += contrib/bzip2