Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 1 | AC_INIT(japi, 18.10) |
| 2 | LT_INIT |
| 3 | AM_INIT_AUTOMAKE |
| 4 | AM_SILENT_RULES([yes]) |
| 5 | AC_PREFIX_DEFAULT([/usr]) |
| 6 | |
| 7 | PKG_CHECK_MODULES([CHECK], [check], [HAVE_CHECK=1], [HAVE_CHECK=0]) |
| 8 | AM_CONDITIONAL([USE_CHECK],[test "$HAVE_CHECK" -eq 1]) |
| 9 | |
| 10 | AC_PROG_CC |
| 11 | AC_PROG_CXX |
| 12 | |
Florin Coras | 9686eac | 2018-08-01 17:24:08 -0700 | [diff] [blame] | 13 | # Check if compiler supports specific flag |
| 14 | AC_DEFUN([CC_CHECK_FLAG], |
| 15 | [ |
| 16 | AC_MSG_CHECKING([if $CC supports $1]) |
| 17 | AC_LANG_PUSH([C]) |
| 18 | ac_saved_cflags="$CFLAGS" |
| 19 | CFLAGS="-Werror $1" |
| 20 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], |
| 21 | [cc_flag_check=yes], |
| 22 | [cc_flag_check=no] |
| 23 | ) |
| 24 | AC_MSG_RESULT([$cc_flag_check]) |
| 25 | CFLAGS="$ac_saved_cflags" |
| 26 | AC_LANG_POP([C]) |
| 27 | ]) |
| 28 | |
| 29 | CC_CHECK_FLAG("-Wno-address-of-packed-member") |
| 30 | AS_IF([test "$cc_flag_check" = yes], |
| 31 | [CFLAGS="${CFLAGS} -Wno-address-of-packed-member"], []) |
| 32 | |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 33 | AM_CONDITIONAL(ENABLE_ACL_PLUGIN, test "yes" = "yes") |
| 34 | AM_CONDITIONAL(ENABLE_NAT_PLUGIN, test "yes" = "yes") |
| 35 | AM_CONDITIONAL(ENABLE_L2E_PLUGIN, test "yes" = "yes") |
| 36 | AM_CONDITIONAL(ENABLE_GBP_PLUGIN, test "yes" = "yes") |
| 37 | AM_CONDITIONAL(ENABLE_PPPOE_PLUGIN, test "yes" = "yes") |
| 38 | AM_CONDITIONAL(ENABLE_GTPU_PLUGIN, test "yes" = "yes") |
| 39 | AM_CONDITIONAL(ENABLE_IOAM_PLUGIN, test "yes" = "yes") |
Hongjun Ni | 3b9bf6f | 2018-09-05 06:46:20 +0800 | [diff] [blame] | 40 | AM_CONDITIONAL(ENABLE_NSH_PLUGIN, test "yes" = "yes") |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 41 | |
| 42 | AX_VPP_FIND_JDK8 |
| 43 | AC_SUBST(JAVA_HOME) |
| 44 | AC_SUBST(JAVAC) |
| 45 | AC_SUBST(JAVAH) |
| 46 | AC_SUBST(JAR) |
| 47 | |
| 48 | AS_CASE([$host_cpu], |
| 49 | [x86_64], [CPU_FLAGS="-march=corei7 -mtune=corei7-avx"], |
| 50 | [aarch64], [CPU_FLAGS="-march=armv8-a+crc"], |
| 51 | [CPU_FLAGS=""], |
| 52 | ) |
| 53 | AC_SUBST([CPU_FLAGS]) |
| 54 | |
| 55 | AC_OUTPUT([Makefile java/Makefile]) |
| 56 | |
| 57 | AC_CONFIG_MACRO_DIR([m4]) |