1 AC_INIT([vpp], [18.01], [vpp-dev@fd.io])
4 AM_INIT_AUTOMAKE([subdir-objects])
6 AC_CONFIG_FILES([Makefile plugins/Makefile vpp-api/python/Makefile vpp-api/java/Makefile vpp-api/vapi/Makefile])
7 AC_CONFIG_MACRO_DIR([m4])
16 AM_CONDITIONAL([CROSSCOMPILE], [test "$cross_compiling" == "yes"])
18 ###############################################################################
20 ###############################################################################
22 AC_DEFUN([ENABLE_ARG],
25 AC_HELP_STRING(patsubst([--enable-$1],[_],[-]), $2),
26 [enable_$1=yes n_enable_$1=1],
27 [enable_$1=no n_enable_$1=0])
28 AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes")
29 m4_append([list_of_enabled], [$1], [, ])
32 AC_DEFUN([DISABLE_ARG],
35 AC_HELP_STRING(patsubst([--disable-$1],[_],[-]), $2),
36 [enable_$1=no n_enable_$1=0],
37 [enable_$1=yes n_enable_$1=1])
38 AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes")
39 m4_append([list_of_enabled], [$1], [, ])
45 AC_HELP_STRING(patsubst([--with-$1],[_],[-]), $2),
46 [with_$1=yes n_with_$1=1],
47 [with_$1=no n_with_$1=0])
48 AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes")
49 m4_append([list_of_with], [$1], [, ])
52 AC_DEFUN([WITHOUT_ARG],
55 AC_HELP_STRING(patsubst([--without-$1],[_],[-]), $2),
56 [with_$1=no n_with_$1=0],
57 [with_$1=yes n_with_$1=1])
58 AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes")
59 m4_append([list_of_with], [$1], [, ])
62 AC_DEFUN([PLUGIN_ENABLED],
64 AC_ARG_ENABLE($1_plugin,
65 AC_HELP_STRING([--disable-$1-plugin], [Do not build $1 plugin]),
66 [enable_$1_plugin=no],
67 [enable_$1_plugin=yes ])
68 AM_CONDITIONAL(m4_toupper(ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes")
69 m4_append([list_of_plugins], [$1], [, ])
72 AC_DEFUN([PLUGIN_DISABLED],
74 AC_ARG_ENABLE($1_plugin,
75 AC_HELP_STRING([--enable-$1-plugin], [Build $1 plugin]),
76 [enable_$1_plugin=yes ],
77 [enable_$1_plugin=no])
78 AM_CONDITIONAL(m4_toupper(ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes")
79 m4_append([list_of_plugins], [$1], [, ])
82 AC_DEFUN([PRINT_VAL], [ AC_MSG_RESULT(AC_HELP_STRING($1,$2)) ])
84 AC_DEFUN([DPDK_IS_PMD_ENABLED],
86 AC_MSG_CHECKING([for $1 in rte_config.h])
89 [[#include <rte_config.h>]],
93 [AC_MSG_RESULT([yes])],
97 AM_CONDITIONAL(m4_toupper(WITH_$2), test "$with_$2" = "yes")
98 m4_append_uniq([list_of_with], [$2], [, ])
101 AC_DEFUN([DETECT_DPDK_IS_1702_OR_1705],
103 AC_MSG_CHECKING([for RTE_VERSION 17.02/17.05 in rte_version.h])
106 #include <rte_version.h>
109 return ((RTE_VER_YEAR != 17) ||
110 (RTE_VER_MONTH != 2 && RTE_VER_MONTH != 5));
113 [dpdk_is_1702_or_1705=yes]
114 [AC_MSG_RESULT([yes])],
115 [dpdk_is_1702_or_1705=no]
116 [AC_MSG_RESULT([no])]
118 AM_CONDITIONAL(DPDK_IS_1702_OR_1705, test "$dpdk_is_1702_or_1705" = "yes")
121 ###############################################################################
122 # configure arguments
123 ###############################################################################
126 ENABLE_ARG(tests, [Enable unit tests])
127 ENABLE_ARG(dpdk_shared, [Enable unit tests])
128 ENABLE_ARG(perftool, [Enable perftool])
129 ENABLE_ARG(g2, [Enable g2])
132 DISABLE_ARG(vlib, [Disable vlib and dependant libs and binaries])
133 DISABLE_ARG(svm, [Disable svm and dependant libs and binaries])
134 DISABLE_ARG(papi, [Disable Python API bindings])
135 DISABLE_ARG(japi, [Disable Java API bindings])
140 WITHOUT_ARG(libssl, [Disable libssl])
141 WITHOUT_ARG(apicli, [Disable binary api CLI])
144 AC_HELP_STRING([--with-unix],[Compile unix version of clib]),
147 darwin* | linux*) with_unix=yes;;
151 AM_CONDITIONAL(WITH_UNIX, test "$with_unix" = "yes")
153 AC_ARG_WITH(pre-data,
154 AC_HELP_STRING([--with-pre-data],[Set buffer rewrite space]),
155 [case $with_pre_data in
158 *) with_pre_data="pre-data-not-set" ;;
159 esac], [with_pre_data=128])
161 ###############################################################################
162 # Substitutions and defines
163 ###############################################################################
165 AC_SUBST(PRE_DATA_SIZE, [$with_pre_data])
166 AC_SUBST(APICLI, [-DVPP_API_TEST_BUILTIN=${n_with_apicli}])
168 AC_DEFINE_UNQUOTED(DPDK_SHARED_LIB, [${n_enable_dpdk_shared}])
169 AC_DEFINE_UNQUOTED(WITH_LIBSSL, [${n_with_libssl}])
172 # Silence following noise:
173 # ar: `u' modifier ignored since `D' is the default (see `U')
177 ###############################################################################
179 ###############################################################################
181 # Please keep alphabetical order
184 PLUGIN_ENABLED(flowprobe)
190 PLUGIN_ENABLED(memif)
191 PLUGIN_ENABLED(pppoe)
192 PLUGIN_ENABLED(sixrd)
196 ###############################################################################
198 ###############################################################################
200 AM_COND_IF([ENABLE_DPDK_SHARED],
202 AC_CHECK_HEADERS([rte_config.h],
204 [AC_MSG_ERROR([DPDK header files not found])],)
205 AC_CHECK_LIB( [dpdk], [rte_eal_init],
207 [AC_MSG_ERROR([DPDK shared library not found])],)
211 with_isa_l_crypto_lib=no
213 DPDK_IS_PMD_ENABLED(LIBRTE_PMD_AESNI_MB, dpdk_aesni_mb_pmd)
214 DPDK_IS_PMD_ENABLED(LIBRTE_PMD_AESNI_GCM, dpdk_aesni_gcm_pmd)
216 DETECT_DPDK_IS_1702_OR_1705()
218 AM_COND_IF([WITH_DPDK_AESNI_MB_PMD],
220 AC_CHECK_LIB([IPSec_MB], [submit_job_sse],
221 [with_aesni_mb_lib=yes],
222 [AC_MSG_ERROR([IPSec_MB library not found])])
225 AM_COND_IF([WITH_DPDK_AESNI_GCM_PMD],
227 AM_COND_IF([DPDK_IS_1702_OR_1705],
229 AC_CHECK_LIB([isal_crypto], [aesni_gcm128_init],
230 [with_isa_l_crypto_lib=yes],
231 [AC_MSG_ERROR([isal_crypto library not found])])
234 AC_CHECK_LIB([IPSec_MB], [submit_job_sse],
235 [with_aesni_mb_lib=yes],
236 [AC_MSG_ERROR([IPSec_MB library not found])])
240 m4_append([list_of_with], [aesni_mb_lib], [, ])
241 AM_CONDITIONAL(WITH_AESNI_MB_LIB, test "$with_aesni_mb_lib" = "yes")
243 m4_append([list_of_with], [isa_l_crypto_lib], [, ])
244 AM_CONDITIONAL(WITH_ISA_L_CRYPTO_LIB, test "$with_isa_l_crypto_lib" = "yes")
248 DPDK_IS_PMD_ENABLED(LIBRTE_MLX4_PMD, dpdk_mlx4_pmd)
249 AM_COND_IF([WITH_DPDK_MLX4_PMD],
251 AC_CHECK_LIB([ibverbs], [ibv_fork_init],
252 [with_ibverbs_lib=yes],
253 [AC_MSG_ERROR([ibverbs library not found])])
256 DPDK_IS_PMD_ENABLED(LIBRTE_MLX5_PMD, dpdk_mlx5_pmd)
257 AM_COND_IF([WITH_DPDK_MLX5_PMD],
259 AC_CHECK_LIB([ibverbs], [ibv_fork_init],
260 [with_ibverbs_lib=yes],
261 [AC_MSG_ERROR([ibverbs library not found])])
264 m4_append([list_of_with], [ibverbs_lib], [, ])
265 AM_CONDITIONAL(WITH_IBVERBS_LIB, test "$with_ibverbs_lib" = "yes")
268 AM_COND_IF([ENABLE_G2],
270 PKG_CHECK_MODULES(g2, gtk+-2.0)
273 # If cross-compiling, we need external vppapigen and we cannot continue without it
274 # For native builds, we just set dependency on vpppaigen binary in top_builddir
275 AM_COND_IF([CROSSCOMPILE],
277 AC_PATH_PROG([VPPAPIGEN], [vppapigen], [no])
278 if test "$VPPAPIGEN" = "no"; then
279 AC_MSG_ERROR([Externaly built vppapigen is needed when cross-compiling...])
282 VPPAPIGEN=\$\(top_builddir\)/vppapigen
284 AC_SUBST([VPPAPIGEN])
287 ###############################################################################
289 ###############################################################################
291 AM_COND_IF([ENABLE_JAPI],
300 ###############################################################################
302 ###############################################################################
304 AM_COND_IF([ENABLE_PAPI],
309 ###############################################################################
311 ###############################################################################
315 AC_MSG_RESULT([==============================================================================])
316 PRINT_VAL([version], $PACKAGE $VERSION)
317 PRINT_VAL([prefix], ${prefix})
318 PRINT_VAL([libdir], ${libdir})
319 PRINT_VAL([includedir], ${includedir})
320 PRINT_VAL([CFLAGS], ${CFLAGS})
321 PRINT_VAL([CPPFLAGS], ${CPPFLAGS})
322 PRINT_VAL([LDFLAGS], ${LDFLAGS})
323 AM_COND_IF([ENABLE_JAPI],
325 PRINT_VAL([JAVA_VERSION], ${JAVA_VERSION})
326 PRINT_VAL([JAVA_HOME], ${JAVA_HOME})
330 AC_MSG_RESULT([with:])
331 m4_foreach([x], m4_dquote(list_of_with), [
332 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${with_], x, [}])))
336 AC_MSG_RESULT([enabled:])
337 m4_foreach([x], m4_dquote(list_of_enabled), [
338 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [}])))
342 AC_MSG_RESULT([plugins:])
343 m4_foreach([x], m4_dquote(list_of_plugins), [
344 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [_plugin}])))
346 AC_MSG_RESULT([==============================================================================])