1 dnl Check to find the miniupnpc headers/libraries
3 AC_DEFUN([tinc_MINIUPNPC],
5 AC_ARG_ENABLE([miniupnpc],
6 AS_HELP_STRING([--enable-miniupnpc], [enable miniupnpc support]))
7 AS_IF([test "x$enable_miniupnpc" = "xyes"], [
8 AC_DEFINE(HAVE_MINIUPNPC, 1, [have miniupnpc support])
10 AS_HELP_STRING([--with-miniupnpc=DIR], [miniupnpc base directory, or:]),
12 CPPFLAGS="$CPPFLAGS -I$withval/include"
13 LDFLAGS="$LDFLAGS -L$withval/lib"]
16 AC_ARG_WITH(miniupnpc-include,
17 AS_HELP_STRING([--with-miniupnpc-include=DIR], [miniupnpc headers directory]),
18 [miniupnpc_include="$withval"
19 CPPFLAGS="$CPPFLAGS -I$withval"]
22 AC_ARG_WITH(miniupnpc-lib,
23 AS_HELP_STRING([--with-miniupnpc-lib=DIR], [miniupnpc library directory]),
24 [miniupnpc_lib="$withval"
25 LDFLAGS="$LDFLAGS -L$withval"]
28 AC_CHECK_HEADERS(miniupnpc/miniupnpc.h,
30 [AC_MSG_ERROR("miniupnpc header files not found."); break]
33 AC_CHECK_LIB(miniupnpc, upnpDiscover,
34 [MINIUPNPC_LIBS="$LIBS -lminiupnpc"],
35 [AC_MSG_ERROR("miniupnpc libraries not found.")]
39 AC_SUBST(MINIUPNPC_LIBS)