1 AC_INIT([vpp], [17.04], [vpp-dev@fd.io])
4 AM_INIT_AUTOMAKE([subdir-objects])
6 AC_CONFIG_FILES([Makefile plugins/Makefile vpp-api/python/Makefile])
13 ###############################################################################
15 ###############################################################################
17 AC_DEFUN([ENABLE_ARG],
20 AC_HELP_STRING(patsubst([--enable-$1],[_],[-]), $2),
21 [enable_$1=yes n_enable_$1=1],
22 [enable_$1=no n_enable_$1=0])
23 AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes")
24 m4_append([list_of_enabled], [$1], [, ])
27 AC_DEFUN([DISABLE_ARG],
30 AC_HELP_STRING(patsubst([--disable-$1],[_],[-]), $2),
31 [enable_$1=no n_enable_$1=0],
32 [enable_$1=yes n_enable_$1=1])
33 AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes")
34 m4_append([list_of_enabled], [$1], [, ])
40 AC_HELP_STRING(patsubst([--with-$1],[_],[-]), $2),
41 [with_$1=yes n_with_$1=1],
42 [with_$1=no n_with_$1=0])
43 AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes")
44 m4_append([list_of_with], [$1], [, ])
47 AC_DEFUN([WITHOUT_ARG],
50 AC_HELP_STRING(patsubst([--without-$1],[_],[-]), $2),
51 [with_$1=no n_with_$1=0],
52 [with_$1=yes n_with_$1=1])
53 AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes")
54 m4_append([list_of_with], [$1], [, ])
57 AC_DEFUN([PLUGIN_ENABLED],
59 AC_ARG_ENABLE($1_plugin,
60 AC_HELP_STRING([--disable-$1-plugin], [Do not build $1 plugin]),
61 [enable_$1_plugin=no],
62 [enable_$1_plugin=yes ])
63 AM_CONDITIONAL(m4_toupper(ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes")
64 m4_append([list_of_plugins], [$1], [, ])
67 AC_DEFUN([PLUGIN_DISABLED],
69 AC_ARG_ENABLE($1_plugin,
70 AC_HELP_STRING([--enable-$1-plugin], [Build $1 plugin]),
71 [enable_$1_plugin=yes ],
72 [enable_$1_plugin=no])
73 AM_CONDITIONAL(m4_toupper((ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes")
74 m4_append([list_of_plugins], [$1], [, ])
77 AC_DEFUN([PRINT_VAL], [ AC_MSG_RESULT(AC_HELP_STRING($1,$2)) ])
79 ###############################################################################
81 ###############################################################################
84 ENABLE_ARG(tests, [Enable unit tests])
85 ENABLE_ARG(dpdk_shared, [Enable unit tests])
86 ENABLE_ARG(perftool, [Enable perftool])
87 ENABLE_ARG(g2, [Enable g2])
90 DISABLE_ARG(vlib, [Disable vlib and dependant libs and binaries])
91 DISABLE_ARG(svm, [Disable svm and dependant libs and binaries])
94 WITH_ARG(dpdk, [Use use DPDK])
95 WITH_ARG(dpdk_crypto, [Use DPDK cryptodev])
96 WITH_ARG(dpdk_mlx5_pmd, [Use DPDK with mlx5 PMD])
99 WITHOUT_ARG(ipsec, [Disable IPSec])
100 WITHOUT_ARG(ipv6sr, [Disable IPv6 SR])
101 WITHOUT_ARG(apicli, [Disable binary api CLI])
104 AC_HELP_STRING([--with-unix],[Compile unix version of clib]),
107 darwin* | linux*) with_unix=yes;;
111 AM_CONDITIONAL(WITH_UNIX, test "$with_unix" = "yes")
113 AC_ARG_WITH(pre-data,
114 AC_HELP_STRING([--with-pre-data],[Set buffer rewrite space]),
115 [case $with_pre_data in
118 *) with_pre_data="pre-data-not-set" ;;
119 esac], [with_pre_data=128])
121 ###############################################################################
122 # Substitutions and defines
123 ###############################################################################
125 AC_SUBST(PRE_DATA_SIZE, [$with_pre_data])
126 AC_SUBST(APICLI, [-DVPP_API_TEST_BUILTIN=${n_with_apicli}])
128 AC_DEFINE_UNQUOTED(DPDK, [${n_with_dpdk}])
129 AC_DEFINE_UNQUOTED(DPDK_SHARED_LIB, [${n_enable_dpdk_shared}])
130 AC_DEFINE_UNQUOTED(DPDK_CRYPTO, [${n_with_dpdk_crypto}])
131 AC_DEFINE_UNQUOTED(IPSEC, [${n_with_ipsec}])
132 AC_DEFINE_UNQUOTED(IPV6SR, [${n_with_ipv6sr}])
134 ###############################################################################
136 ###############################################################################
138 AM_COND_IF([ENABLE_DPDK_SHARED],
140 AC_CHECK_HEADERS([rte_config.h],
142 [AC_MSG_ERROR([DPDK header files not found])],)
143 AC_CHECK_LIB( [dpdk], [rte_eal_init],
145 [AC_MSG_ERROR([DPDK shared library not found])],)
148 AM_COND_IF([ENABLE_G2],
150 PKG_CHECK_MODULES(g2, gtk+-2.0)
153 ###############################################################################
155 ###############################################################################
157 PLUGIN_ENABLED(sixrd)
159 PLUGIN_ENABLED(flowperpkt)
161 ###############################################################################
163 ###############################################################################
167 AC_MSG_RESULT([==============================================================================])
168 PRINT_VAL([version], $PACKAGE $VERSION)
169 PRINT_VAL([prefix], ${prefix})
170 PRINT_VAL([libdir], ${libdir})
171 PRINT_VAL([includedir], ${includedir})
172 PRINT_VAL([CFLAGS], ${CFLAGS})
173 PRINT_VAL([CPPFLAGS], ${CPPFLAGS})
174 PRINT_VAL([LDFLAGS], ${LDFLAGS})
177 AC_MSG_RESULT([with:])
178 m4_foreach([x], m4_dquote(list_of_with), [
179 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${with_], x, [}])))
183 AC_MSG_RESULT([enabled:])
184 m4_foreach([x], m4_dquote(list_of_enabled), [
185 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [}])))
189 AC_MSG_RESULT([plugins:])
190 m4_foreach([x], m4_dquote(list_of_plugins), [
191 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [_plugin}])))
193 AC_MSG_RESULT([==============================================================================])