[patch] Use $target_subdir in a more normal way in gcc

Nathanael Nerode neroden@twcny.rr.com
Sat Jun 7 01:35:00 GMT 2003


This changes target_subdir in gcc to be compatible with target_subdir as used
at the top level (where it is always present).  No behavior changes.

One of several steps towards normalizing variable usage in configure and Make
files.

Tested on i686-pc-linux-gnu.

	* configure.in: Make $(target_subdir) correspond with top level usage.
	* Makefile.in: Likewise.
	* configure: Regenerate.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.677
diff -u -r1.677 configure.in
--- configure.in	5 Jun 2003 16:36:03 -0000	1.677
+++ configure.in	7 Jun 2003 01:29:12 -0000
@@ -38,10 +38,7 @@
 AC_SUBST(build_canonical)
 AC_SUBST(host_canonical)
 
-target_subdir=
-if test "${host}" != "${target}" ; then
-    target_subdir=${target_alias}/
-fi
+target_subdir=${target_alias}
 AC_SUBST(target_subdir)
 	
 # Set program_transform_name
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1070
diff -u -r1.1070 Makefile.in
--- Makefile.in	6 Jun 2003 09:24:21 -0000	1.1070
+++ Makefile.in	7 Jun 2003 01:29:22 -0000
@@ -3230,7 +3230,7 @@
 # These targets are for the dejagnu testsuites. The file site.exp
 # contains global variables that all the testsuites will use.
 
-# Set to $(target_alias)/ for cross.
+# Set to $(target_alias).
 target_subdir = @target_subdir@
 
 site.exp: ./config.status Makefile
@@ -3261,9 +3261,10 @@
 # ??? Another way to solve this might be to rely on linker scripts.  Then
 # theoretically the -B won't be needed.
 # We also need to pass -L ../ld so that the linker can find ldscripts.
-	@if [ -d $(objdir)/../$(target_subdir)newlib ] ; then \
-	  echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \
-	  echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)newlib/\"" >> ./tmp0; \
+	@if [ -d $(objdir)/../$(target_subdir)/newlib ] \
+	    && [ "${host_canonical}" != "${target}" ]; then \
+	  echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)/newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \
+	  echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)/newlib/\"" >> ./tmp0; \
 	  echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
 	  echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
 	  echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmp0; \



More information about the Gcc-patches mailing list