Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 5/5] sim erc32: Add include path for readline.
Date: Wed, 14 Apr 2021 16:02:59 -0700	[thread overview]
Message-ID: <20210414230259.19234-6-jhb@FreeBSD.org> (raw)
In-Reply-To: <20210414230259.19234-1-jhb@FreeBSD.org>

Add a READLINE_CFLAGS variable which adds the include path to the
in-tree readline when using the in-tree readline library.

sim/erc32/ChangeLog:

	* Makefile.in (READLINE_SRC, READLINE_CFLAGS): Add.
	(SIM_EXTRA_CFLAGS): Add READLINE_CFLAGS.
	* configure: Rebuild.
	* configure.ac (READLINE_CFLAGS): Add.
---
 sim/erc32/ChangeLog    | 7 +++++++
 sim/erc32/Makefile.in  | 6 +++++-
 sim/erc32/configure    | 8 ++++++--
 sim/erc32/configure.ac | 3 +++
 4 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/sim/erc32/ChangeLog b/sim/erc32/ChangeLog
index 3b85c66beeb..223c29c7bc9 100644
--- a/sim/erc32/ChangeLog
+++ b/sim/erc32/ChangeLog
@@ -1,3 +1,10 @@
+2021-04-14  John Baldwin  <jhb@FreeBSD.org>
+
+	* Makefile.in (READLINE_SRC, READLINE_CFLAGS): Add.
+	(SIM_EXTRA_CFLAGS): Add READLINE_CFLAGS.
+	* configure: Rebuild.
+	* configure.ac (READLINE_CFLAGS): Add.
+
 2021-04-08  Tom Tromey  <tom@tromey.com>
 
 	* func.c: Include sys/time.h.
diff --git a/sim/erc32/Makefile.in b/sim/erc32/Makefile.in
index 0006922904b..be20fb01fb4 100644
--- a/sim/erc32/Makefile.in
+++ b/sim/erc32/Makefile.in
@@ -19,10 +19,14 @@
 ## COMMON_PRE_CONFIG_FRAG
 
 TERMCAP_LIB = @TERMCAP@
+
+READLINE_SRC = $(srcroot)/readline/readline
 READLINE_LIB = @READLINE@
+READLINE_CFLAGS= @READLINE_CFLAGS@
 
 SIM_OBJS = exec.o erc32.o func.o help.o float.o interf.o
 SIM_RUN_OBJS = sis.o
+SIM_EXTRA_CFLAGS = $(READLINE_CFLAGS)
 SIM_EXTRA_LIBS = $(READLINE_LIB) $(TERMCAP_LIB) -lm
 SIM_EXTRA_INSTALL = install-sis
 SIM_EXTRA_CLEAN = clean-sis
@@ -30,7 +34,7 @@ SIM_EXTRA_CLEAN = clean-sis
 # UARTS run at about 115200 baud (simulator time). Add -DFAST_UART to
 # CFLAGS if faster (infinite) UART speed is desired. Might affect the
 # behaviour of UART interrupt routines ...
-SIM_EXTRA_CFLAGS = -DFAST_UART -I$(srcroot)
+SIM_EXTRA_CFLAGS += -DFAST_UART -I$(srcroot)
 
 ## COMMON_POST_CONFIG_FRAG
 
diff --git a/sim/erc32/configure b/sim/erc32/configure
index 3f7227b2e7e..548b11cf4ed 100755
--- a/sim/erc32/configure
+++ b/sim/erc32/configure
@@ -642,6 +642,7 @@ sim_endian
 sim_bitsize
 sim_alignment
 cgen_breaks
+READLINE_CFLAGS
 READLINE
 TERMCAP
 REPORT_BUGS_TEXI
@@ -11227,7 +11228,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11230 "configure"
+#line 11231 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11333,7 +11334,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11336 "configure"
+#line 11337 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12071,6 +12072,7 @@ fi
 # src/readline (if it's there) is configured before src/sim.
 if test -r ../../readline/Makefile; then
   READLINE=../../readline/readline/libreadline.a
+  READLINE_CFLAGS='-I$(READLINE_SRC)/..'
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5
 $as_echo_n "checking for readline in -lreadline... " >&6; }
@@ -12114,9 +12116,11 @@ else
   as_fn_error $? "the required \"readline\" library is missing" "$LINENO" 5
 fi
 
+  READLINE_CFLAGS=
 fi
 
 
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
diff --git a/sim/erc32/configure.ac b/sim/erc32/configure.ac
index 8b7b688322f..cf7ec5fdb80 100644
--- a/sim/erc32/configure.ac
+++ b/sim/erc32/configure.ac
@@ -39,9 +39,12 @@ AC_SUBST(TERMCAP)
 # src/readline (if it's there) is configured before src/sim.
 if test -r ../../readline/Makefile; then
   READLINE=../../readline/readline/libreadline.a
+  READLINE_CFLAGS='-I$(READLINE_SRC)/..'
 else
   AC_CHECK_LIB(readline, readline, READLINE=-lreadline,
 	       AC_ERROR([the required "readline" library is missing]), $TERMCAP)
+  READLINE_CFLAGS=
 fi
 AC_SUBST(READLINE)
+AC_SUBST(READLINE_CFLAGS)
 SIM_AC_OUTPUT
-- 
2.30.1


  parent reply	other threads:[~2021-04-14 23:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14 23:02 [PATCH 0/5] Various build fixes for sims John Baldwin
2021-04-14 23:02 ` [PATCH 1/5] sim: Add SIM_EXTRA_CFLAGS after CSEARCH John Baldwin
2021-04-14 23:56   ` Mike Frysinger via Gdb-patches
2021-04-14 23:02 ` [PATCH 2/5] sim frv: Add a missing return value for frvbf_check_acc_range John Baldwin
2021-04-14 23:54   ` Mike Frysinger via Gdb-patches
2021-11-10  9:33   ` Mike Frysinger via Gdb-patches
2021-04-14 23:02 ` [PATCH 3/5] sim lm32: Use a known-good shell with genmloop.sh John Baldwin
2021-04-14 23:55   ` Mike Frysinger via Gdb-patches
2021-04-14 23:02 ` [PATCH 4/5] sim mn10300: Fix igen generation John Baldwin
2021-04-14 23:53   ` Mike Frysinger via Gdb-patches
2021-04-14 23:02 ` John Baldwin [this message]
2021-04-14 23:56   ` [PATCH 5/5] sim erc32: Add include path for readline Mike Frysinger via Gdb-patches

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=20210414230259.19234-6-jhb@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    /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