]> granicus.if.org Git - handbrake/commitdiff
build: Add FreeBSD support.
authorYuichiro NAITO <naito.yuichiro@gmail.com>
Mon, 25 Dec 2017 07:13:30 +0000 (16:13 +0900)
committerBradley Sepos <bradley@bradleysepos.com>
Sat, 13 Jan 2018 05:03:39 +0000 (00:03 -0500)
Closes #1076.

make/configure.py
make/include/main.defs
make/variant/freebsd.defs
test/module.defs

index 0fa7e9a3ba7c403fdf80b06d3699bcbf0e57b122..6dd049adb7eebf9d1096bd1c78fd0c7ae1817874 100644 (file)
@@ -581,6 +581,9 @@ class ArchAction( Action ):
             pass
         elif host.match( '*-*-solaris*' ):
             pass
+        elif host.match( '*-*-freebsd.*' ):
+            self.mode['i386']   = 'i386-portsbuild-freebsd%s' % (host.release)
+            self.mode['amd64'] = 'amd64-portsbuild-freebsd%s' % (host.release)
         else:
             self.msg_pass = 'WARNING'
 
@@ -1284,16 +1287,18 @@ def createCLI():
     h = IfHost( 'enable assembly code in non-contrib modules', 'NOMATCH*-*-darwin*', 'NOMATCH*-*-linux*', none=optparse.SUPPRESS_HELP ).value
     grp.add_option( '--enable-asm', default=False, action='store_true', help=h )
 
-    h = IfHost( 'disable GTK GUI', '*-*-linux*', none=optparse.SUPPRESS_HELP ).value
+    h = IfHost( 'disable GTK GUI', '*-*-linux*', '*-*-freebsd*', none=optparse.SUPPRESS_HELP ).value
     grp.add_option( '--disable-gtk', default=False, action='store_true', help=h )
 
-    h = IfHost( 'disable GTK GUI update checks', '*-*-linux*', none=optparse.SUPPRESS_HELP ).value
+    h = IfHost( 'disable GTK GUI update checks', '*-*-linux*', '*-*-freebsd*', none=optparse.SUPPRESS_HELP ).value
+
     grp.add_option( '--disable-gtk-update-checks', default=False, action='store_true', help=h )
 
     h = IfHost( 'enable GTK GUI (mingw)', '*-*-mingw*', none=optparse.SUPPRESS_HELP ).value
     grp.add_option( '--enable-gtk-mingw', default=False, action='store_true', help=h )
 
-    h = IfHost( 'disable GStreamer (live preview)', '*-*-linux*', none=optparse.SUPPRESS_HELP ).value
+    h = IfHost( 'disable GStreamer (live preview)', '*-*-linux*', '*-*-freebsd*', none=optparse.SUPPRESS_HELP ).value
+
     grp.add_option( '--disable-gst', default=False, action='store_true', help=h )
 
     h = IfHost( 'enable Intel Quick Sync Video (QSV) hardware acceleration', '*-*-*', none=optparse.SUPPRESS_HELP ).value
@@ -1345,7 +1350,7 @@ def createCLI():
     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 )
 
-    h = IfHost( 'Build extra contribs for flatpak packaging', '*-*-linux*', none=optparse.SUPPRESS_HELP ).value
+    h = IfHost( 'Build extra contribs for flatpak packaging', '*-*-linux*', '*-*-freebsd*', none=optparse.SUPPRESS_HELP ).value
     grp.add_option( '--flatpak', default=False, action='store_true', help=h )
     cli.add_option_group( grp )
 
@@ -1894,8 +1899,11 @@ int main()
             doc.add( 'HAS.regex', 1 )
         if strtok_r.fail:
             doc.add( 'COMPAT.strtok_r', 1 )
+
     else:
         doc.addBlank()
+        if build.system == 'freebsd':
+            doc.add( 'HAS.pthread', 1 )
         if not strerror_r.fail:
             doc.add( 'HAS.strerror_r', 1 )
 
@@ -1929,6 +1937,8 @@ int main()
         doc.add( 'LIBHB.GCC.D', 'ARCH_X86_32', append=True )
     elif build.match( 'x86_64-*' ):
         doc.add( 'LIBHB.GCC.D', 'ARCH_X86_64', append=True )
+    elif build.match( 'amd64-*' ):
+        doc.add( 'LIBHB.GCC.D', 'ARCH_X86_64', append=True )
 
     if options.enable_asm and ( not Tools.yasm.fail or options.enable_local_yasm ):
         asm = ''
@@ -1941,7 +1951,7 @@ int main()
             else:
                 doc.add( 'LIBHB.YASM.f', 'elf32' )
             doc.add( 'LIBHB.YASM.m', 'x86' )
-        elif build.match( 'x86_64-*' ):
+        elif build.match( 'x86_64-*' ) or build.match( 'amd64-*' ):
             asm = 'x86'
             doc.add( 'LIBHB.GCC.D', 'HAVE_MMX ARCH_X86_64', append=True )
             if build.match( '*-*-darwin*' ):
index b724b6078b8333b5a9a2f5d491c640b2c8951edd..8a0b39dbc435ba36a11244b879120ecc9e2ad555 100644 (file)
@@ -136,6 +136,11 @@ ifeq (1-linux,$(FEATURE.gtk)-$(BUILD.system))
     MODULES += gtk
 endif
 
+ifeq (1-freebsd,$(FEATURE.gtk)-$(BUILD.system))
+    ## build gtk when gtk+freebsd
+    MODULES += gtk
+endif
+
 ifeq (1-kfreebsd,$(FEATURE.gtk)-$(BUILD.system))
     ## build gtk when gtk+kfreebsd
     MODULES += gtk
index 251debcf47ca1e234273abde205b1ae89c42bd2f..f575c8bed40be86d8ee3a76003928f9cb2a6a795 100644 (file)
@@ -1,5 +1,7 @@
 TARGET.dylib.ext = .so
 
+GCC.D       = LIBICONV_PLUG
+
 GCC.args.dylib = -shared
 GCC.args.pic   = 1
 
index 884d558d58f0e723b44b82c2634adaa677ef1bdc..2015bc21240a890561577c10b5c2e56396aa0be3 100644 (file)
@@ -62,7 +62,7 @@ else ifeq ($(BUILD.system),linux)
 else ifeq ($(BUILD.system),kfreebsd)
     TEST.GCC.l += pthread dl m
 else ifeq ($(BUILD.system),freebsd)
-    TEST.GCC.l += iconv pthread m
+    TEST.GCC.l += pthread m
 else ifeq ($(BUILD.system),solaris)
     TEST.GCC.l += pthread nsl socket
 ifneq (,$(filter $(BUILD.release),2.10))