Chris Luke | 7c6df39 | 2018-04-04 16:41:56 -0400 | [diff] [blame] | 1 | AC_INIT([vpp], [18.07], [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 | c0c919c | 2018-05-30 09:55:05 +0200 | [diff] [blame] | 6 | AC_CONFIG_FILES([ \ |
| 7 | Makefile \ |
| 8 | plugins/Makefile \ |
| 9 | vpp-api/python/Makefile \ |
| 10 | vpp-api/java/Makefile \ |
| 11 | vpp-api/vapi/Makefile \ |
| 12 | vlib/config.h \ |
| 13 | ]) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 14 | AC_CONFIG_MACRO_DIR([m4]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 15 | |
| 16 | AC_PROG_CC |
Neale Ranns | 812ed39 | 2017-10-16 04:20:13 -0700 | [diff] [blame] | 17 | AC_PROG_CPP |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 18 | AM_PROG_AS |
| 19 | AM_PROG_LIBTOOL |
Tomofumi Hayashi | dc90d42 | 2017-01-25 13:53:26 +0900 | [diff] [blame] | 20 | AM_PATH_PYTHON |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 21 | |
Damjan Marion | 0be5ec3 | 2016-12-28 17:51:56 +0100 | [diff] [blame] | 22 | AM_CONDITIONAL([CROSSCOMPILE], [test "$cross_compiling" == "yes"]) |
| 23 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 24 | ############################################################################### |
| 25 | # Macros |
| 26 | ############################################################################### |
| 27 | |
| 28 | AC_DEFUN([ENABLE_ARG], |
| 29 | [ |
| 30 | AC_ARG_ENABLE($1, |
| 31 | AC_HELP_STRING(patsubst([--enable-$1],[_],[-]), $2), |
| 32 | [enable_$1=yes n_enable_$1=1], |
| 33 | [enable_$1=no n_enable_$1=0]) |
| 34 | AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes") |
| 35 | m4_append([list_of_enabled], [$1], [, ]) |
| 36 | ]) |
| 37 | |
| 38 | AC_DEFUN([DISABLE_ARG], |
| 39 | [ |
| 40 | AC_ARG_ENABLE($1, |
| 41 | AC_HELP_STRING(patsubst([--disable-$1],[_],[-]), $2), |
| 42 | [enable_$1=no n_enable_$1=0], |
| 43 | [enable_$1=yes n_enable_$1=1]) |
| 44 | AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes") |
| 45 | m4_append([list_of_enabled], [$1], [, ]) |
| 46 | ]) |
| 47 | |
| 48 | AC_DEFUN([WITH_ARG], |
| 49 | [ |
| 50 | AC_ARG_WITH($1, |
| 51 | AC_HELP_STRING(patsubst([--with-$1],[_],[-]), $2), |
| 52 | [with_$1=yes n_with_$1=1], |
| 53 | [with_$1=no n_with_$1=0]) |
| 54 | AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes") |
| 55 | m4_append([list_of_with], [$1], [, ]) |
| 56 | ]) |
| 57 | |
| 58 | AC_DEFUN([WITHOUT_ARG], |
| 59 | [ |
| 60 | AC_ARG_WITH($1, |
| 61 | AC_HELP_STRING(patsubst([--without-$1],[_],[-]), $2), |
| 62 | [with_$1=no n_with_$1=0], |
| 63 | [with_$1=yes n_with_$1=1]) |
| 64 | AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes") |
| 65 | m4_append([list_of_with], [$1], [, ]) |
| 66 | ]) |
| 67 | |
| 68 | AC_DEFUN([PLUGIN_ENABLED], |
| 69 | [ |
| 70 | AC_ARG_ENABLE($1_plugin, |
| 71 | AC_HELP_STRING([--disable-$1-plugin], [Do not build $1 plugin]), |
| 72 | [enable_$1_plugin=no], |
| 73 | [enable_$1_plugin=yes ]) |
| 74 | AM_CONDITIONAL(m4_toupper(ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes") |
| 75 | m4_append([list_of_plugins], [$1], [, ]) |
| 76 | ]) |
| 77 | |
| 78 | AC_DEFUN([PLUGIN_DISABLED], |
| 79 | [ |
| 80 | AC_ARG_ENABLE($1_plugin, |
| 81 | AC_HELP_STRING([--enable-$1-plugin], [Build $1 plugin]), |
| 82 | [enable_$1_plugin=yes ], |
| 83 | [enable_$1_plugin=no]) |
Pablo Camarillo | a084d62 | 2017-03-03 20:47:55 +0100 | [diff] [blame] | 84 | AM_CONDITIONAL(m4_toupper(ENABLE_$1_PLUGIN), test "$enable_$1_plugin" = "yes") |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 85 | m4_append([list_of_plugins], [$1], [, ]) |
| 86 | ]) |
| 87 | |
| 88 | AC_DEFUN([PRINT_VAL], [ AC_MSG_RESULT(AC_HELP_STRING($1,$2)) ]) |
| 89 | |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 90 | AC_DEFUN([DPDK_IS_PMD_ENABLED], |
| 91 | [ |
| 92 | AC_MSG_CHECKING([for $1 in rte_config.h]) |
| 93 | AC_COMPILE_IFELSE( |
| 94 | [AC_LANG_PROGRAM( |
| 95 | [[#include <rte_config.h>]], |
| 96 | [[return RTE_$1;]], |
| 97 | )], |
| 98 | [with_$2=yes] |
| 99 | [AC_MSG_RESULT([yes])], |
| 100 | [with_$2=no] |
| 101 | [AC_MSG_RESULT([no])] |
| 102 | ) |
| 103 | AM_CONDITIONAL(m4_toupper(WITH_$2), test "$with_$2" = "yes") |
| 104 | m4_append_uniq([list_of_with], [$2], [, ]) |
| 105 | ]) |
| 106 | |
Damjan Marion | 04f3db3 | 2017-11-10 21:55:45 +0100 | [diff] [blame] | 107 | # Check if compiler supports specific flag |
| 108 | AC_DEFUN([CC_CHECK_FLAG], |
| 109 | [ |
| 110 | AC_MSG_CHECKING([if $CC supports $1]) |
| 111 | AC_LANG_PUSH([C]) |
| 112 | ac_saved_cflags="$CFLAGS" |
| 113 | CFLAGS="-Werror $1" |
| 114 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], |
Damjan Marion | bf024e6 | 2017-11-14 15:21:19 +0100 | [diff] [blame] | 115 | [cc_flag_check=yes], |
| 116 | [cc_flag_check=no] |
Damjan Marion | 04f3db3 | 2017-11-10 21:55:45 +0100 | [diff] [blame] | 117 | ) |
Damjan Marion | eecb26d | 2017-11-15 13:57:20 +0100 | [diff] [blame] | 118 | AC_MSG_RESULT([$cc_flag_check]) |
Damjan Marion | 04f3db3 | 2017-11-10 21:55:45 +0100 | [diff] [blame] | 119 | CFLAGS="$ac_saved_cflags" |
| 120 | AC_LANG_POP([C]) |
| 121 | ]) |
| 122 | |
Dave Barach | 473f461 | 2018-05-29 17:06:45 -0400 | [diff] [blame] | 123 | # This function deduces the BUILD HOST cache-line size by |
| 124 | # inspecting /sys and/or /proc depending on the kernel / arch in use |
| 125 | as_fn_log2_cache_line_size_p() |
| 126 | { |
| 127 | sysfs_cache_path="/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size" |
| 128 | m4_define([read_cache_line_size_from_sysfs], [`head -n 1 $1`]) |
| 129 | m4_define([read_midr_implementer], |
| 130 | [`awk '/implementer/ {print $[]4;exit}' /proc/cpuinfo`]) |
| 131 | m4_define([read_midr_cpuid], |
| 132 | [`awk '/part/ {print $[]4;exit}' /proc/cpuinfo`]) |
| 133 | |
| 134 | #Check if sysfs path exists,to ignore warning, else do manual mapping |
| 135 | AC_CHECK_FILE($sysfs_cache_path, |
| 136 | [ |
| 137 | cache_line_size=read_cache_line_size_from_sysfs($sysfs_cache_path); |
| 138 | if test $cache_line_size = "32" ; then |
| 139 | log2_cache_line_size="5"; |
| 140 | elif test $cache_line_size = "64" ; then |
| 141 | log2_cache_line_size="6"; |
| 142 | elif test $cache_line_size = "128" ; then |
| 143 | log2_cache_line_size="7"; |
| 144 | fi |
| 145 | AC_MSG_NOTICE([cache_line_size/log2_cache_line_size deduced as $cache_line_size/$log2_cache_line_size]) |
| 146 | ], |
| 147 | [ |
| 148 | #Define Implementer Ids here |
| 149 | implementer_id_cavium=0x43 |
| 150 | |
| 151 | #Define CPU Ids here |
| 152 | cpu_id_cavium_thunderx_cn88xx=0x0a1 |
| 153 | cpu_id_cavium_thunderx2_cn99xx=0x0af |
| 154 | |
| 155 | implementer=read_midr_implementer() |
| 156 | cpuid=read_midr_cpuid() |
| 157 | |
| 158 | AC_MSG_CHECKING([for implementerid/cpuid to set log2_cache_line_size]) |
| 159 | |
| 160 | # Switch case to map log2_cache_line_size for implementer/cpuid combination. |
| 161 | # Default case of Switch sets log2_cache_line_size to 6 |
| 162 | AS_CASE($implementer, |
| 163 | #Switch Case for Cavium SoC's |
| 164 | [$implementer_id_cavium], |
| 165 | [AS_CASE($cpuid, |
| 166 | #Only ThunderX2 is 64B. Remaining chips are 128B |
| 167 | [$cpu_id_cavium_thunderx2_cn99xx], |
| 168 | [AC_MSG_RESULT([Cavium/ThunderX2]);log2_cache_line_size=6], |
| 169 | [$cpu_id_cavium_thunderx_cn88xx], |
| 170 | [AC_MSG_RESULT([Cavium/ThunderX]);log2_cache_line_size=7], |
| 171 | [log2_cache_line_size=7;AC_MSG_RESULT([Cavium/OCTEONTx($cpuid)])] |
| 172 | )], |
| 173 | #Add implementer specific case here: |
| 174 | |
| 175 | #Default case: 64B for all SoC's |
| 176 | [log2_cache_line_size=6;AC_MSG_RESULT([$implementer/$cpuid])] |
| 177 | ) |
| 178 | AC_MSG_NOTICE([log2_cache_line_size deduced as $log2_cache_line_size]) |
| 179 | ] |
| 180 | ) |
| 181 | echo $log2_cache_line_size |
| 182 | } |
| 183 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 184 | ############################################################################### |
| 185 | # configure arguments |
| 186 | ############################################################################### |
| 187 | |
| 188 | # --enable-X |
| 189 | ENABLE_ARG(tests, [Enable unit tests]) |
| 190 | ENABLE_ARG(dpdk_shared, [Enable unit tests]) |
| 191 | ENABLE_ARG(perftool, [Enable perftool]) |
| 192 | ENABLE_ARG(g2, [Enable g2]) |
| 193 | |
| 194 | # --disable-X |
| 195 | DISABLE_ARG(vlib, [Disable vlib and dependant libs and binaries]) |
| 196 | DISABLE_ARG(svm, [Disable svm and dependant libs and binaries]) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 197 | DISABLE_ARG(papi, [Disable Python API bindings]) |
| 198 | DISABLE_ARG(japi, [Disable Java API bindings]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 199 | |
| 200 | # --with-X |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 201 | |
| 202 | # --without-X |
Damjan Marion | a9a951f | 2017-01-16 22:06:10 +0100 | [diff] [blame] | 203 | WITHOUT_ARG(libssl, [Disable libssl]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 204 | WITHOUT_ARG(apicli, [Disable binary api CLI]) |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 205 | WITHOUT_ARG(mbedtls, [Disable mbedtls]) |
Sachin Saxena | ee6ddce | 2018-05-10 16:22:09 +0530 | [diff] [blame] | 206 | WITHOUT_ARG(libnuma, [for non numa architectures]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 207 | |
Dave Barach | 473f461 | 2018-05-29 17:06:45 -0400 | [diff] [blame] | 208 | AC_ARG_WITH(log2-cache-line-bytes, |
| 209 | AC_HELP_STRING([--with-log2-cache-line-bytes],[Set the cache line size, --with-log2-cache-line-bytes=5|6|7|auto]), |
| 210 | [case $with_log2_cache_line_bytes in |
| 211 | 5 | 6 | 7);; |
| 212 | auto) with_log2_cache_line_bytes=`as_fn_log2_cache_line_size_p`;; |
| 213 | *) with_log2_cache_line_bytes="CONFIG_ERROR";; |
| 214 | esac], |
| 215 | [with_log2_cache_line_bytes=`as_fn_log2_cache_line_size_p`]) |
| 216 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 217 | AC_ARG_WITH(unix, |
| 218 | AC_HELP_STRING([--with-unix],[Compile unix version of clib]), |
| 219 | [], |
| 220 | [case $host_os in |
| 221 | darwin* | linux*) with_unix=yes;; |
| 222 | *) with_unix=no;; |
| 223 | esac]) |
| 224 | |
| 225 | AM_CONDITIONAL(WITH_UNIX, test "$with_unix" = "yes") |
| 226 | |
| 227 | AC_ARG_WITH(pre-data, |
| 228 | AC_HELP_STRING([--with-pre-data],[Set buffer rewrite space]), |
| 229 | [case $with_pre_data in |
| 230 | 128) ;; |
| 231 | 256) ;; |
| 232 | *) with_pre_data="pre-data-not-set" ;; |
| 233 | esac], [with_pre_data=128]) |
| 234 | |
| 235 | ############################################################################### |
Damjan Marion | ba3c773 | 2017-11-10 20:26:50 +0100 | [diff] [blame] | 236 | # Target CPU flags |
| 237 | ############################################################################### |
| 238 | |
Damjan Marion | 04f3db3 | 2017-11-10 21:55:45 +0100 | [diff] [blame] | 239 | # Check if compiler supports march=core-avx2 |
| 240 | CC_CHECK_FLAG("-march=core-avx2") |
| 241 | AS_IF([test "$cc_flag_check" = yes], |
| 242 | [march_core_avx2=yes], |
| 243 | [march_core_avx2=no]) |
| 244 | AM_CONDITIONAL([CC_SUPPORTS_AVX2], [test "$march_core_avx2" = "yes"]) |
| 245 | |
| 246 | # Check if compiler supports march=skylake-avx512 |
| 247 | CC_CHECK_FLAG("-march=skylake-avx512") |
| 248 | AS_IF([test "$cc_flag_check" = yes], |
| 249 | [march_skylake_avx512=yes], |
| 250 | [march_skylake_avx512=no]) |
| 251 | AM_CONDITIONAL([CC_SUPPORTS_AVX512], [test "$march_skylake_avx512" = "yes"]) |
| 252 | |
Sachin Saxena | 432bf67 | 2018-05-04 15:08:29 +0530 | [diff] [blame] | 253 | AS_CASE([$host_cpu], |
Damjan Marion | ba3c773 | 2017-11-10 20:26:50 +0100 | [diff] [blame] | 254 | [x86_64], [CPU_FLAGS="-march=corei7 -mtune=corei7-avx"], |
| 255 | [aarch64], [CPU_FLAGS="-march=armv8-a+crc"], |
| 256 | [CPU_FLAGS=""], |
| 257 | ) |
| 258 | AC_SUBST([CPU_FLAGS]) |
| 259 | |
Damjan Marion | 04f3db3 | 2017-11-10 21:55:45 +0100 | [diff] [blame] | 260 | AC_SUBST([CPU_AVX2_FLAGS],"-march=core-avx2 -mtune=core-avx2") |
| 261 | AC_SUBST([CPU_AVX512_FLAGS],"-march=skylake-avx512 -mtune=skylake-avx512") |
| 262 | |
Sachin Saxena | 432bf67 | 2018-05-04 15:08:29 +0530 | [diff] [blame] | 263 | AM_CONDITIONAL([CPU_X86_64], [test "$host_cpu" = "x86_64"]) |
| 264 | AM_CONDITIONAL([CPU_AARCH64], [test "$host_cpu" = "aarch64"]) |
Damjan Marion | 04f3db3 | 2017-11-10 21:55:45 +0100 | [diff] [blame] | 265 | |
Damjan Marion | ba3c773 | 2017-11-10 20:26:50 +0100 | [diff] [blame] | 266 | ############################################################################### |
Damjan Marion | 74a6dab | 2018-03-26 13:36:46 +0200 | [diff] [blame] | 267 | # misc compiler flags |
| 268 | ############################################################################### |
| 269 | |
| 270 | CC_CHECK_FLAG("-Wno-address-of-packed-member") |
| 271 | AS_IF([test "$cc_flag_check" = yes], |
| 272 | [CFLAGS="${CFLAGS} -Wno-address-of-packed-member"], []) |
| 273 | |
| 274 | ############################################################################### |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 275 | # Substitutions and defines |
| 276 | ############################################################################### |
| 277 | |
| 278 | AC_SUBST(PRE_DATA_SIZE, [$with_pre_data]) |
Dave Barach | 473f461 | 2018-05-29 17:06:45 -0400 | [diff] [blame] | 279 | AC_SUBST(LOG2_CACHE_LINE_BYTES, [$with_log2_cache_line_bytes]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 280 | AC_SUBST(APICLI, [-DVPP_API_TEST_BUILTIN=${n_with_apicli}]) |
| 281 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 282 | AC_DEFINE_UNQUOTED(DPDK_SHARED_LIB, [${n_enable_dpdk_shared}]) |
Damjan Marion | a9a951f | 2017-01-16 22:06:10 +0100 | [diff] [blame] | 283 | AC_DEFINE_UNQUOTED(WITH_LIBSSL, [${n_with_libssl}]) |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 284 | AC_DEFINE_UNQUOTED(WITH_MBEDTLS, [${n_with_mbedtls}]) |
Sachin Saxena | ee6ddce | 2018-05-10 16:22:09 +0530 | [diff] [blame] | 285 | AC_DEFINE_UNQUOTED(WITH_LIBNUMA, [${n_with_libnuma}]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 286 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 287 | |
| 288 | # Silence following noise: |
| 289 | # ar: `u' modifier ignored since `D' is the default (see `U') |
| 290 | AR_FLAGS=cr |
| 291 | AC_SUBST(AR_FLAGS) |
| 292 | |
| 293 | ############################################################################### |
| 294 | # Plugins |
| 295 | ############################################################################### |
| 296 | |
| 297 | # Please keep alphabetical order |
Andrew Yourtchenko | 669d07d | 2017-11-17 14:38:18 +0100 | [diff] [blame] | 298 | PLUGIN_ENABLED(abf) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 299 | PLUGIN_ENABLED(acl) |
Damjan Marion | b4ff07a | 2018-02-07 22:35:06 +0100 | [diff] [blame] | 300 | PLUGIN_ENABLED(avf) |
Dave Barach | aaacfbc | 2018-03-10 14:57:00 -0500 | [diff] [blame] | 301 | PLUGIN_ENABLED(cdp) |
Damjan Marion | 374e2c5 | 2017-03-09 20:38:15 +0100 | [diff] [blame] | 302 | PLUGIN_ENABLED(dpdk) |
Ole Troan | 5c74973 | 2017-03-13 13:39:52 +0100 | [diff] [blame] | 303 | PLUGIN_ENABLED(flowprobe) |
Neale Ranns | 7758bf6 | 2018-02-14 06:34:20 -0800 | [diff] [blame] | 304 | PLUGIN_ENABLED(gbp) |
Hongjun Ni | ef486b1 | 2017-04-12 19:21:16 +0800 | [diff] [blame] | 305 | PLUGIN_ENABLED(gtpu) |
Jakub Grajciar | 7b867a8 | 2017-12-08 16:28:42 +0100 | [diff] [blame] | 306 | PLUGIN_ENABLED(igmp) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 307 | PLUGIN_ENABLED(ila) |
| 308 | PLUGIN_ENABLED(ioam) |
Damjan Marion | 374e2c5 | 2017-03-09 20:38:15 +0100 | [diff] [blame] | 309 | PLUGIN_ENABLED(ixge) |
Neale Ranns | 7758bf6 | 2018-02-14 06:34:20 -0800 | [diff] [blame] | 310 | PLUGIN_ENABLED(l2e) |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 311 | PLUGIN_ENABLED(lacp) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 312 | PLUGIN_ENABLED(lb) |
Dave Barach | 7055e26 | 2018-06-18 13:16:39 -0400 | [diff] [blame] | 313 | PLUGIN_ENABLED(mactime) |
Damjan Marion | 92cdd72 | 2017-12-26 13:40:13 +0000 | [diff] [blame] | 314 | PLUGIN_ENABLED(marvell) |
Damjan Marion | eaabe07 | 2017-03-22 10:18:13 +0100 | [diff] [blame] | 315 | PLUGIN_ENABLED(memif) |
Hongjun Ni | 62f9cdd | 2017-07-04 20:11:57 +0800 | [diff] [blame] | 316 | PLUGIN_ENABLED(pppoe) |
Neale Ranns | 7758bf6 | 2018-02-14 06:34:20 -0800 | [diff] [blame] | 317 | PLUGIN_ENABLED(nat) |
Ole Troan | 381e9a9 | 2018-06-22 11:32:12 +0200 | [diff] [blame] | 318 | PLUGIN_ENABLED(map) |
Francois Clad | b4d43d7 | 2018-01-17 12:18:41 +0100 | [diff] [blame] | 319 | PLUGIN_ENABLED(srv6ad) |
Francois Clad | 39d91fe | 2018-01-17 16:08:41 +0100 | [diff] [blame] | 320 | PLUGIN_ENABLED(srv6am) |
Francois Clad | ba7992a | 2018-01-16 17:52:24 +0100 | [diff] [blame] | 321 | PLUGIN_ENABLED(srv6as) |
Pierre Pfister | 0906c5c | 2017-09-27 16:17:31 +0200 | [diff] [blame] | 322 | PLUGIN_ENABLED(stn) |
Florin Coras | d77eee6 | 2018-03-07 08:49:27 -0800 | [diff] [blame] | 323 | PLUGIN_ENABLED(tlsmbedtls) |
Florin Coras | 58d36f0 | 2018-03-09 13:05:53 -0800 | [diff] [blame] | 324 | PLUGIN_ENABLED(tlsopenssl) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 325 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 326 | ############################################################################### |
| 327 | # Dependency checks |
| 328 | ############################################################################### |
Marco Varlese | 3f6ede3 | 2018-03-06 08:09:04 +0100 | [diff] [blame] | 329 | AC_CHECK_FUNC([memfd_create], [AC_DEFINE([HAVE_MEMFD_CREATE], [1], [Define if memfd exists])]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 330 | |
| 331 | AM_COND_IF([ENABLE_DPDK_SHARED], |
| 332 | [ |
| 333 | AC_CHECK_HEADERS([rte_config.h], |
| 334 | [], |
| 335 | [AC_MSG_ERROR([DPDK header files not found])],) |
| 336 | AC_CHECK_LIB( [dpdk], [rte_eal_init], |
| 337 | [], |
| 338 | [AC_MSG_ERROR([DPDK shared library not found])],) |
| 339 | ]) |
| 340 | |
Sergio Gonzalez Monroy | acdc306 | 2017-08-24 14:09:17 +0100 | [diff] [blame] | 341 | with_aesni_mb_lib=no |
| 342 | with_isa_l_crypto_lib=no |
| 343 | |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 344 | 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] | 345 | DPDK_IS_PMD_ENABLED(LIBRTE_PMD_AESNI_GCM, dpdk_aesni_gcm_pmd) |
| 346 | |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 347 | AM_COND_IF([WITH_DPDK_AESNI_MB_PMD], |
| 348 | [ |
Sergio Gonzalez Monroy | acdc306 | 2017-08-24 14:09:17 +0100 | [diff] [blame] | 349 | AC_CHECK_LIB([IPSec_MB], [submit_job_sse], |
| 350 | [with_aesni_mb_lib=yes], |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 351 | [AC_MSG_ERROR([IPSec_MB library not found])]) |
| 352 | ]) |
| 353 | |
Sergio Gonzalez Monroy | 3b12cdc | 2017-06-06 15:29:16 +0100 | [diff] [blame] | 354 | AM_COND_IF([WITH_DPDK_AESNI_GCM_PMD], |
| 355 | [ |
Damjan Marion | 45b4850 | 2017-11-17 09:46:41 +0100 | [diff] [blame] | 356 | AC_CHECK_LIB([IPSec_MB], [submit_job_sse], |
| 357 | [with_aesni_mb_lib=yes], |
| 358 | [AC_MSG_ERROR([IPSec_MB library not found])]) |
Sergio Gonzalez Monroy | acdc306 | 2017-08-24 14:09:17 +0100 | [diff] [blame] | 359 | ]) |
| 360 | |
| 361 | m4_append([list_of_with], [aesni_mb_lib], [, ]) |
| 362 | AM_CONDITIONAL(WITH_AESNI_MB_LIB, test "$with_aesni_mb_lib" = "yes") |
| 363 | |
| 364 | m4_append([list_of_with], [isa_l_crypto_lib], [, ]) |
| 365 | AM_CONDITIONAL(WITH_ISA_L_CRYPTO_LIB, test "$with_isa_l_crypto_lib" = "yes") |
| 366 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 367 | AM_COND_IF([ENABLE_G2], |
| 368 | [ |
| 369 | PKG_CHECK_MODULES(g2, gtk+-2.0) |
| 370 | ]) |
| 371 | |
Damjan Marion | 92cdd72 | 2017-12-26 13:40:13 +0000 | [diff] [blame] | 372 | AM_COND_IF([ENABLE_MARVELL_PLUGIN], |
| 373 | [ |
| 374 | AC_CHECK_LIB( [musdk], [pp2_init], |
| 375 | [], |
| 376 | [ |
| 377 | AC_MSG_WARN([Marvell MUSDK library with PP2 support not found. Plugin disabled.]) |
| 378 | enable_marvell_plugin=no |
| 379 | AM_CONDITIONAL(ENABLE_MARVELL_PLUGIN, false) |
| 380 | ]) |
| 381 | ]) |
| 382 | |
Florin Coras | d77eee6 | 2018-03-07 08:49:27 -0800 | [diff] [blame] | 383 | AM_COND_IF([WITH_MBEDTLS], [], |
| 384 | [ |
| 385 | AC_MSG_WARN([mbedtls not enabled. Disabling tlsmbedtls plugin]) |
| 386 | enable_tlsmbedtls_plugin=no |
| 387 | AM_CONDITIONAL(ENABLE_TLSMBEDTLS_PLUGIN, false) |
| 388 | ]) |
| 389 | |
| 390 | AM_COND_IF([ENABLE_TLSMBEDTLS_PLUGIN], |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 391 | [ |
| 392 | AC_CHECK_HEADERS([mbedtls/ssl.h], [], |
| 393 | [ |
Florin Coras | d77eee6 | 2018-03-07 08:49:27 -0800 | [diff] [blame] | 394 | AC_MSG_WARN([mbedtls headers not found. TLS engine implementation disabled]) |
| 395 | enable_tlsmbedtls_plugin=no |
| 396 | AM_CONDITIONAL(ENABLE_TLSMBEDTLS_PLUGIN, false) |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 397 | ], []) |
| 398 | ]) |
| 399 | |
Ping Yu | e43832c | 2018-05-30 18:16:08 -0400 | [diff] [blame] | 400 | AM_COND_IF([WITH_LIBSSL], |
| 401 | [ |
| 402 | AC_CHECK_LIB([ssl -lcrypto], [SSL_set_async_callback], |
| 403 | [ |
| 404 | AC_DEFINE([HAVE_OPENSSL_ASYNC], [1], [Define if new openssl interface exists]) |
| 405 | ]) |
| 406 | ], |
Florin Coras | 58d36f0 | 2018-03-09 13:05:53 -0800 | [diff] [blame] | 407 | [ |
| 408 | AC_MSG_WARN([openssl not enabled. Disabling tlsopenssl plugin]) |
| 409 | enable_tlsopenssl_plugin=no |
| 410 | AM_CONDITIONAL(ENABLE_TLSOPENSSL_PLUGIN, false) |
| 411 | ]) |
Florin Coras | d77eee6 | 2018-03-07 08:49:27 -0800 | [diff] [blame] | 412 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 413 | ############################################################################### |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 414 | # JAVA |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 415 | ############################################################################### |
| 416 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 417 | AM_COND_IF([ENABLE_JAPI], |
| 418 | [ |
| 419 | AX_VPP_FIND_JDK8 |
| 420 | AC_SUBST(JAVA_HOME) |
| 421 | AC_SUBST(JAVAC) |
| 422 | AC_SUBST(JAVAH) |
| 423 | AC_SUBST(JAR) |
| 424 | ]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 425 | |
| 426 | ############################################################################### |
Ole Troan | 3cc4971 | 2017-03-08 12:02:24 +0100 | [diff] [blame] | 427 | # PYTHON |
| 428 | ############################################################################### |
| 429 | |
| 430 | AM_COND_IF([ENABLE_PAPI], |
| 431 | [ |
| 432 | AM_PATH_PYTHON |
| 433 | ]) |
| 434 | |
| 435 | ############################################################################### |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 436 | # Output |
| 437 | ############################################################################### |
| 438 | |
| 439 | AC_OUTPUT |
| 440 | |
| 441 | AC_MSG_RESULT([==============================================================================]) |
| 442 | PRINT_VAL([version], $PACKAGE $VERSION) |
| 443 | PRINT_VAL([prefix], ${prefix}) |
| 444 | PRINT_VAL([libdir], ${libdir}) |
| 445 | PRINT_VAL([includedir], ${includedir}) |
| 446 | PRINT_VAL([CFLAGS], ${CFLAGS}) |
| 447 | PRINT_VAL([CPPFLAGS], ${CPPFLAGS}) |
| 448 | PRINT_VAL([LDFLAGS], ${LDFLAGS}) |
Dave Barach | 473f461 | 2018-05-29 17:06:45 -0400 | [diff] [blame] | 449 | PRINT_VAL([LOG2_CACHE_LINE_BYTES], ${with_log2_cache_line_bytes}) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 450 | AM_COND_IF([ENABLE_JAPI], |
| 451 | [ |
| 452 | PRINT_VAL([JAVA_VERSION], ${JAVA_VERSION}) |
| 453 | PRINT_VAL([JAVA_HOME], ${JAVA_HOME}) |
| 454 | ]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 455 | |
| 456 | AC_MSG_RESULT([]) |
| 457 | AC_MSG_RESULT([with:]) |
| 458 | m4_foreach([x], m4_dquote(list_of_with), [ |
| 459 | AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${with_], x, [}]))) |
| 460 | ]) |
| 461 | |
| 462 | AC_MSG_RESULT([]) |
| 463 | AC_MSG_RESULT([enabled:]) |
| 464 | m4_foreach([x], m4_dquote(list_of_enabled), [ |
| 465 | AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [}]))) |
| 466 | ]) |
| 467 | |
| 468 | AC_MSG_RESULT([]) |
| 469 | AC_MSG_RESULT([plugins:]) |
| 470 | m4_foreach([x], m4_dquote(list_of_plugins), [ |
| 471 | AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [_plugin}]))) |
| 472 | ]) |
| 473 | AC_MSG_RESULT([==============================================================================]) |
| 474 | |
| 475 | |