Skip to contentSkip to conversation

kmsxx: fix a few build failures

GIT PULL New Yann E. MORIN 2 participants 4 messages Aug 5, 2016

lore
Share & tools
lore
#0 lore raw

Hello All!

This short series fixes a few build failures for kmsxx when doing a static build.

Basically, only the shared libs were ever installed, and the install-staging command was not catching the failure (fortuantely, the install-target command did).

Regards,
Yann E. MORIN.

The following changes since commit 5879f0192e99982880aeff7da5bb934b202a6262

libsepol: fix static build (2016-08-05 15:48:48 +0200)

are available in the git repository at:

https://gitlab.com/ymorin/buildroot.git

for you to fetch changes up to f79ac35d1809e53962c3241c6483f3f7f1613603

package/kmsxx: fix static install (2016-08-05 20:02:30 +0200)

----------------------------------------------------------------
Yann E. MORIN (2):
package/kmsxx: detect failure at install-staging package/kmsxx: fix static install

 package/kmsxx/kmsxx.mk | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
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.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/2 package/kmsxx: detect failure at install-staging

Currently, the staging-install commands do not detect failures to install the libs.

That's because we use ';' to separate the commands, so we only get the result of the last one.

Fix that by using multi-line commands, so they each are called on their own and make would catch the failures.

Partially fixes (only detects the real failure):
http://autobuild.buildroot.org/results/82c/82cfb7451f933b222abe30b5d35d23e409a4af79
and a few others.

Cc Maxime Ripard <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/kmsxx/kmsxx.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/kmsxx/kmsxx.mk +2 -2
index d49ec8f..84c860c 100644
@@ -39,8 +39,8 @@ endef
 define KMSXX_INSTALL_STAGING_CMDS
 	$(foreach l,$(KMSXX_LIBS),\
 		$(INSTALL) -D -m 0755 $(@D)/lib/lib$(l).so \
-			$(STAGING_DIR)/usr/lib/lib$(l).so ; \
-		mkdir -p $(STAGING_DIR)/usr/include/$(l) ; \
+			$(STAGING_DIR)/usr/lib/lib$(l).so
+		mkdir -p $(STAGING_DIR)/usr/include/$(l)
 		cp -dpfr $(@D)/$(l)/inc/$(l)/* $(STAGING_DIR)/usr/include/$(l)/
 	)
 endef
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 package/kmsxx: fix static install

In reply to Yann E. MORIN

Currently, we only try to install the shared libraries.

However, when doing a static build, only the static libs are built, obviously.

Fix this by only installing relevant libraries.

Fixes:

    http://autobuild.buildroot.org/results/82c/82cfb7451f933b222abe30b5d35d23e409a4af79/
    http://autobuild.buildroot.org/results/bb3/bb3840f14382b6ed77d5947eb3ac5c229286681e/
Cc Maxime Ripard <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/kmsxx/kmsxx.mk | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
package/kmsxx/kmsxx.mk +11 -5
index 84c860c..df0ab23 100644
@@ -29,17 +29,23 @@ endif
 KMSXX_LIBS = kms++ kms++util
 
 define KMSXX_INSTALL_TARGET_CMDS
-	$(foreach l,$(KMSXX_LIBS),\
-		$(INSTALL) -D -m 0755 $(@D)/lib/lib$(l).so \
-			$(TARGET_DIR)/usr/lib/lib$(l).so
+	$(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),
+		$(foreach l,$(KMSXX_LIBS),\
+			$(INSTALL) -D -m 0755 $(@D)/lib/lib$(l).so \
+				$(TARGET_DIR)/usr/lib/lib$(l).so
+		)
 	)
 	$(KMSXX_INSTALL_TARGET_TESTS)
 endef
 
 define KMSXX_INSTALL_STAGING_CMDS
 	$(foreach l,$(KMSXX_LIBS),\
-		$(INSTALL) -D -m 0755 $(@D)/lib/lib$(l).so \
-			$(STAGING_DIR)/usr/lib/lib$(l).so
+		$(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),
+			$(INSTALL) -D -m 0755 $(@D)/lib/lib$(l).so \
+				$(STAGING_DIR)/usr/lib/lib$(l).so)
+		$(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),
+			$(INSTALL) -D -m 0755 $(@D)/lib/lib$(l).a \
+				$(STAGING_DIR)/usr/lib/lib$(l).a)
 		mkdir -p $(STAGING_DIR)/usr/include/$(l)
 		cp -dpfr $(@D)/$(l)/inc/$(l)/* $(STAGING_DIR)/usr/include/$(l)/
 	)
Signature · 1 line
2.7.4
#3 lore raw
In reply to Yann E. MORIN

Hello,

Quoted 3 lines · Yann E. MORIN

Yann E. MORIN (2):
package/kmsxx: detect failure at install-staging package/kmsxx: fix static install

Both applied, thanks!

Thomas

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