]> granicus.if.org Git - icinga2/commitdiff
Fix libreadline detection for Debian
authorGunnar Beutner <gunnar@beutner.name>
Tue, 17 Mar 2015 17:01:48 +0000 (18:01 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 17 Mar 2015 17:03:31 +0000 (18:03 +0100)
refs #8776

icinga-app/icinga2.cmake

index 11ca36c4584f3d2ae98f68a4eb989e822057eafa..f090729a2da32033f78d0f0f0f7ddc93b19b0edb 100644 (file)
@@ -1,16 +1,25 @@
 #!/bin/sh
 ICINGA2_BIN=@CMAKE_INSTALL_FULL_LIBDIR@/icinga2/sbin/icinga2
 
-if test "x`uname -s`" = "xLinux"; then
+if test "x`uname -s`" = "xLinux" -a "x$1" = "xconsole"; then
   libedit_line=`ldd $ICINGA2_BIN 2>&1 | grep libedit`
   if test $? -eq 0; then
     libedit_path=`echo $libedit_line | cut -f3 -d' '`
     if test -n "$libedit_path"; then
       libdir=`dirname -- $libedit_path`
-      for libreadline_path in $libdir/libreadline.so*; do
+      found=0
+      for libreadline_path in `ls -1r -- $libdir/libreadline.so.* 2>/dev/null`; do
+        found=1
         break
       done
-      if test -n "$libreadline_path"; then
+      if test $found -eq 0; then
+        libdir2=/`echo $libdir | cut -f3- -d/`
+        for libreadline_path in `ls -1r -- $libdir2/libreadline.so.* 2>/dev/null`; do
+          found=1
+          break
+        done
+      fi
+      if test $found -gt 0; then
         export LD_PRELOAD="$libreadline_path:$LD_PRELOAD"
       fi
     fi