aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2021-04-08 21:21:49 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2021-04-09 11:29:46 -0400
commite9659b244c5a85d7780019534baab3279dbf5844 (patch)
treea2840f05853f4fe60f4345f432655cfe0fa6f808
parent1591725c07730a995d537da652e8481b2801c6a4 (diff)
downloadlibtraceevent-e9659b244c5a85d7780019534baab3279dbf5844.tar.gz
libtraceevent: Fix make install updating of ldconfig
The ldconfig file /etc/ld.conf.d/trace.conf was being updated when it did not need to be, and should not be updated if ldconfig is not in the patch when installing. Add a check to see if ldconfig can successfully run before testing if conf file should be updated. Also fix the grep of the conf file that looks for the path such that the output is not displayed to the console. Link: https://lore.kernel.org/linux-trace-devel/20210408212149.6940fdda@oasis.local.home Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r--Makefile19
1 files changed, 10 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index e5574ce..b617baa 100644
--- a/Makefile
+++ b/Makefile
@@ -290,16 +290,17 @@ ifeq ("$(DESTDIR)", "")
# and running ldconfig, if the library is visible by ld.so.
# If not, add the path to /etc/ld.so.conf.d/trace.conf and run ldconfig again.
define install_ld_config
- $(LDCONFIG); \
- if ! grep "^$(libdir)$$" $(LD_SO_CONF_PATH)/* &> /dev/null ; then \
- $(CC) -o $(OUTPUT)test $(srctree)/test.c -I $(includedir_SQ) \
- -L $(libdir_SQ) -ltraceevent &>/dev/null; \
- if ! $(OUTPUT)test &> /dev/null; then \
- $(call PRINT_INSTALL, trace.conf) \
- echo $(libdir_SQ) >> $(LD_SO_CONF_PATH)/trace.conf; \
- $(LDCONFIG); \
+ if $(LDCONFIG); then \
+ if ! grep -q "^$(libdir)$$" $(LD_SO_CONF_PATH)/* ; then \
+ $(CC) -o $(OUTPUT)test $(srctree)/test.c -I $(includedir_SQ) \
+ -L $(libdir_SQ) -ltraceevent &>/dev/null; \
+ if ! $(OUTPUT)test &> /dev/null; then \
+ $(call PRINT_INSTALL, trace.conf) \
+ echo $(libdir_SQ) >> $(LD_SO_CONF_PATH)/trace.conf; \
+ $(LDCONFIG); \
+ fi; \
+ $(RM) $(OUTPUT)test; \
fi; \
- $(RM) $(OUTPUT)test; \
fi
endef
else