Use separate sed expressions to escape auto-load directories.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 5 Dec 2018 18:51:16 +0000 (10:51 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Wed, 5 Dec 2018 18:51:16 +0000 (10:51 -0800)
Not all sed implementations support alternation via \| in the default
regular expressions.  Instead, resort to separate sed expressions via
-e for $debugdir and $datadir.  This fixes the default setting of the
auto-load directories on FreeBSD.  Previously on FreeBSD the sed
invocation was a no-op causing the debugdir and datadir values to be
expanded yielding an autoload path of ':${prefix}/share/gdb'.

gdb/ChangeLog:

* configure: Re-generate.
* configure.ac: Use separate sed expressions to escape variables
in auto-load directories.

gdb/ChangeLog
gdb/configure
gdb/configure.ac

index da4d61dc8564a83d0ba9c83eac981da501e98b9f..d863f918c6b9c53908b4229a81c29653c09ee60c 100644 (file)
@@ -1,3 +1,9 @@
+2018-12-05  John Baldwin  <jhb@FreeBSD.org>
+
+       * configure: Re-generate.
+       * configure.ac: Use separate sed expressions to escape variables
+       in auto-load directories.
+
 2018-12-05  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * riscv-tdep.c (riscv_features_from_gdbarch_info): New function.
index 7665ba65319f52eaf62d4ce79c4535b4f134ed42..37772308986e27eaa02c7892250b933c334beaee 100755 (executable)
@@ -6579,7 +6579,7 @@ else
   with_auto_load_dir='$debugdir:$datadir/auto-load'
 fi
 
-escape_dir=`echo $with_auto_load_dir | sed 's/[$]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'`
+escape_dir=`echo $with_auto_load_dir | sed -e 's/[$]datadir\>/\\\\\\\\\\\\&/g' -e 's/[$]debugdir\>/\\\\\\\\\\\\&/g'`
 
   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
   test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
@@ -6606,7 +6606,7 @@ else
   with_auto_load_safe_path="$with_auto_load_dir"
 fi
 
-escape_dir=`echo $with_auto_load_safe_path | sed 's/[$]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'`
+escape_dir=`echo $with_auto_load_safe_path | sed -e 's/[$]datadir\>/\\\\\\\\\\\\&/g' -e 's/[$]debugdir\>/\\\\\\\\\\\\&/g'`
 
   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
   test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
index e1ea60660b966de3e9104fe7df7002498e35a05d..eca7ea6d41a2f8957bde50fa7f5b55a0dd9fa4ac 100644 (file)
@@ -146,7 +146,7 @@ AC_ARG_WITH(auto-load-dir,
 AS_HELP_STRING([--with-auto-load-dir=PATH],
   [directories from which to load auto-loaded scripts @<:@$debugdir:$datadir/auto-load@:>@]),,
   [with_auto_load_dir='$debugdir:$datadir/auto-load'])
-escape_dir=`echo $with_auto_load_dir | sed 's/[[$]]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'`
+escape_dir=`echo $with_auto_load_dir | sed -e 's/[[$]]datadir\>/\\\\\\\\\\\\&/g' -e 's/[[$]]debugdir\>/\\\\\\\\\\\\&/g'`
 AC_DEFINE_DIR(AUTO_LOAD_DIR, escape_dir,
              [Directories from which to load auto-loaded scripts.])
 AC_MSG_RESULT([$with_auto_load_dir])
@@ -161,7 +161,7 @@ AS_HELP_STRING([--without-auto-load-safe-path],
      with_auto_load_safe_path="/"
      fi],
 [with_auto_load_safe_path="$with_auto_load_dir"])
-escape_dir=`echo $with_auto_load_safe_path | sed 's/[[$]]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'`
+escape_dir=`echo $with_auto_load_safe_path | sed -e 's/[[$]]datadir\>/\\\\\\\\\\\\&/g' -e 's/[[$]]debugdir\>/\\\\\\\\\\\\&/g'`
 AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
              [Directories safe to hold auto-loaded files.])
 AC_MSG_RESULT([$with_auto_load_safe_path])