f10d180324d8334111bf1afbef151c17fe6a47d4
[vpp.git] / plugins / configure.ac
1 AC_INIT(core_plugins, 1.0)
2 LT_INIT
3 AM_INIT_AUTOMAKE
4
5 AM_PROG_AS
6 AC_PROG_CC
7 AM_PROG_CC_C_O
8
9 AC_ARG_ENABLE(tests,
10               AC_HELP_STRING([--enable-tests], [Build unit tests]),
11               [enable_tests=1],
12               [enable_tests=0])
13
14 AC_ARG_WITH(dpdk,
15             AC_HELP_STRING([--with-dpdk],[Use the Intel dpdk]),
16             [with_dpdk=1],
17             [with_dpdk=0])
18
19 AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" = "1")
20
21 AM_CONDITIONAL(WITH_DPDK, test "$with_dpdk" = "1")
22 AC_SUBST(DPDK,["-DDPDK=${with_dpdk}"])
23
24 AC_DEFUN([PLUGIN_ENABLED],
25 [
26    AC_ARG_ENABLE($1_plugin,
27        AC_HELP_STRING([--disable-$1-plugin], [Do not build $1 plugin]),
28               [enable_the_plugin=0],
29               [enable_the_plugin=1])
30 if test "x$enable_the_plugin" = x1; then
31    AC_CONFIG_SUBDIRS($1-plugin)
32 fi
33 AM_CONDITIONAL(ENABLE_$1_PLUGIN, test "$enable_the_plugin" = "1")
34 ])
35
36 AC_DEFUN([PLUGIN_DISABLED],
37 [
38    AC_ARG_ENABLE($1_plugin,
39        AC_HELP_STRING([--enable-$1-plugin], [Build $1 plugin]),
40               [enable_the_plugin=1],
41               [enable_the_plugin=0])
42 if test "x$enable_the_plugin" = x1; then
43    AC_CONFIG_SUBDIRS($1-plugin)
44 fi
45 AM_CONDITIONAL(ENABLE_$1_PLUGIN, test "$enable_the_plugin" = "1")
46 ])
47
48 # To add a new plugin subdirectory:
49 #
50 # add PLUGIN(new) below, and
51 # add the following to Makefile.am:
52 #
53 # if ENABLE_new_PLUGIN
54 # SUBDIRS += new-plugin
55 # endif
56
57 PLUGIN_ENABLED(sixrd)
58 PLUGIN_ENABLED(ioam)
59 PLUGIN_ENABLED(snat)
60
61 # Disabled plugins, require --enable-XXX-plugin
62 PLUGIN_DISABLED(vcgn)
63 PLUGIN_DISABLED(sample)
64
65 AC_OUTPUT([Makefile])