Anonymous avatar Anonymous committed 3c3da1c

Add separate configure option for the wdb/lua debug bits

Comments (0)

Files changed (2)

 RLLDFLAGS = @RL_LDFLAGS@
 RLCFLAGS = @RL_CFLAGS@
 TRACELDFLAGS = @CORONER_LDFLAGS@
-bin_PROGRAMS = monitor glider #wdb
+if WDB
+wdb = wdb
+liblua = liblua.la
+else
+wdb =
+lublua =
+endif
+bin_PROGRAMS = monitor glider $(wdb)
 noinst_PROGRAMS = wedgie
 lib_LTLIBRARIES = libgimli.la libgimli_ana.la
+if WDB
 noinst_LTLIBRARIES = liblua.la
+endif
 man1_MANS = man/monitor.1 man/glider.1
 include_HEADERS = libgimli.h libgimli_ana.h
 
 monitor_SOURCES = main.c proctitle.c config.c
 glider_SOURCES = glider.c
-glider_LDADD = libgimli_ana.la liblua.la $(TRACELDFLAGS)
+glider_LDADD = libgimli_ana.la $(liblua) $(TRACELDFLAGS)
 
 libgimli_ana_la_SOURCES = \
 	trace.c linux.c elf.c hash.c elf-read.c dwarf-read.c dwarf-unwind.c \
 libgimli_la_SOURCES = \
   heartbeat.c
 
+if WDB
 liblua_la_SOURCES = \
 	lua/lapi.c lua/lcode.c lua/ldebug.c lua/ldo.c lua/ldump.c lua/lfunc.c \
 	lua/lgc.c lua/llex.c lua/lmem.c lua/lobject.c lua/lopcodes.c \
 wdb_SOURCES = wdb.c wdb-objs.c
 wdb_CPPFLAGS = -Ilua $(RLCFLAGS)
 wdb_LDADD = libgimli_ana.la liblua.la $(RLLDFLAGS) $(TRACELDFLAGS)
+endif
 
 wedgie_SOURCES = wedgie.c
 wedgie_LDADD = libgimli.la -lpthread
 ])
 AC_CHECK_SIZEOF(void*)
 
-AC_DEFINE(LUA_USE_POSIX, 1, [Use POSIX functions])
-AC_DEFINE(LUA_USE_DLOPEN, 1, [Use dlopen for loading modules])
-AC_DEFINE_UNQUOTED(LUA_ROOT, "$prefix/", [Installation prefix])
-AC_DEFINE(LUA_VERMAJORMINOR, "5.1", [First two version number octets])
-AC_SUBST(PACKAGE_VERMAJORMINOR, 5.1)
+AC_ARG_ENABLE(wdb,
+[  --enable-wdb     Enable lua based debugger shell],
+[
+  AC_DEFINE(LUA_USE_POSIX, 1, [Use POSIX functions])
+  AC_DEFINE(LUA_USE_DLOPEN, 1, [Use dlopen for loading modules])
+  AC_DEFINE_UNQUOTED(LUA_ROOT, "$prefix/", [Installation prefix])
+  AC_DEFINE(LUA_VERMAJORMINOR, "5.1", [First two version number octets])
+  AC_SUBST(PACKAGE_VERMAJORMINOR, 5.1)
 
-AC_ARG_WITH(readline,
-[  --with-readline   link ldb against libreadline],
-[
-  LDFLAGS_SAVE="$LDFLAGS"
-  LDFLAGS="-L$withval"
-  AC_CHECK_LIB(readline, readline, [
-    AC_SUBST(RL_LDFLAGS, "-lreadline")
-    AC_SUBST(RL_CFLAGS, "-DLUA_USE_READLINE")
+  AC_ARG_WITH(readline,
+  [  --with-readline   link wdb against libreadline],
+  [
+    LDFLAGS_SAVE="$LDFLAGS"
+    LDFLAGS="-L$withval"
+    AC_CHECK_LIB(readline, readline, [
+      AC_SUBST(RL_LDFLAGS, "-lreadline")
+      AC_SUBST(RL_CFLAGS, "-DLUA_USE_READLINE")
+    ])
+    LDFLAGS="$LDFLAGS_SAVE"
   ])
-  LDFLAGS="$LDFLAGS_SAVE"
+
+  AC_ARG_WITH(libedit,
+  [  --with-libedit    link wdb against libedit],
+  [
+    LDFLAGS_SAVE="$LDFLAGS"
+    LDFLAGS="-L$withval"
+    AC_CHECK_LIB(edit, readline, [
+      AC_SUBST(RL_LDFLAGS, "-ledit")
+      AC_SUBST(RL_CFLAGS, "-DLUA_USE_READLINE")
+    ])
+    LDFLAGS="$LDFLAGS_SAVE"
+  ])
+  HAVE_WDB=1
+],[
+  HAVE_WDB=0
 ])
-
-AC_ARG_WITH(libedit,
-[  --with-libedit    link ldb against libedit],
-[
-  LDFLAGS_SAVE="$LDFLAGS"
-  LDFLAGS="-L$withval"
-  AC_CHECK_LIB(edit, readline, [
-    AC_SUBST(RL_LDFLAGS, "-ledit")
-    AC_SUBST(RL_CFLAGS, "-DLUA_USE_READLINE")
-  ])
-  LDFLAGS="$LDFLAGS_SAVE"
-])
+AM_CONDITIONAL([WDB], [test x$HAVE_WDB = x1])
 
 AC_CONFIG_HEADERS(gimli_config.h)
 AC_CONFIG_FILES(Makefile)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.