Skip to contentSkip to conversation

package/sdl2_ttf: x-includes and x-libraries must be set for cross-compiling

PATCH New Romain Naour 2 participants 2 messages Jul 23, 2016 – Jul 24, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/sdl2_ttf: x-includes and x-libraries must be set for cross-compiling

If those flags are not explicitly passed, the sdl2_ttf configure script will include -I/usr/include and -L/usr/lib in the compile flags, which are obviously unsafe for cross-compilation.

"checking for X... libraries /usr/lib, headers /usr/include"

Fixes:
http://autobuild.buildroot.net/results/f96/f968fb31e9882cc856296a7c729d93e345e9e861

---
 package/sdl2_ttf/sdl2_ttf.mk | 11 +++++++++++
 1 file changed, 11 insertions(+)
package/sdl2_ttf/sdl2_ttf.mk +11 -0
index 71c5bc7..e1674a1 100644
@@ -14,4 +14,15 @@ SDL2_TTF_DEPENDENCIES = sdl2 freetype host-pkgconf
 SDL2_TTF_CONF_ENV = \
 	FREETYPE_CONFIG=$(STAGING_DIR)/usr/bin/freetype-config
 
+# x-includes and x-libraries must be set for cross-compiling
+# By default x_includes and x_libraries contains unsafe paths.
+# (/usr/include and /usr/lib)
+ifeq ($(BR2_PACKAGE_SDL2_X11),y)
+SDL2_TTF_CONF_OPTS += --with-x=$(STAGING_DIR) \
+	--x-includes=$(STAGING_DIR)/usr/include \
+	--x-libraries=$(STAGING_DIR)/usr/lib
+else
+SDL2_TTF_CONF_OPTS += --with-x=no
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
2.5.5
#1 lore raw

PATCH 1/1 package/sdl2_ttf: x-includes and x-libraries must be set for cross-compiling

Hello,

package/sdl2_ttf/sdl2_ttf.mk SDL2_TTF_DEPENDENCIES = sdl2 freetype host-pkgconf · line 21

Quoted 5 lines · Romain Naour
package/sdl2_ttf/sdl2_ttf.mk +5 -0
+# x-includes and x-libraries must be set for cross-compiling
+# By default x_includes and x_libraries contains unsafe paths.
+# (/usr/include and /usr/lib)
+ifeq ($(BR2_PACKAGE_SDL2_X11),y)
+SDL2_TTF_CONF_OPTS += --with-x=$(STAGING_DIR) \

I *think* --with-x doesn't look at its argument, so I've changed this to just --with-x.

package/sdl2_ttf/sdl2_ttf.mk SDL2_TTF_DEPENDENCIES = sdl2 freetype host-pkgconf · line 25

Quoted 4 lines
package/sdl2_ttf/sdl2_ttf.mk +4 -0
+	--x-includes=$(STAGING_DIR)/usr/include \
+	--x-libraries=$(STAGING_DIR)/usr/lib
+else
+SDL2_TTF_CONF_OPTS += --with-x=no

And I've changed this to --without-x.

Applied with those changes. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com