From 5ee270a148f95c35b14872fc6497e66c11177ea3 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 10 Jul 2014 18:25:50 -0700 Subject: [PATCH] install: Run ldconfig when installing on Unix. Closes #15596. If ldconfig fails it emits a warning. This is very possible when installing to a non-system directory, so the warning tries to indicate that it may not be a problem. --- src/etc/install.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/etc/install.sh b/src/etc/install.sh index 3f40d54de33f..d8cc3d3a3f6a 100644 --- a/src/etc/install.sh +++ b/src/etc/install.sh @@ -293,9 +293,11 @@ elif [ "$CFG_OSTYPE" = "Darwin" ] then CFG_LD_PATH_VAR=DYLD_LIBRARY_PATH CFG_OLD_LD_PATH_VAR=$DYLD_LIBRARY_PATH + UNIX=1 else CFG_LD_PATH_VAR=LD_LIBRARY_PATH CFG_OLD_LD_PATH_VAR=$LD_LIBRARY_PATH + UNIX=1 fi flag uninstall "only uninstall from the installation prefix" @@ -466,6 +468,17 @@ while read p; do # The manifest lists all files to install done < "${CFG_SRC_DIR}/${CFG_LIBDIR_RELATIVE}/rustlib/manifest.in" +# Run ldconfig to make dynamic libraries available to the linker +if [ $UNIX -eq 1 ] + then + ldconfig + if [ $? -ne 0 ] + then + warn "failed to run ldconfig." + warn "this may happen when not installing as root, in which case you know what you are doing and it's probably fine." + fi +fi + # Sanity check: can we run the installed binaries? # # As with the verification above, make sure the right LD_LIBRARY_PATH-equivalent @@ -494,7 +507,6 @@ then fi fi - echo echo " Rust is ready to roll." echo