1 AC_INIT([vpp], [17.10], [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])
7 AC_CONFIG_MACRO_DIR([m4])
15 AM_CONDITIONAL([CROSSCOMPILE], [test "$cross_compiling" == "yes"])
17 ###############################################################################
19 ###############################################################################
21 AC_DEFUN([ENABLE_ARG],
24 AC_HELP_STRING(patsubst([--enable-$1],[_],[-]), $2),
25 [enable_$1=yes n_enable_$1=1],
26 [enable_$1=no n_enable_$1=0])
27 AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes")
28 m4_append([list_of_enabled], [$1], [, ])
31 AC_DEFUN([DISABLE_ARG],
34 AC_HELP_STRING(patsubst([--disable-$1],[_],[-]), $2),
35 [enable_$1=no n_enable_$1=0],
36 [enable_$1=yes n_enable_$1=1])
37 AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes")
38 m4_append([list_of_enabled], [$1], [, ])
44 AC_HELP_STRING(patsubst([--with-$1],[_],[-]), $2),
45 [with_$1=yes n_with_$1=1],
46 [with_$1=no n_with_$1=0])
47 AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes")
48 m4_append([list_of_with], [$1], [, ])
51 AC_DEFUN([WITHOUT_ARG],
54 AC_HELP_STRING(patsubst([--without-$1],[_],[-]), $2),
55 [with_$1=no n_with_$1=0],
56 [with_$1=yes n_with_$1=1])
57 AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes")
58 m4_append([list_of_with], [$1], [, ])
61 AC_DEFUN([PLUGIN_ENABLED],
63 AC_ARG_ENABLE($1_plugin,
64 AC_HELP_STRING([--disable-$1-plugin], [Do not build $1 plugin]),
65 [enable_$1_plugin=no],
66 [enable_$1_plugin=yes ])
67 AM_CONDITIONAL(m4_toupper(ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes")
68 m4_append([list_of_plugins], [$1], [, ])
71 AC_DEFUN([PLUGIN_DISABLED],
73 AC_ARG_ENABLE($1_plugin,
74 AC_HELP_STRING([--enable-$1-plugin], [Build $1 plugin]),
75 [enable_$1_plugin=yes ],
76 [enable_$1_plugin=no])
77 AM_CONDITIONAL(m4_toupper(ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes")
78 m4_append([list_of_plugins], [$1], [, ])
81 AC_DEFUN([PRINT_VAL], [ AC_MSG_RESULT(AC_HELP_STRING($1,$2)) ])
83 AC_DEFUN([DPDK_IS_PMD_ENABLED],
85 AC_MSG_CHECKING([for $1 in rte_config.h])
88 [[#include <rte_config.h>]],
92 [AC_MSG_RESULT([yes])],
96 AM_CONDITIONAL(m4_toupper(WITH_$2), test "$with_$2" = "yes")
97 m4_append_uniq([list_of_with], [$2], [, ])
100 ###############################################################################
101 # configure arguments
102 ###############################################################################
105 ENABLE_ARG(tests, [Enable unit tests])
106 ENABLE_ARG(dpdk_shared, [Enable unit tests])
107 ENABLE_ARG(perftool, [Enable perftool])
108 ENABLE_ARG(g2, [Enable g2])
111 DISABLE_ARG(vlib, [Disable vlib and dependant libs and binaries])
112 DISABLE_ARG(svm, [Disable svm and dependant libs and binaries])
113 DISABLE_ARG(papi, [Disable Python API bindings])
114 DISABLE_ARG(japi, [Disable Java API bindings])
119 WITHOUT_ARG(libssl, [Disable libssl])
120 WITHOUT_ARG(apicli, [Disable binary api CLI])
123 AC_HELP_STRING([--with-unix],[Compile unix version of clib]),
126 darwin* | linux*) with_unix=yes;;
130 AM_CONDITIONAL(WITH_UNIX, test "$with_unix" = "yes")
132 AC_ARG_WITH(pre-data,
133 AC_HELP_STRING([--with-pre-data],[Set buffer rewrite space]),
134 [case $with_pre_data in
137 *) with_pre_data="pre-data-not-set" ;;
138 esac], [with_pre_data=128])
140 ###############################################################################
141 # Substitutions and defines
142 ###############################################################################
144 AC_SUBST(PRE_DATA_SIZE, [$with_pre_data])
145 AC_SUBST(APICLI, [-DVPP_API_TEST_BUILTIN=${n_with_apicli}])
147 AC_DEFINE_UNQUOTED(DPDK_SHARED_LIB, [${n_enable_dpdk_shared}])
148 AC_DEFINE_UNQUOTED(WITH_LIBSSL, [${n_with_libssl}])
151 # Silence following noise:
152 # ar: `u' modifier ignored since `D' is the default (see `U')
156 ###############################################################################
158 ###############################################################################
160 # Please keep alphabetical order
163 PLUGIN_ENABLED(flowprobe)
169 PLUGIN_ENABLED(memif)
170 PLUGIN_ENABLED(pppoe)
171 PLUGIN_ENABLED(sixrd)
174 ###############################################################################
176 ###############################################################################
178 AM_COND_IF([ENABLE_DPDK_SHARED],
180 AC_CHECK_HEADERS([rte_config.h],
182 [AC_MSG_ERROR([DPDK header files not found])],)
183 AC_CHECK_LIB( [dpdk], [rte_eal_init],
185 [AC_MSG_ERROR([DPDK shared library not found])],)
188 DPDK_IS_PMD_ENABLED(LIBRTE_PMD_AESNI_MB, dpdk_aesni_mb_pmd)
189 AM_COND_IF([WITH_DPDK_AESNI_MB_PMD],
191 AC_CHECK_LIB([IPSec_MB], [submit_job_sse], [],
192 [AC_MSG_ERROR([IPSec_MB library not found])])
195 DPDK_IS_PMD_ENABLED(LIBRTE_PMD_AESNI_GCM, dpdk_aesni_gcm_pmd)
196 AM_COND_IF([WITH_DPDK_AESNI_GCM_PMD],
198 AC_CHECK_LIB([isal_crypto], [aesni_gcm128_init], [],
199 [AC_MSG_ERROR([isal_crypto library not found])])
202 DPDK_IS_PMD_ENABLED(LIBRTE_MLX5_PMD, dpdk_mlx5_pmd)
203 AM_COND_IF([WITH_DPDK_MLX5_PMD],
205 AC_CHECK_LIB([ibverbs], [ibv_fork_init], [],
206 [AC_MSG_ERROR([ibverbs library not found])])
209 DPDK_IS_PMD_ENABLED(LIBRTE_MLX4_PMD, dpdk_mlx4_pmd)
210 AM_COND_IF([WITH_DPDK_MLX4_PMD],
212 AC_CHECK_LIB([ibverbs], [ibv_fork_init], [],
213 [AC_MSG_ERROR([ibverbs library not found])])
216 AM_COND_IF([ENABLE_G2],
218 PKG_CHECK_MODULES(g2, gtk+-2.0)
221 # If cross-compiling, we need external vppapigen and we cannot continue without it
222 # For native builds, we just set dependency on vpppaigen binary in top_builddir
223 AM_COND_IF([CROSSCOMPILE],
225 AC_PATH_PROG([VPPAPIGEN], [vppapigen], [no])
226 if test "$VPPAPIGEN" = "no"; then
227 AC_MSG_ERROR([Externaly built vppapigen is needed when cross-compiling...])
230 VPPAPIGEN=\$\(top_builddir\)/vppapigen
232 AC_SUBST([VPPAPIGEN])
235 ###############################################################################
237 ###############################################################################
239 AM_COND_IF([ENABLE_JAPI],
248 ###############################################################################
250 ###############################################################################
252 AM_COND_IF([ENABLE_PAPI],
257 ###############################################################################
259 ###############################################################################
263 AC_MSG_RESULT([==============================================================================])
264 PRINT_VAL([version], $PACKAGE $VERSION)
265 PRINT_VAL([prefix], ${prefix})
266 PRINT_VAL([libdir], ${libdir})
267 PRINT_VAL([includedir], ${includedir})
268 PRINT_VAL([CFLAGS], ${CFLAGS})
269 PRINT_VAL([CPPFLAGS], ${CPPFLAGS})
270 PRINT_VAL([LDFLAGS], ${LDFLAGS})
271 AM_COND_IF([ENABLE_JAPI],
273 PRINT_VAL([JAVA_VERSION], ${JAVA_VERSION})
274 PRINT_VAL([JAVA_HOME], ${JAVA_HOME})
278 AC_MSG_RESULT([with:])
279 m4_foreach([x], m4_dquote(list_of_with), [
280 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${with_], x, [}])))
284 AC_MSG_RESULT([enabled:])
285 m4_foreach([x], m4_dquote(list_of_enabled), [
286 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [}])))
290 AC_MSG_RESULT([plugins:])
291 m4_foreach([x], m4_dquote(list_of_plugins), [
292 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [_plugin}])))
294 AC_MSG_RESULT([==============================================================================])