Skip to contentSkip to conversation

libcap: rename existing patch

PATCH Superseded Thomas Petazzoni 4 participants 8 messages Nov 1, 2013 – Nov 4, 2013

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libcap: rename existing patch

libcap currently has one patch, but it is named using the old naming strategy, which includes the package version, but not a patch number. This commit switches this to use the new patch naming strategy.

---
 .../{libcap-2.22-build-system.patch => libcap-01-build-system.patch}      | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename package/libcap/{libcap-2.22-build-system.patch => libcap-01-build-system.patch} (100%)
package/libcap/libcap-01-build-system.patch renamed from package/libcap/libcap-2.22-build-system.patch +0 -0
similarity index 100%
rename from package/libcap/libcap-2.22-build-system.patch
rename to package/libcap/libcap-01-build-system.patch
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/2 libcap: rename existing patch

Dear Thomas Petazzoni,

package/libcap/libcap-01-build-system.patch

Quoted 15 lines · Thomas Petazzoni

libcap currently has one patch, but it is named using the old naming strategy, which includes the package version, but not a patch number. This commit switches this to use the new patch naming strategy.

---
 .../{libcap-2.22-build-system.patch => libcap-01-build-system.patch}      | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename package/libcap/{libcap-2.22-build-system.patch => libcap-01-build-system.patch} (100%)
package/libcap/libcap-01-build-system.patch renamed from package/libcap/libcap-2.22-build-system.patch +0 -0
similarity index 100%
rename from package/libcap/libcap-2.22-build-system.patch
rename to package/libcap/libcap-01-build-system.patch

Committed both patches to for-peter-2013.11, thanks.

Thomas

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

PATCH 1/2 libcap: rename existing patch

In reply to Thomas Petazzoni

Thomas, All,

On 2013-11-01 18:47 +0100, Thomas Petazzoni spake thusly:

Quoted 6 lines

libcap currently has one patch, but it is named using the old naming strategy, which includes the package version, but not a patch number. This commit switches this to use the new patch naming strategy.

Quoted 16 lines
---
 .../{libcap-2.22-build-system.patch => libcap-01-build-system.patch}      | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename package/libcap/{libcap-2.22-build-system.patch => libcap-01-build-system.patch} (100%)
package/libcap/libcap-01-build-system.patch renamed from package/libcap/libcap-2.22-build-system.patch +0 -0
similarity index 100%
rename from package/libcap/libcap-2.22-build-system.patch
rename to package/libcap/libcap-01-build-system.patch
Signature · 6 lines
1.8.1.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/2 libcap: rename existing patch

In reply to Thomas Petazzoni

2013/11/1 Thomas Petazzoni <[email protected]>

Quoted 7 lines

libcap currently has one patch, but it is named using the old naming strategy, which includes the package version, but not a patch number. This commit switches this to use the new patch naming strategy.

Regards,

Signature · 4 lines
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20131102/368a36b3/attachment.html>
#4 lore raw

PATCH 2/2 libcap: fix static link

In reply to Thomas Petazzoni

With BR2_PREFER_STATIC_LINK, libcap fails to build:

http://autobuild.buildroot.net/results/619bceb3491ecd2ed4e1ae552fdb237a0ed2fa47/build-end.log

This is due to the fact that it still tries to build a shared library. This commit fixes that by adding a patch that makes libcap provide install-shared/install-static targets. We also now only build the $(@D)/libcap subdirectory, so removing the build of the progs subdirectory is no longer needed.

---
 .../libcap-02-split-static-shared-install.patch    | 30 ++++++++++++++++++++++
 package/libcap/libcap.mk                           | 27 +++++++++----------
 2 files changed, 44 insertions(+), 13 deletions(-)
 create mode 100644 package/libcap/libcap-02-split-static-shared-install.patch
package/libcap/libcap-02-split-static-shared-install.patch new file +30 -0
new file mode 100644
index 0000000..21e7f2a
@@ -0,0 +1,30 @@
+libcap: split install into install-shared/install-static
+
+In order to support static only builds, split the install target into
+install-shared and install-static targets.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+
+Index: b/libcap/Makefile
+===================================================================
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -60,11 +60,17 @@
+ cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+ 	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+ 
+-install: all
++install: install-shared install-static
++
++install-common:
+ 	mkdir -p -m 0755 $(INCDIR)/sys
+ 	install -m 0644 include/sys/capability.h $(INCDIR)/sys
+ 	mkdir -p -m 0755 $(LIBDIR)
++
++install-static: install-common
+ 	install -m 0644 $(STALIBNAME) $(LIBDIR)/$(STALIBNAME)
++
++install-shared: install-common
+ 	install -m 0755 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME)
+ 	ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
+ 	ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME)
package/libcap/libcap.mk +14 -13
index 16afaef..17e2eb5 100644
@@ -25,29 +25,30 @@ endif
 # we don't have host-attr
 HOST_LIBCAP_DEPENDENCIES =
 
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+LIBCAP_MAKE_TARGET = libcap.a
+LIBCAP_MAKE_INSTALL_TARGET = install-static
+else
+LIBCAP_MAKE_TARGET = all
+LIBCAP_MAKE_INSTALL_TARGET = install
+endif
+
 define LIBCAP_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/libcap \
 		LIBATTR=$(LIBCAP_HAVE_LIBATTR) BUILD_CC="$(HOSTCC)" \
-		BUILD_CFLAGS="$(HOST_CFLAGS)"
+		BUILD_CFLAGS="$(HOST_CFLAGS)" $(LIBCAP_MAKE_TARGET)
 endef
 
 define LIBCAP_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
-		DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib install
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+		DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
 endef
 
 define LIBCAP_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
-		DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib install
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+		DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
 endef
 
-# progs use fork()
-define LIBCAP_DISABLE_PROGS
-	$(SED) '/-C progs/d' $(@D)/Makefile
-endef
-
-LIBCAP_POST_PATCH_HOOKS += LIBCAP_DISABLE_PROGS
-
 define HOST_LIBCAP_BUILD_CMDS
 	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) LIBATTR=no
 endef
Signature · 1 line
1.8.1.2
#5 lore raw

PATCH 2/2 libcap: fix static link

2013/11/1 Thomas Petazzoni <[email protected]>

Quoted 5 lines

With BR2_PREFER_STATIC_LINK, libcap fails to build:

http://autobuild.buildroot.net/results/619bceb3491ecd2ed4e1ae552fdb237a0ed2fa47/build-end.log

Quoted 8 lines

This is due to the fact that it still tries to build a shared library. This commit fixes that by adding a patch that makes libcap provide install-shared/install-static targets. We also now only build the $(@D)/libcap subdirectory, so removing the build of the progs subdirectory is no longer needed.

Regards,

Signature · 4 lines
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20131102/0359c586/attachment.html>
#6 lore raw

PATCH 2/2 libcap: fix static link

In reply to Thomas Petazzoni

Thomas, All,

On 2013-11-01 18:47 +0100, Thomas Petazzoni spake thusly:

Quoted 11 lines

With BR2_PREFER_STATIC_LINK, libcap fails to build:

http://autobuild.buildroot.net/results/619bceb3491ecd2ed4e1ae552fdb237a0ed2fa47/build-end.log

This is due to the fact that it still tries to build a shared library. This commit fixes that by adding a patch that makes libcap provide install-shared/install-static targets. We also now only build the $(@D)/libcap subdirectory, so removing the build of the progs subdirectory is no longer needed.

Quoted 97 lines
---
 .../libcap-02-split-static-shared-install.patch    | 30 ++++++++++++++++++++++
 package/libcap/libcap.mk                           | 27 +++++++++----------
 2 files changed, 44 insertions(+), 13 deletions(-)
 create mode 100644 package/libcap/libcap-02-split-static-shared-install.patch
package/libcap/libcap-02-split-static-shared-install.patch new file +30 -0
new file mode 100644
index 0000000..21e7f2a
@@ -0,0 +1,30 @@
+libcap: split install into install-shared/install-static
+
+In order to support static only builds, split the install target into
+install-shared and install-static targets.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+
+Index: b/libcap/Makefile
+===================================================================
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -60,11 +60,17 @@
+ cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+ 	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+ 
+-install: all
++install: install-shared install-static
++
++install-common:
+ 	mkdir -p -m 0755 $(INCDIR)/sys
+ 	install -m 0644 include/sys/capability.h $(INCDIR)/sys
+ 	mkdir -p -m 0755 $(LIBDIR)
++
++install-static: install-common
+ 	install -m 0644 $(STALIBNAME) $(LIBDIR)/$(STALIBNAME)
++
++install-shared: install-common
+ 	install -m 0755 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME)
+ 	ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
+ 	ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME)
package/libcap/libcap.mk +14 -13
index 16afaef..17e2eb5 100644
@@ -25,29 +25,30 @@ endif
 # we don't have host-attr
 HOST_LIBCAP_DEPENDENCIES =
 
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+LIBCAP_MAKE_TARGET = libcap.a
+LIBCAP_MAKE_INSTALL_TARGET = install-static
+else
+LIBCAP_MAKE_TARGET = all
+LIBCAP_MAKE_INSTALL_TARGET = install
+endif
+
 define LIBCAP_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/libcap \
 		LIBATTR=$(LIBCAP_HAVE_LIBATTR) BUILD_CC="$(HOSTCC)" \
-		BUILD_CFLAGS="$(HOST_CFLAGS)"
+		BUILD_CFLAGS="$(HOST_CFLAGS)" $(LIBCAP_MAKE_TARGET)
 endef
 
 define LIBCAP_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
-		DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib install
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+		DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
 endef
 
 define LIBCAP_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
-		DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib install
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+		DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
 endef
 
-# progs use fork()
-define LIBCAP_DISABLE_PROGS
-	$(SED) '/-C progs/d' $(@D)/Makefile
-endef
-
-LIBCAP_POST_PATCH_HOOKS += LIBCAP_DISABLE_PROGS
-
 define HOST_LIBCAP_BUILD_CMDS
 	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) LIBATTR=no
 endef
Signature · 6 lines
1.8.1.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#7 lore raw

PATCH 2/2 libcap: fix static link

In reply to Thomas Petazzoni
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

With BR2_PREFER_STATIC_LINK, libcap fails to build:

The symbol is called BR2_PREFER_STATIC_LIB.

Quoted 11 lines

http://autobuild.buildroot.net/results/619bceb3491ecd2ed4e1ae552fdb237a0ed2fa47/build-end.log

This is due to the fact that it still tries to build a shared library. This commit fixes that by adding a patch that makes libcap provide install-shared/install-static targets. We also now only build the $(@D)/libcap subdirectory, so removing the build of the progs subdirectory is no longer needed.

---
 .../libcap-02-split-static-shared-install.patch    | 30 ++++++++++++++++++++++

Don't forget to send the patch upstream.

Signature · 1 line
Bye, Peter Korsgaard