From 50ff67e6cf65dbe1b8fbbdb7a6c2e43919af95f4 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 12 Apr 2019 19:02:44 +0930 Subject: [PATCH] ld TDIRS substitution 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 | 8 ++++++++ ld/Makefile.am | 2 +- ld/Makefile.in | 2 +- ld/configure | 64 ++++++++++++--------------------------------------------- ld/configure.ac | 14 +++++-------- 5 files changed, 28 insertions(+), 62 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index c161ffe..9b5e3a3 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2019-04-13 Alan Modra + + * 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 PR 24450 diff --git a/ld/Makefile.am b/ld/Makefile.am index 0434a82..7f8722d 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -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 diff --git a/ld/Makefile.in b/ld/Makefile.in index 3aede6e..1a5da09 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -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 diff --git a/ld/configure b/ld/configure index ded3a98..6cedd33 100755 --- a/ld/configure +++ b/ld/configure @@ -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; 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 @@ -18874,17 +18858,6 @@ fi 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 = "" - \$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" && diff --git a/ld/configure.ac b/ld/configure.ac index d335f21..ec43406 100644 --- a/ld/configure.ac +++ b/ld/configure.ac @@ -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 -- 2.7.4