PR ld/5652
authorNick Clifton <nickc@redhat.com>
Mon, 28 Jan 2008 11:07:44 +0000 (11:07 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 28 Jan 2008 11:07:44 +0000 (11:07 +0000)
* genscripts.sh: Check for the existence of BASH_LINENO not just the BASH
  shell before generating line numbers in the emulation file.

ld/ChangeLog
ld/genscripts.sh

index 2a72f890a3943b3ed15da892a4dfb0ec2ccd41ac..b6ac62f93c00b23d15dae905874a48b5cc380e21 100644 (file)
@@ -1,3 +1,10 @@
+2008-01-28  Vincent Riviere  <vincent.riviere@freesbee.fr>
+
+       PR ld/5652
+       * genscripts.sh: Check for the existence of BASH_LINENO not just
+       the BASH shell before generating line numbers in the emulation
+       file.
+
 2008-01-28  Alan Modra  <amodra@bigpond.net.au>
 
        * emultempl/spu_ovl.S: Rewrite.
index fd2409769a636ebacdc18d8d1d86289e40390cd5..f89b3cba8a4d65aa382490477293a5aab8172343 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # genscripts.sh - generate the ld-emulation-target specific files
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007, 2008 Free Software Foundation, Inc.
 #
 # This file is part of the Gnu Linker.
 #
@@ -422,7 +422,16 @@ case " $EMULATION_LIBPATH " in
     *" ${EMULATION_NAME} "*) COMPILE_IN=true;;
 esac
 
-if test -n "${BASH+set}"; then
+# PR ld/5652:
+# Determine if the shell has support for the variable BASH_LINENO.
+# When it is the case, it is only available inside functions.
+has_lineno()
+{
+  test "x$BASH_LINENO" != "x"
+}
+
+# Enable accruate error source in the compiler error messages, if possible.
+if has_lineno; then
   . ${srcdir}/genscrba.sh
 else
   source_em()
This page took 0.026854 seconds and 4 git commands to generate.