diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-05-01 18:05:49 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-05-29 11:56:43 -0400 |
commit | 5c9e84c2d8208444772cae8130a23aa27407f32c (patch) | |
tree | 549d735f6de862152ae964f1f1548f78392a5053 /sim/common | |
parent | 63e47e10725f93a4c07ced83050b917bc9e6b205 (diff) | |
download | gdb-5c9e84c2d8208444772cae8130a23aa27407f32c.zip gdb-5c9e84c2d8208444772cae8130a23aa27407f32c.tar.gz gdb-5c9e84c2d8208444772cae8130a23aa27407f32c.tar.bz2 |
sim: leverage gnulib
We use getline, so leverage gnulib to provide fallback implementation.
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/ChangeLog | 9 | ||||
-rw-r--r-- | sim/common/Make-common.in | 9 | ||||
-rw-r--r-- | sim/common/defs.h | 12 |
3 files changed, 28 insertions, 2 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 76bf134..f44e055 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,12 @@ +2021-05-29 Mike Frysinger <vapier@gentoo.org> + + * Make-common.in (GNULIB_BUILDDIR): Define. + Include $(GNULIB_BUILDDIR)/Makefile.gnulib.inc. + (CSEARCH): Add -I../... + (ALL_CFLAGS): Add $(INCGNU). + (EXTRA_LIBS): Add $(LIBGNU). + * defs.h: Include gnulib/config.h. Undefine PACKAGE* defines. + 2021-05-17 Mike Frysinger <vapier@gentoo.org> * sim-base.h (SIM_HAVE_COMMON_SIM_STATE): Delete. diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index d38c849..8f52cf5 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -40,6 +40,10 @@ srccom = $(srcdir)/../common srcroot = $(srcdir)/../.. srcsim = $(srcdir)/.. +# Helper code from gnulib. +GNULIB_BUILDDIR = ../../gnulib +include $(GNULIB_BUILDDIR)/Makefile.gnulib.inc + prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -232,8 +236,9 @@ CSEARCH = -I. -I$(srcdir) -I../common -I$(srccom) \ -I../../include -I$(srcroot)/include \ -I../../bfd -I$(srcroot)/bfd \ -I../../opcodes -I$(srcroot)/opcodes \ + -I../.. \ @INCINTL@ -ALL_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS) $(CFLAGS) +ALL_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(INCGNU) $(SIM_EXTRA_CFLAGS) $(CFLAGS) BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH) COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS) @@ -248,7 +253,7 @@ LIBINTL_DEP = @LIBINTL_DEP@ CONFIG_LIBS = @LIBS@ $(ZLIB) LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL_DEP) $(LIBIBERTY_LIB) EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL) $(LIBIBERTY_LIB) \ - $(CONFIG_LIBS) $(SIM_EXTRA_LIBS) $(LIBDL) + $(CONFIG_LIBS) $(SIM_EXTRA_LIBS) $(LIBDL) $(LIBGNU) LIB_OBJS = callback.o modules.o syscall.o targ-map.o version.o \ $(SIM_OBJS) diff --git a/sim/common/defs.h b/sim/common/defs.h index 3a0737c..957e36d 100644 --- a/sim/common/defs.h +++ b/sim/common/defs.h @@ -22,6 +22,18 @@ #ifdef HAVE_CONFIG_H +/* Include gnulib's various configure tests. */ +#include "gnulib/config.h" + +/* Reset macros that our config.h will provide. */ +#undef PACKAGE +#undef PACKAGE_BUGREPORT +#undef PACKAGE_NAME +#undef PACKAGE_STRING +#undef PACKAGE_TARNAME +#undef PACKAGE_URL +#undef PACKAGE_VERSION + /* Include sim's various configure tests. */ #include "config.h" |