1 ADDON_DEPS_DIR := $(BUILDDIR)/$(PLATFORM)/build/depends
2 TOOLCHAIN_FILE = $(ADDON_DEPS_DIR)/share/Toolchain_binaddons.cmake
3 ADDON_PROJECT_DIR = $(BUILDDIR)/../../../../cmake/addons
4 export PKG_CONFIG_LIBDIR = $(ADDON_DEPS_DIR)/lib/pkgconfig
6 ifeq ($(CROSS_COMPILING),yes)
7 DEPS = $(TOOLCHAIN_FILE) $(abs_top_srcdir)/target/config-binaddons.site $(abs_top_srcdir)/target/Toolchain_binaddons.cmake $(CONFIG_SUB) $(CONFIG_GUESS)
8 TOOLCHAIN = -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE)
10 DEPS += linux-system-libs linux-system-x11-libs
12 ifeq ($(RENDER_SYSTEM),gl)
13 DEPS += linux-system-gl-libs
15 DEPS += linux-system-gles-libs
28 ifeq (darwin, $(findstring darwin, $(HOST)))
29 INSTALL_PREFIX = ../../../../../addons/
30 CMAKE_EXTRA = -DPACKAGE_ZIP=ON
34 ifneq (darwin, $(findstring darwin, $(HOST)))
35 INSTALL_PREFIX = $(PREFIX) -DOVERRIDE_PATHS=ON
37 ifeq ($(TARGET_PLATFORM),webos)
38 INSTALL_PREFIX = $(PREFIX)/addons
39 CMAKE_EXTRA = -DPACKAGE_ZIP=ON
42 CMAKE_EXTRA += -DAUTOCONF_FILES="$(CONFIG_SUB) $(CONFIG_GUESS)"
45 ifneq ($(TARBALLS_LOCATION),)
46 CMAKE_EXTRA += -DTARBALL_DIR=$(TARBALLS_LOCATION)
49 ifneq ($(ADDON_SRC_PREFIX),)
50 CMAKE_EXTRA += -DADDON_SRC_PREFIX=$(ADDON_SRC_PREFIX)
53 ifneq ($(ADDONS_DEFINITION_DIR),)
54 CMAKE_EXTRA += -DADDONS_DEFINITION_DIR=$(ADDONS_DEFINITION_DIR)
57 ifneq ($(EXTRA_CMAKE_ARGS),)
58 CMAKE_EXTRA += $(EXTRA_CMAKE_ARGS)
62 MAKE_PACKAGE = package-
65 all: .installed-$(PLATFORM)
69 rm -f .installed-$(PLATFORM)
72 rm -rf $(PLATFORM) .installed-$(PLATFORM) native
74 .installed-$(PLATFORM): $(DEPS)
75 cd $(ADDON_PROJECT_DIR) && (git clean -xfd || rm -rf CMakeCache.txt CMakeFiles cmake_install.cmake build/*)
79 @echo "ERROR: please set PREFIX to the xbmc install path e.g. $(MAKE) PREFIX=/usr/local"
82 ifeq ($(CROSS_COMPILING),yes)
83 mkdir -p $(PLATFORM)/build/depends/share; \
84 cp -f $(abs_top_srcdir)/target/config-binaddons.site $(PLATFORM)/build/depends/share/config.site
87 $(CMAKE) -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) $(CMAKE_EXTRA) \
89 -DADDONS_TO_BUILD="$(ADDONS)" $(ADDON_PROJECT_DIR) -DBUILD_DIR=$(BUILDDIR)/$(PLATFORM)/build ;\
90 for addon in $$($(MAKE) supported_addons | awk '/^ALL_ADDONS_BUILDING: .*$$/ { first = $$1; $$1 = ""; print $$0 }'); do \
91 $(MAKE) $(MAKE_PACKAGE)$$addon && echo $$addon >> $(ADDON_PROJECT_DIR)/.success || echo $$addon >> $(ADDON_PROJECT_DIR)/.failure ;\
93 ifneq ($(CROSS_COMPILING),yes)
94 @[ -f $(ADDON_PROJECT_DIR)/.failure ] && echo "Following Addons failed to build:" $(shell cat $(ADDON_PROJECT_DIR)/.failure) || :
95 @cd $(PLATFORM); $(MAKE) need-sudo | grep -q TRUE && $(MAKE) sudo-install || :
99 $(TOOLCHAIN_FILE): $(abs_top_srcdir)/target/Toolchain_binaddons.cmake
100 mkdir -p $(ADDON_DEPS_DIR)/share
101 sed "s|@CMAKE_FIND_ROOT_PATH@|$(ADDON_DEPS_DIR)|g" $(abs_top_srcdir)/target/Toolchain_binaddons.cmake > $@
103 HOST_LIBDIR := $(firstword $(wildcard /usr/lib64 /usr/lib/$(HOST)))
106 mkdir -p $(ADDON_DEPS_DIR)/lib
107 [ -f $(ADDON_DEPS_DIR)/lib/libm.so ] || ln -sf $(HOST_LIBDIR)/libm.so $(ADDON_DEPS_DIR)/lib/
109 linux-system-x11-libs:
110 mkdir -p $(ADDON_DEPS_DIR)/lib/pkgconfig $(ADDON_DEPS_DIR)/include
111 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/x11.pc ] || ln -sf $(HOST_LIBDIR)/pkgconfig/x*.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/
112 [ -f $(ADDON_DEPS_DIR)/lib/libX11.so ] || ln -sf $(HOST_LIBDIR)/libX11.so* $(ADDON_DEPS_DIR)/lib/
113 [ -L $(ADDON_DEPS_DIR)/include/X11 ] || ln -sf /usr/include/X11 $(ADDON_DEPS_DIR)/include/X11
114 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xproto.pc ] || ln -sf /usr/share/pkgconfig/x*.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/
115 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc ] || ln -sf /usr/share/pkgconfig/kbproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc
116 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/damageproto.pc ] || ln -sf /usr/share/pkgconfig/damageproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/damageproto.pc
117 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/fixesproto.pc ] || ln -sf /usr/share/pkgconfig/fixesproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/fixesproto.pc
118 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc ] || ln -sf $(HOST_LIBDIR)/pkgconfig/pthread-stubs.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc
119 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc ] || ln -sf $(HOST_LIBDIR)/pkgconfig/ice.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc
120 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc ] || ln -sf $(HOST_LIBDIR)/pkgconfig/sm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc
121 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc ] || ln -sf $(HOST_LIBDIR)/pkgconfig/libdrm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc
123 linux-system-gl-libs:
124 mkdir -p $(ADDON_DEPS_DIR)/lib/pkgconfig $(ADDON_DEPS_DIR)/include
125 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc ] || ln -sf $(HOST_LIBDIR)/pkgconfig/gl.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc
126 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/glu.pc ] || ln -sf $(HOST_LIBDIR)/pkgconfig/glu.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/glu.pc
127 [ -f $(ADDON_DEPS_DIR)/lib/libGL.so ] || ln -sf $(HOST_LIBDIR)/libGL.so $(ADDON_DEPS_DIR)/lib/libGL.so
128 [ -L $(ADDON_DEPS_DIR)/include/GL ] || ln -sf /usr/include/GL $(ADDON_DEPS_DIR)/include/GL
130 linux-system-gles-libs:
131 mkdir -p $(ADDON_DEPS_DIR)/lib/pkgconfig $(ADDON_DEPS_DIR)/include
132 [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/glesv2.pc ] || ln -sf $(PREFIX)/lib/pkgconfig/glesv2.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/glesv2.pc
133 [ -f $(ADDON_DEPS_DIR)/lib/libGLESv2.so ] || ln -sf $(PREFIX)/lib/libGLESv2.so $(ADDON_DEPS_DIR)/lib/libGLESv2.so
134 [ -L $(ADDON_DEPS_DIR)/include/GLES2 ] || ln -sf $(PREFIX)/include/GLES2 $(ADDON_DEPS_DIR)/include/GLES2
135 [ -L $(ADDON_DEPS_DIR)/include/KHR ] || ln -sf $(PREFIX)/include/KHR $(ADDON_DEPS_DIR)/include/KHR
136 [ -L $(ADDON_DEPS_DIR)/include/EGL ] || ln -sf $(PREFIX)/include/EGL $(ADDON_DEPS_DIR)/include/EGL
137 [ -f $(ADDON_DEPS_DIR)/lib/libEGL.so ] || ln -sf $(PREFIX)/lib/libEGL.so $(ADDON_DEPS_DIR)/lib/libEGL.so