Skip to contentSkip to conversation

Drop X11 dependency of libpthread-stubs and libdrm

PATCH New Paul Cercueil 3 participants 6 messages Dec 20, 2013 – Apr 20, 2014

lore
Share & tools
lore
#0 lore raw

cover Drop X11 dependency of libpthread-stubs and libdrm

The 'pthread-stubs' package was recently renamed to 'xlib_libpthread-stubs'. This makes sense as libpthread-stubs is part of the X libraries.

However, this package does not have any real dependency, not even X11. This is inconsistent with the current package, which can only be enabled when BR2_PACKAGE_XORG7 is selected.

The first patch renames the 'xlib_libpthread-stubs' package into 'libpthread-stubs', and moves it to 'Libraries -> Other' in the config menu.

The second patch applies to libdrm, and removes the dependency towards X11, if no X11-specific driver was selected. This permits to build the Mesa3d library without X11.

#1 lore raw

PATCH 1/2 xlib_libpthread-stubs: Rename package to libpthread-stubs

While libpthread-stubs is part of the X libraries, it does not depend upon X11 or any other X library. On the current architecture, X11 must be enabled for this package to be selectionned; this commit aims to address this problem.

---
 Config.in.legacy                                     | 15 ++++++++++++---
 package/Config.in                                    |  1 +
 package/libpthread-stubs/Config.in                   | 11 +++++++++++
 package/libpthread-stubs/libpthread-stubs.mk         | 20 ++++++++++++++++++++
 package/x11r7/Config.in                              |  1 -
 package/x11r7/libxcb/Config.in                       |  2 +-
 package/x11r7/libxcb/libxcb.mk                       |  2 +-
 package/x11r7/xlib_libpthread-stubs/Config.in        | 11 -----------
 .../xlib_libpthread-stubs/xlib_libpthread-stubs.mk   | 20 --------------------
 9 files changed, 46 insertions(+), 37 deletions(-)
 create mode 100644 package/libpthread-stubs/Config.in
 create mode 100644 package/libpthread-stubs/libpthread-stubs.mk
 delete mode 100644 package/x11r7/xlib_libpthread-stubs/Config.in
 delete mode 100644 package/x11r7/xlib_libpthread-stubs/xlib_libpthread-stubs.mk
Config.in.legacy +12 -3
index 09935f1..97edb01 100644
@@ -382,11 +382,20 @@ config BR2_PACKAGE_XSERVER_tinyx
 config BR2_PACKAGE_PTHREAD_STUBS
 	bool "pthread-stubs option has been renamed"
 	select BR2_LEGACY
-	select BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS
-	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_LIBPTHREAD_STUBS
 	help
 	  For consistency reason, the pthread-stubs package has been
-	  renamed to xlib_libpthread-stubs.
+	  renamed to libpthread-stubs.
+
+config BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS
+	bool "xlib-libpthread-stubs option has been renamed"
+	depends on BR2_PACKAGE_XORG7
+	select BR2_LEGACY
+	select BR2_PACKAGE_LIBPTHREAD_STUBS
+	help
+	  The pthread stubs do not depend on X11 nor Xlib. Thus the
+	  package has been renamed
+	  BR2_PACKAGE_LIBPTHREAD_STUBS
 
 ###############################################################################
 comment "Legacy options removed in 2012.08"
package/Config.in +1 -0
index 311cc6c..e6ccc6a 100644
@@ -698,6 +698,7 @@ source "package/libical/Config.in"
 source "package/liblog4c-localtime/Config.in"
 source "package/libnspr/Config.in"
 source "package/libpfm4/Config.in"
+source "package/libpthread-stubs/Config.in"
 source "package/libpthsem/Config.in"
 source "package/libseccomp/Config.in"
 source "package/libsigc/Config.in"
package/libpthread-stubs/Config.in new file +11 -0
new file mode 100644
index 0000000..a4ce1cb
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_LIBPTHREAD_STUBS
+	bool "libpthread-stubs"
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  This library provides weak aliases for pthread functions not
+	  provided in libc or otherwise available by default.
+
+	  http://xcb.freedesktop.org/
+
+comment "libpthread-stubs needs a toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/libpthread-stubs/libpthread-stubs.mk new file +20 -0
new file mode 100644
index 0000000..b72e5a6
@@ -0,0 +1,20 @@
+################################################################################
+#
+# libpthread-stubs
+#
+################################################################################
+
+LIBPTHREAD_STUBS_VERSION = 0.3
+LIBPTHREAD_STUBS_SOURCE = libpthread-stubs-$(LIBPTHREAD_STUBS_VERSION).tar.bz2
+LIBPTHREAD_STUBS_SITE = http://xcb.freedesktop.org/dist/
+LIBPTHREAD_STUBS_LICENSE = MIT
+LIBPTHREAD_STUBS_LICENSE_FILES = COPYING
+
+LIBPTHREAD_STUBS_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+LIBPTHREAD_STUBS_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -pthread"
+endif
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
package/x11r7/Config.in +0 -1
index a534df9..fb0f8ed 100644
@@ -52,7 +52,6 @@ if BR2_PACKAGE_XORG7
 		source package/x11r7/xlib_libxkbfile/Config.in
 		source package/x11r7/xlib_xtrans/Config.in
 		source package/x11r7/xlib_libpciaccess/Config.in
-		source package/x11r7/xlib_libpthread-stubs/Config.in
 	endmenu
 	menu "X11R7 Applications"
 		source package/x11r7/xapp_appres/Config.in
package/x11r7/libxcb/Config.in +1 -1
index 1e1afb4..32569f7 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_LIBXCB
 	bool "libxcb"
-	select BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS
+	select BR2_PACKAGE_LIBPTHREAD_STUBS
 	select BR2_PACKAGE_XCB_PROTO
 	select BR2_PACKAGE_XLIB_LIBXDMCP
 	select BR2_PACKAGE_XLIB_LIBXAU
package/x11r7/libxcb/libxcb.mk +1 -1
index dfcf6fa..22197e3 100644
@@ -13,7 +13,7 @@ LIBXCB_LICENSE_FILES = COPYING
 LIBXCB_INSTALL_STAGING = YES
 
 LIBXCB_DEPENDENCIES = \
-	host-libxslt xlib_libpthread-stubs xcb-proto xlib_libXdmcp xlib_libXau \
+	host-libxslt libpthread-stubs xcb-proto xlib_libXdmcp xlib_libXau \
 	host-xcb-proto host-python host-pkgconf
 LIBXCB_CONF_ENV = STAGING_DIR="$(STAGING_DIR)"
 LIBXCB_MAKE_OPT = XCBPROTO_XCBINCLUDEDIR=$(STAGING_DIR)/usr/share/xcb \
package/x11r7/xlib_libpthread-stubs/Config.in deleted +0 -11
deleted file mode 100644
index 6ce1b94..0000000
@@ -1,11 +0,0 @@
-config BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS
-	bool "libpthread-stubs"
-	depends on BR2_TOOLCHAIN_HAS_THREADS
-	help
-	  This library provides weak aliases for pthread functions not
-	  provided in libc or otherwise available by default.
-
-	  http://xcb.freedesktop.org/
-
-comment "libpthread-stubs needs a toolchain w/ threads"
-	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/x11r7/xlib_libpthread-stubs/xlib_libpthread-stubs.mk deleted +0 -20
deleted file mode 100644
index 6343691..0000000
@@ -1,20 +0,0 @@
-################################################################################
-#
-# xlib_libpthread-stubs
-#
-################################################################################
-
-XLIB_LIBPTHREAD_STUBS_VERSION = 0.3
-XLIB_LIBPTHREAD_STUBS_SOURCE = libpthread-stubs-$(XLIB_LIBPTHREAD_STUBS_VERSION).tar.bz2
-XLIB_LIBPTHREAD_STUBS_SITE = http://xcb.freedesktop.org/dist/
-XLIB_LIBPTHREAD_STUBS_LICENSE = MIT
-XLIB_LIBPTHREAD_STUBS_LICENSE_FILES = COPYING
-
-XLIB_LIBPTHREAD_STUBS_INSTALL_STAGING = YES
-
-ifeq ($(BR2_PREFER_STATIC_LIB),y)
-XLIB_LIBPTHREAD_STUBS_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -pthread"
-endif
-
-$(eval $(autotools-package))
-$(eval $(host-autotools-package))
Signature · 1 line
1.8.5.1
#2 lore raw

PATCH 2/2 libdrm: Remove dependency towards X11

In reply to Paul Cercueil
---
 package/libdrm/Config.in | 8 +++++---
 package/libdrm/libdrm.mk | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)
package/libdrm/Config.in +5 -3
index 205f47c..51d8e58 100644
@@ -1,8 +1,7 @@
 config BR2_PACKAGE_LIBDRM
 	bool "libdrm"
-	select BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS
-	depends on BR2_PACKAGE_XORG7
 	depends on BR2_LARGEFILE
+	select BR2_PACKAGE_LIBPTHREAD_STUBS
 	help
 	  Direct Rendering Manager
 
@@ -14,6 +13,7 @@ menu "DRM Drivers"
 
 config BR2_PACKAGE_LIBDRM_INTEL
 	bool "intel"
+	depends on BR2_PACKAGE_XORG7
 	select BR2_PACKAGE_LIBATOMIC_OPS
 	select BR2_PACKAGE_XLIB_LIBPCIACCESS
 	depends on BR2_i386 || BR2_x86_64
@@ -22,6 +22,7 @@ config BR2_PACKAGE_LIBDRM_INTEL
 
 config BR2_PACKAGE_LIBDRM_RADEON
 	bool "radeon"
+	depends on BR2_PACKAGE_XORG7
 	select BR2_PACKAGE_LIBATOMIC_OPS
 	select BR2_PACKAGE_XLIB_LIBPCIACCESS
 	depends on BR2_i386 || BR2_x86_64
@@ -30,6 +31,7 @@ config BR2_PACKAGE_LIBDRM_RADEON
 
 config BR2_PACKAGE_LIBDRM_NOUVEAU
 	bool "nouveau"
+	depends on BR2_PACKAGE_XORG7
 	select BR2_PACKAGE_XLIB_LIBPCIACCESS
 	depends on BR2_i386 || BR2_x86_64
 	help
@@ -37,6 +39,7 @@ config BR2_PACKAGE_LIBDRM_NOUVEAU
 
 config BR2_PACKAGE_LIBDRM_VMWGFX
 	bool "vmwgfx"
+	depends on BR2_PACKAGE_XORG7
 	select BR2_PACKAGE_XLIB_LIBPCIACCESS
 	depends on BR2_i386 || BR2_x86_64
 	help
@@ -65,5 +68,4 @@ endmenu
 endif
 
 comment "libdrm needs a toolchain w/ largefile"
-	depends on BR2_PACKAGE_XORG7
 	depends on !BR2_LARGEFILE
package/libdrm/libdrm.mk +1 -1
index f5efaf1..dd08af1 100644
@@ -12,7 +12,7 @@ LIBDRM_LICENSE = MIT
 LIBDRM_INSTALL_STAGING = YES
 
 LIBDRM_DEPENDENCIES = \
-	xlib_libpthread-stubs \
+	libpthread-stubs \
 	host-pkgconf
 
 LIBDRM_CONF_OPT = \
Signature · 1 line
1.8.5.1
#3 lore raw

cover Drop X11 dependency of libpthread-stubs and libdrm

In reply to Paul Cercueil

Dear Paul Cercueil,

Quoted 7 lines · Paul Cercueil

The 'pthread-stubs' package was recently renamed to 'xlib_libpthread-stubs'. This makes sense as libpthread-stubs is part of the X libraries.

However, this package does not have any real dependency, not even X11. This is inconsistent with the current package, which can only be enabled when BR2_PACKAGE_XORG7 is selected.

Quoted 7 lines

The first patch renames the 'xlib_libpthread-stubs' package into 'libpthread-stubs', and moves it to 'Libraries -> Other' in the config menu.

The second patch applies to libdrm, and removes the dependency towards X11, if no X11-specific driver was selected. This permits to build the Mesa3d library without X11.

Just wanted to mention that these patches are very similar to the ones sent by Spenser quite a long time ago:

http://patchwork.ozlabs.org/patch/278296/
http://patchwork.ozlabs.org/patch/278297/

Thomas

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

cover Drop X11 dependency of libpthread-stubs and libdrm

Thomas Petazzoni
<[email protected]> wrote
in news:20131220165345.7cdfe46b at skate:

Quoted 5 lines

Just wanted to mention that these patches are very similar to the ones sent by Spenser quite a long time ago:

http://patchwork.ozlabs.org/patch/278296/
http://patchwork.ozlabs.org/patch/278297/

Hi,

yes, they are similar, but Paul addressed the hints given by you to Spenser?s original patches. As Spenser seems to lack time[1] and Paul?s patches apply without errors upon git HEAD it maybe a good idea to have a look at them again ;)

Currently I am compile-testing Paul?s patches...

Regards, Bernd

[1] http://article.gmane.org/gmane.comp.lib.uclibc.buildroot/73716

#5 lore raw

cover Drop X11 dependency of libpthread-stubs and libdrm

In reply to Paul Cercueil

Dear Paul Cercueil,

Quoted 7 lines · Paul Cercueil

The 'pthread-stubs' package was recently renamed to 'xlib_libpthread-stubs'. This makes sense as libpthread-stubs is part of the X libraries.

However, this package does not have any real dependency, not even X11. This is inconsistent with the current package, which can only be enabled when BR2_PACKAGE_XORG7 is selected.

Quoted 7 lines

The first patch renames the 'xlib_libpthread-stubs' package into 'libpthread-stubs', and moves it to 'Libraries -> Other' in the config menu.

The second patch applies to libdrm, and removes the dependency towards X11, if no X11-specific driver was selected. This permits to build the Mesa3d library without X11.

Thanks for these patches! However, in the mean time we've merged other similar patches, which on IRC you agreed are good replacements for your patches. Therefore, I've marked these two patches as Superseded in patchwork.

Thanks,

Thomas

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