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