Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: Pedro Alves <pedro@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [rfa/rfc] Build libcommon.a for gdb and gdbserver
Date: Wed, 23 Feb 2011 17:42:00 -0000	[thread overview]
Message-ID: <m3fwrek6kx.fsf@fleche.redhat.com> (raw)
In-Reply-To: <m3oc62k8wy.fsf@fleche.redhat.com> (Tom Tromey's message of "Wed,	23 Feb 2011 09:33:33 -0700")

>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Tom> What do you think of that?  I may write a patch to do it.

It was simpler than I thought.

The downside of this approach is that changes in common/ mean updating
two Makefiles, not just one.  I think this is an ok tradeoff for getting
rid of a configure script plus the associated rules.

Tom

2011-02-23  Tom Tromey  <tromey@redhat.com>

	* configure: Rebuild.
	* configure.ac: Don't configure in common.
	* Makefile.in (LIBCOMMON_DIR, LIBCOMMON, LIBCOMMON_SRC): Remove.
	(CLIBS, CDEPS): Don't use LIBCOMMON.
	(COMMON_OBS): Add signals.o.
	($(LIBCOMMON), configure-common, common/Makefile): Remove.
	(signals.o): New target.
	* common/Makefile.in: Remove.
	* common/configure.ac: Remove.
	* common/configure: Remove.
	* common/aclocal.m4: Remove.

2011-02-23  Tom Tromey  <tromey@redhat.com>

	* Makefile.in (SFILES): Add signals.c.
	(LIBCOMMON, LIBCOMMON_DIR, LIBCOMMON_SRC): Remove.
	(OBS): Add signals.o.
	($(LIBCOMMON), common/Makefile, configure-common): Remove.
	(gdbserver$(EXEEXT)): Don't use LIBCOMMON.
	(COMMON_CFLAGS): New variable.
	(signals.o): New target.

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 6363773..5e1c5c8 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -142,10 +142,6 @@ LIBDECNUMBER = $(LIBDECNUMBER_DIR)/libdecnumber.a
 LIBDECNUMBER_SRC = $(srcdir)/$(LIBDECNUMBER_DIR)
 LIBDECNUMBER_CFLAGS = -I$(LIBDECNUMBER_DIR) -I$(LIBDECNUMBER_SRC)
 
-LIBCOMMON_DIR = common
-LIBCOMMON = $(LIBCOMMON_DIR)/libcommon.a
-LIBCOMMON_SRC = $(srcdir)/$(LIBCOMMON_DIR)
-
 # Where is the READLINE library?  Typically in ../readline.
 READLINE_DIR = ../readline
 READLINE_SRC = $(srcdir)/$(READLINE_DIR)
@@ -473,10 +469,9 @@ INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_
 CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \
 	$(XM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ @PYTHON_LIBS@ \
 	$(LIBEXPAT) \
-	$(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBCOMMON)
+	$(LIBIBERTY) $(WIN32LIBS) $(LIBGNU)
 CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
-	$(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) \
-        $(LIBCOMMON)
+	$(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
 
 ADD_FILES = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
 ADD_DEPS = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
@@ -892,7 +887,8 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
 	prologue-value.o memory-map.o memrange.o xml-support.o xml-syscall.o \
 	target-descriptions.o target-memory.o xml-tdesc.o xml-builtin.o \
 	inferior.o osdata.o gdb_usleep.o record.o gcore.o \
-	jit.o progspace.o
+	jit.o progspace.o \
+	signals.o
 
 TSOBS = inflow.o
 
@@ -1170,26 +1166,6 @@ all-lib: gnulib/Makefile
 	@$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS=gnulib subdir_do
 .PHONY: all-lib
 
-# 
-$(LIBCOMMON): $(LIBCOMMON_DIR)/Makefile
-	@$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS=common subdir_do
-
-configure-common: 
-	@: $(MAKE); $(unstage)
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-        test ! -f common/Makefile || exit 0; \
-        $(SHELL) $(srcdir)/../mkinstalldirs common ; \
-        $(HOST_EXPORTS)  \
-        echo Configuring in common; \
-        cd "common" || exit 1; \
-        commondir="$$s/common"; \
-        srcdiroption="--srcdir=$${commondir}"; \
-	$(SHELL) $${commondir}/configure --enable-gdbserver=no \
-          $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
-          --target=${target_alias} $${srcdiroption}  \
-          || exit 1
-
 # Convenience rule to handle recursion.
 .PHONY: all-data-directory
 all-data-directory: data-directory/Makefile
@@ -1325,13 +1301,6 @@ data-directory/Makefile: data-directory/Makefile.in config.status @frags@
 	  CONFIG_LINKS= \
 	  $(SHELL) config.status
 
-common/Makefile: configure-common common/Makefile.in config.status @frags@
-        CONFIG_FILES="common/Makefile" \
-          CONFIG_COMMANDS="depfiles" \
-          CONFIG_HEADERS= \
-          CONFIG_LINKS= \
-          $(SHELL) config.status
-
 config.h: stamp-h ; @true
 stamp-h: $(srcdir)/config.in config.status
 	CONFIG_HEADERS=config.h:config.in \
@@ -2136,6 +2105,16 @@ py-value.o: $(srcdir)/python/py-value.c
 	$(POSTCOMPILE)
 
 #
+# gdb/common/ dependencies.
+#
+# Need to explicitly specify the compile rule as make will do nothing
+# or try to compile the object file into the sub-directory.
+
+signals.o: $(srcdir)/common/signals.c
+	$(COMPILE) $(srcdir)/common/signals.c
+	$(POSTCOMPILE)
+
+#
 # Dependency tracking.  Most of this is conditional on GNU Make being
 # found by configure; if GNU Make is not found, we fall back to a
 # simpler scheme.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index f31ef2a..d2b75f6 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -109,7 +109,6 @@ AS_HELP_STRING([--with-relocated-sources=PATH], [automatically relocate this pat
 ])
 
 AC_CONFIG_SUBDIRS(testsuite)
-AC_CONFIG_SUBDIRS(common)
 
 # Check whether to support alternative target configurations
 AC_ARG_ENABLE(targets,
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 352f4f1..f2daaac 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -126,22 +126,20 @@ SFILES=	$(srcdir)/gdbreplay.c $(srcdir)/inferiors.c \
 	$(srcdir)/linux-xtensa-low.c \
 	$(srcdir)/win32-arm-low.c $(srcdir)/win32-i386-low.c \
 	$(srcdir)/win32-low.c $(srcdir)/wincecompat.c \
-	$(srcdir)/hostio.c $(srcdir)/hostio-errno.c
+	$(srcdir)/hostio.c $(srcdir)/hostio-errno.c \
+	$(srcdir)/../common/signals.c
 
 DEPFILES = @GDBSERVER_DEPFILES@
 
 LIBOBJS = @LIBOBJS@
 
-LIBCOMMON_DIR = common
-LIBCOMMON = $(LIBCOMMON_DIR)/libcommon.a
-LIBCOMMON_SRC = $(srcdir)/$(LIBCOMMON_DIR)
-
 SOURCES = $(SFILES)
 TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
 
 OBS = inferiors.o regcache.o remote-utils.o server.o target.o \
 	utils.o version.o \
 	mem-break.o hostio.o event-loop.o tracepoint.o \
+	signals.o \
 	$(XML_BUILTIN) \
 	$(DEPFILES) $(LIBOBJS)
 GDBREPLAY_OBS = gdbreplay.o version.o
@@ -196,32 +194,6 @@ FLAGS_TO_PASS = \
 
 all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT) $(extra_libraries)
 
-$(LIBCOMMON): $(LIBCOMMON_DIR)/Makefile
-	@$(MAKE) $(FLAGS_TO_PASS) DO=all --directory=common
-
-common/Makefile: configure-common config.status
-        CONFIG_FILES="common/Makefile" \
-          CONFIG_COMMANDS="depfiles" \
-          CONFIG_HEADERS= \
-          CONFIG_LINKS= \
-          $(SHELL) config.status
-
-configure-common: 
-	@: $(MAKE); $(unstage)
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-        test ! -f common/Makefile || exit 0; \
-        $(SHELL) $(srcdir)/../../mkinstalldirs common ; \
-        $(HOST_EXPORTS)  \
-        echo Configuring in common; \
-        cd "common" || exit 1; \
-        commondir="$$s/../common"; \
-        srcdiroption="--srcdir=$${commondir}"; \
-	$(SHELL) $${commondir}/configure --enable-gdbserver=yes \
-          $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
-          --target=${target_alias} $${srcdiroption}  \
-          || exit 1
-
 # Traditionally "install" depends on "all".  But it may be useful
 # not to; for example, if the user has made some trivial change to a
 # source file and doesn't care about rebuilding or just wants to save the
@@ -256,10 +228,10 @@ html:
 install-html:
 clean-info:
 
-gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} $(LIBCOMMON)
+gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS}
 	rm -f gdbserver$(EXEEXT)
 	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \
-	$(LIBCOMMON) $(GDBSERVER_LIBS) $(XM_CLIBS)
+	$(GDBSERVER_LIBS) $(XM_CLIBS)
 
 gdbreplay$(EXEEXT): $(GDBREPLAY_OBS)
 	rm -f gdbreplay$(EXEEXT)
@@ -414,6 +386,11 @@ tracepoint.o: tracepoint.c $(server_h) $(srcdir)/../common/ax.def
 utils.o: utils.c $(server_h)
 gdbreplay.o: gdbreplay.c config.h
 
+COMMON_CFLAGS = $(CPPFLAGS) $(INTERNAL_CFLAGS) -DGDBSERVER
+
+signals.o: $(srcdir)/../common/signals.c $(server_h) $(signals_h)
+	$(CC) -c $(COMMON_CFLAGS) $< -o signals.o
+
 # We build memmem.c without -Werror because this file is not under
 # our control.  On LynxOS, the compiler generates some warnings
 # because str-two-way.h uses a constant (MAX_SIZE) whose definition


  reply	other threads:[~2011-02-23 17:24 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-15  0:52 Yao Qi
2011-01-15  0:57 ` Pedro Alves
2011-01-17 17:11 ` Tom Tromey
2011-01-17 18:41   ` Joel Brobecker
2011-01-18  0:42   ` Yao Qi
2011-01-18  5:20     ` Pedro Alves
2011-01-18 15:29     ` Tom Tromey
2011-01-19 23:26       ` Yao Qi
2011-01-28 15:04         ` Tom Tromey
2011-01-28 15:22           ` Pedro Alves
2011-01-28 15:52             ` Pedro Alves
2011-02-03 21:30             ` Tom Tromey
2011-02-11  9:58               ` Yao Qi
2011-02-11 18:47                 ` Tom Tromey
2011-02-12  3:13                   ` Yao Qi
2011-02-14 14:50                     ` Tom Tromey
2011-02-14 15:19                     ` Tom Tromey
2011-02-14 17:43                       ` Pierre Muller
2011-02-14 17:58                         ` Pierre Muller
2011-02-14 18:22                       ` Tom Tromey
2011-02-14 19:31                         ` Change gdb/common/ to use Automake [was: Re: [rfa/rfc] Build libcommon.a for gdb and gdbserver] Pedro Alves
2011-02-14 19:39                           ` Change gdb/common/ to use Automake Tom Tromey
2011-02-14 20:13                             ` Pedro Alves
2011-02-14 20:14                               ` Tom Tromey
2011-02-15  6:46                                 ` Joel Brobecker
2011-02-18 23:59                                 ` Doug Evans
2011-02-14 22:11                               ` Tom Tromey
2011-02-14 23:16                                 ` Pedro Alves
2011-02-18 19:54                                 ` Tom Tromey
2011-02-23  7:21                                   ` Yao Qi
2011-02-23 17:24                                     ` Tom Tromey
2011-02-15 13:08                         ` [rfa/rfc] Build libcommon.a for gdb and gdbserver Pierre Muller
2011-02-15 13:20                           ` Pierre Muller
2011-02-18 16:15                             ` Tom Tromey
2011-02-18 16:58                               ` Pierre Muller
2011-02-18 15:53                         ` Tom Tromey
2011-02-23  5:26                         ` Yao Qi
2011-02-23 16:38                           ` Tom Tromey
2011-02-23 17:42                             ` Tom Tromey [this message]
2011-02-23 18:05                               ` Joel Brobecker
2011-02-23 18:31                               ` Joel Brobecker
2011-02-23 18:47                               ` Pedro Alves
2011-02-23 20:22                                 ` Tom Tromey
2011-02-23 20:28                                   ` Pedro Alves
2011-02-23 20:36                                     ` Tom Tromey
2011-02-23 20:57                                       ` Pedro Alves
2011-02-24  3:58                             ` Yao Qi
2011-02-28 18:10                               ` Tom Tromey
2011-03-01  4:42                                 ` Joel Brobecker
2011-03-01  5:46                                   ` Yao Qi
2011-03-01 10:52                                     ` Joel Brobecker
2011-03-01 14:36                                     ` Tom Tromey
2011-03-02  4:41                                       ` Yao Qi
2011-03-02 14:38                                         ` Tom Tromey
2011-03-03  6:00                                           ` Yao Qi
2011-02-15  8:11                       ` Yao Qi
2011-01-31  2:01           ` Yao Qi
2011-02-12 13:06         ` Yao Qi
2011-02-15 13:54         ` Jan Kratochvil
2011-02-15 15:32           ` Yao Qi
2011-02-15 21:07             ` Jan Kratochvil
2011-02-15 21:18           ` [obv] Merge gdb/common/Changelog to gdb/ChangeLog [Re: [rfa/rfc] Build libcommon.a for gdb and gdbserver] Jan Kratochvil
2011-02-16  1:54             ` Yao Qi
2011-02-16  6:55               ` Jan Kratochvil
2011-02-16  8:38               ` Stan Shebs
2011-02-16 18:17                 ` Michael Snyder
2011-02-16 19:40                   ` Tom Tromey
2011-02-16 19:47                     ` Michael Snyder
2011-02-16 19:57                       ` Tom Tromey
2011-02-16 20:18                         ` Michael Snyder
2011-02-17  4:03                         ` Yao Qi
2011-02-16 22:03                   ` Stan Shebs
2011-02-17 19:02                     ` Frank Ch. Eigler
2011-02-16 16:49               ` Tom Tromey
2011-02-18 18:49         ` [rfa/rfc] Build libcommon.a for gdb and gdbserver Tom Tromey
2011-02-19 12:35           ` Joel Brobecker
2011-02-19 13:20             ` Andreas Tobler
2011-02-19 13:50             ` Mark Kettenis
2011-02-19 17:24               ` Joel Brobecker
2011-02-19 18:01                 ` Mark Kettenis
2011-02-21  6:31                   ` Pedro Alves
2011-02-23 21:53                     ` Mark Kettenis
2011-02-23 22:50                       ` Pedro Alves
2011-02-23 23:50                         ` Pedro Alves
2011-03-06 17:23               ` Jan Kratochvil
2011-03-06 18:23                 ` Mark Kettenis
2011-03-06 18:28                   ` Andreas Schwab
2011-03-06 22:44                     ` [patch] Fix Solaris make gdb/data-directory/ compat. [Re: [rfa/rfc] Build libcommon.a for gdb and gdbserver] Jan Kratochvil
2011-03-07  4:28                       ` Yao Qi
2011-03-07  4:35                         ` Jan Kratochvil
2011-03-07 16:50                       ` Tom Tromey
2011-02-21 18:58         ` [patch] Regression on CFLAGS=-m32 build " Jan Kratochvil
2011-02-21 20:09           ` Jan Kratochvil
2011-01-18  0:45   ` [rfa/rfc] Build libcommon.a for gdb and gdbserver Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3fwrek6kx.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox