Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] lm-sensors: fix static-only builds
@ 2014-07-09 20:50 Thomas Petazzoni
  2014-07-09 20:50 ` [Buildroot] [PATCH 2/3] lm-sensors: don't use host ldconfig Thomas Petazzoni
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2014-07-09 20:50 UTC (permalink / raw)
  To: buildroot

This commit adds a patch to lm-sensors to support a new variable
BUILD_SHARED_LIB that allows to conditionally enable or disable the
build (and usage) of the libsensors shared library.

It also refactors the make variables in a variable called
LM_SENSORS_MAKE_OPT.

Fixes:

  http://autobuild.buildroot.org/results/06c/06c197263e4939d6adc4877e152f602a69df751d/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../lm-sensors/lm-sensors-0001-static-build.patch  | 81 ++++++++++++++++++++++
 package/lm-sensors/lm-sensors.mk                   | 18 +++--
 2 files changed, 95 insertions(+), 4 deletions(-)
 create mode 100644 package/lm-sensors/lm-sensors-0001-static-build.patch

diff --git a/package/lm-sensors/lm-sensors-0001-static-build.patch b/package/lm-sensors/lm-sensors-0001-static-build.patch
new file mode 100644
index 0000000..c914d3a
--- /dev/null
+++ b/package/lm-sensors/lm-sensors-0001-static-build.patch
@@ -0,0 +1,81 @@
+Add support for static only build
+
+This patch adds support for a BUILD_SHARED_LIB variable that allows to
+enable/disable the build of the shared library, in order to support
+static-only builds.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/Makefile
+===================================================================
+--- a/Makefile
++++ b/Makefile
+@@ -85,6 +85,9 @@
+ # Build and install static library
+ BUILD_STATIC_LIB := 1
+ 
++# Build and install shared library
++BUILD_SHARED_LIB := 1
++
+ # Set these to add preprocessor or compiler flags, or use
+ # environment variables
+ # CFLAGS :=
+Index: b/lib/Module.mk
+===================================================================
+--- a/lib/Module.mk
++++ b/lib/Module.mk
+@@ -43,8 +43,14 @@
+ LIBSTLIBNAME := libsensors.a
+ LIBSHSONAME := libsensors.so.$(LIBMAINVER)
+ 
++ifeq ($(BUILD_SHARED_LIB),1)
+ LIBTARGETS := $(MODULE_DIR)/$(LIBSHLIBNAME) \
+               $(MODULE_DIR)/$(LIBSHSONAME) $(MODULE_DIR)/$(LIBSHBASENAME)
++LIBDEP     := $(LIBSHBASENAME)
++else
++LIBDEP     := $(LIBSTLIBNAME)
++endif
++
+ ifeq ($(BUILD_STATIC_LIB),1)
+ LIBTARGETS += $(MODULE_DIR)/$(LIBSTLIBNAME)
+ endif
+@@ -131,9 +137,11 @@
+ ifeq ($(BUILD_STATIC_LIB),1)
+ 	$(INSTALL) -m 644 $(LIB_DIR)/$(LIBSTLIBNAME) $(DESTDIR)$(LIBDIR)
+ endif
++ifeq ($(BUILD_SHARED_LIB),1)
+ 	$(INSTALL) -m 755 $(LIB_DIR)/$(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR)
+ 	$(LN) $(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBSHSONAME)
+ 	$(LN) $(LIBSHSONAME) $(DESTDIR)$(LIBDIR)/$(LIBSHBASENAME)
++endif
+ 	@if [ -z "$(DESTDIR)" -a "$(LIBDIR)" != "/usr/lib" -a "$(LIBDIR)" != "/lib" ] ; then \
+ 	   if [ -e "/usr/lib/$(LIBSHSONAME)" -o -e "/usr/lib/$(LIBSHBASENAME)" ] ; then \
+ 	     echo '******************************************************************************' ; \
+Index: b/prog/sensord/Module.mk
+===================================================================
+--- a/prog/sensord/Module.mk
++++ b/prog/sensord/Module.mk
+@@ -41,7 +41,7 @@
+ REMOVESENSORDBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGSENSORDTARGETS))
+ REMOVESENSORDMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORDMAN8DIR)/%,$(PROGSENSORDMAN8FILES))
+ 
+-$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
++$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBDEP)
+ 	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORDSOURCES:.c=.ro) -Llib -lsensors -lrrd
+ 
+ all-prog-sensord: $(PROGSENSORDTARGETS)
+Index: b/prog/sensors/Module.mk
+===================================================================
+--- a/prog/sensors/Module.mk
++++ b/prog/sensors/Module.mk
+@@ -39,8 +39,8 @@
+ 
+ LIBICONV := $(shell if /sbin/ldconfig -p | grep -q '/libiconv\.so$$' ; then echo \-liconv; else echo; fi)
+ 
+-$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
+-	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors
++$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBDEP)
++	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors -lm
+ 
+ all-prog-sensors: $(PROGSENSORSTARGETS)
+ user :: all-prog-sensors
diff --git a/package/lm-sensors/lm-sensors.mk b/package/lm-sensors/lm-sensors.mk
index 03c6b54..61e1c73 100644
--- a/package/lm-sensors/lm-sensors.mk
+++ b/package/lm-sensors/lm-sensors.mk
@@ -20,18 +20,28 @@ LM_SENSORS_BINS_$(BR2_PACKAGE_LM_SENSORS_ISASET) += sbin/isaset
 LM_SENSORS_BINS_$(BR2_PACKAGE_LM_SENSORS_PWMCONFIG) += sbin/pwmconfig
 LM_SENSORS_BINS_$(BR2_PACKAGE_LM_SENSORS_SENSORS_DETECT) += sbin/sensors-detect
 
+LM_SENSORS_MAKE_OPT = \
+	BUILD_STATIC_LIB=1 \
+	MACHINE=$(KERNEL_ARCH) \
+	PREFIX=/usr
+
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+LM_SENSORS_MAKE_OPT += BUILD_SHARED_LIB=0
+else
+LM_SENSORS_MAKE_OPT += BUILD_SHARED_LIB=1
+endif
+
 define LM_SENSORS_BUILD_CMDS
-	$(MAKE) $(TARGET_CONFIGURE_OPTS) MACHINE=$(KERNEL_ARCH) \
-		PREFIX=/usr -C $(@D)
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) $(LM_SENSORS_MAKE_OPT) -C $(@D)
 endef
 
 define LM_SENSORS_INSTALL_STAGING_CMDS
-	$(MAKE) -C $(@D) PREFIX=/usr DESTDIR=$(STAGING_DIR) install
+	$(MAKE) -C $(@D) $(LM_SENSORS_MAKE_OPT) DESTDIR=$(STAGING_DIR) install
 	rm -f $(addprefix $(STAGING_DIR)/usr/,$(LM_SENSORS_BINS_) $(LM_SENSORS_BINS_y))
 endef
 
 define LM_SENSORS_INSTALL_TARGET_CMDS
-	$(MAKE) -C $(@D) PREFIX=/usr DESTDIR=$(TARGET_DIR) install
+	$(MAKE) -C $(@D) $(LM_SENSORS_MAKE_OPT) DESTDIR=$(TARGET_DIR) install
 	rm -f $(addprefix $(TARGET_DIR)/usr/,$(LM_SENSORS_BINS_))
 endef
 
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/3] lm-sensors: don't use host ldconfig
  2014-07-09 20:50 [Buildroot] [PATCH 1/3] lm-sensors: fix static-only builds Thomas Petazzoni
@ 2014-07-09 20:50 ` Thomas Petazzoni
  2014-07-09 21:30   ` Yann E. MORIN
  2014-07-09 20:50 ` [Buildroot] [PATCH 3/3] lm-sensors: sensors-detect requires perl Thomas Petazzoni
  2014-07-09 21:40 ` [Buildroot] [PATCH 1/3] lm-sensors: fix static-only builds Yann E. MORIN
  2 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2014-07-09 20:50 UTC (permalink / raw)
  To: buildroot

To know whether the libiconv library is available, lm-sensors is using
the host ldconfig, which is obviously wrong in cross-compilation.

Moreover, the lm-sensors program making use of the iconv_*() API
already does it when __UCLIBC__ is *not* defined. In this case, the
iconv_*() functions are already part of the C library, so there is no
need to link against a separate library. Therefore, this patch simply
removes the libiconv handling.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../lm-sensors-0002-no-host-ldconfig.patch         | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 package/lm-sensors/lm-sensors-0002-no-host-ldconfig.patch

diff --git a/package/lm-sensors/lm-sensors-0002-no-host-ldconfig.patch b/package/lm-sensors/lm-sensors-0002-no-host-ldconfig.patch
new file mode 100644
index 0000000..ed4b550
--- /dev/null
+++ b/package/lm-sensors/lm-sensors-0002-no-host-ldconfig.patch
@@ -0,0 +1,29 @@
+Remove usage of host ldconfig
+
+To know whether the libiconv library is available, lm-sensors is using
+the host ldconfig, which is obviously wrong in cross-compilation.
+
+Moreover, the lm-sensors program making use of the iconv_*() API
+already does it when __UCLIBC__ is *not* defined. In this case, the
+iconv_*() functions are already part of the C library, so there is no
+need to link against a separate library. Therefore, this patch simply
+removes the libiconv handling.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/prog/sensors/Module.mk
+===================================================================
+--- a/prog/sensors/Module.mk
++++ b/prog/sensors/Module.mk
+@@ -37,10 +37,8 @@
+ REMOVESENSORSBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGSENSORSTARGETS))
+ REMOVESENSORSMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORSMAN1DIR)/%,$(PROGSENSORSMAN1FILES))
+ 
+-LIBICONV := $(shell if /sbin/ldconfig -p | grep -q '/libiconv\.so$$' ; then echo \-liconv; else echo; fi)
+-
+ $(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBDEP)
+-	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors -lm
++	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) -Llib -lsensors -lm
+ 
+ all-prog-sensors: $(PROGSENSORSTARGETS)
+ user :: all-prog-sensors
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 3/3] lm-sensors: sensors-detect requires perl
  2014-07-09 20:50 [Buildroot] [PATCH 1/3] lm-sensors: fix static-only builds Thomas Petazzoni
  2014-07-09 20:50 ` [Buildroot] [PATCH 2/3] lm-sensors: don't use host ldconfig Thomas Petazzoni
@ 2014-07-09 20:50 ` Thomas Petazzoni
  2014-07-09 21:41   ` Yann E. MORIN
  2014-07-09 21:40 ` [Buildroot] [PATCH 1/3] lm-sensors: fix static-only builds Yann E. MORIN
  2 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2014-07-09 20:50 UTC (permalink / raw)
  To: buildroot

The sensors-detect program is in fact a Perl script, so it won't run
on the target unless Perl is enabled in the configuration.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/lm-sensors/Config.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/lm-sensors/Config.in b/package/lm-sensors/Config.in
index 33c59fd..7065c4c 100644
--- a/package/lm-sensors/Config.in
+++ b/package/lm-sensors/Config.in
@@ -44,8 +44,12 @@ config BR2_PACKAGE_LM_SENSORS_PWMCONFIG
 
 config BR2_PACKAGE_LM_SENSORS_SENSORS_DETECT
 	bool "sensors-detect"
+	depends on BR2_PACKAGE_PERL
 	help
 	  Sensors-detect is an interactive program for detecting
 	  available hardware monitoring chips.
 
+comment "sensors-detect needs perl"
+	depends on !BR2_PACKAGE_PERL
+
 endif
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/3] lm-sensors: don't use host ldconfig
  2014-07-09 20:50 ` [Buildroot] [PATCH 2/3] lm-sensors: don't use host ldconfig Thomas Petazzoni
@ 2014-07-09 21:30   ` Yann E. MORIN
  0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-07-09 21:30 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2014-07-09 22:50 +0200, Thomas Petazzoni spake thusly:
> To know whether the libiconv library is available, lm-sensors is using
> the host ldconfig, which is obviously wrong in cross-compilation.
> 
> Moreover, the lm-sensors program making use of the iconv_*() API
> already does it when __UCLIBC__ is *not* defined. In this case, the
> iconv_*() functions are already part of the C library, so there is no
> need to link against a separate library. Therefore, this patch simply
> removes the libiconv handling.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  .../lm-sensors-0002-no-host-ldconfig.patch         | 29 ++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>  create mode 100644 package/lm-sensors/lm-sensors-0002-no-host-ldconfig.patch
> 
> diff --git a/package/lm-sensors/lm-sensors-0002-no-host-ldconfig.patch b/package/lm-sensors/lm-sensors-0002-no-host-ldconfig.patch
> new file mode 100644
> index 0000000..ed4b550
> --- /dev/null
> +++ b/package/lm-sensors/lm-sensors-0002-no-host-ldconfig.patch
> @@ -0,0 +1,29 @@
> +Remove usage of host ldconfig
> +
> +To know whether the libiconv library is available, lm-sensors is using
> +the host ldconfig, which is obviously wrong in cross-compilation.
> +
> +Moreover, the lm-sensors program making use of the iconv_*() API
> +already does it when __UCLIBC__ is *not* defined. In this case, the
> +iconv_*() functions are already part of the C library, so there is no
> +need to link against a separate library. Therefore, this patch simply
> +removes the libiconv handling.
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +
> +Index: b/prog/sensors/Module.mk
> +===================================================================
> +--- a/prog/sensors/Module.mk
> ++++ b/prog/sensors/Module.mk
> +@@ -37,10 +37,8 @@
> + REMOVESENSORSBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGSENSORSTARGETS))
> + REMOVESENSORSMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORSMAN1DIR)/%,$(PROGSENSORSMAN1FILES))
> + 
> +-LIBICONV := $(shell if /sbin/ldconfig -p | grep -q '/libiconv\.so$$' ; then echo \-liconv; else echo; fi)
> +-
> + $(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBDEP)
> +-	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors -lm
> ++	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) -Llib -lsensors -lm
> + 
> + all-prog-sensors: $(PROGSENSORSTARGETS)
> + user :: all-prog-sensors
> -- 
> 2.0.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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] 6+ messages in thread

* [Buildroot] [PATCH 1/3] lm-sensors: fix static-only builds
  2014-07-09 20:50 [Buildroot] [PATCH 1/3] lm-sensors: fix static-only builds Thomas Petazzoni
  2014-07-09 20:50 ` [Buildroot] [PATCH 2/3] lm-sensors: don't use host ldconfig Thomas Petazzoni
  2014-07-09 20:50 ` [Buildroot] [PATCH 3/3] lm-sensors: sensors-detect requires perl Thomas Petazzoni
@ 2014-07-09 21:40 ` Yann E. MORIN
  2 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-07-09 21:40 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2014-07-09 22:50 +0200, Thomas Petazzoni spake thusly:
> This commit adds a patch to lm-sensors to support a new variable
> BUILD_SHARED_LIB that allows to conditionally enable or disable the
> build (and usage) of the libsensors shared library.
> 
> It also refactors the make variables in a variable called
> LM_SENSORS_MAKE_OPT.
> 
> Fixes:
> 
>   http://autobuild.buildroot.org/results/06c/06c197263e4939d6adc4877e152f602a69df751d/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

See comment below...

> ---
>  .../lm-sensors/lm-sensors-0001-static-build.patch  | 81 ++++++++++++++++++++++
>  package/lm-sensors/lm-sensors.mk                   | 18 +++--
>  2 files changed, 95 insertions(+), 4 deletions(-)
>  create mode 100644 package/lm-sensors/lm-sensors-0001-static-build.patch
> 
> diff --git a/package/lm-sensors/lm-sensors-0001-static-build.patch b/package/lm-sensors/lm-sensors-0001-static-build.patch
> new file mode 100644
> index 0000000..c914d3a
> --- /dev/null
> +++ b/package/lm-sensors/lm-sensors-0001-static-build.patch
> @@ -0,0 +1,81 @@
> +Add support for static only build
> +
> +This patch adds support for a BUILD_SHARED_LIB variable that allows to
> +enable/disable the build of the shared library, in order to support
> +static-only builds.
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +
> +Index: b/Makefile
> +===================================================================
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -85,6 +85,9 @@
> + # Build and install static library
> + BUILD_STATIC_LIB := 1
> + 
> ++# Build and install shared library
> ++BUILD_SHARED_LIB := 1
> ++
> + # Set these to add preprocessor or compiler flags, or use
> + # environment variables
> + # CFLAGS :=
> +Index: b/lib/Module.mk
> +===================================================================
> +--- a/lib/Module.mk
> ++++ b/lib/Module.mk
> +@@ -43,8 +43,14 @@
> + LIBSTLIBNAME := libsensors.a
> + LIBSHSONAME := libsensors.so.$(LIBMAINVER)
> + 
> ++ifeq ($(BUILD_SHARED_LIB),1)
> + LIBTARGETS := $(MODULE_DIR)/$(LIBSHLIBNAME) \
> +               $(MODULE_DIR)/$(LIBSHSONAME) $(MODULE_DIR)/$(LIBSHBASENAME)
> ++LIBDEP     := $(LIBSHBASENAME)
> ++else
> ++LIBDEP     := $(LIBSTLIBNAME)

I found LIBDEP to be not really explicit what it was used for.
Why not name it:  LIBDEP_FOR_PROGS

Regards,
Yann E. MORIN.

> ++endif
> ++
> + ifeq ($(BUILD_STATIC_LIB),1)
> + LIBTARGETS += $(MODULE_DIR)/$(LIBSTLIBNAME)
> + endif
> +@@ -131,9 +137,11 @@
> + ifeq ($(BUILD_STATIC_LIB),1)
> + 	$(INSTALL) -m 644 $(LIB_DIR)/$(LIBSTLIBNAME) $(DESTDIR)$(LIBDIR)
> + endif
> ++ifeq ($(BUILD_SHARED_LIB),1)
> + 	$(INSTALL) -m 755 $(LIB_DIR)/$(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR)
> + 	$(LN) $(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBSHSONAME)
> + 	$(LN) $(LIBSHSONAME) $(DESTDIR)$(LIBDIR)/$(LIBSHBASENAME)
> ++endif
> + 	@if [ -z "$(DESTDIR)" -a "$(LIBDIR)" != "/usr/lib" -a "$(LIBDIR)" != "/lib" ] ; then \
> + 	   if [ -e "/usr/lib/$(LIBSHSONAME)" -o -e "/usr/lib/$(LIBSHBASENAME)" ] ; then \
> + 	     echo '******************************************************************************' ; \
> +Index: b/prog/sensord/Module.mk
> +===================================================================
> +--- a/prog/sensord/Module.mk
> ++++ b/prog/sensord/Module.mk
> +@@ -41,7 +41,7 @@
> + REMOVESENSORDBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGSENSORDTARGETS))
> + REMOVESENSORDMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORDMAN8DIR)/%,$(PROGSENSORDMAN8FILES))
> + 
> +-$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
> ++$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBDEP)
> + 	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORDSOURCES:.c=.ro) -Llib -lsensors -lrrd
> + 
> + all-prog-sensord: $(PROGSENSORDTARGETS)
> +Index: b/prog/sensors/Module.mk
> +===================================================================
> +--- a/prog/sensors/Module.mk
> ++++ b/prog/sensors/Module.mk
> +@@ -39,8 +39,8 @@
> + 
> + LIBICONV := $(shell if /sbin/ldconfig -p | grep -q '/libiconv\.so$$' ; then echo \-liconv; else echo; fi)
> + 
> +-$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
> +-	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors
> ++$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBDEP)
> ++	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors -lm
> + 
> + all-prog-sensors: $(PROGSENSORSTARGETS)
> + user :: all-prog-sensors
> diff --git a/package/lm-sensors/lm-sensors.mk b/package/lm-sensors/lm-sensors.mk
> index 03c6b54..61e1c73 100644
> --- a/package/lm-sensors/lm-sensors.mk
> +++ b/package/lm-sensors/lm-sensors.mk
> @@ -20,18 +20,28 @@ LM_SENSORS_BINS_$(BR2_PACKAGE_LM_SENSORS_ISASET) += sbin/isaset
>  LM_SENSORS_BINS_$(BR2_PACKAGE_LM_SENSORS_PWMCONFIG) += sbin/pwmconfig
>  LM_SENSORS_BINS_$(BR2_PACKAGE_LM_SENSORS_SENSORS_DETECT) += sbin/sensors-detect
>  
> +LM_SENSORS_MAKE_OPT = \
> +	BUILD_STATIC_LIB=1 \
> +	MACHINE=$(KERNEL_ARCH) \
> +	PREFIX=/usr
> +
> +ifeq ($(BR2_PREFER_STATIC_LIB),y)
> +LM_SENSORS_MAKE_OPT += BUILD_SHARED_LIB=0
> +else
> +LM_SENSORS_MAKE_OPT += BUILD_SHARED_LIB=1
> +endif
> +
>  define LM_SENSORS_BUILD_CMDS
> -	$(MAKE) $(TARGET_CONFIGURE_OPTS) MACHINE=$(KERNEL_ARCH) \
> -		PREFIX=/usr -C $(@D)
> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) $(LM_SENSORS_MAKE_OPT) -C $(@D)
>  endef
>  
>  define LM_SENSORS_INSTALL_STAGING_CMDS
> -	$(MAKE) -C $(@D) PREFIX=/usr DESTDIR=$(STAGING_DIR) install
> +	$(MAKE) -C $(@D) $(LM_SENSORS_MAKE_OPT) DESTDIR=$(STAGING_DIR) install
>  	rm -f $(addprefix $(STAGING_DIR)/usr/,$(LM_SENSORS_BINS_) $(LM_SENSORS_BINS_y))
>  endef
>  
>  define LM_SENSORS_INSTALL_TARGET_CMDS
> -	$(MAKE) -C $(@D) PREFIX=/usr DESTDIR=$(TARGET_DIR) install
> +	$(MAKE) -C $(@D) $(LM_SENSORS_MAKE_OPT) DESTDIR=$(TARGET_DIR) install
>  	rm -f $(addprefix $(TARGET_DIR)/usr/,$(LM_SENSORS_BINS_))
>  endef
>  
> -- 
> 2.0.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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] 6+ messages in thread

* [Buildroot] [PATCH 3/3] lm-sensors: sensors-detect requires perl
  2014-07-09 20:50 ` [Buildroot] [PATCH 3/3] lm-sensors: sensors-detect requires perl Thomas Petazzoni
@ 2014-07-09 21:41   ` Yann E. MORIN
  0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-07-09 21:41 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2014-07-09 22:50 +0200, Thomas Petazzoni spake thusly:
> The sensors-detect program is in fact a Perl script, so it won't run
> on the target unless Perl is enabled in the configuration.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  package/lm-sensors/Config.in | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/package/lm-sensors/Config.in b/package/lm-sensors/Config.in
> index 33c59fd..7065c4c 100644
> --- a/package/lm-sensors/Config.in
> +++ b/package/lm-sensors/Config.in
> @@ -44,8 +44,12 @@ config BR2_PACKAGE_LM_SENSORS_PWMCONFIG
>  
>  config BR2_PACKAGE_LM_SENSORS_SENSORS_DETECT
>  	bool "sensors-detect"
> +	depends on BR2_PACKAGE_PERL
>  	help
>  	  Sensors-detect is an interactive program for detecting
>  	  available hardware monitoring chips.
>  
> +comment "sensors-detect needs perl"
> +	depends on !BR2_PACKAGE_PERL
> +
>  endif
> -- 
> 2.0.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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] 6+ messages in thread

end of thread, other threads:[~2014-07-09 21:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-09 20:50 [Buildroot] [PATCH 1/3] lm-sensors: fix static-only builds Thomas Petazzoni
2014-07-09 20:50 ` [Buildroot] [PATCH 2/3] lm-sensors: don't use host ldconfig Thomas Petazzoni
2014-07-09 21:30   ` Yann E. MORIN
2014-07-09 20:50 ` [Buildroot] [PATCH 3/3] lm-sensors: sensors-detect requires perl Thomas Petazzoni
2014-07-09 21:41   ` Yann E. MORIN
2014-07-09 21:40 ` [Buildroot] [PATCH 1/3] lm-sensors: fix static-only builds 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