This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

(toplevel patch) Configure in Makefile version 2


Revision, addressing a rather interesting problem which showed up in the 
bootstrap target sometimes: GCC bootstrapped and then was remade using 
the 'all' target, causing various strange problems.

Bootstrap in progress.  I'll also build a cross-compiler to
a multilibbed target.

DJ, I've never successfully made a Canadian cross under GCC, due to
my inability to install cross toolchains correctly.  Can you do that test? :-/  

(I've actually been finding less trouble in cross cases, overall, because 
they're more 'systematic' than the native case.)

---
This causes all subdirectories to be configured in the Makefile, always.

	* configure.in: Substitute more.
	* configure: Run subconfigures from the Makefile.
	* Makefile.tpl: Run subconfigures from the Makefile; add a few
	convenience targets.  Make sure gcc isn't rebuilt after bootstrap.
	* Makefile.in: Regenerate.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.177.4.16
diff -u -r1.177.4.16 configure.in
--- configure.in	3 Dec 2002 23:34:52 -0000	1.177.4.16
+++ configure.in	5 Dec 2002 02:03:51 -0000
@@ -1402,6 +1402,7 @@
   install_host_modules="${install_host_modules} install-${module}"
   configure_host_modules="${configure_host_modules} configure-${module}"
 done
+all_host_modules_nogcc=`echo "${all_host_modules}" | sed -e 's/all-gcc//g'`
 install_host_modules_nogcc=`echo "${install_host_modules}" | sed -e 's/install-gcc//g'`
 
 all_target_modules=
@@ -1706,12 +1707,15 @@
 sedtemp=sed.$$
 cat >$sedtemp <<EOF
 s%@GDB_TK@%${GDB_TK}%
-s%@all_build_modules@%${all_build_modules}%
 s%@configure_build_modules@%${configure_build_modules}%
+s%@all_build_modules@%${all_build_modules}%
+s%@configure_host_modules@%${configure_host_modules}%
 s%@all_host_modules@%${all_host_modules}%
+s%@all_host_modules_nogcc@%${all_host_modules_nogcc}%
 s%@check_host_modules@%${check_host_modules}%
 s%@install_host_modules@%${install_host_modules}%
 s%@install_host_modules_nogcc@%${install_host_modules_nogcc}%
+s%@configure_target_modules@%${configure_target_modules}%
 s%@all_target_modules@%${all_target_modules}%
 s%@check_target_modules@%${check_target_modules}%
 s%@install_target_modules@%${install_target_modules}%
Index: configure
===================================================================
RCS file: /cvs/gcc/gcc/configure,v
retrieving revision 1.46.6.8
diff -u -r1.46.6.8 configure
--- configure	3 Dec 2002 03:42:19 -0000	1.46.6.8
+++ configure	5 Dec 2002 02:03:58 -0000
@@ -1396,98 +1396,6 @@
 fi
 ${config_shell} ${moveifchange} ./config.new ./config.status
 
-# If there are subdirectories, then recur.
-if [ -z "${norecursion}" ] && [ -n "${configdirs}" ] ; then 
-        for configdir in ${configdirs} ${extraconfigdirs} ; do
-
-		# If configdir contains ',' it is
-		# srcdir,builddir,target_alias
-		# These come from extraconfigdirs.
-		case ${configdir} in
-		*,*)
-		    eval `echo ${configdir} | sed -e 's/\([^,]*\),\([^,]*\),\(.*\)/cfg_dir=\1 bld_dir=\2 tgt_alias=\3/'`
-		    ;;
-		*)
-		    cfg_dir=${configdir}
-		    bld_dir=${configdir}
-		    tgt_alias=${target_alias}
-		    ;;
-		esac
-
-                if [ -d ${srcdir}/${cfg_dir} ] ; then
-                        eval echo Configuring ${configdir}... ${redirect}
-                        case "${srcdir}" in
-                        ".") ;;
-                        *)
-                                if [ ! -d ./${bld_dir} ] ; then
-                                        if mkdir ./${bld_dir} ; then
-                                                true
-                                        else
-                                                echo '***' "${progname}: could not make ${PWD=`${PWDCMD-pwd}`}/${bld_dir}" 1>&2
-                                                exit 1
-                                        fi
-                                fi
-                                ;;
-                        esac
-
-                        POPDIR=${PWD=`${PWDCMD-pwd}`}
-                        cd ${bld_dir} 
-
-### figure out what to do with srcdir
-                        case "${srcdir}" in
-                        ".") newsrcdir=${srcdir} ;; # no -srcdir option.  We're building in place.
-                        /* | [A-Za-z]:[\\/]* ) # absolute path
-                                newsrcdir=${srcdir}/${cfg_dir}
-                                srcdiroption="--srcdir=${newsrcdir}"
-                                ;;
-                        *) # otherwise relative
-                                newsrcdir=../${srcdir}/${cfg_dir}
-                                srcdiroption="--srcdir=${newsrcdir}"
-                                ;;
-                        esac
-
-			# Handle --cache-file=../XXX
-			case "${cache_file}" in
-			"") # empty
-				;;
-			/* | [A-Za-z]:[\\/]* ) # absolute path
-				cache_file_option="--cache-file=${cache_file}"
-				;;
-			*) # relative path
-				cache_file_option="--cache-file=../${cache_file}"
-				;;
-			esac
-
-### check for guested configure, otherwise fix possibly relative progname
-                        if [ -f ${newsrcdir}/configure ] ; then
-                                recprog=${newsrcdir}/configure
-                        elif [ -f ${newsrcdir}/configure.in ] ; then
-                                case "${progname}" in
-                                /* | [A-Za-z]:[\\/]* )  recprog=${progname} ;;
-                                *)                      recprog=../${progname} ;;
-                                esac
-			else
-				eval echo No configuration information in ${cfg_dir} ${redirect}
-				recprog=
-                        fi
-
-### The recursion line is here.
-			if [ ! -z "${recprog}" ] ; then
-	                        if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${tgt_alias} \
-        	                        ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
-                	                ${srcdiroption} ${diroptions} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${floating_pointoption} ${cache_file_option} ${other_options} ${redirect} ; then
-	                                true
-        	                else
-					echo Configure in `${PWDCMD-pwd}` failed, exiting. 1>&2
-                	                exit 1
-                        	fi
-			fi
-
-                        cd ${POPDIR}
-                fi
-        done
-fi
-
 # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
 # and reset the trap handler.
 rm -rf ${tmpdir}
Index: Makefile.tpl
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.tpl,v
retrieving revision 1.5.2.21
diff -u -r1.5.2.21 Makefile.tpl
--- Makefile.tpl	4 Dec 2002 01:41:48 -0000	1.5.2.21
+++ Makefile.tpl	5 Dec 2002 02:04:08 -0000
@@ -530,14 +530,8 @@
 
 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
 
-# This is a list of the configure targets for all of the modules which
-# are compiled using the target tools.
-CONFIGURE_TARGET_MODULES =[+
-    FOR target_modules +] \
-	configure-target-[+module+][+
-    ENDFOR target_modules +]
-
-configure-target: $(CONFIGURE_TARGET_MODULES)
+configure-host: @configure_host_modules@
+configure-target: @configure_target_modules@
 
 # This is a list of the targets for which we can do a clean-{target}.
 CLEAN_MODULES =[+
@@ -566,6 +560,10 @@
 	@all_host_modules@ \
 	@all_target_modules@
 
+# Used for bootstrap.
+all-nogcc: @all_build_modules@ @all_host_modules_nogcc@ @all_target_modules@
+
+all-host: @all_host_modules@
 all-target: @all_target_modules@
 
 # Do a target for all the subdirectories.  A ``make do-X'' will do a
@@ -910,7 +908,7 @@
 
 .PHONY: all-[+module+] maybe-all-[+module+]
 maybe-all-[+module+]:
-all-[+module+]:
+all-[+module+]: configure-[+module+]
 	@r=`${PWD}`; export r; \
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
@@ -1141,15 +1139,11 @@
 
 .PHONY: all-gcc maybe-all-gcc
 maybe-all-gcc:
-all-gcc:
-	@if [ -f ./gcc/Makefile ] ; then \
-	  r=`${PWD}`; export r; \
+all-gcc: configure-gcc
+	@r=`${PWD}`; export r; \
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
-	else \
-	  true; \
-	fi
 
 # Building GCC uses some tools for rebuilding "source" files
 # like texinfo, bison/byacc, etc.  So we must depend on those.
@@ -1162,7 +1156,7 @@
 # in parallel.
 #
 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap
-bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap
+bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap configure-gcc
 	@r=`${PWD}`; export r; \
 	s=`cd $(srcdir); ${PWD}`; export s; \
 	$(SET_LIB_PATH) \
@@ -1188,7 +1182,7 @@
 	s=`cd $(srcdir); ${PWD}` ; export s; \
 	$(SET_LIB_PATH) \
 	echo "Building runtime libraries"; \
-	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
+	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all-nogcc
 
 .PHONY: cross
 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]