All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv
@ 2012-04-14 19:09 Martin Suchanek
  2012-04-14 20:07 ` Jean Delvare
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Martin Suchanek @ 2012-04-14 19:09 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 357 bytes --]

Hi,

When I tried to compile lm-sensors from source code I have got by make
commad error:

/usr/bin/ld.bfd.real: cannot find -liconv
collect2: ld returned 1 exit status
make: *** [prog/sensors/sensors] Error 1


Could you please help me to solve this problem. (I have compiled it half
year ago without problem)

Thank you for any clue.
Kind Regards,
Martin

[-- Attachment #1.2: Type: text/html, Size: 401 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv
  2012-04-14 19:09 [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv Martin Suchanek
@ 2012-04-14 20:07 ` Jean Delvare
  2012-04-16  7:35 ` Jean Delvare
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jean Delvare @ 2012-04-14 20:07 UTC (permalink / raw)
  To: lm-sensors

Hi Martin,

On Sat, 14 Apr 2012 20:09:22 +0100, Martin Suchanek wrote:
> When I tried to compile lm-sensors from source code I have got by make
> commad error:
> 
> /usr/bin/ld.bfd.real: cannot find -liconv
> collect2: ld returned 1 exit status
> make: *** [prog/sensors/sensors] Error 1
> 
> 
> Could you please help me to solve this problem. (I have compiled it half
> year ago without problem)

What system are you building on? Are you building for the local host or
for a different system?

The makefile is supposed to figure out automatically if -liconv must be
passed or not. In your case it thinks it should be passed but your
linker disagrees.

What does the following command return?

$ /sbin/ldconfig -p | grep libiconv\\.so

Do you have any package named libiconv installed? If not, does any
installed package include libiconv.so, and if yes, where is it located?

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv
  2012-04-14 19:09 [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv Martin Suchanek
  2012-04-14 20:07 ` Jean Delvare
@ 2012-04-16  7:35 ` Jean Delvare
  2012-04-17 11:34 ` Jean Delvare
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jean Delvare @ 2012-04-16  7:35 UTC (permalink / raw)
  To: lm-sensors

Hi Martin,

Please don't top-post, and please leave the list included.

On Sun, 15 Apr 2012 17:29:23 +0100, Martin Suchanek wrote:
> Hi ,
> thanks for helping me out.
> bulding for local host.

You didn't answer my question: what system (which distribution) are you
building on?

> libiconv.so.2 (libc6,x86-64) => /usr/lib/libiconv.so.2
> dpkg -l|grep libicon
> ii  libiconv-hook-dev
> 0.0.20021209-10                                        header files of libiconv-hook
> ii  libiconv-hook1
> 0.0.20021209-10                                        extension of iconv for libapache-mod-encoding

Hmm, OK, so you do have one libiconv library on the system, but I'm not
sure if you really need to link against it, as it seems to be
apache-specific (no idea why though.)

Please list all files that match /usr/lib/libiconv.so.*, and for each
of them, check which package provides it.

Then as a test you can edit prog/sensors/Module.mk, search for the
following line:

LIBICONV := $(shell if /sbin/ldconfig -p | grep -q libiconv\\.so ; then echo \-liconv; else echo; fi)

Replace with:

LIBICONV := 

and try building again. Obviously this can't be a definitive fix but at
least it will tell us if you really need libiconv or not.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv
  2012-04-14 19:09 [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv Martin Suchanek
  2012-04-14 20:07 ` Jean Delvare
  2012-04-16  7:35 ` Jean Delvare
@ 2012-04-17 11:34 ` Jean Delvare
  2012-04-18 10:20 ` Martin Suchanek
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jean Delvare @ 2012-04-17 11:34 UTC (permalink / raw)
  To: lm-sensors

Hi Martin,

Again, please keep the discussion list in Cc, for the interest of
other readers and the archives.

On Mon, 16 Apr 2012 18:13:38 +0100, Martin Suchanek wrote:
> > Please list all files that match /usr/lib/libiconv.so.*, and for each
> > of them, check which package provides it.
> >
> only
> /usr/lib/libiconv.so.2 ... php-5.3-fcgi-zend-server package

Hmm, OK. Very odd to have a generic library in such a specific package.
I presume this package isn't part of Ubuntu but is a proprietary
package from Zend?

> Then as a test you can edit prog/sensors/Module.mk, search for the
> > following line:
> >
> > LIBICONV := $(shell if /sbin/ldconfig -p | grep -q libiconv\\.so ; then
> > echo \-liconv; else echo; fi)
> >
> > Replace with:
> >
> > LIBICONV :> >
> > and try building again. Obviously this can't be a definitive fix but at
> > least it will tell us if you really need libiconv or not.
> >
> compiled ok
> 
> Is there some conflict ?

Not really a conflict, rather the build system is confused because
libiconf.so.2 is available at runtime but libiconf.so isn't available
for build-time linking. I think we should ignore libiconv in this case,
and hope it's not needed. Please revert the previous change and try the
following patch instead, I'll apply it if it works for you.

---
 prog/sensors/Module.mk |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- lm-sensors.orig/prog/sensors/Module.mk	2008-03-26 14:37:44.000000000 +0100
+++ lm-sensors/prog/sensors/Module.mk	2012-04-17 13:32:29.857884198 +0200
@@ -37,7 +37,7 @@ INCLUDEFILES += $(PROGSENSORSSOURCES:.c 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)
+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


-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv
  2012-04-14 19:09 [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv Martin Suchanek
                   ` (2 preceding siblings ...)
  2012-04-17 11:34 ` Jean Delvare
@ 2012-04-18 10:20 ` Martin Suchanek
  2012-04-18 11:22 ` Jean Delvare
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Martin Suchanek @ 2012-04-18 10:20 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 2940 bytes --]

On Tue, Apr 17, 2012 at 12:34 PM, Jean Delvare <khali@linux-fr.org> wrote:

> Hi Martin,
>
> Again, please keep the discussion list in Cc, for the interest of
> other readers and the archives.


Sorry, my bad habits within emailing with proprietary technical support -
they have always interest about vice versa.

>
> On Mon, 16 Apr 2012 18:13:38 +0100, Martin Suchanek wrote:
> > > Please list all files that match /usr/lib/libiconv.so.*, and for each
> > > of them, check which package provides it.
> > >
> > only
> > /usr/lib/libiconv.so.2 ... php-5.3-fcgi-zend-server package
>
> Hmm, OK. Very odd to have a generic library in such a specific package.
> I presume this package isn't part of Ubuntu but is a proprietary
> package from Zend?
>
> Yes , it is proprietary package from Zend


>  > Then as a test you can edit prog/sensors/Module.mk, search for the
> > > following line:
> > >
> > > LIBICONV := $(shell if /sbin/ldconfig -p | grep -q libiconv\\.so ; then
> > > echo \-liconv; else echo; fi)
> > >
> > > Replace with:
> > >
> > > LIBICONV :=
> > >
> > > and try building again. Obviously this can't be a definitive fix but at
> > > least it will tell us if you really need libiconv or not.
> > >
> > compiled ok
> >
> > Is there some conflict ?
>
> Not really a conflict, rather the build system is confused because
> libiconf.so.2 is available at runtime but libiconf.so isn't available
> for build-time linking. I think we should ignore libiconv in this case,
> and hope it's not needed. Please revert the previous change and try the
> following patch instead, I'll apply it if it works for you.
>
> ---
>  prog/sensors/Module.mk |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- lm-sensors.orig/prog/sensors/Module.mk      2008-03-26
> 14:37:44.000000000 +0100
> +++ lm-sensors/prog/sensors/Module.mk   2012-04-17 13:32:29.857884198 +0200
> @@ -37,7 +37,7 @@ INCLUDEFILES += $(PROGSENSORSSOURCES:.c=
>  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)
> +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
>
>
> --
>
This '/libiconv\.so$' gave me error "/bin/sh: Syntax error: Unterminated
quoted string". I do not know why ?

add info - /sbin/ldconfig -p | grep 'libiconv' returned:
    libiconv_hook.so.1 (libc6,x86-64) => /usr/lib/libiconv_hook.so.1
    libiconv_hook.so (libc6,x86-64) => /usr/lib/libiconv_hook.so
    libiconv.so.2 (libc6,x86-64) => /usr/lib/libiconv.so.2


Regards,
Martin


> Jean Delvare
>

[-- Attachment #1.2: Type: text/html, Size: 4128 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv
  2012-04-14 19:09 [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv Martin Suchanek
                   ` (3 preceding siblings ...)
  2012-04-18 10:20 ` Martin Suchanek
@ 2012-04-18 11:22 ` Jean Delvare
  2012-04-18 13:11 ` Martin Suchanek
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jean Delvare @ 2012-04-18 11:22 UTC (permalink / raw)
  To: lm-sensors

On Wed, 18 Apr 2012 11:20:40 +0100, Martin Suchanek wrote:
> This '/libiconv\.so$' gave me error "/bin/sh: Syntax error: Unterminated
> quoted string". I do not know why ?

My bad, I should have tested more carefully. I tested the command
outside of "make" and it worked, but "make" interprets '$' so it needs
special care.

Updated patch follows, hopefully it will work OK this time:

---
 prog/sensors/Module.mk |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- lm-sensors.orig/prog/sensors/Module.mk	2008-03-26 14:37:44.000000000 +0100
+++ lm-sensors/prog/sensors/Module.mk	2012-04-18 13:17:51.978110528 +0200
@@ -37,7 +37,7 @@ INCLUDEFILES += $(PROGSENSORSSOURCES:.c 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)
+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


-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv
  2012-04-14 19:09 [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv Martin Suchanek
                   ` (4 preceding siblings ...)
  2012-04-18 11:22 ` Jean Delvare
@ 2012-04-18 13:11 ` Martin Suchanek
  2012-04-18 14:42 ` Jean Delvare
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Martin Suchanek @ 2012-04-18 13:11 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 2006 bytes --]

On Wed, Apr 18, 2012 at 12:22 PM, Jean Delvare <khali@linux-fr.org> wrote:

> On Wed, 18 Apr 2012 11:20:40 +0100, Martin Suchanek wrote:
> > This '/libiconv\.so$' gave me error "/bin/sh: Syntax error: Unterminated
> > quoted string". I do not know why ?
>
> My bad, I should have tested more carefully. I tested the command
> outside of "make" and it worked, but "make" interprets '$' so it needs
> special care.
>
> Updated patch follows, hopefully it will work OK this time:
>
> ---
>  prog/sensors/Module.mk |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- lm-sensors.orig/prog/sensors/Module.mk      2008-03-26
> 14:37:44.000000000 +0100
> +++ lm-sensors/prog/sensors/Module.mk   2012-04-18 13:17:51.978110528 +0200
> @@ -37,7 +37,7 @@ INCLUDEFILES += $(PROGSENSORSSOURCES:.c=
>  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)
> +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
>
>
> compiled/installed succesfully.
Should I test it by some way ?

(
There is one warning within sudo make install:
******************************************************************************
Warning: Library directory /usr/local/lib is not in /etc/ld.so.conf!
         Add it and run /sbin/ldconfig for the userspace tools to work.
******************************************************************************
I have checked /etc/ld.so.conf and it contains include
/etc/ld.so.conf.d/*.conf which actually include /usr/local/bin in
/etc/ld.so.conf.d/libc.conf
)

cheers,
Martin

> --
> Jean Delvare
>

[-- Attachment #1.2: Type: text/html, Size: 2767 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv
  2012-04-14 19:09 [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv Martin Suchanek
                   ` (5 preceding siblings ...)
  2012-04-18 13:11 ` Martin Suchanek
@ 2012-04-18 14:42 ` Jean Delvare
  2012-04-19 11:15 ` Andrey Repin
  2012-04-19 13:26 ` Jean Delvare
  8 siblings, 0 replies; 10+ messages in thread
From: Jean Delvare @ 2012-04-18 14:42 UTC (permalink / raw)
  To: lm-sensors

On Wed, 18 Apr 2012 14:11:47 +0100, Martin Suchanek wrote:
> On Wed, Apr 18, 2012 at 12:22 PM, Jean Delvare <khali@linux-fr.org> wrote:
> > My bad, I should have tested more carefully. I tested the command
> > outside of "make" and it worked, but "make" interprets '$' so it needs
> > special care.
> >
> > Updated patch follows, hopefully it will work OK this time:
> >
> > ---
> >  prog/sensors/Module.mk |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > --- lm-sensors.orig/prog/sensors/Module.mk      2008-03-26
> > 14:37:44.000000000 +0100
> > +++ lm-sensors/prog/sensors/Module.mk   2012-04-18 13:17:51.978110528 +0200
> > @@ -37,7 +37,7 @@ INCLUDEFILES += $(PROGSENSORSSOURCES:.c> >  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)
> > +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
> >
> >
> > compiled/installed succesfully.
> Should I test it by some way ?

If it build OK (without warning), that should be enough.

> (
> There is one warning within sudo make install:
> ******************************************************************************
> Warning: Library directory /usr/local/lib is not in /etc/ld.so.conf!
>          Add it and run /sbin/ldconfig for the userspace tools to work.
> ******************************************************************************
> I have checked /etc/ld.so.conf and it contains include
> /etc/ld.so.conf.d/*.conf which actually include /usr/local/bin in
> /etc/ld.so.conf.d/libc.conf
> )

This is another bug, when this check was written the includes
in /etc/ld.so.conf did not exist. So the check should be completed to
take this case into account. The following patch should do. I know it's
not complete as I hardcoded /etc/ld.so.conf.d/*.conf but in practice
that should be good enough.

---
 lib/Module.mk |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- lm-sensors.orig/lib/Module.mk	2012-04-05 10:33:39.000000000 +0200
+++ lm-sensors/lib/Module.mk	2012-04-18 16:41:28.432532280 +0200
@@ -144,10 +144,10 @@ endif
 	     echo '         Run the following command: rm /usr/lib/$(LIBSHBASENAME)*' ; \
 	     echo '******************************************************************************' ; \
 	   fi ; \
-	   grep -q '^$(LIBDIR)$$' /etc/ld.so.conf || \
-	   grep -q '^$(LIBDIR)[[:space:]:,=]' /etc/ld.so.conf || \
-	   grep -q '[[:space:]:,]$(LIBDIR)$$' /etc/ld.so.conf || \
-	   grep -q '[[:space:]:,]$(LIBDIR)[[:space:]:,=]' /etc/ld.so.conf || \
+	   cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '^$(LIBDIR)$$' || \
+	   cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '^$(LIBDIR)[[:space:]:,=]' || \
+	   cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '[[:space:]:,]$(LIBDIR)$$' || \
+	   cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '[[:space:]:,]$(LIBDIR)[[:space:]:,=]' || \
 		( echo '******************************************************************************' ; \
 		  echo 'Warning: Library directory $(LIBDIR) is not in /etc/ld.so.conf!' ; \
 		  echo '         Add it and run /sbin/ldconfig for the userspace tools to work.' ; \


-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv
  2012-04-14 19:09 [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv Martin Suchanek
                   ` (6 preceding siblings ...)
  2012-04-18 14:42 ` Jean Delvare
@ 2012-04-19 11:15 ` Andrey Repin
  2012-04-19 13:26 ` Jean Delvare
  8 siblings, 0 replies; 10+ messages in thread
From: Andrey Repin @ 2012-04-19 11:15 UTC (permalink / raw)
  To: lm-sensors

Greetings, Jean Delvare!

> -          grep -q '^$(LIBDIR)$$' /etc/ld.so.conf || \
> -          grep -q '^$(LIBDIR)[[:space:]:,=]' /etc/ld.so.conf || \
> -          grep -q '[[:space:]:,]$(LIBDIR)$$' /etc/ld.so.conf || \
> -          grep -q '[[:space:]:,]$(LIBDIR)[[:space:]:,=]' /etc/ld.so.conf || \
> +          cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '^$(LIBDIR)$$' || \
> +          cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '^$(LIBDIR)[[:space:]:,=]' || \
> +          cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '[[:space:]:,]$(LIBDIR)$$' || \
> +          cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '[[:space:]:,]$(LIBDIR)[[:space:]:,=]' || \
>                 ( echo '******************************************************************************' ; \
>                   echo 'Warning: Library directory $(LIBDIR) is not in /etc/ld.so.conf!' ; \
>                   echo '         Add it and run /sbin/ldconfig for the userspace tools to work.' ; \

http://en.wikipedia.org/wiki/Cat_(Unix)#Useless_use_of_cat

Move file lists to grep, save yourself a few CPU cycles.


--
WBR,
Andrey Repin (hell-for-yahoo@umail.ru) 19.04.2012, <15:08>

Sorry for my terrible english...


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv
  2012-04-14 19:09 [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv Martin Suchanek
                   ` (7 preceding siblings ...)
  2012-04-19 11:15 ` Andrey Repin
@ 2012-04-19 13:26 ` Jean Delvare
  8 siblings, 0 replies; 10+ messages in thread
From: Jean Delvare @ 2012-04-19 13:26 UTC (permalink / raw)
  To: lm-sensors

Hi Andrey,

On Thu, 19 Apr 2012 15:15:24 +0400, Andrey Repin wrote:
> Greetings, Jean Delvare!
> 
> > -          grep -q '^$(LIBDIR)$$' /etc/ld.so.conf || \
> > -          grep -q '^$(LIBDIR)[[:space:]:,=]' /etc/ld.so.conf || \
> > -          grep -q '[[:space:]:,]$(LIBDIR)$$' /etc/ld.so.conf || \
> > -          grep -q '[[:space:]:,]$(LIBDIR)[[:space:]:,=]' /etc/ld.so.conf || \
> > +          cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '^$(LIBDIR)$$' || \
> > +          cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '^$(LIBDIR)[[:space:]:,=]' || \
> > +          cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '[[:space:]:,]$(LIBDIR)$$' || \
> > +          cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 2>/dev/null | grep -q '[[:space:]:,]$(LIBDIR)[[:space:]:,=]' || \
> >                 ( echo '******************************************************************************' ; \
> >                   echo 'Warning: Library directory $(LIBDIR) is not in /etc/ld.so.conf!' ; \
> >                   echo '         Add it and run /sbin/ldconfig for the userspace tools to work.' ; \
> 
> http://en.wikipedia.org/wiki/Cat_(Unix)#Useless_use_of_cat
> 
> Move file lists to grep, save yourself a few CPU cycles.

This is on purpose. /etc/ld.so.conf.d/*.conf may match nothing (as is
the case on my own system), passing that as a parameter to "grep" would
cause it to return an error code, even if the requested directory was
found in /etc/ld.so.conf. This could be worked around by checking the
exact value of $? after the call, but this would make the code a lot
more complex than it is currently, for a rather small benefit. We don't
care that much about performance in "make install", you don't run that
command several times every day.

As far as performance is concerned, a much cheaper optimization is to
merge all 4 regular expressions into a single one - which I just did:
http://lm-sensors.org/changeset/6046

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

end of thread, other threads:[~2012-04-19 13:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-14 19:09 [lm-sensors] make lm-sensors 3.3.2 ERROR /usr/bin/ld.bfd.real: cannot find -liconv Martin Suchanek
2012-04-14 20:07 ` Jean Delvare
2012-04-16  7:35 ` Jean Delvare
2012-04-17 11:34 ` Jean Delvare
2012-04-18 10:20 ` Martin Suchanek
2012-04-18 11:22 ` Jean Delvare
2012-04-18 13:11 ` Martin Suchanek
2012-04-18 14:42 ` Jean Delvare
2012-04-19 11:15 ` Andrey Repin
2012-04-19 13:26 ` Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.