Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Commit

Permalink
Enabling PCRE in autoconf for mqexec.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreams committed Apr 4, 2012
1 parent c66d736 commit 36ad610
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Copyright 2012 Jonathan Reams
Copyright 2012 The Trustees of Columbia University in the City of New York

Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
21 changes: 21 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ AC_ARG_WITH([zmq-headers],
[]
[with_zmq_headers=default])

AC_ARG_WITH([pcre-config],
[AC_HELP_STRING([--with-pcre-config],
[Path to PCRE configuration for mqexec filtering])],
[pcre_config_prog=$withval])
AC_PATH_PROG(PCRE_CONFIG, [pcre-config], $pcre_config_prog)

AC_PROG_CC
AC_PROG_LIBTOOL

Expand All @@ -33,6 +39,21 @@ AC_FUNC_REALLOC
AC_FUNC_STRTOD

m4_include([libev/libev.m4])
if test "x$PCRE_CONFIG" != "x"; then
CFLAGS_SAVE=$CFLAGS
LIBS_SAVE=$LIBS
CFLAGS="$CFLAGS $($PCRE_CONFIG --cflags)"
LIBS="$LIBS $($PCRE_CONFIG --libs)"
AC_CHECK_HEADER([pcre.h], [],
AC_MSG_FAILURE([PCRE was enabled but headers weren't found]), [])
AC_CHECK_LIB([pcre], [pcre_compile], [],
AC_MSG_FAILURE([PCRE was enabled but libraries weren't found]), [])
CFLAGS=$CFLAGS_SAVE
LIBS=$LIBS_SAVE
AC_SUBST([PCRE_HEADERS], $($PCRE_CONFIG --cflags))
AC_SUBST([PCRE_LIBS], $($PCRE_CONFIG --libs))
AC_DEFINE([HAVE_PCRE], [], [PCRE Libraries are installed])
fi

AC_CONFIG_FILES([Makefile mods/Makefile dnxmq/Makefile])
AC_CONFIG_SUBDIRS([jansson])
Expand Down
4 changes: 2 additions & 2 deletions dnxmq/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sbin_PROGRAMS = mqexec

mqexec_SOURCES = mqexec.c ../libev/ev.c
mqexec_LDADD = ../jansson/src/libjansson.la
mqexec_CFLAGS = -I../jansson/src
mqexec_LDADD = ../jansson/src/libjansson.la @PCRE_LIBS@
mqexec_CFLAGS = -I../jansson/src @PCRE_HEADERS@
2 changes: 2 additions & 0 deletions dnxmq/config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Define to 1 if you have the PCRE libraries installed */
#undef HAVE_PCRE

0 comments on commit 36ad610

Please sign in to comment.