Neale Ranns | 39f9240 | 2017-06-22 14:43:55 -0700 | [diff] [blame] | 1 | AC_INIT([vpp], [17.10], [vpp-dev@fd.io]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 2 | LT_INIT |
| 3 | AC_CONFIG_AUX_DIR([.]) |
| 4 | AM_INIT_AUTOMAKE([subdir-objects]) |
| 5 | AM_SILENT_RULES([yes]) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 6 | AC_CONFIG_FILES([Makefile plugins/Makefile vpp-api/python/Makefile vpp-api/java/Makefile]) |
| 7 | AC_CONFIG_MACRO_DIR([m4]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 8 | |
| 9 | AC_PROG_CC |
| 10 | AM_PROG_AS |
| 11 | AM_PROG_LIBTOOL |
| 12 | AC_PROG_YACC |
Tomofumi Hayashi | dc90d42 | 2017-01-25 13:53:26 +0900 | [diff] [blame] | 13 | AM_PATH_PYTHON |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 14 | |
Damjan Marion | 0be5ec3 | 2016-12-28 17:51:56 +0100 | [diff] [blame] | 15 | AM_CONDITIONAL([CROSSCOMPILE], [test "$cross_compiling" == "yes"]) |
| 16 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 17 | ############################################################################### |
| 18 | # Macros |
| 19 | ############################################################################### |
| 20 | |
| 21 | AC_DEFUN([ENABLE_ARG], |
| 22 | [ |
| 23 | AC_ARG_ENABLE($1, |
| 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], [, ]) |
| 29 | ]) |
| 30 | |
| 31 | AC_DEFUN([DISABLE_ARG], |
| 32 | [ |
| 33 | AC_ARG_ENABLE($1, |
| 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], [, ]) |
| 39 | ]) |
| 40 | |
| 41 | AC_DEFUN([WITH_ARG], |
| 42 | [ |
| 43 | AC_ARG_WITH($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], [, ]) |
| 49 | ]) |
| 50 | |
| 51 | AC_DEFUN([WITHOUT_ARG], |
| 52 | [ |
| 53 | AC_ARG_WITH($1, |
| 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], [, ]) |
| 59 | ]) |
| 60 | |
| 61 | AC_DEFUN([PLUGIN_ENABLED], |
| 62 | [ |
| 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], [, ]) |
| 69 | ]) |
| 70 | |
| 71 | AC_DEFUN([PLUGIN_DISABLED], |
| 72 | [ |
| 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]) |
Pablo Camarillo | a084d62 | 2017-03-03 20:47:55 +0100 | [diff] [blame] | 77 | AM_CONDITIONAL(m4_toupper(ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes") |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 78 | m4_append([list_of_plugins], [$1], [, ]) |
| 79 | ]) |
| 80 | |
| 81 | AC_DEFUN([PRINT_VAL], [ AC_MSG_RESULT(AC_HELP_STRING($1,$2)) ]) |
| 82 | |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 83 | AC_DEFUN([DPDK_IS_PMD_ENABLED], |
| 84 | [ |
| 85 | AC_MSG_CHECKING([for $1 in rte_config.h]) |
| 86 | AC_COMPILE_IFELSE( |
| 87 | [AC_LANG_PROGRAM( |
| 88 | [[#include <rte_config.h>]], |
| 89 | [[return RTE_$1;]], |
| 90 | )], |
| 91 | [with_$2=yes] |
| 92 | [AC_MSG_RESULT([yes])], |
| 93 | [with_$2=no] |
| 94 | [AC_MSG_RESULT([no])] |
| 95 | ) |
| 96 | AM_CONDITIONAL(m4_toupper(WITH_$2), test "$with_$2" = "yes") |
| 97 | m4_append_uniq([list_of_with], [$2], [, ]) |
| 98 | ]) |
| 99 | |
Sergio Gonzalez Monroy | acdc306 | 2017-08-24 14:09:17 +0100 | [diff] [blame] | 100 | AC_DEFUN([DETECT_DPDK_IS_1702_OR_1705], |
| 101 | [ |
| 102 | AC_MSG_CHECKING([for RTE_VERSION 17.02/17.05 in rte_version.h]) |
| 103 | AC_TRY_RUN( |
| 104 | [ |
| 105 | #include <rte_version.h> |
| 106 | int main() |
| 107 | { |
| 108 | return ((RTE_VER_YEAR != 17) || |
| 109 | (RTE_VER_MONTH != 2 && RTE_VER_MONTH != 5)); |
| 110 | } |
| 111 | ], |
| 112 | [dpdk_is_1702_or_1705=yes] |
| 113 | [AC_MSG_RESULT([yes])], |
| 114 | [dpdk_is_1702_or_1705=no] |
| 115 | [AC_MSG_RESULT([no])] |
| 116 | ) |
| 117 | AM_CONDITIONAL(DPDK_IS_1702_OR_1705, test "$dpdk_is_1702_or_1705" = "yes") |
| 118 | ]) |
| 119 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 120 | ############################################################################### |
| 121 | # configure arguments |
| 122 | ############################################################################### |
| 123 | |
| 124 | # --enable-X |
| 125 | ENABLE_ARG(tests, [Enable unit tests]) |
| 126 | ENABLE_ARG(dpdk_shared, [Enable unit tests]) |
| 127 | ENABLE_ARG(perftool, [Enable perftool]) |
| 128 | ENABLE_ARG(g2, [Enable g2]) |
| 129 | |
| 130 | # --disable-X |
| 131 | DISABLE_ARG(vlib, [Disable vlib and dependant libs and binaries]) |
| 132 | DISABLE_ARG(svm, [Disable svm and dependant libs and binaries]) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 133 | DISABLE_ARG(papi, [Disable Python API bindings]) |
| 134 | DISABLE_ARG(japi, [Disable Java API bindings]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 135 | |
| 136 | # --with-X |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 137 | |
| 138 | # --without-X |
Damjan Marion | a9a951f | 2017-01-16 22:06:10 +0100 | [diff] [blame] | 139 | WITHOUT_ARG(libssl, [Disable libssl]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 140 | WITHOUT_ARG(apicli, [Disable binary api CLI]) |
| 141 | |
| 142 | AC_ARG_WITH(unix, |
| 143 | AC_HELP_STRING([--with-unix],[Compile unix version of clib]), |
| 144 | [], |
| 145 | [case $host_os in |
| 146 | darwin* | linux*) with_unix=yes;; |
| 147 | *) with_unix=no;; |
| 148 | esac]) |
| 149 | |
| 150 | AM_CONDITIONAL(WITH_UNIX, test "$with_unix" = "yes") |
| 151 | |
| 152 | AC_ARG_WITH(pre-data, |
| 153 | AC_HELP_STRING([--with-pre-data],[Set buffer rewrite space]), |
| 154 | [case $with_pre_data in |
| 155 | 128) ;; |
| 156 | 256) ;; |
| 157 | *) with_pre_data="pre-data-not-set" ;; |
| 158 | esac], [with_pre_data=128]) |
| 159 | |
| 160 | ############################################################################### |
| 161 | # Substitutions and defines |
| 162 | ############################################################################### |
| 163 | |
| 164 | AC_SUBST(PRE_DATA_SIZE, [$with_pre_data]) |
| 165 | AC_SUBST(APICLI, [-DVPP_API_TEST_BUILTIN=${n_with_apicli}]) |
| 166 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 167 | AC_DEFINE_UNQUOTED(DPDK_SHARED_LIB, [${n_enable_dpdk_shared}]) |
Damjan Marion | a9a951f | 2017-01-16 22:06:10 +0100 | [diff] [blame] | 168 | AC_DEFINE_UNQUOTED(WITH_LIBSSL, [${n_with_libssl}]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 169 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 170 | |
| 171 | # Silence following noise: |
| 172 | # ar: `u' modifier ignored since `D' is the default (see `U') |
| 173 | AR_FLAGS=cr |
| 174 | AC_SUBST(AR_FLAGS) |
| 175 | |
| 176 | ############################################################################### |
| 177 | # Plugins |
| 178 | ############################################################################### |
| 179 | |
| 180 | # Please keep alphabetical order |
| 181 | PLUGIN_ENABLED(acl) |
Damjan Marion | 374e2c5 | 2017-03-09 20:38:15 +0100 | [diff] [blame] | 182 | PLUGIN_ENABLED(dpdk) |
Ole Troan | 5c74973 | 2017-03-13 13:39:52 +0100 | [diff] [blame] | 183 | PLUGIN_ENABLED(flowprobe) |
Hongjun Ni | ef486b1 | 2017-04-12 19:21:16 +0800 | [diff] [blame] | 184 | PLUGIN_ENABLED(gtpu) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 185 | PLUGIN_ENABLED(ila) |
| 186 | PLUGIN_ENABLED(ioam) |
Damjan Marion | 374e2c5 | 2017-03-09 20:38:15 +0100 | [diff] [blame] | 187 | PLUGIN_ENABLED(ixge) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 188 | PLUGIN_ENABLED(lb) |
Damjan Marion | eaabe07 | 2017-03-22 10:18:13 +0100 | [diff] [blame] | 189 | PLUGIN_ENABLED(memif) |
Hongjun Ni | 62f9cdd | 2017-07-04 20:11:57 +0800 | [diff] [blame] | 190 | PLUGIN_ENABLED(pppoe) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 191 | PLUGIN_ENABLED(sixrd) |
Matus Fabian | 2ba92e3 | 2017-08-21 07:05:03 -0700 | [diff] [blame] | 192 | PLUGIN_ENABLED(nat) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 193 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 194 | ############################################################################### |
| 195 | # Dependency checks |
| 196 | ############################################################################### |
| 197 | |
| 198 | AM_COND_IF([ENABLE_DPDK_SHARED], |
| 199 | [ |
| 200 | AC_CHECK_HEADERS([rte_config.h], |
| 201 | [], |
| 202 | [AC_MSG_ERROR([DPDK header files not found])],) |
| 203 | AC_CHECK_LIB( [dpdk], [rte_eal_init], |
| 204 | [], |
| 205 | [AC_MSG_ERROR([DPDK shared library not found])],) |
| 206 | ]) |
| 207 | |
Sergio Gonzalez Monroy | acdc306 | 2017-08-24 14:09:17 +0100 | [diff] [blame] | 208 | with_aesni_mb_lib=no |
| 209 | with_isa_l_crypto_lib=no |
| 210 | |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 211 | DPDK_IS_PMD_ENABLED(LIBRTE_PMD_AESNI_MB, dpdk_aesni_mb_pmd) |
Sergio Gonzalez Monroy | acdc306 | 2017-08-24 14:09:17 +0100 | [diff] [blame] | 212 | DPDK_IS_PMD_ENABLED(LIBRTE_PMD_AESNI_GCM, dpdk_aesni_gcm_pmd) |
| 213 | |
| 214 | DETECT_DPDK_IS_1702_OR_1705() |
| 215 | |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 216 | AM_COND_IF([WITH_DPDK_AESNI_MB_PMD], |
| 217 | [ |
Sergio Gonzalez Monroy | acdc306 | 2017-08-24 14:09:17 +0100 | [diff] [blame] | 218 | AC_CHECK_LIB([IPSec_MB], [submit_job_sse], |
| 219 | [with_aesni_mb_lib=yes], |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 220 | [AC_MSG_ERROR([IPSec_MB library not found])]) |
| 221 | ]) |
| 222 | |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 223 | AM_COND_IF([WITH_DPDK_AESNI_GCM_PMD], |
| 224 | [ |
Sergio Gonzalez Monroy | acdc306 | 2017-08-24 14:09:17 +0100 | [diff] [blame] | 225 | AM_COND_IF([DPDK_IS_1702_OR_1705], |
| 226 | [ |
| 227 | AC_CHECK_LIB([isal_crypto], [aesni_gcm128_init], |
| 228 | [with_isa_l_crypto_lib=yes], |
| 229 | [AC_MSG_ERROR([isal_crypto library not found])]) |
| 230 | ], |
| 231 | [ |
| 232 | AC_CHECK_LIB([IPSec_MB], [submit_job_sse], |
| 233 | [with_aesni_mb_lib=yes], |
| 234 | [AC_MSG_ERROR([IPSec_MB library not found])]) |
| 235 | ]) |
| 236 | ]) |
| 237 | |
| 238 | m4_append([list_of_with], [aesni_mb_lib], [, ]) |
| 239 | AM_CONDITIONAL(WITH_AESNI_MB_LIB, test "$with_aesni_mb_lib" = "yes") |
| 240 | |
| 241 | m4_append([list_of_with], [isa_l_crypto_lib], [, ]) |
| 242 | AM_CONDITIONAL(WITH_ISA_L_CRYPTO_LIB, test "$with_isa_l_crypto_lib" = "yes") |
| 243 | |
| 244 | |
| 245 | with_ibverbs_lib=no |
| 246 | DPDK_IS_PMD_ENABLED(LIBRTE_MLX4_PMD, dpdk_mlx4_pmd) |
| 247 | AM_COND_IF([WITH_DPDK_MLX4_PMD], |
| 248 | [ |
| 249 | AC_CHECK_LIB([ibverbs], [ibv_fork_init], |
| 250 | [with_ibverbs_lib=yes], |
| 251 | [AC_MSG_ERROR([ibverbs library not found])]) |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 252 | ]) |
| 253 | |
| 254 | DPDK_IS_PMD_ENABLED(LIBRTE_MLX5_PMD, dpdk_mlx5_pmd) |
| 255 | AM_COND_IF([WITH_DPDK_MLX5_PMD], |
| 256 | [ |
Sergio Gonzalez Monroy | acdc306 | 2017-08-24 14:09:17 +0100 | [diff] [blame] | 257 | AC_CHECK_LIB([ibverbs], [ibv_fork_init], |
| 258 | [with_ibverbs_lib=yes], |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 259 | [AC_MSG_ERROR([ibverbs library not found])]) |
| 260 | ]) |
| 261 | |
Sergio Gonzalez Monroy | acdc306 | 2017-08-24 14:09:17 +0100 | [diff] [blame] | 262 | m4_append([list_of_with], [ibverbs_lib], [, ]) |
| 263 | AM_CONDITIONAL(WITH_IBVERBS_LIB, test "$with_ibverbs_lib" = "yes") |
| 264 | |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 265 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 266 | AM_COND_IF([ENABLE_G2], |
| 267 | [ |
| 268 | PKG_CHECK_MODULES(g2, gtk+-2.0) |
| 269 | ]) |
| 270 | |
Damjan Marion | 0be5ec3 | 2016-12-28 17:51:56 +0100 | [diff] [blame] | 271 | # If cross-compiling, we need external vppapigen and we cannot continue without it |
| 272 | # For native builds, we just set dependency on vpppaigen binary in top_builddir |
| 273 | AM_COND_IF([CROSSCOMPILE], |
| 274 | [ |
| 275 | AC_PATH_PROG([VPPAPIGEN], [vppapigen], [no]) |
| 276 | if test "$VPPAPIGEN" = "no"; then |
| 277 | AC_MSG_ERROR([Externaly built vppapigen is needed when cross-compiling...]) |
| 278 | fi |
| 279 | ],[ |
| 280 | VPPAPIGEN=\$\(top_builddir\)/vppapigen |
| 281 | ]) |
| 282 | AC_SUBST([VPPAPIGEN]) |
| 283 | |
| 284 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 285 | ############################################################################### |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 286 | # JAVA |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 287 | ############################################################################### |
| 288 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 289 | AM_COND_IF([ENABLE_JAPI], |
| 290 | [ |
| 291 | AX_VPP_FIND_JDK8 |
| 292 | AC_SUBST(JAVA_HOME) |
| 293 | AC_SUBST(JAVAC) |
| 294 | AC_SUBST(JAVAH) |
| 295 | AC_SUBST(JAR) |
| 296 | ]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 297 | |
| 298 | ############################################################################### |
Ole Troan | 3cc4971 | 2017-03-08 12:02:24 +0100 | [diff] [blame] | 299 | # PYTHON |
| 300 | ############################################################################### |
| 301 | |
| 302 | AM_COND_IF([ENABLE_PAPI], |
| 303 | [ |
| 304 | AM_PATH_PYTHON |
| 305 | ]) |
| 306 | |
| 307 | ############################################################################### |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 308 | # Output |
| 309 | ############################################################################### |
| 310 | |
| 311 | AC_OUTPUT |
| 312 | |
| 313 | AC_MSG_RESULT([==============================================================================]) |
| 314 | PRINT_VAL([version], $PACKAGE $VERSION) |
| 315 | PRINT_VAL([prefix], ${prefix}) |
| 316 | PRINT_VAL([libdir], ${libdir}) |
| 317 | PRINT_VAL([includedir], ${includedir}) |
| 318 | PRINT_VAL([CFLAGS], ${CFLAGS}) |
| 319 | PRINT_VAL([CPPFLAGS], ${CPPFLAGS}) |
| 320 | PRINT_VAL([LDFLAGS], ${LDFLAGS}) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 321 | AM_COND_IF([ENABLE_JAPI], |
| 322 | [ |
| 323 | PRINT_VAL([JAVA_VERSION], ${JAVA_VERSION}) |
| 324 | PRINT_VAL([JAVA_HOME], ${JAVA_HOME}) |
| 325 | ]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 326 | |
| 327 | AC_MSG_RESULT([]) |
| 328 | AC_MSG_RESULT([with:]) |
| 329 | m4_foreach([x], m4_dquote(list_of_with), [ |
| 330 | AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${with_], x, [}]))) |
| 331 | ]) |
| 332 | |
| 333 | AC_MSG_RESULT([]) |
| 334 | AC_MSG_RESULT([enabled:]) |
| 335 | m4_foreach([x], m4_dquote(list_of_enabled), [ |
| 336 | AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [}]))) |
| 337 | ]) |
| 338 | |
| 339 | AC_MSG_RESULT([]) |
| 340 | AC_MSG_RESULT([plugins:]) |
| 341 | m4_foreach([x], m4_dquote(list_of_plugins), [ |
| 342 | AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [_plugin}]))) |
| 343 | ]) |
| 344 | AC_MSG_RESULT([==============================================================================]) |
| 345 | |
| 346 | |