blob: f6e7b53ac7f6a1d5482ac366e4478c93ccb02b08 [file] [log] [blame]
Damjan Marion09cce662018-09-27 18:02:28 +00001AC_INIT(japi, 18.10)
2LT_INIT
3AM_INIT_AUTOMAKE
4AM_SILENT_RULES([yes])
5AC_PREFIX_DEFAULT([/usr])
6
7PKG_CHECK_MODULES([CHECK], [check], [HAVE_CHECK=1], [HAVE_CHECK=0])
8AM_CONDITIONAL([USE_CHECK],[test "$HAVE_CHECK" -eq 1])
9
10AC_PROG_CC
11AC_PROG_CXX
12
13# Check if compiler supports specific flag
14AC_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
29CC_CHECK_FLAG("-Wno-address-of-packed-member")
30AS_IF([test "$cc_flag_check" = yes],
31 [CFLAGS="${CFLAGS} -Wno-address-of-packed-member"], [])
32
33AM_CONDITIONAL(ENABLE_ACL_PLUGIN, test "yes" = "yes")
34AM_CONDITIONAL(ENABLE_NAT_PLUGIN, test "yes" = "yes")
35AM_CONDITIONAL(ENABLE_L2E_PLUGIN, test "yes" = "yes")
36AM_CONDITIONAL(ENABLE_GBP_PLUGIN, test "yes" = "yes")
37AM_CONDITIONAL(ENABLE_PPPOE_PLUGIN, test "yes" = "yes")
38AM_CONDITIONAL(ENABLE_GTPU_PLUGIN, test "yes" = "yes")
39AM_CONDITIONAL(ENABLE_IOAM_PLUGIN, test "yes" = "yes")
40AM_CONDITIONAL(ENABLE_NSH_PLUGIN, test "yes" = "yes")
41
42AX_VPP_FIND_JDK8
43AC_SUBST(JAVA_HOME)
44AC_SUBST(JAVAC)
45AC_SUBST(JAVAH)
46AC_SUBST(JAR)
47
48AS_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)
53AC_SUBST([CPU_FLAGS])
54
55AC_OUTPUT([Makefile java/Makefile])
56
57AC_CONFIG_MACRO_DIR([m4])