summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRashmica Gupta <rashmica.g@gmail.com>2018-11-02 11:46:43 +1100
committerAlistair Popple <alistair@popple.id.au>2018-11-02 14:38:02 +1100
commitbd8a11b744da4650598309a5cc9349cb3f37594b (patch)
tree180b6ba5e226ff0e60bc15065b53b3db7e5cc6d2
parentf2fad542bada02b54ef13769d3bd00bea10fe088 (diff)
downloadpdbg-bd8a11b744da4650598309a5cc9349cb3f37594b.tar.gz
pdbg-bd8a11b744da4650598309a5cc9349cb3f37594b.zip
pdbg/gdbserver: Make gdbserver optional
Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Signed-off-by: Alistair Popple <alistair@popple.id.au>
-rw-r--r--Makefile.am23
-rw-r--r--configure.ac6
-rw-r--r--src/pdbgproxy.c9
3 files changed, 28 insertions, 10 deletions
diff --git a/Makefile.am b/Makefile.am
index 5a9d239..754e75d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -84,23 +84,26 @@ pdbg_SOURCES = \
src/parsers.c \
src/optcmd.c \
src/options_@ARCH@.c \
- src/htm.h \
- src/main.h \
- src/optcmd.h \
- src/options.h \
- src/parsers.h \
- src/progress.h \
- src/pdbgproxy.c \
- src/gdb_parser.c
+ src/pdbgproxy.c
+
+pdbg_CFLAGS = -I$(top_srcdir)/libpdbg -Wall -Werror -DGIT_SHA1=\"${GIT_SHA1}\" \
+ $(ARCH_FLAGS)
+
+if GDBSERVER
+pdbg_SOURCES += \
+ $(extra_sources)
+else
+pdbg_CFLAGS += -DDISABLE_GDBSERVER
+endif
src/main.c: $(DT_headers)
+src/pdbg-gdb_parser.$(OBJEXT): CFLAGS+=-Wno-unused-const-variable
+
pdbg_LDADD = $(DT_objects) libpdbg.la libccan.a \
-L.libs -lrt
pdbg_LDFLAGS = -Wl,--whole-archive,-lpdbg,--no-whole-archive
-pdbg_CFLAGS = -I$(top_srcdir)/libpdbg -Wall -Werror -DGIT_SHA1=\"${GIT_SHA1}\" \
- $(ARCH_FLAGS)
lib_LTLIBRARIES = libpdbg.la libfdt.la
diff --git a/configure.ac b/configure.ac
index 0fbf8ae..a52e1ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,4 +36,10 @@ AC_SUBST([ARCH])
AM_CONDITIONAL([TARGET_ARM], [test x"$ARCH" = "xarm"])
AM_CONDITIONAL([TARGET_PPC], [test x"$ARCH" = "xppc"])
+AC_ARG_ENABLE(gdbserver,
+AC_HELP_STRING([--disable-gdbserver], [disables building the gdbserver]),
+want_gdbserver=false,
+want_gdbserver=true)
+AM_CONDITIONAL([GDBSERVER], [test x$want_gdbserver = xtrue])
+
AC_OUTPUT
diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c
index 7c0344c..697e58e 100644
--- a/src/pdbgproxy.c
+++ b/src/pdbgproxy.c
@@ -25,6 +25,8 @@
#include "debug.h"
#include "chip.h"
+#ifndef DISABLE_GDBSERVER
+
/* Maximum packet size */
#define BUFFER_SIZE 8192
@@ -544,4 +546,11 @@ static int gdbserver(uint16_t port)
gdbserver_start(target, port);
return 0;
}
+#else
+
+static int gdbserver(uint16_t port)
+{
+ return 0;
+}
+#endif
OPTCMD_DEFINE_CMD_WITH_ARGS(gdbserver, gdbserver, (DATA16));
OpenPOWER on IntegriCloud