blob: 3b9206630ae5f7a43d82b448191970e9543a114c [file] [log] [blame]
Stephane Barbarie14088962017-06-01 16:56:55 -04001AC_PREREQ([2.63])
2AC_INIT([voltha], [1.0], [BUG-REPORT-ADDRESS])
3AC_CONFIG_SRCDIR([voltha.c])
4
5PROJECTNAME=voltha
6AC_SUBST(PROJECTNAME)
7
8# --enable-debug option
9AC_ARG_ENABLE([debug],
10 AC_HELP_STRING([--enable-debug],[Compile with debug options]),
11 CFLAGS="$CFLAGS -g -DDEBUG",
12 CFLAGS="$CFLAGS -O3"
13)
14
15AC_ARG_WITH([netopeer-confdir],
16 [AC_HELP_STRING([--with-netopeer-confdir=DIR], [Netopeer server configuration directory (by default ${sysconfdir}/netopeer/)])],
17 [NETOPEER_DIR="$withval"],
18 [NETOPEER_DIR="${sysconfdir}/netopeer"]
19)
20AC_SUBST(NETOPEER_DIR)
21
22# --with-libxml2=path-to-libxml2-git-repository
23AC_ARG_WITH([libxml2],
24[AC_HELP_STRING([--with-libxml2], [specific libxml2 location])],
25[
26 AC_CHECK_PROG([XML2_CONFIG], [xml2-config], [yes], [no], [$withval])
27 if test "$XML2_CONFIG" = "no"; then
28 AC_MSG_ERROR([Missing development package of libxml2.])
29 fi
30 CFLAGS="`$withval/xml2-config --cflags` $CFLAGS"
31 LDFLAGS="`$withval/xml2-config --libs` $LDFLAGS"
32 WITH_LIBXML2="$withval"
33]
34)
35
36# Checks for programs.
37AC_PROG_CC
38AC_PROG_INSTALL
39
40# Use libtool
41AC_PROG_LIBTOOL
42# Always use ./libtool unless overridden from command-line
43if test -z "$libtool"; then
44 libtool='./libtool'
45fi
46AC_SUBST(libtool)
47
48AC_PATH_PROG(NETOPEER_MANAGER, [netopeer-manager], [])
49AC_SUBST(NETOPEER_MANAGER)
50
51# Checks for libraries.
52AC_SEARCH_LIBS([ncds_apply_rpc2all], [netconf], ,AC_MSG_ERROR([libnetconf not found!]))
53
54# Check for libxml2.
55if test -z "$WITH_LIBXML2" ; then
56 AC_CHECK_PROG([XML2_CONFIG], [xml2-config], [yes], [no])
57 if test "$XML2_CONFIG" = "no"; then
58 AC_MSG_ERROR([Missing development package of libxml2.])
59 fi
60 AC_CHECK_LIB([xml2], [main], [LIBS="`xml2-config --libs` $LIBS" CFLAGS="`xml2-config --cflags` $CFLAGS"], AC_MSG_ERROR([Libxml2 not found ]))
61fi
62
63# Add VOLTHA library
64AC_CHECK_LIB([voltha], [main])
65AC_CHECK_LIB([voltha-netconf-model], [main])
66
67# Checks for header files.
68AC_CHECK_HEADERS([stdlib.h libnetconf.h])
69
70# Checks for typedefs, structures, and compiler characteristics.
71#AC_TYPE_UINT32_T
72
73# Checks for library functions.
74#AC_CHECK_FUNCS([strdup])
75
76AC_CONFIG_FILES([Makefile])
77AC_OUTPUT