This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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]

Re: [patch/rfc] Build inf-ptrace.o when ptrace available


   Date: Wed, 13 Oct 2004 09:54:05 -0400
   From: Daniel Jacobowitz <drow@false.org>

   I wrote that my experience with automated builds suggested that a
   problem _would_ occur.  I don't have an example of this problem
   occuring, but I don't think we need one to understand why it is an
   unsound design principle.  The change would cause inf-ptrace to be
   built on more systems/configurations (where GDB wouldn't know how to
   use it), and could potentially cause it to be built on fewer systems
   (where GDB wouldn't work without it).  No win.

We should try to make things as robust as possible.  In many cases
autoconfiguring makes things more robust than hardcoding things based
on a host triplet.  In some cases this may not be the case though, and
I think inf-ptrace is such a case.

   > >>>If we used configure.tgt and:
   > >>>	switch "$target"
   > >>>	 *-*-linux* ) "objs=objs symfile-mem.c"
   > >>>	esac
   > >>>then all GNU/Linux systems will always and consistently include 
   > >>>symtab-mem.c.  We don't, they don't ...
   > >
   > >
   > >This is no harder than having a common linux.mh, as GCC has done for
   > >years (gcc/config/t-linux).  It's not a technical differece between
   > >configure-frobbing and makefile-fragmenting.

Configure-frobbing still gives you more flexibility since it's easier
to change things without having to touch multiple files.  With
makefile-fragmenting, we'd need to modify the configure script in many
cases anyway.  Moreover, configure-frobbing gives you the full
flexibility of the shell syntax.  In a configure.host file for example
I could write things as:

case $host in
  *-openbsd*)
    if test -f $srcdir/${cpu}obsd-nat.c; then
      OBJS += ${cpu}obsd-nat.o
    elif test -f $srcdir/${cpu}nbsd-nat.c; then
      OBJS += ${cpu}nbsd-nat.o
    fi
esac

This could potentially save us quite a substantial number of makefile
fragments.

However, makefile-fragmenting has benefits.  Configure-frobbing can do
variable substition in makefiles, but not much more.
Makefile-fragmenting can use the full makefile syntax.

I'm not sure yet what we need most.  But if our makefile fragments
only contain a list of object files, I'd certainly ditch them in
favour of configure-frobbing.


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