Description: Only build debug_disasm.o if needed
Author: Stephen Kitt <skitt@debian.org>

debug_disasm.cpp is licensed under GPL-2.0-only, which is incompatible
with some of the other licenses used in the project. To make it clear
that the release build doesn't use this file, exclude it from the
build unless the debugger is enabled.

--- a/src/debug/Makefile.am
+++ b/src/debug/Makefile.am
@@ -1,4 +1,8 @@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 
 noinst_LIBRARIES = libdebug.a
-libdebug_a_SOURCES = debug.cpp debug_gui.cpp debug_disasm.cpp debug_inc.h disasm_tables.h debug_win32.cpp
\ No newline at end of file
+libdebug_a_SOURCES = debug_gui.cpp debug_inc.h disasm_tables.h debug_win32.cpp
+
+if C_DEBUG
+libdebug_a_SOURCES += debug.cpp debug_disasm.cpp
+endif
--- a/configure.ac
+++ b/configure.ac
@@ -948,6 +948,7 @@
      AC_MSG_ERROR([Can't find curses, which is required for debug mode])
    fi
 ],)
+AM_CONDITIONAL(C_DEBUG, test "x$enable_debug" = "xyes" || test "x$enable_debug" = "xheavy")
 
 dnl automake 1.14 and upwards rewrite the host to have always 64 bit unless i386 as host is passed
 dnl this can make building a 32 bit executable a bit tricky, as dosbox relies on the host to select the
