Stephane Barbarie | 1408896 | 2017-06-01 16:56:55 -0400 | [diff] [blame] | 1 | AC_PREREQ([2.63]) |
| 2 | AC_INIT([voltha], [1.0], [BUG-REPORT-ADDRESS]) |
| 3 | AC_CONFIG_SRCDIR([voltha.c]) |
| 4 | |
| 5 | PROJECTNAME=voltha |
| 6 | AC_SUBST(PROJECTNAME) |
| 7 | |
| 8 | # --enable-debug option |
| 9 | AC_ARG_ENABLE([debug], |
| 10 | AC_HELP_STRING([--enable-debug],[Compile with debug options]), |
| 11 | CFLAGS="$CFLAGS -g -DDEBUG", |
| 12 | CFLAGS="$CFLAGS -O3" |
| 13 | ) |
| 14 | |
| 15 | AC_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 | ) |
| 20 | AC_SUBST(NETOPEER_DIR) |
| 21 | |
| 22 | # --with-libxml2=path-to-libxml2-git-repository |
| 23 | AC_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. |
| 37 | AC_PROG_CC |
| 38 | AC_PROG_INSTALL |
| 39 | |
| 40 | # Use libtool |
| 41 | AC_PROG_LIBTOOL |
| 42 | # Always use ./libtool unless overridden from command-line |
| 43 | if test -z "$libtool"; then |
| 44 | libtool='./libtool' |
| 45 | fi |
| 46 | AC_SUBST(libtool) |
| 47 | |
| 48 | AC_PATH_PROG(NETOPEER_MANAGER, [netopeer-manager], []) |
| 49 | AC_SUBST(NETOPEER_MANAGER) |
| 50 | |
| 51 | # Checks for libraries. |
| 52 | AC_SEARCH_LIBS([ncds_apply_rpc2all], [netconf], ,AC_MSG_ERROR([libnetconf not found!])) |
| 53 | |
| 54 | # Check for libxml2. |
| 55 | if 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 ])) |
| 61 | fi |
| 62 | |
| 63 | # Add VOLTHA library |
| 64 | AC_CHECK_LIB([voltha], [main]) |
| 65 | AC_CHECK_LIB([voltha-netconf-model], [main]) |
| 66 | |
| 67 | # Checks for header files. |
| 68 | AC_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 | |
| 76 | AC_CONFIG_FILES([Makefile]) |
| 77 | AC_OUTPUT |