blob: f90ff9686afae628b0aa2c6e8ebcf904fe57e6f3 [file] [log] [blame]
Florin Corasa3bae4e2017-09-27 23:31:07 -07001AC_INIT([vpp], [18.01], [vpp-dev@fd.io])
Damjan Marion7cd468a2016-12-19 23:05:39 +01002LT_INIT
3AC_CONFIG_AUX_DIR([.])
4AM_INIT_AUTOMAKE([subdir-objects])
5AM_SILENT_RULES([yes])
Klement Sekera8f2a4ea2017-05-04 06:15:18 +02006AC_CONFIG_FILES([Makefile plugins/Makefile vpp-api/python/Makefile vpp-api/java/Makefile vpp-api/vapi/Makefile])
Damjan Marioncb034b92016-12-28 18:38:59 +01007AC_CONFIG_MACRO_DIR([m4])
Damjan Marion7cd468a2016-12-19 23:05:39 +01008
9AC_PROG_CC
Klement Sekeradc15be22017-06-12 06:49:33 +020010AC_PROG_CXX
Damjan Marion7cd468a2016-12-19 23:05:39 +010011AM_PROG_AS
12AM_PROG_LIBTOOL
13AC_PROG_YACC
Tomofumi Hayashidc90d422017-01-25 13:53:26 +090014AM_PATH_PYTHON
Damjan Marion7cd468a2016-12-19 23:05:39 +010015
Damjan Marion0be5ec32016-12-28 17:51:56 +010016AM_CONDITIONAL([CROSSCOMPILE], [test "$cross_compiling" == "yes"])
17
Damjan Marion7cd468a2016-12-19 23:05:39 +010018###############################################################################
19# Macros
20###############################################################################
21
22AC_DEFUN([ENABLE_ARG],
23[
24 AC_ARG_ENABLE($1,
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], [, ])
30])
31
32AC_DEFUN([DISABLE_ARG],
33[
34 AC_ARG_ENABLE($1,
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], [, ])
40])
41
42AC_DEFUN([WITH_ARG],
43[
44 AC_ARG_WITH($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], [, ])
50])
51
52AC_DEFUN([WITHOUT_ARG],
53[
54 AC_ARG_WITH($1,
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], [, ])
60])
61
62AC_DEFUN([PLUGIN_ENABLED],
63[
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], [, ])
70])
71
72AC_DEFUN([PLUGIN_DISABLED],
73[
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])
Pablo Camarilloa084d622017-03-03 20:47:55 +010078 AM_CONDITIONAL(m4_toupper(ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes")
Damjan Marion7cd468a2016-12-19 23:05:39 +010079 m4_append([list_of_plugins], [$1], [, ])
80])
81
82AC_DEFUN([PRINT_VAL], [ AC_MSG_RESULT(AC_HELP_STRING($1,$2)) ])
83
Sergio Gonzalez Monroy3b12cdc2017-06-06 15:29:16 +010084AC_DEFUN([DPDK_IS_PMD_ENABLED],
85[
86 AC_MSG_CHECKING([for $1 in rte_config.h])
87 AC_COMPILE_IFELSE(
88 [AC_LANG_PROGRAM(
89 [[#include <rte_config.h>]],
90 [[return RTE_$1;]],
91 )],
92 [with_$2=yes]
93 [AC_MSG_RESULT([yes])],
94 [with_$2=no]
95 [AC_MSG_RESULT([no])]
96 )
97 AM_CONDITIONAL(m4_toupper(WITH_$2), test "$with_$2" = "yes")
98 m4_append_uniq([list_of_with], [$2], [, ])
99])
100
Sergio Gonzalez Monroyacdc3062017-08-24 14:09:17 +0100101AC_DEFUN([DETECT_DPDK_IS_1702_OR_1705],
102[
103 AC_MSG_CHECKING([for RTE_VERSION 17.02/17.05 in rte_version.h])
104 AC_TRY_RUN(
105 [
106 #include <rte_version.h>
107 int main()
108 {
109 return ((RTE_VER_YEAR != 17) ||
110 (RTE_VER_MONTH != 2 && RTE_VER_MONTH != 5));
111 }
112 ],
113 [dpdk_is_1702_or_1705=yes]
114 [AC_MSG_RESULT([yes])],
115 [dpdk_is_1702_or_1705=no]
116 [AC_MSG_RESULT([no])]
117 )
118 AM_CONDITIONAL(DPDK_IS_1702_OR_1705, test "$dpdk_is_1702_or_1705" = "yes")
119])
120
Damjan Marion7cd468a2016-12-19 23:05:39 +0100121###############################################################################
122# configure arguments
123###############################################################################
124
125# --enable-X
126ENABLE_ARG(tests, [Enable unit tests])
127ENABLE_ARG(dpdk_shared, [Enable unit tests])
128ENABLE_ARG(perftool, [Enable perftool])
129ENABLE_ARG(g2, [Enable g2])
130
131# --disable-X
132DISABLE_ARG(vlib, [Disable vlib and dependant libs and binaries])
133DISABLE_ARG(svm, [Disable svm and dependant libs and binaries])
Damjan Marioncb034b92016-12-28 18:38:59 +0100134DISABLE_ARG(papi, [Disable Python API bindings])
135DISABLE_ARG(japi, [Disable Java API bindings])
Damjan Marion7cd468a2016-12-19 23:05:39 +0100136
137# --with-X
Damjan Marion7cd468a2016-12-19 23:05:39 +0100138
139# --without-X
Damjan Mariona9a951f2017-01-16 22:06:10 +0100140WITHOUT_ARG(libssl, [Disable libssl])
Damjan Marion7cd468a2016-12-19 23:05:39 +0100141WITHOUT_ARG(apicli, [Disable binary api CLI])
142
143AC_ARG_WITH(unix,
144 AC_HELP_STRING([--with-unix],[Compile unix version of clib]),
145 [],
146 [case $host_os in
147 darwin* | linux*) with_unix=yes;;
148 *) with_unix=no;;
149 esac])
150
151AM_CONDITIONAL(WITH_UNIX, test "$with_unix" = "yes")
152
153AC_ARG_WITH(pre-data,
154 AC_HELP_STRING([--with-pre-data],[Set buffer rewrite space]),
155 [case $with_pre_data in
156 128) ;;
157 256) ;;
158 *) with_pre_data="pre-data-not-set" ;;
159 esac], [with_pre_data=128])
160
161###############################################################################
162# Substitutions and defines
163###############################################################################
164
165AC_SUBST(PRE_DATA_SIZE, [$with_pre_data])
166AC_SUBST(APICLI, [-DVPP_API_TEST_BUILTIN=${n_with_apicli}])
167
Damjan Marion7cd468a2016-12-19 23:05:39 +0100168AC_DEFINE_UNQUOTED(DPDK_SHARED_LIB, [${n_enable_dpdk_shared}])
Damjan Mariona9a951f2017-01-16 22:06:10 +0100169AC_DEFINE_UNQUOTED(WITH_LIBSSL, [${n_with_libssl}])
Damjan Marion7cd468a2016-12-19 23:05:39 +0100170
Damjan Marioncb034b92016-12-28 18:38:59 +0100171
172# Silence following noise:
173# ar: `u' modifier ignored since `D' is the default (see `U')
174AR_FLAGS=cr
175AC_SUBST(AR_FLAGS)
176
177###############################################################################
178# Plugins
179###############################################################################
180
181# Please keep alphabetical order
182PLUGIN_ENABLED(acl)
Damjan Marion374e2c52017-03-09 20:38:15 +0100183PLUGIN_ENABLED(dpdk)
Ole Troan5c749732017-03-13 13:39:52 +0100184PLUGIN_ENABLED(flowprobe)
Hongjun Nief486b12017-04-12 19:21:16 +0800185PLUGIN_ENABLED(gtpu)
Damjan Marioncb034b92016-12-28 18:38:59 +0100186PLUGIN_ENABLED(ila)
187PLUGIN_ENABLED(ioam)
Damjan Marion374e2c52017-03-09 20:38:15 +0100188PLUGIN_ENABLED(ixge)
Damjan Marioncb034b92016-12-28 18:38:59 +0100189PLUGIN_ENABLED(lb)
Damjan Marioneaabe072017-03-22 10:18:13 +0100190PLUGIN_ENABLED(memif)
Hongjun Ni62f9cdd2017-07-04 20:11:57 +0800191PLUGIN_ENABLED(pppoe)
Damjan Marioncb034b92016-12-28 18:38:59 +0100192PLUGIN_ENABLED(sixrd)
Matus Fabian2ba92e32017-08-21 07:05:03 -0700193PLUGIN_ENABLED(nat)
Pierre Pfister0906c5c2017-09-27 16:17:31 +0200194PLUGIN_ENABLED(stn)
Damjan Marioncb034b92016-12-28 18:38:59 +0100195
Damjan Marion7cd468a2016-12-19 23:05:39 +0100196###############################################################################
197# Dependency checks
198###############################################################################
199
200AM_COND_IF([ENABLE_DPDK_SHARED],
201[
202 AC_CHECK_HEADERS([rte_config.h],
203 [],
204 [AC_MSG_ERROR([DPDK header files not found])],)
205 AC_CHECK_LIB( [dpdk], [rte_eal_init],
206 [],
207 [AC_MSG_ERROR([DPDK shared library not found])],)
208])
209
Sergio Gonzalez Monroyacdc3062017-08-24 14:09:17 +0100210with_aesni_mb_lib=no
211with_isa_l_crypto_lib=no
212
Sergio Gonzalez Monroy3b12cdc2017-06-06 15:29:16 +0100213DPDK_IS_PMD_ENABLED(LIBRTE_PMD_AESNI_MB, dpdk_aesni_mb_pmd)
Sergio Gonzalez Monroyacdc3062017-08-24 14:09:17 +0100214DPDK_IS_PMD_ENABLED(LIBRTE_PMD_AESNI_GCM, dpdk_aesni_gcm_pmd)
215
216DETECT_DPDK_IS_1702_OR_1705()
217
Sergio Gonzalez Monroy3b12cdc2017-06-06 15:29:16 +0100218AM_COND_IF([WITH_DPDK_AESNI_MB_PMD],
219[
Sergio Gonzalez Monroyacdc3062017-08-24 14:09:17 +0100220 AC_CHECK_LIB([IPSec_MB], [submit_job_sse],
221 [with_aesni_mb_lib=yes],
Sergio Gonzalez Monroy3b12cdc2017-06-06 15:29:16 +0100222 [AC_MSG_ERROR([IPSec_MB library not found])])
223])
224
Sergio Gonzalez Monroy3b12cdc2017-06-06 15:29:16 +0100225AM_COND_IF([WITH_DPDK_AESNI_GCM_PMD],
226[
Sergio Gonzalez Monroyacdc3062017-08-24 14:09:17 +0100227 AM_COND_IF([DPDK_IS_1702_OR_1705],
228 [
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])])
232 ],
233 [
234 AC_CHECK_LIB([IPSec_MB], [submit_job_sse],
235 [with_aesni_mb_lib=yes],
236 [AC_MSG_ERROR([IPSec_MB library not found])])
237 ])
238])
239
240m4_append([list_of_with], [aesni_mb_lib], [, ])
241AM_CONDITIONAL(WITH_AESNI_MB_LIB, test "$with_aesni_mb_lib" = "yes")
242
243m4_append([list_of_with], [isa_l_crypto_lib], [, ])
244AM_CONDITIONAL(WITH_ISA_L_CRYPTO_LIB, test "$with_isa_l_crypto_lib" = "yes")
245
246
247with_ibverbs_lib=no
248DPDK_IS_PMD_ENABLED(LIBRTE_MLX4_PMD, dpdk_mlx4_pmd)
249AM_COND_IF([WITH_DPDK_MLX4_PMD],
250[
251 AC_CHECK_LIB([ibverbs], [ibv_fork_init],
252 [with_ibverbs_lib=yes],
253 [AC_MSG_ERROR([ibverbs library not found])])
Sergio Gonzalez Monroy3b12cdc2017-06-06 15:29:16 +0100254])
255
256DPDK_IS_PMD_ENABLED(LIBRTE_MLX5_PMD, dpdk_mlx5_pmd)
257AM_COND_IF([WITH_DPDK_MLX5_PMD],
258[
Sergio Gonzalez Monroyacdc3062017-08-24 14:09:17 +0100259 AC_CHECK_LIB([ibverbs], [ibv_fork_init],
260 [with_ibverbs_lib=yes],
Sergio Gonzalez Monroy3b12cdc2017-06-06 15:29:16 +0100261 [AC_MSG_ERROR([ibverbs library not found])])
262])
263
Sergio Gonzalez Monroyacdc3062017-08-24 14:09:17 +0100264m4_append([list_of_with], [ibverbs_lib], [, ])
265AM_CONDITIONAL(WITH_IBVERBS_LIB, test "$with_ibverbs_lib" = "yes")
266
Sergio Gonzalez Monroy3b12cdc2017-06-06 15:29:16 +0100267
Damjan Marion7cd468a2016-12-19 23:05:39 +0100268AM_COND_IF([ENABLE_G2],
269[
270 PKG_CHECK_MODULES(g2, gtk+-2.0)
271])
272
Damjan Marion0be5ec32016-12-28 17:51:56 +0100273# 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
275AM_COND_IF([CROSSCOMPILE],
276[
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...])
280 fi
281],[
282 VPPAPIGEN=\$\(top_builddir\)/vppapigen
283])
284AC_SUBST([VPPAPIGEN])
285
286
Damjan Marion7cd468a2016-12-19 23:05:39 +0100287###############################################################################
Damjan Marioncb034b92016-12-28 18:38:59 +0100288# JAVA
Damjan Marion7cd468a2016-12-19 23:05:39 +0100289###############################################################################
290
Damjan Marioncb034b92016-12-28 18:38:59 +0100291AM_COND_IF([ENABLE_JAPI],
292[
293 AX_VPP_FIND_JDK8
294 AC_SUBST(JAVA_HOME)
295 AC_SUBST(JAVAC)
296 AC_SUBST(JAVAH)
297 AC_SUBST(JAR)
298])
Damjan Marion7cd468a2016-12-19 23:05:39 +0100299
300###############################################################################
Ole Troan3cc49712017-03-08 12:02:24 +0100301# PYTHON
302###############################################################################
303
304AM_COND_IF([ENABLE_PAPI],
305[
306 AM_PATH_PYTHON
307])
308
309###############################################################################
Damjan Marion7cd468a2016-12-19 23:05:39 +0100310# Output
311###############################################################################
312
313AC_OUTPUT
314
315AC_MSG_RESULT([==============================================================================])
316PRINT_VAL([version], $PACKAGE $VERSION)
317PRINT_VAL([prefix], ${prefix})
318PRINT_VAL([libdir], ${libdir})
319PRINT_VAL([includedir], ${includedir})
320PRINT_VAL([CFLAGS], ${CFLAGS})
321PRINT_VAL([CPPFLAGS], ${CPPFLAGS})
322PRINT_VAL([LDFLAGS], ${LDFLAGS})
Damjan Marioncb034b92016-12-28 18:38:59 +0100323AM_COND_IF([ENABLE_JAPI],
324[
325 PRINT_VAL([JAVA_VERSION], ${JAVA_VERSION})
326 PRINT_VAL([JAVA_HOME], ${JAVA_HOME})
327])
Damjan Marion7cd468a2016-12-19 23:05:39 +0100328
329AC_MSG_RESULT([])
330AC_MSG_RESULT([with:])
331m4_foreach([x], m4_dquote(list_of_with), [
332 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${with_], x, [}])))
333])
334
335AC_MSG_RESULT([])
336AC_MSG_RESULT([enabled:])
337m4_foreach([x], m4_dquote(list_of_enabled), [
338 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [}])))
339])
340
341AC_MSG_RESULT([])
342AC_MSG_RESULT([plugins:])
343m4_foreach([x], m4_dquote(list_of_plugins), [
344 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [_plugin}])))
345])
346AC_MSG_RESULT([==============================================================================])
347
348