python-pyasn: bump to version 1.6.0b1
[buildroot-gz.git] / package / ti-gfx / ti-gfx.mk
blob428878a08b6532fc5ffef82ac27ab73427da96a0
1 ################################################################################
3 # ti-gfx
5 ################################################################################
7 # SDK 5_01_01_01 only support EABIhf so we downgrade to 5_01_00_01 if EABIhf is
8 # not available.
9 ifeq ($(BR2_ARM_EABIHF),y)
10 TI_GFX_VERSION = 5_01_01_02
11 TI_GFX_SOURCE = Graphics_SDK_setuplinux_hardfp_$(TI_GFX_VERSION).bin
12 else
13 TI_GFX_VERSION = 5_01_00_01
14 TI_GFX_SOURCE = Graphics_SDK_setuplinux_softfp_$(TI_GFX_VERSION).bin
15 endif
17 TI_GFX_SO_VERSION = 1.10.2359475
18 TI_GFX_SITE = http://downloads.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsdk/$(TI_GFX_VERSION)/exports
19 TI_GFX_LICENSE = Technology / Software Publicly Available
20 TI_GFX_LICENSE_FILES = TSPA.txt
21 TI_GFX_INSTALL_STAGING = YES
23 TI_GFX_DEPENDENCIES = linux
25 TI_GFX_PROVIDES = libegl libgles powervr
27 ifeq ($(BR2_PACKAGE_TI_GFX_ES3),y)
28 TI_GFX_OMAPES = 3.x
29 TI_GFX_PLATFORM = omap3
30 endif
31 ifeq ($(BR2_PACKAGE_TI_GFX_ES5),y)
32 TI_GFX_OMAPES = 5.x
33 TI_GFX_PLATFORM = omap3630
34 endif
35 ifeq ($(BR2_PACKAGE_TI_GFX_ES6),y)
36 TI_GFX_OMAPES = 6.x
37 TI_GFX_PLATFORM = ti81xx
38 endif
39 ifeq ($(BR2_PACKAGE_TI_GFX_ES8),y)
40 TI_GFX_OMAPES = 8.x
41 TI_GFX_PLATFORM = ti335x
42 endif
44 ifeq ($(BR2_PACKAGE_TI_GFX_DEBUG),y)
45 TI_GFX_DEBUG_LIB = dbg
46 TI_GFX_DEBUG_KM = debug
47 else
48 TI_GFX_DEBUG_LIB = rel
49 TI_GFX_DEBUG_KM = release
50 endif
52 TI_GFX_BIN_PATH = gfx_$(TI_GFX_DEBUG_LIB)_es$(TI_GFX_OMAPES)
54 TI_GFX_KM_MAKE_OPTS = \
55 $(LINUX_MAKE_FLAGS) \
56 BUILD=$(TI_GFX_DEBUG_KM) \
57 TI_PLATFORM=$(TI_GFX_PLATFORM) \
58 OMAPES=$(TI_GFX_OMAPES) \
59 SUPPORT_XORG=0 \
60 KERNELDIR=$(LINUX_DIR)
62 TI_GFX_DEMO_MAKE_OPTS = \
63 PLATFORM=LinuxARMV7 \
64 X11BUILD=0 \
65 PLAT_CC="$(TARGET_CC)" \
66 PLAT_CPP="$(TARGET_CXX)" \
67 PLAT_AR="$(TARGET_AR)"
69 # The only required binary is pvrsrvctl all others are optional
70 TI_GFX_BIN = pvrsrvctl
72 ifeq ($(BR2_PACKAGE_TI_GFX_DEBUG),y)
73 TI_GFX_BIN += \
74 eglinfo ews_server ews_server_es2 ews_test_gles1 ews_test_gles2 \
75 ews_test_swrender gles1test1 gles2test1 pvr2d_test services_test \
76 sgx_blit_test sgx_clipblit_test sgx_flip_test sgx_init_test \
77 sgx_render_flip_test xeglinfo xgles1test1 xgles2test1 xmultiegltest
78 endif
80 TI_GFX_LIBS = \
81 libews libpvr2d libpvrEWS_WSEGL libpvrPVR2D_BLITWSEGL libpvrPVR2D_DRIWSEGL \
82 libpvrPVR2D_FLIPWSEGL libpvrPVR2D_FRONTWSEGL libpvrPVR2D_LINUXFBWSEGL \
83 libPVRScopeServices libsrv_init libsrv_um libusc pvr_drv
85 TI_GFX_EGLIMAGE_LIBS = \
86 libEGL libGLES_CM libGLESv2 libglslcompiler libIMGegl
88 TI_GFX_DEMOS = ChameleonMan MagicLantern
89 TI_GFX_DEMOS_LOC = GFX_Linux_SDK/OGLES2/SDKPackage/Demos
90 TI_GFX_DEMOS_MAKE_LOC = OGLES2/Build/LinuxGeneric
91 TI_GFX_DEMOS_BIN_LOC = OGLES2/Build/LinuxARMV7/ReleaseRaw/
93 TI_GFX_HDR_DIRS = OGLES2/EGL OGLES2/EWS OGLES2/GLES2 OGLES2/KHR \
94 OGLES/GLES bufferclass_ti/ pvr2d/ wsegl/
96 define TI_GFX_EXTRACT_CMDS
97 chmod +x $(DL_DIR)/$(TI_GFX_SOURCE)
98 printf "Y\nY\n qY\n\n" | $(DL_DIR)/$(TI_GFX_SOURCE) \
99 --prefix $(@D) \
100 --mode console
101 endef
103 define TI_GFX_BUILD_KM_CMDS
104 $(TARGET_MAKE_ENV) $(MAKE) $(TI_GFX_KM_MAKE_OPTS) -C $(@D)/GFX_Linux_KM all
105 endef
107 ifeq ($(BR2_PACKAGE_TI_GFX_DEMOS),y)
108 define TI_GFX_BUILD_DEMO_CMDS
109 $(foreach demo, $(TI_GFX_DEMOS), \
110 $(TARGET_MAKE_ENV) $(MAKE1) -C \
111 $(@D)/$(TI_GFX_DEMOS_LOC)/$(demo)/$(TI_GFX_DEMOS_MAKE_LOC) \
112 $(TI_GFX_DEMO_MAKE_OPTS) all
114 endef
115 endif
117 define TI_GFX_BUILD_CMDS
118 $(TI_GFX_BUILD_KM_CMDS)
119 $(TI_GFX_BUILD_DEMO_CMDS)
120 endef
122 # Install libs
123 # argument 1 is the location to install to (e.g. STAGING_DIR, TARGET_DIR)
124 define TI_GFX_INSTALL_LIBS
125 $(foreach lib,$(TI_GFX_LIBS),
126 $(INSTALL) -D -m 0644 $(@D)/$(TI_GFX_BIN_PATH)/$(lib).so \
127 $(1)/usr/lib/$(lib).so.$(TI_GFX_SO_VERSION); \
128 ln -sf $(lib).so.$(TI_GFX_SO_VERSION) \
129 $(1)/usr/lib/$(lib).so
131 $(foreach lib,$(TI_GFX_EGLIMAGE_LIBS),
132 $(if $(BR2_PACKAGE_TI_GFX_EGLIMAGE),
133 $(INSTALL) -D -m 0644 $(@D)/$(TI_GFX_BIN_PATH)/$(lib)_eglimage.so \
134 $(1)/usr/lib/$(lib).so.$(TI_GFX_SO_VERSION);
136 $(INSTALL) -D -m 0644 $(@D)/$(TI_GFX_BIN_PATH)/$(lib).so \
137 $(1)/usr/lib/$(lib).so.$(TI_GFX_SO_VERSION);
139 ln -sf $(lib).so.$(TI_GFX_SO_VERSION) \
140 $(1)/usr/lib/$(lib).so
142 endef
144 define TI_GFX_INSTALL_STAGING_CMDS
145 $(foreach incdir,$(TI_GFX_HDR_DIRS),
146 $(INSTALL) -d $(STAGING_DIR)/usr/include/$(notdir $(incdir)); \
147 $(INSTALL) -D -m 0644 $(@D)/include/$(incdir)/*.h \
148 $(STAGING_DIR)/usr/include/$(notdir $(incdir))/
150 $(call TI_GFX_INSTALL_LIBS,$(STAGING_DIR))
152 $(INSTALL) -D -m 0644 package/ti-gfx/egl.pc \
153 $(STAGING_DIR)/usr/lib/pkgconfig/egl.pc
154 $(INSTALL) -D -m 0644 package/ti-gfx/glesv2.pc \
155 $(STAGING_DIR)/usr/lib/pkgconfig/glesv2.pc
156 endef
158 define TI_GFX_INSTALL_KM_CMDS
159 $(TARGET_MAKE_ENV) $(MAKE) $(TI_GFX_KM_MAKE_OPTS) -C $(@D)/GFX_Linux_KM install
160 endef
162 define TI_GFX_INSTALL_BINS_CMDS
163 $(foreach bin,$(TI_GFX_BIN),
164 $(INSTALL) -D -m 0755 $(@D)/$(TI_GFX_BIN_PATH)/$(bin) \
165 $(TARGET_DIR)/usr/bin/$(bin)
167 $(if $(BR2_PACKAGE_TI_GFX_DEBUG),
168 $(INSTALL) -D -m 0755 package/ti-gfx/esrev.sh \
169 $(TARGET_DIR)/usr/sbin/esrev
171 endef
173 define TI_GFX_INSTALL_CONF_CMDS
174 # libs use the following file for configuration.
175 $(INSTALL) -D -m 0644 package/ti-gfx/powervr.ini \
176 $(TARGET_DIR)/etc/powervr.ini
177 endef
179 ifeq ($(BR2_PACKAGE_TI_GFX_DEMOS),y)
180 define TI_GFX_INSTALL_DEMOS_CMDS
181 $(foreach demo,$(TI_GFX_DEMOS),
182 $(INSTALL) -D -m 0755 \
183 $(@D)/$(TI_GFX_DEMOS_LOC)/$(demo)/$(TI_GFX_DEMOS_BIN_LOC)/OGLES2$(demo) \
184 $(TARGET_DIR)/usr/bin/OGLES2$(demo)
186 endef
187 endif
189 define TI_GFX_INSTALL_INIT_SYSV
190 $(INSTALL) -D -m 0755 package/ti-gfx/S80ti-gfx \
191 $(TARGET_DIR)/etc/init.d/S80ti-gfx
192 endef
194 define TI_GFX_INSTALL_INIT_SYSTEMD
195 $(INSTALL) -D -m 755 package/ti-gfx/S80ti-gfx \
196 $(TARGET_DIR)/usr/lib/systemd/scripts/ti-gfx
197 $(INSTALL) -D -m 644 package/ti-gfx/ti-gfx.service \
198 $(TARGET_DIR)/usr/lib/systemd/system/ti-gfx.service
199 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
200 ln -sf ../../../../usr/lib/systemd/system/ti-gfx.service \
201 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ti-gfx.service
202 endef
204 define TI_GFX_INSTALL_TARGET_CMDS
205 $(TI_GFX_INSTALL_KM_CMDS)
206 $(TI_GFX_INSTALL_BINS_CMDS)
207 $(call TI_GFX_INSTALL_LIBS,$(TARGET_DIR))
208 $(TI_GFX_INSTALL_CONF_CMDS)
209 $(TI_GFX_INSTALL_DEMOS_CMDS)
210 endef
212 $(eval $(generic-package))