Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Command line AMQP tools based on rabbitmq-c
Browse files Browse the repository at this point in the history
  • Loading branch information
dpw committed Feb 20, 2010
1 parent 55ac202 commit c90336e
Show file tree
Hide file tree
Showing 11 changed files with 773 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

^librabbitmq/amqp_framing\.[ch]$

^(|librabbitmq/|tests/|examples/)Makefile(\.in)?$
^(|librabbitmq/|tests/|examples/|tools/)Makefile(\.in)?$
^tests/test_tables$
^examples/amqp_sendstring$
^examples/amqp_exchange_declare$
Expand All @@ -28,3 +28,6 @@
^examples/amqp_unbind$
^examples/amqp_bind$
^examples/amqp_listenq$
^tools/amqp-publish$
^tools/amqp-get$
^tools/amqp-consume$
10 changes: 8 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
SUBDIRS=librabbitmq tests examples
if TOOLS
TOOLS_SUBDIR=tools
else
TOOLS_SUBDIR=
endif

SUBDIRS=librabbitmq tests examples $(TOOLS_SUBDIR)

squeakyclean: maintainer-clean
rm -f Makefile.in librabbitmq/Makefile.in tests/Makefile.in examples/Makefile.in
rm -f Makefile.in librabbitmq/Makefile.in tests/Makefile.in examples/Makefile.in tools/Makefile.in
rm -f aclocal.m4
rm -f config.guess config.h.in* config.sub configure
rm -f depcomp install-sh ltmain.sh missing
Expand Down
20 changes: 20 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([config.h])

dnl Program checks
AC_GNU_SOURCE
AC_PROG_CC

dnl Library checks
Expand Down Expand Up @@ -63,9 +64,28 @@ AC_SUBST(AMQP_CODEGEN_DIR)
AC_SUBST(AMQP_SPEC_JSON_PATH)
AC_SUBST(PYTHON)

AC_ARG_WITH([popt],
[AS_HELP_STRING([--with-popt], [use the popt library. Needed for tools])],
[],
[with_popt=check])

LIBPOPT=
AS_IF([test "x$with_popt" != xno],
[AC_CHECK_LIB([popt], [poptGetContext],
[AC_SUBST([LIBPOPT], ["-lpopt"])
AC_DEFINE([HAVE_LIBPOPT], [1], [Define if you have libpopt])
],
[if test "x$with_popt" != xcheck; then
AC_MSG_FAILURE([--with-popt was given, but test for libpopt failed])
fi
])])

AM_CONDITIONAL(TOOLS, test "x$LIBPOPT" != "x")

AC_OUTPUT(
Makefile
librabbitmq/Makefile
tests/Makefile
examples/Makefile
tools/Makefile
)
12 changes: 12 additions & 0 deletions tools/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
bin_PROGRAMS = amqp-publish amqp-get amqp-consume

AM_CFLAGS = -I$(top_srcdir)/librabbitmq
AM_LDFLAGS = $(top_builddir)/librabbitmq/librabbitmq.la

LDADD=$(LIBPOPT)

noinst_HEADERS = common.h

amqp_publish_SOURCES = publish.c common.c
amqp_get_SOURCES = get.c common.c common_consume.c
amqp_consume_SOURCES = consume.c common.c common_consume.c
Loading

0 comments on commit c90336e

Please sign in to comment.