Anlu Yan | 04f8d3f | 2017-02-22 09:18:11 -0800 | [diff] [blame] | 1 | AC_INIT(vpp_plugins, 1.0) |
Dave Barach | 2126b35 | 2016-02-10 08:42:59 -0500 | [diff] [blame] | 2 | LT_INIT |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 3 | AM_INIT_AUTOMAKE |
Dave Barach | dbacf85 | 2016-07-02 10:34:55 -0400 | [diff] [blame] | 4 | AM_SILENT_RULES([yes]) |
Damjan Marion | 905a7f5 | 2016-07-07 20:27:49 +0200 | [diff] [blame] | 5 | AC_PREFIX_DEFAULT([/usr]) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 6 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 7 | AC_PROG_CC |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 8 | |
Damjan Marion | de02414 | 2018-04-25 00:56:08 +0200 | [diff] [blame] | 9 | # Check if compiler supports specific flag |
| 10 | AC_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 | |
| 25 | CC_CHECK_FLAG("-Wno-address-of-packed-member") |
| 26 | AS_IF([test "$cc_flag_check" = yes], |
| 27 | [CFLAGS="${CFLAGS} -Wno-address-of-packed-member"], []) |
| 28 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 29 | AC_OUTPUT([Makefile]) |
Anlu Yan | 04f8d3f | 2017-02-22 09:18:11 -0800 | [diff] [blame] | 30 | |
| 31 | AC_CONFIG_MACRO_DIR([m4]) |