summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-05-01 18:05:49 -0400
committerMike Frysinger <vapier@gentoo.org>2021-05-29 11:56:43 -0400
commit5c9e84c2d8208444772cae8130a23aa27407f32c (patch)
tree549d735f6de862152ae964f1f1548f78392a5053
parent63e47e10725f93a4c07ced83050b917bc9e6b205 (diff)
sim: leverage gnulib
We use getline, so leverage gnulib to provide fallback implementation.
-rw-r--r--ChangeLog5
-rwxr-xr-xconfigure3
-rw-r--r--configure.ac3
-rw-r--r--sim/common/ChangeLog9
-rw-r--r--sim/common/Make-common.in9
-rw-r--r--sim/common/defs.h12
-rw-r--r--sim/ppc/ChangeLog4
-rw-r--r--sim/ppc/Makefile.in2
8 files changed, 44 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 26eb827412..53ec7cb152 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-05-29 Mike Frysinger <vapier@gentoo.org>
+
+ * configure.ac: Add gnulib to configdirs for sim.
+ * configure: Regenerate.
+
2021-05-24 Maciej W. Rozycki <macro@orcam.me.uk>
* MAINTAINERS: Update path to readline config.{sub,guess} files.
diff --git a/configure b/configure
index 544a8d19c7..3dd206525a 100755
--- a/configure
+++ b/configure
@@ -7504,6 +7504,9 @@ case " ${configdirs} " in
*\ gdbserver\ *)
configdirs="${configdirs} gnulib gdbsupport"
;;
+ *\ sim\ *)
+ configdirs="${configdirs} gnulib"
+ ;;
esac
# Strip out unwanted targets.
diff --git a/configure.ac b/configure.ac
index 59b4194fb2..797a624621 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2812,6 +2812,9 @@ case " ${configdirs} " in
*\ gdbserver\ *)
configdirs="${configdirs} gnulib gdbsupport"
;;
+ *\ sim\ *)
+ configdirs="${configdirs} gnulib"
+ ;;
esac
# Strip out unwanted targets.
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 76bf134fa3..f44e0559e6 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 d38c849c40..8f52cf5e53 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 3a0737cb9b..957e36d3c9 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"
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 0755fe288b..15b50ef50d 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-29 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (INCLUDES): Add -I../..
+
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (gentmap): Pass -DUSE_CONFIG_H.
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 5ce511e96b..1996e13279 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -147,7 +147,7 @@ LIB_INCLUDES = -I$(srcdir)/../../include
BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config
-INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES)
+INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES) -I../..
LIBIBERTY_LIB = ../../libiberty/libiberty.a
BFD_LIB = ../../bfd/libbfd.a