blob: 53975e3eaa6ae57ecdd508c09a556d3849d2e812 [file] [log] [blame]
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([mod_netconf], [1.0.0], [cejkat@cesnet.cz])
AM_INIT_AUTOMAKE([silent-rules])
AM_SILENT_RULES([yes])
USERNAME=`git config --get user.name`
USERMAIL=`git config --get user.email`
AC_SUBST(USERNAME)
AC_SUBST(USERMAIL)
RELEASE=1
AC_SUBST(RELEASE)
AC_ARG_VAR(httpdmoduledir, [Installation directory for Apache module, leave unset to use Apache default.])
AC_SUBST(httpdmoduledir)
if test "x$httpdconfddir" == x; then
httpdconfddir="/etc/httpd/conf.d"
fi
AC_ARG_VAR(httpdconfddir, [Directory for Apache configuration files [/etc/httpd/conf.d]])
AC_SUBST(httpdconfddir)
# Checks for programs.
AC_ARG_WITH(apxs, AC_HELP_STRING([--with-apxs=NAME],[name of the apxs executable [[apxs]]]), [APXS="$with_apxs"])
if test -z "${APXS}"; then
AC_PATH_PROGS(APXS, [apxs2 apxs], [no], [$PATH:/usr/sbin:/usr/local/apache2/bin])
else
AC_MSG_ERROR([Apxs for Apache module compilation and installation was not found.])
fi
AM_CONDITIONAL([MANUAL_CONFD], [test -n "$with_apxs" ])
# Check for rpmbuild
AC_CHECK_PROG(RPMBUILD, [rpmbuild], [rpmbuild], [""])
AC_CHECK_PROG(HTTPD, [httpd], [yes], [""])
AC_PATH_PROGS(APACHECTL, apachectl apache2ctl, no, [$PATH:/usr/sbin])
if test "x$APACHECTL" != xno; then
AC_MSG_CHECKING([for php5_module in apache])
$APACHECTL -M 2> /dev/null | grep php5_module > /dev/null && AC_MSG_RESULT([yes]) || AC_MSG_ERROR(["php5_module was not found."])
else
AC_MSG_ERROR([apachectl was not found])
fi
# Check for rpmbuild
AC_CHECK_PROG(RPMBUILD, rpmbuild, rpmbuild, [""])
RPM_RELEASE=1
AC_SUBST(RPM_RELEASE)
AM_CONDITIONAL(MAKE_RPMS, test x$RPMBUILD != x)
# Checks for libraries.
# save clean LIBS and CFLAGS
SAVEDTEMP_LIBS=$LIBS
SAVEDTEMP_CFLAGS=$CFLAGS
PKG_CHECK_MODULES([json], [json])
PKG_CHECK_MODULES([websockets], [libwebsockets])
PKG_CHECK_MODULES([apr], [apr-1])
PKG_CHECK_MODULES([aprutil], [apr-util-1])
PKG_CHECK_MODULES([netconf], [libnetconf])
PKG_CHECK_MODULES([xml], [libxml-2.0])
CFLAGS="$json_CFLAGS $websockets_CFLAGS $netconf_CFLAGS $xml_CFLAGS"
LIBS="$json_LIBS $websockets_LIBS $netconf_LIBS $xml_LIBS"
CPPFLAGS="$xml_CPPFLAGS"
AX_PTHREAD([CC="$PTHREAD_CC"],
[AC_MSG_ERROR([pthread not found])])
AC_ARG_WITH([notifications],
[AC_HELP_STRING([--without-notifications], [Disable notifications])],
AS_IF([test "x$with_notifications" == "xno"],[CFLAGS="$CFLAGS"],
[AC_CHECK_LIB([websockets], [libwebsocket_create_context])
CFLAGS="$CFLAGS -DWITH_NOTIFICATIONS"]),
[AC_CHECK_LIB([websockets], [libwebsocket_create_context])
CFLAGS="$CFLAGS -DWITH_NOTIFICATIONS"])
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT64_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([getdelim gettimeofday memset socket strdup strerror])
AC_CONFIG_FILES([Makefile
conf.d/Makefile
src/Makefile
])
AC_OUTPUT
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo
echo "Configuration Options Summary:"
echo
echo "Documentation..........: ${build_doc}"
echo
echo "Compilation............: make (or gmake)"
echo " asxs.................: $ASXS"
echo " LIBS.................: $LIBS"
echo " CFLAGS...............: $CFLAGS"
echo
echo "Components"
echo " mod_netconf..........: $with_modnetconf"
echo " webgui frontend......: $with_webgui"
echo " pyang plugins........: $with_pyang"
echo
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
echo " prefix...............: $prefix"
echo " python module dir....: $pyplugindir"
echo " webgui dir...........: $webguidir"
echo " webgui name..........: $webguiname"
echo " httpdmoduledir.......: $(test -z "$httpdmoduledir" && echo "Apache default path" || echo "$httpdmoduledir")"
echo " httpdconfddir........: $(test -z "$httpdconfddir" && echo "Apache default path" || echo "$httpdconfddir")"
echo " run composer install.: $composerinstall"
echo