Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* (toplevel) introduce host subdir configuration in Makefile
@ 2002-11-28 14:13 Nathanael Nerode
  2002-11-29  8:44 ` Andrew Cagney
  2002-12-02  8:18 ` Daniel Jacobowitz
  0 siblings, 2 replies; 17+ messages in thread
From: Nathanael Nerode @ 2002-11-28 14:13 UTC (permalink / raw)
  To: gcc-patches, gdb-patches, binutils, dj

This introduces configure targets for host modules, but doesn't use them
by default.  To use them right now, you need to configure --norecursion
and then hit each one by hand.  I'll make them used automatically once I 
fiddle around and get the dependencies right for sure.

At the moment it appears that 'gcc','zlib','fastjar', and 'libiberty' can
be configured in any order relative to each other (nice and straightforward).
If anyone knows of specific configure order dependencies, they should tell
me.  I'll be spending a while fiddling with gcc and src trying to identify
any other real configure order dependencies.

The 'safe' way to do it is to have all-foo for *every* host module foo
depend on configure-bar for *every* host module bar, and to have
a huge list of configure-configure dependencies forcing a specific order.
But that's stupid, and it looks to me like there are actually few if any
of these dependences. (Apart from all-foo: configure-foo).  I did include
the one which was actually documented.

Note that the configure target was written to replicate existing behavior 
as closely as possible, and is therefore a bit squirrely; I'll deal with 
that later, but at the moment I want to break as little as possible.

This is made to apply after my outstanding patches.  I hear that there's 
some support for dropping my patches into src now, letting it diverge from 
gcc mainline.  That would be fine with me. :-)  Either way,
the sooner I can get my outstanding patches in the happier I am.

Tested on i686-pc-linux-gnu.  Without --norecursion, behaves as before.
With --norecursion, seems to work as expected, but I'm working on checking
dependencies.  (Although if this goes in, others can help me.)

	* Makefile.tpl: Introduce host module configuration targets.
	* configure.in: Introduce support for them.

--- configure.in.current	2002-11-28 15:08:58.000000000 -0500
+++ configure.in	2002-11-28 16:50:51.000000000 -0500
@@ -1446,6 +1446,18 @@
 # desired.
 buildargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${baseargs}"
 
+# For host modules, accept cache file option, or specification as blank.
+case "${cache_file}" in
+"") # empty
+  cache_file_option="" ;;
+/* | [A-Za-z]:[\\/]* ) # absolute path
+  cache_file_option="--cache-file=${cache_file}" ;;
+*) # relative path
+  cache_file_option="--cache-file=../${cache_file}" ;;
+esac
+
+hostargs="${cache_file_option} ${buildopt} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}"
+
 targargs=${baseargs}
 
 # Passing a --with-cross-host argument lets the target libraries know
@@ -1670,6 +1682,7 @@
 s%@build_subdir@%${build_subdir}%
 s%@build_configargs@%${buildargs}%
 s%@gxx_include_dir@%${gxx_include_dir}%
+s%@host_configargs@%${hostargs}%
 EOF
 sed -f $sedtemp Makefile > Makefile.tem
 rm -f Makefile $sedtemp
--- Makefile.tpl.current	2002-11-28 16:42:32.000000000 -0500
+++ Makefile.tpl	2002-11-28 17:02:07.000000000 -0500
@@ -223,13 +223,17 @@
 BUILD_SUBDIR = @build_subdir@
 
 # This is set by the configure script to the arguments to use when configuring
-# directories built for the target.
-TARGET_CONFIGARGS = @target_configargs@
-
-# This is set by the configure script to the arguments to use when configuring
 # directories built for the build system.
 BUILD_CONFIGARGS = @build_configargs@
 
+# This is set by the configure script to the arguments to use when configuring
+# directories built for the host system.
+HOST_CONFIGARGS = @host_configargs@
+
+# This is set by the configure script to the arguments to use when configuring
+# directories built for the target.
+TARGET_CONFIGARGS = @target_configargs@
+
 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
 # was used.
 SET_LIB_PATH = @SET_LIB_PATH@
@@ -862,6 +866,46 @@
 	      +] $(X11_FLAGS_TO_PASS)[+ 
 	    ENDIF with_x +] all)
 
+.PHONY: configure-[+module+] maybe-configure-[+module+]
+maybe-configure-[+module+]:
+configure-[+module+]: [+module+]/Makefile
+[+module+]/Makefile: config.status
+	@[ -d [+module+] ] || mkdir [+module+]; \
+	r=`${PWD}`; export r; \
+	s=`cd $(srcdir); ${PWD}`; export s; \
+	CC="$(CC)"; export CC; \
+	CFLAGS="$(CFLAGS)"; export CFLAGS; \
+	CXX="$(CXX)"; export CXX; \
+	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
+	if [ z$(build_canonical) !=  z$(host_canoncial) ] ; then \
+	  AR="$(AR)"; export AR; \
+	  AS="$(AS)"; export AS; \
+	  CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
+	  DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
+	  LD="$(LD)"; export LD; \
+	  NM="$(NM)"; export NM; \
+	  RANLIB="$(RANLIB)"; export RANLIB; \
+	  WINDRES="$(WINDRES)"; export WINDRES; \
+	  OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
+	  OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	fi; \
+	echo Configuring in [+module+]; \
+	cd [+module+] || exit 1; \
+	case $(srcdir) in \
+	\.) \
+	  srcdiroption="--srcdir=."; \
+	  libsrcdir=".";; \
+	/* | [A-Za-z]:[\\/]*) \
+	  srcdiroption="--srcdir=$(srcdir)/[+module+]"; \
+	  libsrcdir="$$s/[+module+]";; \
+	*) \
+	  srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \
+	  libsrcdir="$$s/[+module+]";; \
+	esac; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  || exit 1
+
 [+ IF no_check +]
 .PHONY: check-[+module+]
 check-[+module+]:
@@ -1042,6 +1086,46 @@
 	  true; \
 	fi
 
+.PHONY: configure-gcc maybe-configure-gcc
+maybe-configure-gcc:
+configure-gcc: gcc/Makefile
+gcc/Makefile: config.status
+	@[ -d gcc ] || mkdir gcc;\
+	r=`${PWD}`; export r; \
+	s=`cd $(srcdir); ${PWD}`; export s; \
+	CC="$(CC)"; export CC; \
+	CFLAGS="$(CFLAGS)"; export CFLAGS; \
+	CXX="$(CXX)"; export CXX; \
+	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
+	if [ z$(build_canonical) != z$(host_canoncial) ] ; then \
+	  AR="$(AR)"; export AR; \
+	  AS="$(AS)"; export AS; \
+	  CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
+	  DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
+	  LD="$(LD)"; export LD; \
+	  NM="$(NM)"; export NM; \
+	  RANLIB="$(RANLIB)"; export RANLIB; \
+	  WINDRES="$(WINDRES)"; export WINDRES; \
+	  OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
+	  OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	fi; \
+	echo Configuring in gcc; \
+	cd gcc || exit 1; \
+	case $(srcdir) in \
+	\.) \
+	  srcdiroption="--srcdir=."; \
+	  libsrcdir=".";; \
+	/* | [A-Za-z]:[\\/]*) \
+	  srcdiroption="--srcdir=$(srcdir)/gcc"; \
+	  libsrcdir="$$s/gcc";; \
+	*) \
+	  srcdiroption="--srcdir=../$(srcdir)/gcc"; \
+	  libsrcdir="$$s/gcc";; \
+	esac; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  || exit 1
+
 # Building GCC uses some tools for rebuilding "source" files
 # like texinfo, bison/byacc, etc.  So we must depend on those.
 #


^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: (toplevel) introduce host subdir configuration in Makefile
@ 2002-11-29 13:51 Nathanael Nerode
  2002-11-29 14:23 ` Andrew Cagney
  0 siblings, 1 reply; 17+ messages in thread
From: Nathanael Nerode @ 2002-11-29 13:51 UTC (permalink / raw)
  To: gdb-patches

>>At the moment it appears that 'gcc','zlib','fastjar', and 'libiberty' 
>>can
>>be configured in any order relative to each other (nice and 
>>straightforward).
>>If anyone knows of specific configure order dependencies, they should 
>>tell
>>me.  I'll be spending a while fiddling with gcc and src trying to 
>identify
>any other real configure order dependencies.
> Nathanael,
>
> Some heads up.
>
> GDB requires an ISO C compiler and on some systems that involves 
>running the compiler with specific flags (-Ae, I think, on HP/UX?). The 
>problem is that GDB can't test/configure this directly. By time time it 
>has a say in the matter, it is too late. The top level will need to do 
>this very early on.
This *shouldn't*, hopefully, be affected, because this doesn't require
that any other *subdirectories* be built.  The top level still 
determines the value of CC, CFLAGS, and so on and so forth, and passes 
them down to subconfigures and submakes.

> While GDB has a depencency on the SIM directory, it resolves it by 
>testing for ${srcdir)/../sim so that should be ok.
Whee.  I put a dependency in for that anyway because of the comment (in
my follow-up patch).

> While INSIGHT has a dependency on tcl/tk, it appears to resolve it 
>doing some pretty agressive hunting. It looks in both ${srcdir} and 
>`pwd`.
Extensive testing indicated that several subdirs with tcl/tk 
dependencies *did* require that in-source tcl/tk be configured; 
otherwise they used installed tcl/tk (or just failed). I dealt with this
in a subsequent patch (but I'm going to commit these patches as a whole,
probably, once I eventually get to them, since the follow-ups are 
effectively tweaks to the original).

> Andrew
Thanks for all the help.  This particular bit is likely to be the most 
destabilizing of my changes; most of the stuff prior to it was carefully
designed to be "behavior-change-free".

--Nathanael


^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: (toplevel) introduce host subdir configuration in Makefile
@ 2002-11-29 14:40 Nathanael Nerode
  2002-11-29 15:16 ` Andrew Cagney
  0 siblings, 1 reply; 17+ messages in thread
From: Nathanael Nerode @ 2002-11-29 14:40 UTC (permalink / raw)
  To: gdb-patches

>>[...] This particular bit is likely to be the most destabilizing of my 
>>changes; most of the stuff prior to it was carefully
>> designed to be "behavior-change-free".
> Yes, that's why I'd like to see it sooner rather than later. Plenty of 
>time before 5.4/6.0 branches to fix problems.
>
> Andrew
And when is that branch anticipated to happen?  (So I can plan...)

--Nathanael


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2002-12-04 11:14 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-28 14:13 (toplevel) introduce host subdir configuration in Makefile Nathanael Nerode
2002-11-29  8:44 ` Andrew Cagney
2002-12-02  8:18 ` Daniel Jacobowitz
2002-12-02  8:40   ` Alexandre Oliva
2002-12-02  8:52     ` Daniel Jacobowitz
2002-12-02  9:44       ` Alexandre Oliva
2002-12-02 10:23         ` Daniel Jacobowitz
2002-12-02 12:48           ` Alexandre Oliva
2002-12-02 13:43             ` DJ Delorie
2002-12-02 14:03     ` Thomas Dickey
2002-12-04  0:42       ` Samuel Tardieu
2002-12-04  3:14         ` Thomas E. Dickey
2002-12-02 10:17   ` DJ Delorie
2002-11-29 13:51 Nathanael Nerode
2002-11-29 14:23 ` Andrew Cagney
2002-11-29 14:40 Nathanael Nerode
2002-11-29 15:16 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox