]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld TDIRS substitution
authorAlan Modra <amodra@gmail.com>
Fri, 12 Apr 2019 09:32:44 +0000 (19:02 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 13 Apr 2019 02:42:43 +0000 (12:12 +0930)
It is no longer true that autoconf/automake cannot substitute vars
with embedded new-lines.

* configure.ac (TDIRS): Build up tdirs in this variable and
AC_SUBST, also using AM_SUBST_NOTMAKE.
* configure: Regenerate.
* Makefile.am (DISTCLEANFILES): Remove tdirs.
* Makefile.in: Regenerate.

ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/configure
ld/configure.ac

index c161ffefc2f80bcdbda4cdaef9ec3f2e58963ae7..9b5e3a3cb1c1a6a7108a7dbbd9bbb45904e4f3e4 100644 (file)
@@ -1,3 +1,11 @@
+2019-04-13  Alan Modra  <amodra@gmail.com>
+
+       * configure.ac (TDIRS): Build up tdirs in this variable and
+       AC_SUBST, also using AM_SUBST_NOTMAKE.
+       * configure: Regenerate.
+       * Makefile.am (DISTCLEANFILES): Remove tdirs.
+       * Makefile.in: Regenerate.
+
 2019-04-12  Nick Clifton  <nickc@redhat.com>
 
        PR 24450
index 0434a827b9cb44766e88c8aabf94c04d010ec035..7f8722dc2d07af61ca8eedf47bb18c33529f88ff 100644 (file)
@@ -2013,7 +2013,7 @@ diststuff: info $(EXTRA_DIST)
 # ld.1 to support parallel build.
 info-recursive: ld.1
 
-DISTCLEANFILES = tdirs site.exp development.exp site.bak stringify.sed
+DISTCLEANFILES = site.exp development.exp site.bak stringify.sed
 distclean-local:
        rm -rf ldscripts
 
index 3aede6e79856503e88838719f50b693df91d1152..1a5da09d3d19bbb4f8c0c1182984697e97960e15 100644 (file)
@@ -1045,7 +1045,7 @@ CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 spu_ovl.s spu_ovl.@OBJEXT@ spu_icache.s
 EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.@OBJEXT@_c \
             emultempl/spu_icache.@OBJEXT@_c deffilep.c deffilep.h $(man_MANS)
 
-DISTCLEANFILES = tdirs site.exp development.exp site.bak stringify.sed
+DISTCLEANFILES = site.exp development.exp site.bak stringify.sed
 all: $(BUILT_SOURCES) config.h
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
index ded3a98eb81147b61d0e4f7ca71058d303ef4145..6cedd332172d68faaaae360f00b117cf6318acb0 100755 (executable)
@@ -639,6 +639,7 @@ EMULATION_LIBPATH
 LIB_PATH
 EMUL_EXTRA_OFILES
 EMULATION_OFILES
+TDIRS
 EMUL
 elf_plt_unwind_list_options
 elf_shlib_list_options
@@ -804,7 +805,7 @@ PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
 SHELL'
-ac_subst_files='TDIRS'
+ac_subst_files=''
 ac_user_opts='
 enable_option_checking
 enable_dependency_tracking
@@ -12026,7 +12027,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12029 "configure"
+#line 12030 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12132,7 +12133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12135 "configure"
+#line 12136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17430,8 +17431,7 @@ EMUL=
 all_emuls=
 all_emul_extras=
 all_libpath=
-
-rm -f tdirs
+TDIRS=
 
 # If the host is 64-bit, then we enable 64-bit targets by default.
 # This is consistent with what ../bfd/configure.ac does.
@@ -17515,7 +17515,8 @@ do
          all_emuls="$all_emuls e${i}.o"
          eval result=\$tdir_$i
          test -z "$result" && result=$targ_alias
-         echo tdir_$i=$result >> tdirs
+         TDIRS="$TDIRS
+tdir_$i=$result"
          case "${i}" in
          *elf*)
            elf_list_options=TRUE
@@ -17614,7 +17615,7 @@ _ACEOF
 
 
 
-TDIRS=tdirs
+
 
 
 if test x${all_targets} = xtrue; then
@@ -18839,24 +18840,7 @@ ac_tmp=$tmp
 # This happens for instance with `./config.status config.h'.
 if test -n "$CONFIG_FILES"; then
 
-if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
-  ac_cs_awk_getline=:
-  ac_cs_awk_pipe_init=
-  ac_cs_awk_read_file='
-      while ((getline aline < (F[key])) > 0)
-       print(aline)
-      close(F[key])'
-  ac_cs_awk_pipe_fini=
-else
-  ac_cs_awk_getline=false
-  ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\""
-  ac_cs_awk_read_file='
-      print "|#_!!_#|"
-      print "cat " F[key] " &&"
-      '$ac_cs_awk_pipe_init
-  # The final `:' finishes the AND list.
-  ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }'
-fi
+
 ac_cr=`echo X | tr X '\015'`
 # On cygwin, bash can eat \r inside `` if the user requested igncr.
 # But we know of no other shell where ac_cr would be empty at this
 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
-# Create commands to substitute file output variables.
-{
-  echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" &&
-  echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' &&
-  echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' &&
-  echo "_ACAWK" &&
-  echo "_ACEOF"
-} >conf$$files.sh &&
-. ./conf$$files.sh ||
-  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-rm -f conf$$files.sh
 
 {
   echo "cat >conf$$subs.awk <<_ACEOF" &&
@@ -18961,7 +18934,7 @@ _ACAWK
 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = "\a"
-  \$ac_cs_awk_pipe_init
+
 }
 {
   line = $ 0
@@ -18979,16 +18952,10 @@ cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
     } else
       len += 1 + keylen
   }
-  if (nfields == 3 && !substed) {
-    key = field[2]
-    if (F[key] != "" && line ~ /^[      ]*@.*@[         ]*$/) {
-      \$ac_cs_awk_read_file
-      next
-    }
-  }
+
   print line
 }
-\$ac_cs_awk_pipe_fini
+
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
@@ -19335,12 +19302,7 @@ s&@INSTALL@&$ac_INSTALL&;t t
 s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" |
-if $ac_cs_awk_getline; then
-  $AWK -f "$ac_tmp/subs.awk"
-else
-  $AWK -f "$ac_tmp/subs.awk" | $SHELL
-fi \
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
   >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
index d335f210917f397d4f868acc2c3b06ac9ddd8fcb..ec434066afdcec88f376f0134ba6140832af1286 100644 (file)
@@ -319,12 +319,7 @@ EMUL=
 all_emuls=
 all_emul_extras=
 all_libpath=
-
-dnl We need to get an arbitrary number of tdir definitions into
-dnl Makefile.  We can't do it using AC_SUBST, because autoconf does
-dnl not permit literal newlines in an AC_SUBST variables.  So we use a
-dnl file.
-rm -f tdirs
+TDIRS=
 
 # If the host is 64-bit, then we enable 64-bit targets by default.
 # This is consistent with what ../bfd/configure.ac does.
@@ -376,7 +371,8 @@ do
          all_emuls="$all_emuls e${i}.o"
          eval result=\$tdir_$i
          test -z "$result" && result=$targ_alias
-         echo tdir_$i=$result >> tdirs
+         TDIRS="$TDIRS
+tdir_$i=$result"
          case "${i}" in
          *elf*)
            elf_list_options=TRUE
@@ -463,8 +459,8 @@ AC_SUBST(elf_shlib_list_options)
 AC_SUBST(elf_plt_unwind_list_options)
 AC_SUBST(EMUL)
 
-TDIRS=tdirs
-AC_SUBST_FILE(TDIRS)
+AC_SUBST(TDIRS)
+AM_SUBST_NOTMAKE(TDIRS)
 
 if test x${all_targets} = xtrue; then
   if test x${want64} = xtrue; then