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 vpp-api/java/Makefile])
7 AC_CONFIG_MACRO_DIR([m4])
14 AM_CONDITIONAL([CROSSCOMPILE], [test "$cross_compiling" == "yes"])
16 ###############################################################################
18 ###############################################################################
20 AC_DEFUN([ENABLE_ARG],
23 AC_HELP_STRING(patsubst([--enable-$1],[_],[-]), $2),
24 [enable_$1=yes n_enable_$1=1],
25 [enable_$1=no n_enable_$1=0])
26 AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes")
27 m4_append([list_of_enabled], [$1], [, ])
30 AC_DEFUN([DISABLE_ARG],
33 AC_HELP_STRING(patsubst([--disable-$1],[_],[-]), $2),
34 [enable_$1=no n_enable_$1=0],
35 [enable_$1=yes n_enable_$1=1])
36 AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes")
37 m4_append([list_of_enabled], [$1], [, ])
43 AC_HELP_STRING(patsubst([--with-$1],[_],[-]), $2),
44 [with_$1=yes n_with_$1=1],
45 [with_$1=no n_with_$1=0])
46 AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes")
47 m4_append([list_of_with], [$1], [, ])
50 AC_DEFUN([WITHOUT_ARG],
53 AC_HELP_STRING(patsubst([--without-$1],[_],[-]), $2),
54 [with_$1=no n_with_$1=0],
55 [with_$1=yes n_with_$1=1])
56 AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes")
57 m4_append([list_of_with], [$1], [, ])
60 AC_DEFUN([PLUGIN_ENABLED],
62 AC_ARG_ENABLE($1_plugin,
63 AC_HELP_STRING([--disable-$1-plugin], [Do not build $1 plugin]),
64 [enable_$1_plugin=no],
65 [enable_$1_plugin=yes ])
66 AM_CONDITIONAL(m4_toupper(ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes")
67 m4_append([list_of_plugins], [$1], [, ])
70 AC_DEFUN([PLUGIN_DISABLED],
72 AC_ARG_ENABLE($1_plugin,
73 AC_HELP_STRING([--enable-$1-plugin], [Build $1 plugin]),
74 [enable_$1_plugin=yes ],
75 [enable_$1_plugin=no])
76 AM_CONDITIONAL(m4_toupper((ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes")
77 m4_append([list_of_plugins], [$1], [, ])
80 AC_DEFUN([PRINT_VAL], [ AC_MSG_RESULT(AC_HELP_STRING($1,$2)) ])
82 ###############################################################################
84 ###############################################################################
87 ENABLE_ARG(tests, [Enable unit tests])
88 ENABLE_ARG(dpdk_shared, [Enable unit tests])
89 ENABLE_ARG(perftool, [Enable perftool])
90 ENABLE_ARG(g2, [Enable g2])
93 DISABLE_ARG(vlib, [Disable vlib and dependant libs and binaries])
94 DISABLE_ARG(svm, [Disable svm and dependant libs and binaries])
95 DISABLE_ARG(papi, [Disable Python API bindings])
96 DISABLE_ARG(japi, [Disable Java API bindings])
99 WITH_ARG(dpdk, [Use use DPDK])
100 WITH_ARG(dpdk_crypto, [Use DPDK cryptodev])
101 WITH_ARG(dpdk_mlx5_pmd, [Use DPDK with mlx5 PMD])
104 WITHOUT_ARG(libssl, [Disable libssl])
105 WITHOUT_ARG(apicli, [Disable binary api CLI])
108 AC_HELP_STRING([--with-unix],[Compile unix version of clib]),
111 darwin* | linux*) with_unix=yes;;
115 AM_CONDITIONAL(WITH_UNIX, test "$with_unix" = "yes")
117 AC_ARG_WITH(pre-data,
118 AC_HELP_STRING([--with-pre-data],[Set buffer rewrite space]),
119 [case $with_pre_data in
122 *) with_pre_data="pre-data-not-set" ;;
123 esac], [with_pre_data=128])
125 ###############################################################################
126 # Substitutions and defines
127 ###############################################################################
129 AC_SUBST(PRE_DATA_SIZE, [$with_pre_data])
130 AC_SUBST(APICLI, [-DVPP_API_TEST_BUILTIN=${n_with_apicli}])
132 AC_DEFINE_UNQUOTED(DPDK, [${n_with_dpdk}])
133 AC_DEFINE_UNQUOTED(DPDK_SHARED_LIB, [${n_enable_dpdk_shared}])
134 AC_DEFINE_UNQUOTED(DPDK_CRYPTO, [${n_with_dpdk_crypto}])
135 AC_DEFINE_UNQUOTED(WITH_LIBSSL, [${n_with_libssl}])
138 # Silence following noise:
139 # ar: `u' modifier ignored since `D' is the default (see `U')
143 ###############################################################################
145 ###############################################################################
147 # Please keep alphabetical order
149 PLUGIN_ENABLED(flowperpkt)
153 PLUGIN_ENABLED(sixrd)
156 ###############################################################################
158 ###############################################################################
160 AM_COND_IF([ENABLE_DPDK_SHARED],
162 AC_CHECK_HEADERS([rte_config.h],
164 [AC_MSG_ERROR([DPDK header files not found])],)
165 AC_CHECK_LIB( [dpdk], [rte_eal_init],
167 [AC_MSG_ERROR([DPDK shared library not found])],)
170 AM_COND_IF([ENABLE_G2],
172 PKG_CHECK_MODULES(g2, gtk+-2.0)
175 # If cross-compiling, we need external vppapigen and we cannot continue without it
176 # For native builds, we just set dependency on vpppaigen binary in top_builddir
177 AM_COND_IF([CROSSCOMPILE],
179 AC_PATH_PROG([VPPAPIGEN], [vppapigen], [no])
180 if test "$VPPAPIGEN" = "no"; then
181 AC_MSG_ERROR([Externaly built vppapigen is needed when cross-compiling...])
184 VPPAPIGEN=\$\(top_builddir\)/vppapigen
186 AC_SUBST([VPPAPIGEN])
189 ###############################################################################
191 ###############################################################################
193 AM_COND_IF([ENABLE_JAPI],
202 ###############################################################################
204 ###############################################################################
208 AC_MSG_RESULT([==============================================================================])
209 PRINT_VAL([version], $PACKAGE $VERSION)
210 PRINT_VAL([prefix], ${prefix})
211 PRINT_VAL([libdir], ${libdir})
212 PRINT_VAL([includedir], ${includedir})
213 PRINT_VAL([CFLAGS], ${CFLAGS})
214 PRINT_VAL([CPPFLAGS], ${CPPFLAGS})
215 PRINT_VAL([LDFLAGS], ${LDFLAGS})
216 AM_COND_IF([ENABLE_JAPI],
218 PRINT_VAL([JAVA_VERSION], ${JAVA_VERSION})
219 PRINT_VAL([JAVA_HOME], ${JAVA_HOME})
223 AC_MSG_RESULT([with:])
224 m4_foreach([x], m4_dquote(list_of_with), [
225 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${with_], x, [}])))
229 AC_MSG_RESULT([enabled:])
230 m4_foreach([x], m4_dquote(list_of_enabled), [
231 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [}])))
235 AC_MSG_RESULT([plugins:])
236 m4_foreach([x], m4_dquote(list_of_plugins), [
237 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [_plugin}])))
239 AC_MSG_RESULT([==============================================================================])