Re: [rfa/rfc] Build libcommon.a for gdb and gdbserver

Tom Tromey
2011-01-28T14:54:02Z

Tom> Another idea would be to just have gdb/configure, but have a special
Tom> Makefile target that only builds gdbserver. Then all the configury
Tom> would be unified; maybe this is the best option, for that reason.

Yao> I thought of this, but it makes gdb/configure in mess when we move
Yao> everything to gdb/configure. Finally, IMO, it is better to create
Yao> separate Makefile.in/configure.ac in common/, whic scales well when we
Yao> move more files to common/ later.

I think gdb/configure is already pretty messy. It is more than 2000
lines of code. A few more for gdbserver aren't going to hurt much, IMO.

The problem I have with adding another configure script is that
presumably it must arrive at all the same conclusions as both gdb and
gdbserver's configure scripts. That means either maintaining things in
parallel -- which will be fragile -- or putting a bunch of code into
shared .m4 files. But then... why run that same code multiple times,
when we can just do it once?

Yao> 3. Including different headers when building libcommon.a for gdb and
Yao> gdbserver.

I don't understand this. I didn't see it in the patch.

Yao> 4 Building libcommon.a for gdb and gdbserver respectively.

This seems to mean that we must build libcommon twice. I don't
understand that -- what is the benefit, versus having a single library?

Yao> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
[...]
Yao> +$(LIBCOMMON): $(LIBCOMMON_DIR)/Makefile
Yao> + @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS=common subdir_do
Yao> +
Yao> +configure-common:
Yao> + @: $(MAKE); $(unstage)
Yao> + @r=`${PWD_COMMAND}`; export r; \
Yao> + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \

I believe gdb/configure will take care of this, because `common' is now
in AC_CONFIG_SUBDIRS.

Tom