aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples/sample-plugin/configure.ac
blob: 588e7dd16b9d1d015cb3ab649452233a6f2d4be5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
AC_INIT(vpp_plugins, 1.0)
LT_INIT
AM_INIT_AUTOMAKE
AM_SILENT_RULES([yes])
AC_PREFIX_DEFAULT([/usr])

AC_PROG_CC

# Check if compiler supports specific flag
AC_DEFUN([CC_CHECK_FLAG],
[
  AC_MSG_CHECKING([if $CC supports $1])
  AC_LANG_PUSH([C])
  ac_saved_cflags="$CFLAGS"
  CFLAGS="-Werror $1"
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
  [cc_flag_check=yes],
  [cc_flag_check=no]
)
  AC_MSG_RESULT([$cc_flag_check])
  CFLAGS="$ac_saved_cflags"
  AC_LANG_POP([C])
])

CC_CHECK_FLAG("-Wno-address-of-packed-member")
AS_IF([test "$cc_flag_check" = yes],
	[CFLAGS="${CFLAGS} -Wno-address-of-packed-member"], [])

AC_OUTPUT([Makefile])

AC_CONFIG_MACRO_DIR([m4])
se">\ | vppapigen --input - --output $@ --show-name $@ %.api.json: %.api @echo " JSON APIGEN " $@ ; \ mkdir -p `dirname $@` ; \ $(CC) $(CPPFLAGS) -E -P -C -x c $^ \ | vppapigen --input - --json $@ apidir = $(prefix)/lb/ api_DATA = lb/lb.api.json noinst_HEADERS = lb/lb.h lb/util.h lb/refcount.h lb/lbhash.h lb/lb.api.h lb_test_plugin_la_SOURCES = \ lb/lb_test.c lb/lb_plugin.api.h # Remove *.la files install-data-hook: @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES)) @(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES))