* configure.in: Put the tdirs in a file and use AC_SUBST_FILE,
authorIan Lance Taylor <ian@airs.com>
Fri, 3 Apr 1998 18:30:15 +0000 (18:30 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 3 Apr 1998 18:30:15 +0000 (18:30 +0000)
rather than in a shell variable and using AC_SUBST.
* Makefile.am (DISTCLEANFILES): Remove ldscripts.  Add tdirs.
  (distclean-local): New target.
* configure, Makefile.in: Rebuild.

ld/Makefile.am
ld/Makefile.in
ld/configure
ld/configure.in

index 3a4d6a5..41377f5 100644 (file)
@@ -708,7 +708,9 @@ install-data-local:
 LDDISTSTUFF = ldgram.c ldgram.h ldlex.c
 diststuff: $(LDDISTSTUFF) info
 
-DISTCLEANFILES = ldscripts
+DISTCLEANFILES = tdirs
+distclean-local:
+       rm -rf ldscripts
 
 # Targets to rebuild dependencies in this Makefile.
 # Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
index 719b22b..e000ac0 100644 (file)
@@ -73,7 +73,6 @@ NATIVE_LIB_DIRS = @NATIVE_LIB_DIRS@
 NM = @NM@
 PACKAGE = @PACKAGE@
 RANLIB = @RANLIB@
-TDIRS = @TDIRS@
 VERSION = @VERSION@
 
 AUTOMAKE_OPTIONS = cygnus dejagnu
@@ -313,7 +312,7 @@ CLEANFILES = dep.sed .dep .dep1 bfdsumm.texi
 # target is run by the taz target in ../Makefile.in.
 LDDISTSTUFF = ldgram.c ldgram.h ldlex.c
 
-DISTCLEANFILES = ldscripts
+DISTCLEANFILES = tdirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_HEADER = config.h
@@ -704,7 +703,7 @@ clean:  clean-hdr clean-noinstPROGRAMS clean-compile clean-libtool \
 
 distclean:  distclean-hdr distclean-noinstPROGRAMS distclean-compile \
                distclean-libtool distclean-aminfo distclean-tags \
-               distclean-generic clean
+               distclean-generic clean distclean-local
        -rm -f config.status
        -rm -f libtool
 
@@ -1201,6 +1200,8 @@ install-data-local:
          $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \
        done
 diststuff: $(LDDISTSTUFF) info
+distclean-local:
+       rm -rf ldscripts
 
 # Targets to rebuild dependencies in this Makefile.
 # Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
index 0281b17..529249d 100755 (executable)
@@ -2298,7 +2298,8 @@ fi
 all_targets=
 EMUL=
 all_emuls=
-TDIRS=
+
+rm -f tdirs
 
 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
 do
@@ -2326,8 +2327,7 @@ do
          all_emuls="$all_emuls e${i}.o"
          eval result=\$tdir_$i
          test -z "$result" && result=$targ_alias
-         TDIRS="$TDIRS\\
-tdir_$i=$result"
+         echo tdir_$i=$result >> tdirs
          ;;
        esac
     done
@@ -2336,6 +2336,8 @@ done
 
 
 
+TDIRS=tdirs
+
 
 if test x${all_targets} = xtrue; then
   if test x${want64} = xtrue; then
@@ -2524,7 +2526,8 @@ s%@HOSTING_CRT0@%$HOSTING_CRT0%g
 s%@HOSTING_LIBS@%$HOSTING_LIBS%g
 s%@NATIVE_LIB_DIRS@%$NATIVE_LIB_DIRS%g
 s%@EMUL@%$EMUL%g
-s%@TDIRS@%$TDIRS%g
+/@TDIRS@/r $TDIRS
+s%@TDIRS@%%g
 s%@EMULATION_OFILES@%$EMULATION_OFILES%g
 
 CEOF
index 8fb33a6..8a27a72 100644 (file)
@@ -70,7 +70,12 @@ BFD_NEED_DECLARATION(getenv)
 all_targets=
 EMUL=
 all_emuls=
-TDIRS=
+
+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
 
 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
 do
@@ -98,8 +103,7 @@ do
          all_emuls="$all_emuls e${i}.o"
          eval result=\$tdir_$i
          test -z "$result" && result=$targ_alias
-         TDIRS="$TDIRS\\
-tdir_$i=$result"
+         echo tdir_$i=$result >> tdirs
          ;;
        esac
     done
@@ -107,7 +111,9 @@ tdir_$i=$result"
 done
 
 AC_SUBST(EMUL)
-AC_SUBST(TDIRS)
+
+TDIRS=tdirs
+AC_SUBST_FILE(TDIRS)
 
 dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
 dnl target, and in those cases we should also build the 64 bit