* [Buildroot] [PATCH v2 1/2] package/lockdev: handle static/shared only build
@ 2015-01-06 23:06 Romain Naour
2015-01-06 23:06 ` [Buildroot] [PATCH v2 2/2] package/lockdev: use LOCKDEV_MAJOR to create symbolic links Romain Naour
2015-01-07 21:01 ` [Buildroot] [PATCH v2 1/2] package/lockdev: handle static/shared only build Thomas Petazzoni
0 siblings, 2 replies; 4+ messages in thread
From: Romain Naour @ 2015-01-06 23:06 UTC (permalink / raw)
To: buildroot
Add a patch to install headers and static library separately.
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
v2: Headers must always be installed in staging,
remove static library installation from install_dev target (ThomasP)
---
...stall-static-library-and-headers-separate.patch | 44 ++++++++++++++++++++++
package/lockdev/lockdev.mk | 35 ++++++++++-------
2 files changed, 66 insertions(+), 13 deletions(-)
create mode 100644 package/lockdev/0001-Makefile-install-static-library-and-headers-separate.patch
diff --git a/package/lockdev/0001-Makefile-install-static-library-and-headers-separate.patch b/package/lockdev/0001-Makefile-install-static-library-and-headers-separate.patch
new file mode 100644
index 0000000..d5a498a
--- /dev/null
+++ b/package/lockdev/0001-Makefile-install-static-library-and-headers-separate.patch
@@ -0,0 +1,44 @@
+From 0dcd2368c3e23a5cc1cc4a979d9c241ed9302236 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Sun, 4 Jan 2015 16:06:07 +0100
+Subject: [PATCH] Makefile: install static library and headers separately
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ Makefile | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index e27dcbd..ecf52d1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -45,12 +45,10 @@ perl-lib: static
+ cd LockDev && make OPTIMIZE="-O2 -g -Wall"
+ cd LockDev && make test
+
+-.PHONY: install install_dev install_dbg install_doc install_run
+-install: install_dev install_dbg install_doc install_run
++.PHONY: install install_dev install_dbg install_doc install_run install_static
++install: install_dev install_dbg install_doc install_run install_static
+
+-install_dev: ${static} src/lockdev.h
+- install -m755 -d ${libdir}
+- install -m644 ${static} ${libdir}
++install_dev: src/lockdev.h
+ install -m755 -d ${incdir}
+ install -m644 src/lockdev.h ${incdir}
+ install -m644 src/ttylock.h ${incdir}
+@@ -69,6 +67,10 @@ install_doc: docs/lockdev.3
+ install -m755 -d ${mandir}/man3
+ install -m644 docs/lockdev.3 ${mandir}/man3
+
++install_static: ${static}
++ install -m755 -d ${libdir}
++ install -m644 ${static} ${libdir}
++
+ install_run: ${shared}
+ install -m755 -d ${libdir}
+ install -m644 ${shared} ${libdir}
+--
+1.9.3
+
diff --git a/package/lockdev/lockdev.mk b/package/lockdev/lockdev.mk
index 59561ba..11142e6 100644
--- a/package/lockdev/lockdev.mk
+++ b/package/lockdev/lockdev.mk
@@ -13,30 +13,39 @@ LOCKDEV_LICENSE_FILES = LICENSE
LOCKDEV_INSTALL_STAGING = YES
ifeq ($(BR2_STATIC_LIBS),y)
-define LOCKDEV_BUILD_CMDS
- $(MAKE1) $(TARGET_CONFIGURE_OPTS) -C $(@D) static
+LOCKDEV_BUILD_ARGS = static
+LOCKDEV_INSTALL_ARGS = install_static
+else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
+LOCKDEV_BUILD_ARGS = static shared
+LOCKDEV_INSTALL_ARGS = install_run install_static
+else # BR2_SHARED_LIBS
+LOCKDEV_BUILD_ARGS = shared
+LOCKDEV_INSTALL_ARGS = install_run
+endif
+
+ifeq ($(BR2_SHARED_STATIC_LIBS)$(BR2_SHARED_LIBS),y)
+define LOCKDEV_CREATE_LINKS_STAGING
+ ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so
+ ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so.1
endef
-define LOCKDEV_INSTALL_STAGING_CMDS
- $(MAKE1) basedir=$(STAGING_DIR)/usr -C $(@D) install_dev
+define LOCKDEV_CREATE_LINKS_TARGET
+ ln -sf liblockdev.$(LOCKDEV_VERSION).so $(TARGET_DIR)/usr/lib/liblockdev.so.1
endef
-
-else # BR2_STATIC_LIBS
+endif
define LOCKDEV_BUILD_CMDS
- $(MAKE1) $(TARGET_CONFIGURE_OPTS) -C $(@D) static shared
+ $(MAKE1) $(TARGET_CONFIGURE_OPTS) -C $(@D) $(LOCKDEV_BUILD_ARGS)
endef
define LOCKDEV_INSTALL_STAGING_CMDS
- $(MAKE1) basedir=$(STAGING_DIR)/usr -C $(@D) install_dev install_run
- ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so
- ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so.1
+ $(MAKE1) basedir=$(STAGING_DIR)/usr -C $(@D) $(LOCKDEV_INSTALL_ARGS) install_dev
+ $(LOCKDEV_CREATE_LINKS_STAGING)
endef
define LOCKDEV_INSTALL_TARGET_CMDS
- $(MAKE1) basedir=$(TARGET_DIR)/usr -C $(@D) install_run
- ln -sf liblockdev.$(LOCKDEV_VERSION).so $(TARGET_DIR)/usr/lib/liblockdev.so.1
+ $(MAKE1) basedir=$(TARGET_DIR)/usr -C $(@D) $(LOCKDEV_INSTALL_ARGS)
+ $(LOCKDEV_CREATE_LINKS_TARGET)
endef
-endif # BR2_STATIC_LIBS
$(eval $(generic-package))
--
1.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v2 2/2] package/lockdev: use LOCKDEV_MAJOR to create symbolic links
2015-01-06 23:06 [Buildroot] [PATCH v2 1/2] package/lockdev: handle static/shared only build Romain Naour
@ 2015-01-06 23:06 ` Romain Naour
2015-01-07 21:01 ` [Buildroot] [PATCH v2 1/2] package/lockdev: handle static/shared only build Thomas Petazzoni
1 sibling, 0 replies; 4+ messages in thread
From: Romain Naour @ 2015-01-06 23:06 UTC (permalink / raw)
To: buildroot
Thanks to Baruch Siach for the suggestion.
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
package/lockdev/lockdev.mk | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/package/lockdev/lockdev.mk b/package/lockdev/lockdev.mk
index 11142e6..8d2c760 100644
--- a/package/lockdev/lockdev.mk
+++ b/package/lockdev/lockdev.mk
@@ -4,7 +4,8 @@
#
################################################################################
-LOCKDEV_VERSION = 1.0.3
+LOCKDEV_MAJOR = 1
+LOCKDEV_VERSION = $(LOCKDEV_MAJOR).0.3
LOCKDEV_SOURCE = lockdev_$(LOCKDEV_VERSION).orig.tar.gz
LOCKDEV_PATCH = lockdev_$(LOCKDEV_VERSION)-1.6.diff.gz
LOCKDEV_SITE = http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/l/lockdev
@@ -26,11 +27,11 @@ endif
ifeq ($(BR2_SHARED_STATIC_LIBS)$(BR2_SHARED_LIBS),y)
define LOCKDEV_CREATE_LINKS_STAGING
ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so
- ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so.1
+ ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so.$(LOCKDEV_MAJOR)
endef
define LOCKDEV_CREATE_LINKS_TARGET
- ln -sf liblockdev.$(LOCKDEV_VERSION).so $(TARGET_DIR)/usr/lib/liblockdev.so.1
+ ln -sf liblockdev.$(LOCKDEV_VERSION).so $(TARGET_DIR)/usr/lib/liblockdev.so.$(LOCKDEV_MAJOR)
endef
endif
--
1.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v2 1/2] package/lockdev: handle static/shared only build
2015-01-06 23:06 [Buildroot] [PATCH v2 1/2] package/lockdev: handle static/shared only build Romain Naour
2015-01-06 23:06 ` [Buildroot] [PATCH v2 2/2] package/lockdev: use LOCKDEV_MAJOR to create symbolic links Romain Naour
@ 2015-01-07 21:01 ` Thomas Petazzoni
2015-01-07 21:17 ` Yann E. MORIN
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2015-01-07 21:01 UTC (permalink / raw)
To: buildroot
Dear Romain Naour,
On Wed, 7 Jan 2015 00:06:03 +0100, Romain Naour wrote:
> Add a patch to install headers and static library separately.
>
> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
> ---
> v2: Headers must always be installed in staging,
> remove static library installation from install_dev target (ThomasP)
Thanks, both patches applied. Can you submit upstream?
To be honest, I am wondering if it's really a good idea to patch all
package to make sure they only install shared libraries in a
BR2_SHARED_LIBS=y build. Ideally yes, but do we want to carry patches
in all packages that have a crazy build system, and are for many of
them essentially unmaintained? I don't know.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v2 1/2] package/lockdev: handle static/shared only build
2015-01-07 21:01 ` [Buildroot] [PATCH v2 1/2] package/lockdev: handle static/shared only build Thomas Petazzoni
@ 2015-01-07 21:17 ` Yann E. MORIN
0 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2015-01-07 21:17 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-01-07 22:01 +0100, Thomas Petazzoni spake thusly:
> On Wed, 7 Jan 2015 00:06:03 +0100, Romain Naour wrote:
> > Add a patch to install headers and static library separately.
> >
> > Signed-off-by: Romain Naour <romain.naour@openwide.fr>
> > ---
> > v2: Headers must always be installed in staging,
> > remove static library installation from install_dev target (ThomasP)
>
> Thanks, both patches applied. Can you submit upstream?
>
> To be honest, I am wondering if it's really a good idea to patch all
> package to make sure they only install shared libraries in a
> BR2_SHARED_LIBS=y build. Ideally yes, but do we want to carry patches
> in all packages that have a crazy build system, and are for many of
> them essentially unmaintained? I don't know.
Gustavo and I already discussed this on IRC a while back.
The basic idea was to have a way to identify bad packages, and somehow
mark them so that Buildroot would do the clean-up in a generic way.
Something like: FOO_IS_NOT_SHARED_ONLY_CLEAN = YES
and Buildroot would remove the .a files.
But there are some gotchas, since we can not blindly remove any and
every .a files, as some are really needed (from the toolchain, for
example, or because the package really only installs a .a because a .so
is meaningless).
Anyway, I'm still thinking about that...
Topic for the BDD, maybe?
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| 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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-01-07 21:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-06 23:06 [Buildroot] [PATCH v2 1/2] package/lockdev: handle static/shared only build Romain Naour
2015-01-06 23:06 ` [Buildroot] [PATCH v2 2/2] package/lockdev: use LOCKDEV_MAJOR to create symbolic links Romain Naour
2015-01-07 21:01 ` [Buildroot] [PATCH v2 1/2] package/lockdev: handle static/shared only build Thomas Petazzoni
2015-01-07 21:17 ` Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox