blob: 69d989183c55f325edd04deb61125779baf663c8 [file] [log] [blame]
Anlu Yan04f8d3f2017-02-22 09:18:11 -08001AC_INIT(vpp_plugins, 1.0)
Dave Barach2126b352016-02-10 08:42:59 -05002LT_INIT
Ed Warnickecb9cada2015-12-08 15:45:58 -07003AM_INIT_AUTOMAKE
Dave Barachdbacf852016-07-02 10:34:55 -04004AM_SILENT_RULES([yes])
Damjan Marion905a7f52016-07-07 20:27:49 +02005AC_PREFIX_DEFAULT([/usr])
Ed Warnickecb9cada2015-12-08 15:45:58 -07006
Ed Warnickecb9cada2015-12-08 15:45:58 -07007AC_PROG_CC
Ed Warnickecb9cada2015-12-08 15:45:58 -07008
Damjan Marionde024142018-04-25 00:56:08 +02009# Check if compiler supports specific flag
10AC_DEFUN([CC_CHECK_FLAG],
11[
12 AC_MSG_CHECKING([if $CC supports $1])
13 AC_LANG_PUSH([C])
14 ac_saved_cflags="$CFLAGS"
15 CFLAGS="-Werror $1"
16 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
17 [cc_flag_check=yes],
18 [cc_flag_check=no]
19)
20 AC_MSG_RESULT([$cc_flag_check])
21 CFLAGS="$ac_saved_cflags"
22 AC_LANG_POP([C])
23])
24
Dave Barach6a5adc32018-07-04 10:56:23 -040025AC_DEFUN([ENABLE_ARG],
26[
27 AC_ARG_ENABLE($1,
28 AC_HELP_STRING(patsubst([--enable-$1],[_],[-]), $2),
29 [enable_$1=yes n_enable_$1=1],
30 [enable_$1=no n_enable_$1=0])
31 AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes")
32 m4_append([list_of_enabled], [$1], [, ])
33])
34
Damjan Marionde024142018-04-25 00:56:08 +020035CC_CHECK_FLAG("-Wno-address-of-packed-member")
36AS_IF([test "$cc_flag_check" = yes],
37 [CFLAGS="${CFLAGS} -Wno-address-of-packed-member"], [])
38
Ed Warnickecb9cada2015-12-08 15:45:58 -070039AC_OUTPUT([Makefile])
Anlu Yan04f8d3f2017-02-22 09:18:11 -080040
41AC_CONFIG_MACRO_DIR([m4])