summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodeo <[email protected]>2014-02-07 19:21:19 +0000
committerRodeo <[email protected]>2014-02-07 19:21:19 +0000
commit903357b41263285e03bc83d41f9224d91ab4fb1a (patch)
treeec66076bdb7a914045486ffea66055cb4c40ab95
parent4b014e9417611581e70649f2bd7d950b1b2347b5 (diff)
build: use a local version of pkg-config when necessary (Darwin-only).
Automatically enabled when pkg-config detection fails, and can be forced with the --enable-local-pkgconfig configure option. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6019 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--contrib/libbluray/module.defs8
-rw-r--r--contrib/libdvdnav/module.defs7
-rw-r--r--contrib/libdvdread/module.defs7
-rw-r--r--contrib/pkgconfig/module.defs6
-rw-r--r--contrib/pkgconfig/module.rules2
-rw-r--r--make/configure.py9
-rw-r--r--make/include/main.defs4
7 files changed, 39 insertions, 4 deletions
diff --git a/contrib/libbluray/module.defs b/contrib/libbluray/module.defs
index 6c1c0f195..5a7b610e3 100644
--- a/contrib/libbluray/module.defs
+++ b/contrib/libbluray/module.defs
@@ -1,5 +1,4 @@
-__deps__ := LIBXML2 FREETYPE
-$(eval $(call import.MODULE.defs,LIBBLURAY,libbluray,$(__deps__)))
+$(eval $(call import.MODULE.defs,LIBBLURAY,libbluray,PKGCONFIG LIBXML2 FREETYPE))
$(eval $(call import.CONTRIB.defs,LIBBLURAY))
LIBBLURAY.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libbluray-0.5.0.tar.bz2
@@ -15,3 +14,8 @@ ifeq (none,$(LIBBLURAY.GCC.O))
endif
LIBBLURAY.CONFIGURE.extra += --disable-examples
+
+ifeq (1,$(FEATURE.local_pkgconfig))
+ LIBBLURAY.CONFIGURE.env = PATH="$(call fn.ABSOLUTE,$(CONTRIB.build/)bin):$(PATH)"
+ LIBBLURAY.BUILD.env = PATH="$(call fn.ABSOLUTE,$(CONTRIB.build/)bin):$(PATH)"
+endif
diff --git a/contrib/libdvdnav/module.defs b/contrib/libdvdnav/module.defs
index 0e22d2919..697e89988 100644
--- a/contrib/libdvdnav/module.defs
+++ b/contrib/libdvdnav/module.defs
@@ -1,4 +1,4 @@
-$(eval $(call import.MODULE.defs,LIBDVDNAV,libdvdnav,LIBDVDREAD))
+$(eval $(call import.MODULE.defs,LIBDVDNAV,libdvdnav,PKGCONFIG LIBDVDREAD))
$(eval $(call import.CONTRIB.defs,LIBDVDNAV))
LIBDVDNAV.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libdvdnav-a5c1325.tar.bz2
@@ -6,3 +6,8 @@ LIBDVDNAV.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libdvdnav-a
ifneq (max,$(LIBDVDNAV.GCC.g))
LIBDVDNAV.GCC.D += NDEBUG
endif
+
+ifeq (1,$(FEATURE.local_pkgconfig))
+ LIBDVDNAV.CONFIGURE.env = PATH="$(call fn.ABSOLUTE,$(CONTRIB.build/)bin):$(PATH)"
+ LIBDVDNAV.BUILD.env = PATH="$(call fn.ABSOLUTE,$(CONTRIB.build/)bin):$(PATH)"
+endif
diff --git a/contrib/libdvdread/module.defs b/contrib/libdvdread/module.defs
index 3dcfc8892..8efbc31ce 100644
--- a/contrib/libdvdread/module.defs
+++ b/contrib/libdvdread/module.defs
@@ -1,4 +1,4 @@
-$(eval $(call import.MODULE.defs,LIBDVDREAD,libdvdread))
+$(eval $(call import.MODULE.defs,LIBDVDREAD,libdvdread,PKGCONFIG))
$(eval $(call import.CONTRIB.defs,LIBDVDREAD))
LIBDVDREAD.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libdvdread-a2f211a.tar.bz2
@@ -6,3 +6,8 @@ LIBDVDREAD.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libdvdread
ifeq (1-mingw,$(BUILD.cross)-$(BUILD.system))
LIBDVDREAD.CONFIGURE.extra = --enable-dlfcn
endif
+
+ifeq (1,$(FEATURE.local_pkgconfig))
+ LIBDVDREAD.CONFIGURE.env = PATH="$(call fn.ABSOLUTE,$(CONTRIB.build/)bin):$(PATH)"
+ LIBDVDREAD.BUILD.env = PATH="$(call fn.ABSOLUTE,$(CONTRIB.build/)bin):$(PATH)"
+endif
diff --git a/contrib/pkgconfig/module.defs b/contrib/pkgconfig/module.defs
new file mode 100644
index 000000000..f87a343f3
--- /dev/null
+++ b/contrib/pkgconfig/module.defs
@@ -0,0 +1,6 @@
+$(eval $(call import.MODULE.defs,PKGCONFIG,pkgconfig))
+$(eval $(call import.CONTRIB.defs,PKGCONFIG))
+
+PKGCONFIG.FETCH.url = http://download.handbrake.fr/handbrake/contrib/pkg-config-0.28.tar.bz2
+
+PKGCONFIG.CONFIGURE.extra = --with-internal-glib --disable-host-tool
diff --git a/contrib/pkgconfig/module.rules b/contrib/pkgconfig/module.rules
new file mode 100644
index 000000000..3d6747c89
--- /dev/null
+++ b/contrib/pkgconfig/module.rules
@@ -0,0 +1,2 @@
+$(eval $(call import.MODULE.rules,PKGCONFIG))
+$(eval $(call import.CONTRIB.rules,PKGCONFIG))
diff --git a/make/configure.py b/make/configure.py
index 22bdce59f..9a9285cb1 100644
--- a/make/configure.py
+++ b/make/configure.py
@@ -1260,6 +1260,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 pkg-config', '*-*-darwin*', none=optparse.SUPPRESS_HELP ).value
+ grp.add_option( '--enable-local-pkgconfig', default=False, action='store_true', help=h )
cli.add_option_group( grp )
@@ -1430,6 +1432,7 @@ try:
autoconf = ToolProbe( 'AUTOCONF.exe', 'autoconf', abort=False )
automake = ToolProbe( 'AUTOMAKE.exe', 'automake', abort=False )
libtool = ToolProbe( 'LIBTOOL.exe', 'libtool', abort=False )
+ pkgconfig = ToolProbe( 'PKGCONFIG.exe', 'pkg-config', abort=False )
xcodebuild = ToolProbe( 'XCODEBUILD.exe', 'xcodebuild', abort=False )
lipo = ToolProbe( 'LIPO.exe', 'lipo', abort=False )
@@ -1501,6 +1504,11 @@ try:
stdout.write( 'note: enabling local autotools\n' )
options.enable_local_autotools = 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' )
+ options.enable_local_pkgconfig = True
+
if build.system == 'mingw':
dlfcn_test = """
#include <dlfcn.h>
@@ -1664,6 +1672,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_pkgconfig', int( options.enable_local_pkgconfig ))
doc.add( 'FEATURE.asm', 'disabled' )
doc.add( 'FEATURE.gtk', int( not options.disable_gtk ))
doc.add( 'FEATURE.gtk.update.checks', int( not options.disable_gtk_update_checks ))
diff --git a/make/include/main.defs b/make/include/main.defs
index dde127c9a..0cec07d0e 100644
--- a/make/include/main.defs
+++ b/make/include/main.defs
@@ -8,6 +8,10 @@ include $(SRC/)make/include/tool.defs
###############################################################################
+ifeq (1,$(FEATURE.local_pkgconfig))
+ MODULES += contrib/pkgconfig
+endif
+
ifeq (1,$(FEATURE.local_autotools))
MODULES += contrib/autoconf
MODULES += contrib/automake