0003-handle-static-shared-only-build.patch 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From a826c7c722db40bfedf00e51ce38411550ae8216 Mon Sep 17 00:00:00 2001
  2. From: Romain Naour <romain.naour@openwide.fr>
  3. Date: Thu, 25 Dec 2014 19:22:16 +0100
  4. Subject: [PATCH] Make.rules: Handle static/shared only build
  5. Do not build .a library when enable_static is set to "no"
  6. Do not build .so library when enable_shared is set to "no"
  7. Signed-off-by: Romain Naour <romain.naour@openwide.fr>
  8. ---
  9. Make.rules | 10 ++++++++--
  10. 1 file changed, 8 insertions(+), 2 deletions(-)
  11. diff --git a/Make.rules b/Make.rules
  12. index 3410d7b..d274e16 100644
  13. --- a/Make.rules
  14. +++ b/Make.rules
  15. @@ -9,7 +9,13 @@ ifneq ($(lib_name),)
  16. CFLAGS_LIB ?= -fPIC
  17. CFLAGS += $(CFLAGS_LIB)
  18. -libraries = $(lib_name).so $(lib_name).a
  19. +ifneq ($(enable_static),no)
  20. +libraries += $(lib_name).a
  21. +endif
  22. +
  23. +ifneq ($(enable_shared),no)
  24. +libraries += $(lib_name).so
  25. +endif
  26. .PHONY: library
  27. @@ -23,7 +29,7 @@ prerequisites = $(subst .o,.d,$(objects)) $(addsuffix .d,$(binaries))
  28. .PHONY: clean install
  29. -ifeq ($(static),1)
  30. +ifneq ($(enable_static),no)
  31. LDFLAGS += -static
  32. endif
  33. --
  34. 1.9.3