7aff9875edfad7501647e6b7e386fb696e7dafc1
[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(plugin-toolkit,
15             AC_HELP_STRING([--with-plugin-toolkit],
16             [build using the vpp toolkit]),
17             [with_plugin_toolkit=${prefix}/include],
18             [with_plugin_toolkit=.])
19
20 AC_ARG_WITH(dpdk,
21             AC_HELP_STRING([--with-dpdk],[Use the Intel dpdk]),
22             [with_dpdk=1],
23             [with_dpdk=0])
24
25 AC_SUBST(TOOLKIT_INCLUDE,[${with_plugin_toolkit}])
26 AM_CONDITIONAL(WITH_PLUGIN_TOOLKIT, test "$with_plugin_toolkit" != ".")
27 AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" = "1")
28
29 AM_CONDITIONAL(WITH_DPDK, test "$with_dpdk" = "1")
30 AC_SUBST(DPDK,["-DDPDK=${with_dpdk}"])
31
32 AC_DEFUN([PLUGIN],
33 [
34    AC_ARG_ENABLE($1_plugin,
35        AC_HELP_STRING([--enable-$1-plugin], [Build $1 plugin]),
36               [enable_the_plugin=1],
37               [enable_the_plugin=0])
38 if test "x$enable_the_plugin" = x1; then
39    AC_CONFIG_SUBDIRS($1-plugin)
40 fi
41 AM_CONDITIONAL(ENABLE_$1_PLUGIN, test "$enable_the_plugin" = "1")
42 ])
43
44 # To add a new plugin subdirectory:
45
46 # add PLUGIN(new) below, and
47 # add the following to Makefile.am:
48 #
49 # if ENABLE_new_PLUGIN
50 # SUBDIRS += new-plugin
51 # endif
52
53 PLUGIN(sample)
54 PLUGIN(sixrd)
55 PLUGIN(ioam)
56 PLUGIN(vcgn)
57 PLUGIN(snat)
58
59 AC_OUTPUT([Makefile])