]> granicus.if.org Git - handbrake/commitdiff
build: Allows to use clang/clang++ compiler on FreeBSD.
authorYuichiro NAITO <naito.yuichiro@gmail.com>
Tue, 21 Aug 2018 01:42:30 +0000 (10:42 +0900)
committerBradley Sepos <bradley@bradleysepos.com>
Wed, 22 Aug 2018 10:10:32 +0000 (06:10 -0400)
LOCALBASE variable is used to indicate where FreeBSD ports are installed.
default is /usr/local.

contrib/ffmpeg/module.defs
libhb/module.defs
make/configure.py
make/variant/freebsd.defs
test/module.defs

index 9460b5e563895edb8da63ca622d86f5ea4ade238..87f236380b85a10aed071ed0070f6049cb11b182 100644 (file)
@@ -22,6 +22,11 @@ FFMPEG.CONFIGURE.build =
 FFMPEG.CONFIGURE.env.LOCAL_PATH = PATH="$(call fn.ABSOLUTE,$(CONTRIB.build/)bin):$(PATH)"
 FFMPEG.BUILD.env                = PATH="$(call fn.ABSOLUTE,$(CONTRIB.build/)bin):$(PATH)"
 
+ifeq (freebsd,$(BUILD.system))
+       FFMPEG.CONFIGURE.env += CFLAGS=-I$(LOCALBASE)/include
+       FFMPEG.CONFIGURE.env += LDFLAGS=-L$(LOCALBASE)/lib
+endif
+
 FFMPEG.CONFIGURE.extra = \
     --enable-gpl \
     --disable-doc \
index 3c45869f747633ee1748ab7f29633746c092ee13..593328b106da6c047475562b632d10c2d255ba74 100644 (file)
@@ -49,7 +49,7 @@ LIBHB.GCC.D += __LIBHB__ USE_PTHREAD
 LIBHB.GCC.I += $(LIBHB.build/) $(CONTRIB.build/)include
 
 ifeq ($(BUILD.system),freebsd)
-    LIBHB.GCC.I += /usr/local/include/libxml2
+    LIBHB.GCC.I += $(LOCALBASE)/include/libxml2
 else ifneq (,$(filter $(BUILD.system),darwin cygwin mingw))
     LIBHB.GCC.I += $(CONTRIB.build/)include/libxml2
 else
index c3eeee34dfb9f832998d85f04ab1afccd80f9c01..3a9d1c257cd9dead652cb4cbb2fd66d1548013b2 100644 (file)
@@ -1512,7 +1512,7 @@ try:
     class Tools:
         ar    = ToolProbe( 'AR.exe',    'ar', abort=True )
         cp    = ToolProbe( 'CP.exe',    'cp', abort=True )
-        gcc   = ToolProbe( 'GCC.gcc',   'gcc', IfHost( 'gcc-4', '*-*-cygwin*' ))
+        gcc   = ToolProbe( 'GCC.gcc',   'gcc', IfHost( 'clang', '*-*-freebsd*' ), IfHost( 'gcc-4', '*-*-cygwin*' ))
 
         if host.match( '*-*-darwin*' ):
             gmake = ToolProbe( 'GMAKE.exe', 'make', 'gmake', abort=True )
index f575c8bed40be86d8ee3a76003928f9cb2a6a795..d8a7245f80d92256d8248b712d0e06a9425aa34f 100644 (file)
@@ -1,5 +1,10 @@
+# LOCALBASE is where FreeBSD ports are installed. default is '/usr/local'.
+LOCALBASE  ?= /usr/local
+
 TARGET.dylib.ext = .so
 
+GCC.I       = $(LOCALBASE)/include
+GCC.L       = $(LOCALBASE)/lib
 GCC.D       = LIBICONV_PLUG
 
 GCC.args.dylib = -shared
index 2ecbb076787369abe1516e7dd73656be77ce7708..eaa10ea69940a135e6a72de1a175d286330ed052 100644 (file)
@@ -81,6 +81,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 += $(LOCALBASE)/lib
     TEST.GCC.l += pthread m
 else ifeq ($(BUILD.system),solaris)
     TEST.GCC.l += pthread nsl socket