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 | |
| 83 | ############################################################################### |
| 84 | # configure arguments |
| 85 | ############################################################################### |
| 86 | |
| 87 | # --enable-X |
| 88 | ENABLE_ARG(tests, [Enable unit tests]) |
| 89 | ENABLE_ARG(dpdk_shared, [Enable unit tests]) |
| 90 | ENABLE_ARG(perftool, [Enable perftool]) |
| 91 | ENABLE_ARG(g2, [Enable g2]) |
| 92 | |
| 93 | # --disable-X |
| 94 | DISABLE_ARG(vlib, [Disable vlib and dependant libs and binaries]) |
| 95 | DISABLE_ARG(svm, [Disable svm and dependant libs and binaries]) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 96 | DISABLE_ARG(papi, [Disable Python API bindings]) |
| 97 | DISABLE_ARG(japi, [Disable Java API bindings]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 98 | |
| 99 | # --with-X |
Sergio Gonzalez Monroy | d04b60b | 2017-01-20 15:35:23 +0000 | [diff] [blame] | 100 | WITH_ARG(dpdk_crypto_sw,[Use DPDK cryptodev SW PMDs]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 101 | WITH_ARG(dpdk_mlx5_pmd, [Use DPDK with mlx5 PMD]) |
| 102 | |
| 103 | # --without-X |
Damjan Marion | a9a951f | 2017-01-16 22:06:10 +0100 | [diff] [blame] | 104 | WITHOUT_ARG(libssl, [Disable libssl]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 105 | WITHOUT_ARG(apicli, [Disable binary api CLI]) |
| 106 | |
| 107 | AC_ARG_WITH(unix, |
| 108 | AC_HELP_STRING([--with-unix],[Compile unix version of clib]), |
| 109 | [], |
| 110 | [case $host_os in |
| 111 | darwin* | linux*) with_unix=yes;; |
| 112 | *) with_unix=no;; |
| 113 | esac]) |
| 114 | |
| 115 | AM_CONDITIONAL(WITH_UNIX, test "$with_unix" = "yes") |
| 116 | |
| 117 | AC_ARG_WITH(pre-data, |
| 118 | AC_HELP_STRING([--with-pre-data],[Set buffer rewrite space]), |
| 119 | [case $with_pre_data in |
| 120 | 128) ;; |
| 121 | 256) ;; |
| 122 | *) with_pre_data="pre-data-not-set" ;; |
| 123 | esac], [with_pre_data=128]) |
| 124 | |
| 125 | ############################################################################### |
| 126 | # Substitutions and defines |
| 127 | ############################################################################### |
| 128 | |
| 129 | AC_SUBST(PRE_DATA_SIZE, [$with_pre_data]) |
| 130 | AC_SUBST(APICLI, [-DVPP_API_TEST_BUILTIN=${n_with_apicli}]) |
| 131 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 132 | AC_DEFINE_UNQUOTED(DPDK_SHARED_LIB, [${n_enable_dpdk_shared}]) |
Sergio Gonzalez Monroy | d04b60b | 2017-01-20 15:35:23 +0000 | [diff] [blame] | 133 | AC_DEFINE_UNQUOTED(DPDK_CRYPTO_SW, [${n_with_dpdk_crypto_sw}]) |
Damjan Marion | a9a951f | 2017-01-16 22:06:10 +0100 | [diff] [blame] | 134 | AC_DEFINE_UNQUOTED(WITH_LIBSSL, [${n_with_libssl}]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 135 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 136 | |
| 137 | # Silence following noise: |
| 138 | # ar: `u' modifier ignored since `D' is the default (see `U') |
| 139 | AR_FLAGS=cr |
| 140 | AC_SUBST(AR_FLAGS) |
| 141 | |
| 142 | ############################################################################### |
| 143 | # Plugins |
| 144 | ############################################################################### |
| 145 | |
| 146 | # Please keep alphabetical order |
| 147 | PLUGIN_ENABLED(acl) |
Damjan Marion | 374e2c5 | 2017-03-09 20:38:15 +0100 | [diff] [blame] | 148 | PLUGIN_ENABLED(dpdk) |
Ole Troan | 5c74973 | 2017-03-13 13:39:52 +0100 | [diff] [blame] | 149 | PLUGIN_ENABLED(flowprobe) |
Hongjun Ni | ef486b1 | 2017-04-12 19:21:16 +0800 | [diff] [blame] | 150 | PLUGIN_ENABLED(gtpu) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 151 | PLUGIN_ENABLED(ila) |
| 152 | PLUGIN_ENABLED(ioam) |
Damjan Marion | 374e2c5 | 2017-03-09 20:38:15 +0100 | [diff] [blame] | 153 | PLUGIN_ENABLED(ixge) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 154 | PLUGIN_ENABLED(lb) |
Damjan Marion | eaabe07 | 2017-03-22 10:18:13 +0100 | [diff] [blame] | 155 | PLUGIN_ENABLED(memif) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 156 | PLUGIN_ENABLED(sixrd) |
| 157 | PLUGIN_ENABLED(snat) |
| 158 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 159 | ############################################################################### |
| 160 | # Dependency checks |
| 161 | ############################################################################### |
| 162 | |
| 163 | AM_COND_IF([ENABLE_DPDK_SHARED], |
| 164 | [ |
| 165 | AC_CHECK_HEADERS([rte_config.h], |
| 166 | [], |
| 167 | [AC_MSG_ERROR([DPDK header files not found])],) |
| 168 | AC_CHECK_LIB( [dpdk], [rte_eal_init], |
| 169 | [], |
| 170 | [AC_MSG_ERROR([DPDK shared library not found])],) |
| 171 | ]) |
| 172 | |
| 173 | AM_COND_IF([ENABLE_G2], |
| 174 | [ |
| 175 | PKG_CHECK_MODULES(g2, gtk+-2.0) |
| 176 | ]) |
| 177 | |
Damjan Marion | 0be5ec3 | 2016-12-28 17:51:56 +0100 | [diff] [blame] | 178 | # If cross-compiling, we need external vppapigen and we cannot continue without it |
| 179 | # For native builds, we just set dependency on vpppaigen binary in top_builddir |
| 180 | AM_COND_IF([CROSSCOMPILE], |
| 181 | [ |
| 182 | AC_PATH_PROG([VPPAPIGEN], [vppapigen], [no]) |
| 183 | if test "$VPPAPIGEN" = "no"; then |
| 184 | AC_MSG_ERROR([Externaly built vppapigen is needed when cross-compiling...]) |
| 185 | fi |
| 186 | ],[ |
| 187 | VPPAPIGEN=\$\(top_builddir\)/vppapigen |
| 188 | ]) |
| 189 | AC_SUBST([VPPAPIGEN]) |
| 190 | |
| 191 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 192 | ############################################################################### |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 193 | # JAVA |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 194 | ############################################################################### |
| 195 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 196 | AM_COND_IF([ENABLE_JAPI], |
| 197 | [ |
| 198 | AX_VPP_FIND_JDK8 |
| 199 | AC_SUBST(JAVA_HOME) |
| 200 | AC_SUBST(JAVAC) |
| 201 | AC_SUBST(JAVAH) |
| 202 | AC_SUBST(JAR) |
| 203 | ]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 204 | |
| 205 | ############################################################################### |
Ole Troan | 3cc4971 | 2017-03-08 12:02:24 +0100 | [diff] [blame] | 206 | # PYTHON |
| 207 | ############################################################################### |
| 208 | |
| 209 | AM_COND_IF([ENABLE_PAPI], |
| 210 | [ |
| 211 | AM_PATH_PYTHON |
| 212 | ]) |
| 213 | |
| 214 | ############################################################################### |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 215 | # Output |
| 216 | ############################################################################### |
| 217 | |
| 218 | AC_OUTPUT |
| 219 | |
| 220 | AC_MSG_RESULT([==============================================================================]) |
| 221 | PRINT_VAL([version], $PACKAGE $VERSION) |
| 222 | PRINT_VAL([prefix], ${prefix}) |
| 223 | PRINT_VAL([libdir], ${libdir}) |
| 224 | PRINT_VAL([includedir], ${includedir}) |
| 225 | PRINT_VAL([CFLAGS], ${CFLAGS}) |
| 226 | PRINT_VAL([CPPFLAGS], ${CPPFLAGS}) |
| 227 | PRINT_VAL([LDFLAGS], ${LDFLAGS}) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 228 | AM_COND_IF([ENABLE_JAPI], |
| 229 | [ |
| 230 | PRINT_VAL([JAVA_VERSION], ${JAVA_VERSION}) |
| 231 | PRINT_VAL([JAVA_HOME], ${JAVA_HOME}) |
| 232 | ]) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 233 | |
| 234 | AC_MSG_RESULT([]) |
| 235 | AC_MSG_RESULT([with:]) |
| 236 | m4_foreach([x], m4_dquote(list_of_with), [ |
| 237 | AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${with_], x, [}]))) |
| 238 | ]) |
| 239 | |
| 240 | AC_MSG_RESULT([]) |
| 241 | AC_MSG_RESULT([enabled:]) |
| 242 | m4_foreach([x], m4_dquote(list_of_enabled), [ |
| 243 | AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [}]))) |
| 244 | ]) |
| 245 | |
| 246 | AC_MSG_RESULT([]) |
| 247 | AC_MSG_RESULT([plugins:]) |
| 248 | m4_foreach([x], m4_dquote(list_of_plugins), [ |
| 249 | AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [_plugin}]))) |
| 250 | ]) |
| 251 | AC_MSG_RESULT([==============================================================================]) |
| 252 | |
| 253 | |