From b3af89061896d247da0d29bb3e83b22b7f0a145c Mon Sep 17 00:00:00 2001 From: darkcoven Date: Sat, 28 Sep 2013 00:56:07 +0200 Subject: [PATCH] Enable spy support --- .gitignore | 2 +- Makefile.am | 6 +++--- configure.ac | 17 +++++++++++++++++ dump/Makefile | 34 ---------------------------------- spy/Makefile.am | 3 +++ spy/man/Makefile.am | 3 +++ spy/src/Makefile.am | 7 +++++++ dump/dump.c => spy/src/spy.c | 0 8 files changed, 34 insertions(+), 38 deletions(-) delete mode 100644 dump/Makefile create mode 100644 spy/Makefile.am create mode 100644 spy/man/Makefile.am create mode 100644 spy/src/Makefile.am rename dump/dump.c => spy/src/spy.c (100%) diff --git a/.gitignore b/.gitignore index 0ad50c4..bffc0ff 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ *.a *.la admin -ngdump +ngspy lib/doc/ raw/doc/ *.m4 diff --git a/Makefile.am b/Makefile.am index efaba3e..3146684 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I . SUBDIRS = raw lib cli -#if ENABLE_SPY -#SUBDIRS += dump -#endif +if ENABLE_SPY +SUBDIRS += spy +endif diff --git a/configure.ac b/configure.ac index ed7bdaf..0987be3 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,13 @@ AC_ARG_ENABLE(doc, [AS_HELP_STRING([--enable-doc], [enable documentation generation [default=no]])], [enable_doc=yes], [enable_doc=no]) +# enable/disable build of NgSpy +AC_ARG_ENABLE(spy, + [AS_HELP_STRING([--enable-spy], [enable NgSpy [default=no]])], + [enable_spy=yes], [enable_spy=no]) +AM_CONDITIONAL(ENABLE_SPY, test x$enable_spy = xyes) + + if test "x${enable_doc}" = xyes; then AC_CHECK_PROGS([DOXYGEN], [doxygen]) @@ -92,6 +99,15 @@ AC_CONFIG_FILES([ cli/src/Makefile ]) +AM_COND_IF([ENABLE_SPY], [ + AC_CONFIG_FILES([ + spy/Makefile + spy/man/Makefile + spy/src/Makefile + ]) +]) + + AC_OUTPUT @@ -101,6 +117,7 @@ Prefix.............: ${prefix} Debug..............: ${enable_debug} Compiler...........: ${CC} ${CFLAGS} ${CPPFLAGS} Readline suppport..: ${with_readline} +Spy................: ${enable_spy} " diff --git a/dump/Makefile b/dump/Makefile deleted file mode 100644 index 9d347c1..0000000 --- a/dump/Makefile +++ /dev/null @@ -1,34 +0,0 @@ - -CC=gcc -CFLAGS=-I../raw/include/ -W -Wall -Wextra -Os -LDFLAGS=-L../raw -lrawnsdp -EXEC=ngdump - -SRC=$(wildcard *.c) -OBJ=$(SRC:.c=.o) - - -ifeq ($(DEBUG), yes) -CFLAGS+=-g -LDFLAGS+=-g -else -CFLAGS+=-fomit-frame-pointer -LDFLAGS+=-s -endif - - -$(EXEC): $(OBJ) - $(CC) $^ -o $@ $(LDFLAGS) - -%.o: %.c - $(CC) -c $^ -o $@ $(CFLAGS) - - -clean: - @rm -f *.o - -mrproper: clean - @rm -f $(EXEC) - - - diff --git a/spy/Makefile.am b/spy/Makefile.am new file mode 100644 index 0000000..1c0c975 --- /dev/null +++ b/spy/Makefile.am @@ -0,0 +1,3 @@ + +SUBDIRS = man src + diff --git a/spy/man/Makefile.am b/spy/man/Makefile.am new file mode 100644 index 0000000..b28b04f --- /dev/null +++ b/spy/man/Makefile.am @@ -0,0 +1,3 @@ + + + diff --git a/spy/src/Makefile.am b/spy/src/Makefile.am new file mode 100644 index 0000000..9a61a82 --- /dev/null +++ b/spy/src/Makefile.am @@ -0,0 +1,7 @@ + +bin_PROGRAMS = ngspy + +ngspy_SOURCES = spy.c +ngspy_CPPFLAGS = -I$(top_srcdir)/raw/include/ +ngspy_LDADD = $(top_builddir)/raw/src/librawnsdp.la + diff --git a/dump/dump.c b/spy/src/spy.c similarity index 100% rename from dump/dump.c rename to spy/src/spy.c -- 2.39.2