xref: /OK3568_Linux_fs/buildroot/package/lm-sensors/0002-no-host-ldconfig.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunRemove usage of host ldconfig
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunTo know whether the libiconv library is available, lm-sensors is using
4*4882a593Smuzhiyunthe host ldconfig, which is obviously wrong in cross-compilation.
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunMoreover, the lm-sensors program making use of the iconv_*() API
7*4882a593Smuzhiyunalready does it when __UCLIBC__ is *not* defined. In this case, the
8*4882a593Smuzhiyuniconv_*() functions are already part of the C library, so there is no
9*4882a593Smuzhiyunneed to link against a separate library. Therefore, this patch simply
10*4882a593Smuzhiyunremoves the libiconv handling.
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunSigned-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunIndex: b/prog/sensors/Module.mk
15*4882a593Smuzhiyun===================================================================
16*4882a593Smuzhiyun--- a/prog/sensors/Module.mk
17*4882a593Smuzhiyun+++ b/prog/sensors/Module.mk
18*4882a593Smuzhiyun@@ -37,10 +37,8 @@
19*4882a593Smuzhiyun REMOVESENSORSBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGSENSORSTARGETS))
20*4882a593Smuzhiyun REMOVESENSORSMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORSMAN1DIR)/%,$(PROGSENSORSMAN1FILES))
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun-LIBICONV := $(shell if /sbin/ldconfig -p | grep -q '/libiconv\.so$$' ; then echo \-liconv; else echo; fi)
23*4882a593Smuzhiyun-
24*4882a593Smuzhiyun $(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBDEP_FOR_PROGS)
25*4882a593Smuzhiyun-	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors -lm
26*4882a593Smuzhiyun+	$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) -Llib -lsensors -lm
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun all-prog-sensors: $(PROGSENSORSTARGETS)
29*4882a593Smuzhiyun user :: all-prog-sensors
30