support for struct dirent.d_type added to Linux readdir wrapper
[public/netxms.git] / configure.ac
index a21e073..c86a84d 100644 (file)
@@ -4,7 +4,7 @@
 # Configure script
 #
 
-AC_INIT([NetXMS], [2.0], [bugs@netxms.org])
+AC_INIT([NetXMS], [2.1-RC1], [bugs@netxms.org])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_HEADERS(config.h)
 AM_INIT_AUTOMAKE
@@ -48,6 +48,7 @@ COMPONENTS=""
 DISABLE_ICONV="no"
 DISABLE_ENCRYPTION="no"
 DISABLE_LMSENSORS="no"
+DISABLE_SSH="no"
 ENABLE_DEBUG="no"
 ENABLE_WERROR="no"
 STATIC_BUILD="no"
@@ -59,12 +60,12 @@ BUILD_AGENT="no"
 BUILD_CLIENT="no"
 BUILD_STATIC_AGENT="no"
 BUILD_SDK="no"
-NEED_ZLIB="no"
 MODULES="libnetxms tools install"
 STATIC_SUBAGENT_LIST=""
 PROPOSED_STATIC_SUBAGENTS="default"
 SUBAGENT_DIRS=""
 SUBAGENT_LIBS=""
+AGENT_DIRS=""
 SERVER_LIBS=""
 SERVER_TOOLS=""
 SERVER_INCLUDE=""
@@ -74,8 +75,9 @@ PDSDRV_DIRS=""
 TOP_LEVEL_MODULES=""
 CONTRIB_MODULES=""
 CLIENT_COMPONENTS=""
-BUILD_UNICODE="no"
+BUILD_UNICODE="yes"
 FORCE_INTERNAL_EXPAT="no"
+FORCE_INTERNAL_LIBTRE="yes"
 USE_INTERNAL_LIBTRE="no"
 FORCE_INTERNAL_LIBTRE="no"
 FORCE_INTERNAL_JANSSON="no"
@@ -93,15 +95,28 @@ RUNTIME_STATE_DIR=""
 HPUX_HPPA="no"
 XMPP_SUPPORT="yes"
 ZEROMQ_SUPPORT="no"
+ZEROMQ_REQUIRED="no"
 ZEROMQ_CPPFLAGS=""
 ZEROMQ_LDFLAGS=""
+MQTT_SUPPORT="yes"
+MQTT_REQUIRED="no"
+MQTT_CPPFLAGS=""
+MQTT_LDFLAGS=""
+MQTT_LIBS=""
 LDAP_SUPPORT="yes"
-DISABLE_READLINE="no"
+DISABLE_READLINE="yes"
 TUXEDO_LIBS=""
+TUXEDO_TPINIT=""
 MONGODB_LIBS=""
+VMGR_LIBS=""
+LIBVIRT_BASE=""
 DISABLE_IPV6="no"
 IPV6_SUPPORT="no"
 INSTALL_LIBPATH=""
+WITH_ENCRYPTION="no"
+DISABLE_COMMONCRYPTO="no"
+OPENSSL_LIBSSL="ssl"
+OPENSSL_LIBCRYPTO="crypto"
 
 
 #--------------------------------------------------------------------
@@ -261,6 +276,13 @@ AC_ARG_WITH(jdk,
                LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"   
                LDFLAGS="$LDFLAGS -L${withval}/lib"
                CPPFLAGS="$CPPFLAGS -I${withval}/include"
+               if test -d "${withval}/include/linux"; then
+                       CPPFLAGS="$CPPFLAGS -I${withval}/include/linux"
+               fi
+               if test -d "${withval}/include/solaris"; then
+                       CPPFLAGS="$CPPFLAGS -I${withval}/include/solaris"
+               fi
+               AC_DEFINE_UNQUOTED([JDK_LOCATION],["$withval"],[JDK location])
        fi
        COMPONENTS="$COMPONENTS java"
 fi ])
@@ -275,13 +297,28 @@ AC_ARG_WITH(tuxedo,
 fi ])
 
 AC_ARG_WITH(zeromq,
-[AS_HELP_STRING(--with-zeromq,build  with ZeroMQ)],
+[AS_HELP_STRING(--with-zeromq,build with ZeroMQ)],
 [ if test "x$withval" != "xno" ; then
        if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
                ZEROMQ_BASE="$withval"
+               ZEROMQ_REQUIRED=yes
        fi
        COMPONENTS="$COMPONENTS zeromq"
-   ZEROMQ_SUPPORT=yes
+       ZEROMQ_SUPPORT=yes
+else
+       ZEROMQ_SUPPORT=no
+fi ])
+
+AC_ARG_WITH(mqtt,
+[AS_HELP_STRING(--with-mqtt,build with MQTT support)],
+[ if test "x$withval" != "xno" ; then
+       if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
+               MQTT_BASE="$withval"
+               MQTT_REQUIRED=yes
+       fi
+       MQTT_SUPPORT=yes
+else
+       MQTT_SUPPORT=no
 fi ])
 
 AC_ARG_WITH(mongodb,
@@ -293,6 +330,20 @@ AC_ARG_WITH(mongodb,
        COMPONENTS="$COMPONENTS mongodb"
 fi ])
 
+AC_ARG_WITH(vmgr,
+[AS_HELP_STRING(--with-vmgr,build VirtualHost management subagent)],
+[ if test "x$withval" != "xno" ; then
+       COMPONENTS="$COMPONENTS vmgr"
+fi ])
+
+AC_ARG_WITH(libvirt,
+[AS_HELP_STRING(--with-libvirt,provide libvirt location)],
+[ if test "x$withval" != "xno" ; then
+       if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
+               LIBVIRT_BASE="$withval"
+       fi
+fi ])
+
 AC_ARG_WITH(sqlite,
 [AS_HELP_STRING(--with-sqlite,build SQLite database driver)],
 [ if test "x$withval" != "xno" ; then
@@ -454,6 +505,29 @@ AC_ARG_WITH(openssl,
        fi
 ])
 
+AC_ARG_ENABLE(commoncrypto,
+[AS_HELP_STRING(--disable-commoncrypto,disable CommonCrypto usage on Mac OS X)],
+[
+       if test "x$enableval" = "xno"; then
+               DISABLE_COMMONCRYPTO="yes"
+       fi
+])
+
+AC_ARG_WITH(bundled-openssl,
+[AS_HELP_STRING(--with-bundled-openssl,use bundled OpenSSL libraries with product-specific prefix)],
+[
+       OPENSSL_LIBSSL="nxssl"
+       OPENSSL_LIBCRYPTO="nxcrypto"
+])
+
+AC_ARG_ENABLE(ssh,
+[AS_HELP_STRING(--disable-ssh,disable SSH support)],
+[
+       if test "x$enableval" = "xno"; then
+               DISABLE_SSH="yes"
+       fi
+])
+
 AC_ARG_WITH(jemalloc,
 [AS_HELP_STRING(--with-jemalloc,specify libjemalloc location)],
 [
@@ -470,13 +544,17 @@ AC_ARG_WITH(jemalloc,
 AC_ARG_ENABLE(iconv,
 [AS_HELP_STRING(--disable-iconv,do not use iconv() for text conversions)],
 [
-       DISABLE_ICONV="yes"
+       if test "x$$enableval" = "xno"; then
+               DISABLE_ICONV="yes"
+       fi
 ])
 
 AC_ARG_ENABLE(ipv6,
 [AS_HELP_STRING(--disable-ipv6,disable IPv6 support)],
 [
-       DISABLE_IPV6="yes"
+       if test "x$$enableval" = "xno"; then
+               DISABLE_IPV6="yes"
+       fi
 ])
 
 AC_ARG_ENABLE(iconv-cache,
@@ -487,73 +565,92 @@ AC_ARG_ENABLE(iconv-cache,
 AC_ARG_ENABLE(readline,
 [AS_HELP_STRING(--disable-readline,do not use libreadline)],
 [
-       DISABLE_READLINE="yes"
+       if test "x$$enableval" = "xno"; then
+               DISABLE_READLINE="yes"
+       fi
 ])
 
 AC_ARG_ENABLE(encryption,
 [AS_HELP_STRING(--disable-encryption,disable encryption support)],
 [
-       DISABLE_ENCRYPTION="yes"
-       XMPP_SUPPORT="no"
+       if test "x$$enableval" = "xno"; then
+               DISABLE_ENCRYPTION="yes"
+               XMPP_SUPPORT="no"
+       fi
 ])
 
 AC_ARG_ENABLE(lmsensors,
 [AS_HELP_STRING(--disable-lmsensors,disable lmsensors support)],
 [
-       DISABLE_LMSENSORS="yes"
+       if test "x$$enableval" = "xno"; then
+               DISABLE_LMSENSORS="yes"
+       fi
 ])
 
 AC_ARG_ENABLE(xmpp,
 [AS_HELP_STRING(--disable-xmpp,disable XMPP support)],
 [
-       XMPP_SUPPORT="no"
+       if test "x$$enableval" = "xno"; then
+               XMPP_SUPPORT="no"
+       fi
 ])
 
 AC_ARG_ENABLE(ldap,
 [AS_HELP_STRING(--disable-ldap,disable LDAP support)],
 [
-       LDAP_SUPPORT="no"
+       if test "x$$enableval" = "xno"; then
+               LDAP_SUPPORT="no"
+       fi
 ])
 
 AC_ARG_ENABLE(unicode,
-[AS_HELP_STRING(--enable-unicode,enable UNICODE build)],
+[AS_HELP_STRING(--disable-unicode,disable UNICODE build)],
 [
-       BUILD_UNICODE="yes"
-       CPPFLAGS="$CPPFLAGS -DUNICODE"
-       FORCE_INTERNAL_LIBTRE="yes"
+       if test "x$enableval" = "xno"; then
+               BUILD_UNICODE="no"
+               FORCE_INTERNAL_LIBTRE="no"
+               DISABLE_READLINE="no"
+       fi
 ])
 
 AC_ARG_ENABLE(debug,
 [AS_HELP_STRING(--enable-debug,enable additional debugging functionality)],
 [
-       ENABLE_DEBUG="yes"
+       if test "x$enableval" = "xyes"; then
+               ENABLE_DEBUG="yes"
+       fi
 ])
 
 AC_ARG_ENABLE(werror,
 [AS_HELP_STRING(--enable-werror,threat all warnings as errors)],
 [
-       ENABLE_WERROR="yes"
+       if test "x$enableval" = "xyes"; then
+               ENABLE_WERROR="yes"
+       fi
 ])
 
 AC_ARG_ENABLE(64bit,
 [AS_HELP_STRING(--disable-64bit,disable 64bit build (force 32bit build on 64bit machine))],
 [
-       FORCE_32BIT_BUILD="yes"
+       if test "x$enableval" = "xno"; then
+               FORCE_32BIT_BUILD="yes"
+       fi
 ])
 
 AC_ARG_WITH(dist,
 [AS_HELP_STRING(--with-dist,for maintainers only)],
        DB_DRIVERS=" mysql pgsql odbc mssql sqlite oracle db2 informix"
-       MODULES="appagent jansson libexpat libstrophe libtre zlib libnetxms install sqlite snmp libnxsl libnxmb libnxlp libnxcc db server agent libnxmap client nxscript nxcproxy nxlptest tools"
-       SUBAGENT_DIRS="linux ds18x20 freebsd openbsd minix netbsd sunos aix ipso hpux odbcquery informix oracle lmsensors darwin rpi java ubntlw netsvc db2 tuxedo mongodb"
-       SMSDRV_DIRS="kannel slack text2reach websms"
-   HDLINK_DIRS="jira"
+       MODULES="appagent jansson libexpat libstrophe libtre zlib libnetxms install sqlite snmp libnxsl libnxmb libnxlp libnxcc db server smsdrv agent libnxmap client nxscript nxcproxy nxlptest tools"
+       SUBAGENT_DIRS="linux ds18x20 freebsd openbsd minix mqtt mysql netbsd sunos aix ipso hpux odbcquery informix oracle lmsensors darwin rpi java jmx bind9 ubntlw netsvc db2 tuxedo mongodb ssh vmgr"
+       AGENT_DIRS="libnxtux"
+       SMSDRV_DIRS="anysms kannel mymobile nexmo nxagent slack smseagle text2reach websms"
+   HDLINK_DIRS="jira redmine"
    PDSDRV_DIRS="rrdtool"
        NXCONFIG="nxconfig"
        TOP_LEVEL_MODULES="include sql images tests"
        SERVER_INCLUDE="include"
-       CONTRIB_MODULES="mibs backgrounds music"
-       CLIENT_COMPONENTS="nxalarm nxevent nxpush nxsms"
+       CONTRIB_MODULES="mibs backgrounds music templates"
+       CLIENT_COMPONENTS="nxalarm nxevent nxpush nxshell nxsms"
        SERVER_TOOLS="nxconfig"
 )
 
@@ -588,7 +685,6 @@ fi
 
 check_substr "$COMPONENTS" "snmp"
 if test $? = 0; then
-       NEED_ZLIB="yes"
        MODULES="$MODULES snmp"
 fi
 
@@ -622,16 +718,22 @@ if test $? = 0; then
                SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/oracle/oracle.la"
        fi
 
-    check_substr "$STATIC_SUBAGENT_LIST" "informix"
-    if test $? = 0; then
-        COMPONENTS="$COMPONENTS informix"
-        SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/informix/informix.la"
-    fi
+       check_substr "$STATIC_SUBAGENT_LIST" "informix"
+       if test $? = 0; then
+               COMPONENTS="$COMPONENTS informix"
+               SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/informix/informix.la"
+       fi
        
        check_substr "$STATIC_SUBAGENT_LIST" "db2"
        if test $? = 0; then
                COMPONENTS="$COMPONENTS db2"
-        SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/db2/db2.la"
+               SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/db2/db2.la"
+       fi
+
+       check_substr "$STATIC_SUBAGENT_LIST" "mysql"
+       if test $? = 0; then
+               COMPONENTS="$COMPONENTS mysql"
+               SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/mysql/mysql.la"
        fi
 
        case "$PLATFORM" in
@@ -748,9 +850,10 @@ if test $? = 0; then
                AC_MSG_ERROR(You must select at least one database driver when building server.)
        fi
        BUILD_SERVER="yes"
-       MODULES="$MODULES libnxmap libnxsl libnxcc server nxscript"
+       MODULES="$MODULES libnxmap libnxsl libnxcc server smsdrv nxscript"
        TOP_LEVEL_MODULES="$TOP_LEVEL_MODULES sql images"
-       CONTRIB_MODULES="$CONTRIB_MODULES mibs backgrounds music"
+       CONTRIB_MODULES="$CONTRIB_MODULES mibs backgrounds music templates"
+       SMSDRV_DIRS="$SMSDRV_DIRS nxagent"
        if test "x$XMPP_SUPPORT" = "xyes"; then
                MODULES="libstrophe $MODULES"
                AC_DEFINE(XMPP_SUPPORTED, 1, Define to 1 if XMPP is supported)
@@ -760,9 +863,12 @@ fi
 check_substr "$COMPONENTS" "client"
 if test $? = 0; then
        BUILD_CLIENT="yes"
-       NEED_ZLIB="yes"
        MODULES="$MODULES client"
        CLIENT_COMPONENTS="$CLIENT_COMPONENTS nxalarm nxevent nxpush nxsms"
+       check_substr "$COMPONENTS" "java"
+       if test $? = 0; then
+               CLIENT_COMPONENTS="$CLIENT_COMPONENTS nxshell"
+       fi
 fi
 
 check_substr "$COMPONENTS" "client-proxy"
@@ -773,6 +879,7 @@ fi
 check_substr "$COMPONENTS" "mysql"
 if test $? = 0; then
        DB_DRIVERS="$DB_DRIVERS mysql"
+       SUBAGENT_DIRS="$SUBAGENT_DIRS mysql"
 fi
 
 check_substr "$COMPONENTS" "pgsql"
@@ -810,17 +917,17 @@ fi
 
 check_substr "$COMPONENTS" "raspberrypi"
 if test $? = 0; then
-       NEED_ZLIB="yes"
        SUBAGENT_DIRS="$SUBAGENT_DIRS rpi"
 fi
 
 check_substr "$COMPONENTS" "java"
 if test $? = 0; then
-       SUBAGENT_DIRS="$SUBAGENT_DIRS java ubntlw"
+       SUBAGENT_DIRS="$SUBAGENT_DIRS java bind9 jmx ubntlw"
 fi
 
 check_substr "$COMPONENTS" "tuxedo"
 if test $? = 0; then
+       AGENT_DIRS="$AGENT_DIRS libnxtux"
        SUBAGENT_DIRS="$SUBAGENT_DIRS tuxedo"
 fi
 
@@ -829,9 +936,18 @@ if test $? = 0; then
        SUBAGENT_DIRS="$SUBAGENT_DIRS mongodb"
 fi
 
+check_substr "$COMPONENTS" "vmgr"
+if test $? = 0; then
+       SUBAGENT_DIRS="$SUBAGENT_DIRS vmgr"
+fi
+
 check_substr "$COMPONENTS" "sdk"
 if test $? = 0; then
-       MODULES="$MODULES appagent libnxmap client libnxsl libnxmb libnxlp libnxcc db nxscript"
+       if test "x$STATIC_BUILD" = "xyes"; then
+               MODULES="$MODULES appagent libnxmap client libnxmb"
+       else
+               MODULES="$MODULES appagent libnxmap client libnxsl libnxmb libnxlp libnxcc db nxscript smsdrv snmp"
+       fi
 fi
 
 
@@ -1081,6 +1197,8 @@ if test "x$ac_compiler_gnu" = "xyes" ; then
                        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
                                [ 
                                        LDFLAGS="-m32 $LDFLAGS"
+                                       LTINIT_CC="$CC -m32"
+                                       LTINIT_CXX="$CXX -m32"
                                        AC_MSG_RESULT(yes) 
                                ], 
                                [ 
@@ -1094,6 +1212,8 @@ if test "x$ac_compiler_gnu" = "xyes" ; then
                        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
                                [ 
                                        LDFLAGS="-m64 $LDFLAGS"
+                                       LTINIT_CC="$CC -m64"
+                                       LTINIT_CXX="$CXX -m64"
                                        AC_MSG_RESULT(yes) 
                                ], 
                                [ 
@@ -1112,6 +1232,8 @@ if test "x$ac_compiler_gnu" = "xyes" ; then
                        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
                                [ 
                                        LDFLAGS="-m32 $LDFLAGS"
+                                       LTINIT_CC="$CC -m32"
+                                       LTINIT_CXX="$CXX -m32"
                                        AC_MSG_RESULT(yes) 
                                ], 
                                [ 
@@ -1377,8 +1499,14 @@ else
                        [#if defined(__FreeBSD_cc_version) || defined(__OpenBSD__)
                                yes
                        #endif
-                       ], AC_MSG_RESULT(yes)
-                       PTHREAD_LIBS="-pthread",
+                       ], [
+                               AC_MSG_RESULT(yes)
+                               PTHREAD_LIBS="-pthread"
+                               if test "x$CXX" = "xc++"; then
+                                       # Quash clang's "-pthread unused during compilation" warnings
+                                       PTHREAD_LDFLAGS="-Wc,-Qunused-arguments"
+                               fi
+                       ],
                        AC_MSG_RESULT(no))
                if test "x$PTHREAD_LIBS" = "xerror"; then
                        AC_CHECK_LIB(pthread, pthread_attr_init,
@@ -1454,36 +1582,43 @@ fi
 
 
 #--------------------------------------------------------------------
-# Checks for OpenSSL
+# Checks for OpenSSL/CommonCrypto
 #--------------------------------------------------------------------
 
 if test "x$DISABLE_ENCRYPTION" != "xyes" ; then
-       AC_CHECK_LIB(crypto, RSA_new,
-               [
-                       AC_DEFINE(WITH_OPENSSL, 1, Define to 1 if you have OpenSSL library and headers)
-                       AC_CHECK_LIB(crypto, EVP_aes_256_cbc,
-                                                        [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_AES,,[desc])])
-                       AC_CHECK_LIB(crypto, EVP_bf_cbc,
-                                                        [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_BF,,[desc])])
-                       AC_CHECK_LIB(crypto, EVP_idea_cbc,
-                                                        [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_IDEA,,[desc])])
-                       AC_CHECK_LIB(crypto, EVP_des_ede3_cbc,
-                                                        [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_DES,,[desc])])
-                       SERVER_LIBS="$SERVER_LIBS -lssl"
-                       if test "x$HAVE_LIBCRYPTO" = "xyes"; then
-                               if test "x$BUILD_STATIC_AGENT" = "xyes"; then
-#                                      LIBS="$LIBS -Wl,-Bstatic -lcrypto -Wl,-Bdynamic"
-                                       LIBS="$LIBS -lcrypto"
-                               else
-                                       LIBS="$LIBS -lcrypto"
-                               fi      
-                       else
-                               AC_MSG_ERROR(libcrypto does not provide any suitable encryption algorithm)
-                       fi
-               ],
-               [
-                       AC_MSG_ERROR(libcrypto is required for encryption support)
+       USE_COMMONCRYPTO="no"
+       if test "x$PLATFORM" = "xDarwin" -a "x$DISABLE_COMMONCRYPTO" != "xyes"; then
+               AC_CHECK_FUNC(CC_MD5_Init, [ 
+                       AC_DEFINE(WITH_COMMONCRYPTO, 1, Define to 1 if you have CommonCrypto library and headers)
+                       USE_COMMONCRYPTO="yes"
+                       WITH_ENCRYPTION="yes"
                ])
+       fi
+       if test "x$USE_COMMONCRYPTO" != "xyes"; then
+               AC_CHECK_LIB($OPENSSL_LIBCRYPTO, RSA_new,
+                       [
+                               AC_DEFINE(WITH_OPENSSL, 1, Define to 1 if you have OpenSSL library and headers)
+                               AC_CHECK_LIB($OPENSSL_LIBCRYPTO, EVP_aes_256_cbc,
+                                                                [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_AES,,[desc])])
+                               AC_CHECK_LIB($OPENSSL_LIBCRYPTO, EVP_bf_cbc,
+                                                                [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_BF,,[desc])])
+                               AC_CHECK_LIB($OPENSSL_LIBCRYPTO, EVP_idea_cbc,
+                                                                [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_IDEA,,[desc])])
+                               AC_CHECK_LIB($OPENSSL_LIBCRYPTO, EVP_des_ede3_cbc,
+                                                                [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_DES,,[desc])])
+                               if test "x$HAVE_LIBCRYPTO" = "xyes"; then
+                                       WITH_ENCRYPTION="yes"
+                                       LIBS="$LIBS -l$OPENSSL_LIBSSL -l$OPENSSL_LIBCRYPTO"
+                               else
+                                       AC_MSG_ERROR(lib$OPENSSL_LIBCRYPTO does not provide any suitable encryption algorithm)
+                               fi
+
+                               AC_CHECK_FUNCS([X509_STORE_set_verify_cb])
+                       ],
+                       [
+                               AC_MSG_ERROR(lib$OPENSSL_LIBCRYPTO is required for encryption support)
+                       ])
+       fi
 fi
 
 
@@ -1498,7 +1633,7 @@ AC_CHECK_HEADERS([fcntl.h dirent.h sys/ioctl.h sys/sockio.h poll.h termios.h])
 AC_CHECK_HEADERS([inttypes.h memory.h stdint.h stdlib.h strings.h string.h])
 AC_CHECK_HEADERS([readline/readline.h byteswap.h sys/select.h dlfcn.h locale.h])
 AC_CHECK_HEADERS([sys/sysctl.h sys/param.h sys/user.h vm/vm_param.h syslog.h])
-AC_CHECK_HEADERS([grp.h pwd.h malloc.h])
+AC_CHECK_HEADERS([grp.h pwd.h malloc.h stdbool.h utime.h])
 AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h],,,
 [[#ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
@@ -1544,6 +1679,36 @@ AC_LANG_POP([C++])
 
 
 #--------------------------------------------------------------------
+# Checks for d_type in struct dirent
+#--------------------------------------------------------------------
+
+AC_MSG_CHECKING(for d_type in struct dirent)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+]],[[
+       struct dirent d;
+       return d.d_type;
+]])
+],[
+       AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE_DIRENT_D_TYPE,1,Define to 1 if struct dirent has member d_type)
+],[
+       AC_MSG_RESULT(no)
+       AC_DEFINE(HAVE_DIRENT_D_TYPE,0,Define to 1 if struct dirent has member d_type)
+])
+AC_CHECK_DECLS([DT_DIR, DT_REG, DT_UNKNOWN],,,[
+#if HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+])
+
+
+#--------------------------------------------------------------------
 # Checks for IPv6 support
 #--------------------------------------------------------------------
 
@@ -1565,6 +1730,22 @@ if test "x$DISABLE_IPV6" != "xyes"; then
        fi
 fi
 
+
+#--------------------------------------------------------------------
+# Checks for RADIUS client library
+#--------------------------------------------------------------------
+
+if test "x$BUILD_SERVER" = "xyes" ; then
+       AC_CHECK_HEADERS([radcli/radcli.h])
+       if test "x$ac_cv_header_radcli_radcli_h" = "xyes"; then
+               AC_CHECK_LIB(radcli, rc_auth, [
+                       SERVER_LIBS="$SERVER_LIBS -lradcli"
+                       AC_DEFINE(USE_RADCLI, 1, Define to 1 if radcli is used as RADIUS client)
+               ])
+       fi
+fi
+
+
 #--------------------------------------------------------------------
 # Checks for other libs.
 #--------------------------------------------------------------------
@@ -1652,20 +1833,18 @@ if test $? = 0; then
        fi
 fi
 
-if test "x$NEED_ZLIB" = "xyes"; then
-       if test "x$FORCE_INTERNAL_ZLIB" = "xyes"; then
-               HAVE_ZLIB=no
-       else
-               HAVE_ZLIB=yes
-               AC_CHECK_HEADER(zlib.h,,HAVE_ZLIB=no)
-               if test "x$HAVE_ZLIB" = "xyes"; then
-                       AC_CHECK_LIB(z, deflate, [], [ HAVE_ZLIB=no ])
-               fi
-       fi
-       if test "x$HAVE_ZLIB" = "xno"; then
-               MODULES="zlib $MODULES"
+if test "x$FORCE_INTERNAL_ZLIB" = "xyes"; then
+       HAVE_ZLIB=no
+else
+       HAVE_ZLIB=yes
+       AC_CHECK_HEADER(zlib.h,,HAVE_ZLIB=no)
+       if test "x$HAVE_ZLIB" = "xyes"; then
+               AC_CHECK_LIB(z, deflate, [], [ HAVE_ZLIB=no ])
        fi
 fi
+if test "x$HAVE_ZLIB" = "xno"; then
+       MODULES="zlib $MODULES"
+fi
 
 if test "x$FORCE_INTERNAL_EXPAT" = "xyes"; then
        HAVE_LIBEXPAT=no
@@ -1737,11 +1916,27 @@ fi
 
 if test "x$HAVE_LIBCURL" = "xyes"; then
   SUBAGENT_DIRS="$SUBAGENT_DIRS netsvc"
-  SMSDRV_DIRS="$SMSDRV_DIRS kannel slack text2reach websms"
-  HDLINK_DIRS="$HDLINK_DIRS jira"
+  SMSDRV_DIRS="$SMSDRV_DIRS anysms kannel mymobile nexmo slack smseagle text2reach websms"
+  HDLINK_DIRS="$HDLINK_DIRS jira redmine"
   AC_DEFINE(HAVE_LIBCURL, 1, Define to 1 if libcurl is available)
 fi
 
+if test "x$DISABLE_SSH" != "xyes"; then
+       AC_CHECK_HEADER(libssh/libssh.h,HAVE_LIBSSH=yes,HAVE_LIBSSH=no)
+       if test "x$HAVE_LIBSSH" = "xyes"; then
+               AC_CHECK_LIB(ssh, ssh_version, [ HAVE_LIBSSH=yes ], [ HAVE_LIBSSH=no ])
+       fi
+
+       if test "x$HAVE_LIBSSH" = "xyes"; then
+               SUBAGENT_DIRS="$SUBAGENT_DIRS ssh"
+               AC_DEFINE(HAVE_LIBSSH, 1, Define to 1 if libssh is available)
+       else
+               AC_MSG_ERROR(libssh is required for SSH support. Check that it is installed or use --disable-ssh option)
+       fi
+else
+       HAVE_LIBSSH=no
+fi
+
 if test "x$LDAP_SUPPORT" = "xyes"; then
        AC_CHECK_HEADER(ldap.h,HAVE_LDAP=yes,HAVE_LDAP=no)
        if test "x$HAVE_LDAP" = "xyes"; then
@@ -1796,7 +1991,14 @@ AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_STRUCT_TIMEZONE
 
-AC_CHECK_TYPES([long long, unsigned long long, int64_t, uint64_t, u_int64_t, uuid_t])
+AC_CHECK_TYPES([long long, unsigned long long, int64_t, uint64_t, u_int64_t, uuid_t, bool],,,[
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+])
 AC_CHECK_TYPES([mode_t, off_t, socklen_t],,,[
 #if HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -1824,11 +2026,11 @@ AC_FUNC_STRTOD
 AC_FUNC_VPRINTF
 
 AC_CHECK_FUNCS([gettimeofday memmove memset bcopy strchr strcspn strdup strerror])
-AC_CHECK_FUNCS([strrchr strlwr strtol strtoul strtoll strtoull setlocale])
-AC_CHECK_FUNCS([if_nametoindex daemon mmap strerror_r scandir uname poll])
+AC_CHECK_FUNCS([strrchr strlwr strtok_r strtol strtoul strtoll strtoull setlocale])
+AC_CHECK_FUNCS([tolower if_nametoindex daemon mmap strerror_r scandir uname poll])
 AC_CHECK_FUNCS([usleep nanosleep gmtime_r localtime_r stat64 fstat64 lstat64])
-AC_CHECK_FUNCS([fopen64 strptime timegm gethostbyname2_r getaddrinfo])
-AC_CHECK_FUNCS([itoa _itoa isatty getgrnam getpwnam malloc_info malloc_trim])
+AC_CHECK_FUNCS([fopen64 strptime timegm gethostbyname2_r getaddrinfo rand_r])
+AC_CHECK_FUNCS([itoa _itoa isatty getgrnam getpwnam malloc_info malloc_trim utime])
 
 AC_CHECK_DECLS([nanosleep, daemon, strerror])
 
@@ -1929,7 +2131,7 @@ AC_RUN_IFELSE(
 # Checks for macros and definitions
 #--------------------------------------------------------------------
 
-AC_CHECK_DECLS([__bswap_32, __bswap_64, htonll, ntohll],,,[
+AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64, htonll, ntohll],,,[
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -2081,8 +2283,9 @@ fi
 # *BSD specific checks
 #--------------------------------------------------------------------
 
+AC_CHECK_HEADERS([sys/event.h])
 AC_CHECK_LIB(kvm, kvm_open)
-AC_CHECK_FUNCS([kvm_getswapinfo])
+AC_CHECK_FUNCS([kvm_openfiles kvm_getswapinfo kqueue])
 AC_CHECK_TYPES([struct kinfo_proc2],,,[
 #if HAVE_SYS_SYSCTL_H
 #include <sys/sysctl.h>
@@ -2164,6 +2367,10 @@ fi
 # Check for UNICODE stuff
 #--------------------------------------------------------------------
 
+if test "x$BUILD_UNICODE" = "xyes"; then
+       CPPFLAGS="$CPPFLAGS -DUNICODE"
+fi
+
 AC_CHECK_HEADERS([wchar.h wctype.h iconv.h widec.h])
 AC_CHECK_TYPES([wchar_t, wint_t],,,[
 #if HAVE_WCHAR_H
@@ -2180,7 +2387,7 @@ AC_CHECK_FUNCS([wcslwr wcserror wcserror_r wfopen wfopen64 fputws putws])
 AC_CHECK_FUNCS([wopen wstat waccess wgetenv wrename wunlink wremove wchdir])
 AC_CHECK_FUNCS([wmkdir wrmdir wsystem wmkstemp wpopen wctime wchmod vwscanf])
 AC_CHECK_FUNCS([vswscanf vfwscanf wcscasecmp wcsncasecmp wcstombs wcsrtombs])
-AC_CHECK_FUNCS([itow _itow wcsftime])
+AC_CHECK_FUNCS([mbstowcs mbsrtowcs itow _itow wcsftime wcstok wutime])
 
 AC_CHECK_DECLS([putws],,,[
 #if HAVE_WCHAR_H
@@ -2647,7 +2854,11 @@ if test $? = 0; then
        AC_CHECK_LIB(m, floor)
        AC_CHECK_LIB(pq, PQconnectdb, [PGSQL_LIBS="-lpq"], [
                if test "x$PLATFORM" = "xSunOS"; then
-                       PGSQL_LDFLAGS="$PGSQL_LDFLAGS/sparcv9"
+                       if test -d "$PGSQL_LD_RUN_PATH/sparcv9"; then
+                               PGSQL_LDFLAGS="$PGSQL_LDFLAGS/sparcv9"
+                       else
+                               PGSQL_LDFLAGS="$PGSQL_LDFLAGS/64"
+                       fi
                        LDFLAGS="$OLD_LDFLAGS $PGSQL_LDFLAGS"
                        if test "x$PGSQL_LD_RUN_PATH" != "x"; then
                                PGSQL_LD_RUN_PATH="$PGSQL_LD_RUN_PATH/sparcv9"
@@ -2822,11 +3033,12 @@ if test $? = 0; then
 
        if test "x$PLATFORM" = "xAIX"; then
                if test -e $TUXEDO_BASE/lib/tpinit.o; then
-                       TUXEDO_LIBS="$TUXEDO_BASE/lib/tpinit.o $TUXEDO_LIBS"
+                       TUXEDO_TPINIT="$TUXEDO_BASE/lib/tpinit.o"
                fi
        fi
 fi
 
+
 #--------------------------------------------------------------------
 # ZeroMQ
 #--------------------------------------------------------------------
@@ -2844,16 +3056,73 @@ if test $? = 0; then
                LDFLAGS="$LDFLAGS $ZEROMQ_LDFLAGS"
        fi
        
-       AC_CHECK_HEADER(zmq.h,,AC_MSG_ERROR([*** Cannot find zmq.h - check your ZeroMQ installation ***]))
-       AC_CHECK_LIB(zmq, zmq_ctx_new, [ SERVER_LIBS="$SERVER_LIBS -lzmq" ], AC_MSG_ERROR([*** libzmq is missing or too old - check your ZeroMQ installation ***]))
+       AC_CHECK_HEADER(zmq.h,,[
+               if test "x$ZEROMQ_REQUIRED" = "xyes"; then
+                       AC_MSG_ERROR([*** Cannot find zmq.h - check your ZeroMQ installation ***])
+               else
+                       ZEROMQ_SUPPORT="no"
+               fi
+       ])
+       AC_CHECK_LIB(zmq, zmq_ctx_new, [ SERVER_LIBS="$SERVER_LIBS -lzmq" ], [
+               if test "x$ZEROMQ_REQUIRED" = "xyes"; then
+                       AC_MSG_ERROR([*** libzmq is missing or too old - check your ZeroMQ installation ***])
+               else
+                       ZEROMQ_SUPPORT="no"
+               fi
+       ])
+    
+       if test "x$ZEROMQ_SUPPORT" = "xyes"; then
+               AC_DEFINE(WITH_ZMQ, 1, Define to 1 if ZeroMQ is supported)
+       fi
+
+       CPPFLAGS="$OLD_CPPFLAGS"
+       LDFLAGS="$OLD_LDFLAGS"
+       LIBS="$OLD_LIBS"
+fi
+
+
+#--------------------------------------------------------------------
+# MQTT
+#--------------------------------------------------------------------
+
+if test "x$MQTT_SUPPORT" = "xyes"; then
+       OLD_CPPFLAGS="$CPPFLAGS"
+       OLD_LDFLAGS="$LDFLAGS"
+       OLD_LIBS="$LIBS"
+
+       if test "x$MQTT_BASE" != "x"; then
+               MQTT_CPPFLAGS="-I$MQTT_BASE/include"
+               MQTT_LDFLAGS="-L$MQTT_BASE/lib"
+               CPPFLAGS="$CPPFLAGS $MQTT_CPPFLAGS"
+               LDFLAGS="$LDFLAGS $MQTT_LDFLAGS"
+       fi
+       
+       AC_CHECK_HEADER(mosquitto.h,,[
+               if test "x$MQTT_REQUIRED" = "xyes"; then
+                       AC_MSG_ERROR([*** Cannot find mosquitto.h - check your libmosquitto installation ***])
+               else
+                       MQTT_SUPPORT="no"
+               fi
+       ])
+       AC_CHECK_LIB(mosquitto, mosquitto_lib_init, [ MQTT_LIBS="-lmosquitto" ], [
+               if test "x$MQTT_REQUIRED" = "xyes"; then
+                       AC_MSG_ERROR([*** libmosquitto is missing - check your libmosquitto installation ***])
+               else
+                       MQTT_SUPPORT="no"
+               fi
+       ])
     
-       AC_DEFINE(WITH_ZMQ, 1, Define to 1 if ZeroMQ is supported)
+       if test "x$MQTT_SUPPORT" = "xyes"; then
+               AC_DEFINE(WITH_MQTT, 1, Define to 1 if MQTT is supported)
+               SUBAGENT_DIRS="$SUBAGENT_DIRS mqtt"
+       fi
 
        CPPFLAGS="$OLD_CPPFLAGS"
        LDFLAGS="$OLD_LDFLAGS"
        LIBS="$OLD_LIBS"
 fi
 
+
 #--------------------------------------------------------------------
 # MongoDB
 #--------------------------------------------------------------------
@@ -2874,10 +3143,10 @@ if test $? = 0; then
                MONGODB_LDFLAGS="-L/usr/local/lib"
                CPPFLAGS="$CPPFLAGS $MONGODB_CPPFLAGS"
                LDFLAGS="$LDFLAGS $MONGODB_LDFLAGS"
-    fi
+       fi
        
        AC_CHECK_HEADER(mongoc.h,,AC_MSG_ERROR([*** Cannot find mongoc.h - check your MongoDB installation ***]))
-       AC_CHECK_LIB(mongoc-1.0, nanosleep, [ MONGODB_LIBS="$MONGODB_LIBS -lmongoc-1.0" ])
+       AC_CHECK_LIB(mongoc-1.0, mongoc_client_get_database, [ MONGODB_LIBS="$MONGODB_LIBS -lmongoc-1.0" ])
        AC_CHECK_LIB(bson-1.0, nanosleep, [ MONGODB_LIBS="$MONGODB_LIBS -lbson-1.0" ])
 
        LIBS="$LIBS $MONGODB_LIBS"
@@ -2888,6 +3157,39 @@ if test $? = 0; then
 fi
 
 #--------------------------------------------------------------------
+# VMGR
+#--------------------------------------------------------------------
+
+check_substr "$COMPONENTS" "vmgr"
+if test $? = 0; then
+       OLD_CPPFLAGS="$CPPFLAGS"
+       OLD_LDFLAGS="$LDFLAGS"
+       OLD_LIBS="$LIBS"
+
+       if test "x$LIBVIRT_BASE" != "x"; then
+               VMGR_CPPFLAGS="-I$LIBVIRT_BASE/include"
+               VMGR_LDFLAGS="-L$LIBVIRT_BASE/lib"
+               CPPFLAGS="$CPPFLAGS $VMGR_CPPFLAGS"
+               LDFLAGS="$LDFLAGS $VMGR_LDFLAGS"
+       else
+               VMGR_CPPFLAGS=""
+               VMGR_LDFLAGS=""
+               CPPFLAGS="$CPPFLAGS $VMGR_CPPFLAGS"
+               LDFLAGS="$LDFLAGS $VMGR_LDFLAGS"
+       fi
+       
+       AC_CHECK_HEADER(libvirt/libvirt.h,,AC_MSG_ERROR([*** Cannot find libvirt.h - check your libvirt installation ***]))
+       AC_CHECK_LIB(virt, virConnectGetLibVersion, [ VMGR_LIBS="$VMGR_LIBS -lvirt" ])
+       LIBS="$LIBS $VMGR_LIBS"
+
+       AC_CHECK_FUNCS([virDomainGetTime])
+
+       CPPFLAGS="$OLD_CPPFLAGS"
+       LDFLAGS="$OLD_LDFLAGS"
+       LIBS="$OLD_LIBS"
+fi
+
+#--------------------------------------------------------------------
 # Other settings
 #--------------------------------------------------------------------
 
@@ -2905,7 +3207,8 @@ else
        fi
        LDFLAGS_SUFFIX="$LDFLAGS_SUFFIX -R $RUNTIME_PREFIX/lib"
 fi
-LDFLAGS="$LDFLAGS_PREFIX $LDFLAGS $LDFLAGS_SUFFIX"
+
+LDFLAGS="$LDFLAGS_PREFIX $LDFLAGS $PTHREAD_LDFLAGS $LDFLAGS_SUFFIX"
 
 if test "x${ENABLE_WERROR}" = "xyes"; then
        CPPFLAGS="$CPPFLAGS -Werror"
@@ -2934,33 +3237,53 @@ AM_CONDITIONAL([USE_INTERNAL_EXPAT], [test "x$HAVE_LIBEXPAT" = "xno"])
 AM_CONDITIONAL([USE_INTERNAL_LIBTRE], [test "x$HAVE_LIBTRE" = "xno"])
 AM_CONDITIONAL([USE_INTERNAL_JANSSON], [test "x$HAVE_JANSSON" = "xno"])
 AM_CONDITIONAL([USE_INTERNAL_SQLITE], [test "x$HAVE_SQLITE" = "xno"])
-AM_CONDITIONAL([USE_INTERNAL_ZLIB], [test "$NEED_ZLIB/$HAVE_ZLIB" = "yes/no"])
+AM_CONDITIONAL([USE_INTERNAL_ZLIB], [test "$HAVE_ZLIB" = "no"])
 AM_CONDITIONAL([STATIC_BUILD], [test "x$STATIC_BUILD" = "xyes"])
 AM_CONDITIONAL([ALL_STATIC], [test "x$ALL_STATIC" = "xyes"])
-AM_CONDITIONAL([USE_ENCRYPTION], [test "x${ac_cv_lib_crypto_RSA_new}" = "xyes"])
+AM_CONDITIONAL([USE_ENCRYPTION], [test "x${WITH_ENCRYPTION}" = "xyes"])
 AM_CONDITIONAL([HPUX_HPPA], [test "x$HPUX_HPPA" = "xyes"])
+AM_CONDITIONAL([MQTT_SUPPORT], [test "x$MQTT_SUPPORT" = "xyes"])
 AM_CONDITIONAL([XMPP_SUPPORT], [test "x$XMPP_SUPPORT" = "xyes"])
 AM_CONDITIONAL([ZEROMQ_SUPPORT], [test "x$ZEROMQ_SUPPORT" = "xyes"])
 
 
 #--------------------------------------------------------------------
+# Get compiler version
+#--------------------------------------------------------------------
+
+COMPILER_VERSION=""
+for opt in -qversion --version -v -V; do
+       v=`$CXX $opt 2>/dev/null | head -1`
+       if test $? = 0; then
+               if test "x$COMPILER_VERSION" = "x"; then
+                       COMPILER_VERSION="$v"
+                       AC_DEFINE_UNQUOTED([CPP_COMPILER_VERSION], "$COMPILER_VERSION", [C++ compiler version information])
+               fi
+       fi
+done
+
+
+#--------------------------------------------------------------------
 # Cleanup variables
 #--------------------------------------------------------------------
 
 AS_IF([test "x$with_dist" = "xyes"],
 [
+  AGENT_DIRS=`echo $AGENT_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
   SUBAGENT_DIRS=`echo $SUBAGENT_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
   MODULES=`echo $MODULES|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
   SMSDRV_DIRS=`echo $SMSDRV_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
   HDLINK_DIRS=`echo $HDLINK_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
 ])
 
+
 #--------------------------------------------------------------------
 # Substitute variables
 #--------------------------------------------------------------------
 
 AC_SUBST(DB_DRIVERS)
 AC_SUBST(MODULES)
+AC_SUBST(AGENT_DIRS)
 AC_SUBST(SUBAGENT_DIRS)
 AC_SUBST(SERVER_INCLUDE)
 AC_SUBST(SERVER_LIBS)
@@ -2999,9 +3322,16 @@ AC_SUBST(SHLIB_SUFFIX)
 AC_SUBST(TUXEDO_CPPFLAGS)
 AC_SUBST(TUXEDO_LDFLAGS)
 AC_SUBST(TUXEDO_LIBS)
+AC_SUBST(TUXEDO_TPINIT)
 AC_SUBST(MONGODB_CPPFLAGS)
 AC_SUBST(MONGODB_LDFLAGS)
 AC_SUBST(MONGODB_LIBS)
+AC_SUBST(MQTT_CPPFLAGS)
+AC_SUBST(MQTT_LDFLAGS)
+AC_SUBST(MQTT_LIBS)
+AC_SUBST(VMGR_CPPFLAGS)
+AC_SUBST(VMGR_LDFLAGS)
+AC_SUBST(VMGR_LIBS)
 AC_SUBST(INSTALL_LIBPATH)
 AC_SUBST(ZEROMQ_CPPFLAGS)
 AC_SUBST(ZEROMQ_LDFLAGS)
@@ -3052,6 +3382,7 @@ AC_CONFIG_FILES([
        contrib/mibs/Makefile
        contrib/music/Makefile
        contrib/startup/Makefile
+       contrib/startup/systemd/Makefile
        contrib/startup/debian/Makefile
        contrib/startup/gentoo/Makefile
        contrib/startup/hp-ux/Makefile
@@ -3059,6 +3390,7 @@ AC_CONFIG_FILES([
        contrib/startup/suse/Makefile
        contrib/startup/ubuntu/Makefile
        contrib/startup/solaris/Makefile
+       contrib/templates/Makefile
        doc/Makefile
        doc/internal/Makefile
        doc/manuals/Makefile
@@ -3073,8 +3405,10 @@ AC_CONFIG_FILES([
        src/agent/libnxagent/Makefile
        src/agent/libnxappc/Makefile
        src/agent/libnxsd/Makefile
+       src/agent/libnxtux/Makefile
        src/agent/subagents/Makefile
        src/agent/subagents/aix/Makefile
+       src/agent/subagents/bind9/Makefile
        src/agent/subagents/darwin/Makefile
        src/agent/subagents/db2/Makefile
        src/agent/subagents/dbquery/Makefile
@@ -3083,30 +3417,19 @@ AC_CONFIG_FILES([
        src/agent/subagents/ecs/Makefile
        src/agent/subagents/filemgr/Makefile
        src/agent/subagents/freebsd/Makefile
+       src/agent/subagents/gps/Makefile
        src/agent/subagents/hpux/Makefile
        src/agent/subagents/informix/Makefile
        src/agent/subagents/ipso/Makefile
        src/agent/subagents/java/Makefile
        src/agent/subagents/java/java/Makefile
-       src/agent/subagents/java/java/src/Makefile
-       src/agent/subagents/java/java/src/main/Makefile
-       src/agent/subagents/java/java/src/main/java/Makefile
-       src/agent/subagents/java/java/src/main/java/org/Makefile
-       src/agent/subagents/java/java/src/main/java/org/netxms/Makefile
-       src/agent/subagents/java/java/src/main/java/org/netxms/agent/Makefile
-       src/agent/subagents/java/java/src/main/java/org/netxms/agent/adapters/Makefile
-       src/agent/subagents/java/sample/Makefile
-       src/agent/subagents/java/sample/src/Makefile
-       src/agent/subagents/java/sample/src/main/Makefile
-       src/agent/subagents/java/sample/src/main/java/Makefile
-       src/agent/subagents/java/sample/src/main/java/org/Makefile
-       src/agent/subagents/java/sample/src/main/java/org/netxms/Makefile
-       src/agent/subagents/java/sample/src/main/java/org/netxms/agent/Makefile
-       src/agent/subagents/java/sample/src/main/java/org/netxms/agent/demo/Makefile
+       src/agent/subagents/jmx/Makefile
        src/agent/subagents/linux/Makefile
        src/agent/subagents/lmsensors/Makefile
        src/agent/subagents/logwatch/Makefile
        src/agent/subagents/minix/Makefile
+       src/agent/subagents/mqtt/Makefile
+       src/agent/subagents/mysql/Makefile
        src/agent/subagents/netbsd/Makefile
        src/agent/subagents/netsvc/Makefile
        src/agent/subagents/odbcquery/Makefile
@@ -3116,11 +3439,13 @@ AC_CONFIG_FILES([
        src/agent/subagents/portCheck/Makefile
        src/agent/subagents/rpi/Makefile
        src/agent/subagents/sms/Makefile
+       src/agent/subagents/ssh/Makefile
        src/agent/subagents/sunos/Makefile
        src/agent/subagents/tuxedo/Makefile
        src/agent/subagents/mongodb/Makefile
        src/agent/subagents/ubntlw/Makefile
        src/agent/subagents/ups/Makefile
+       src/agent/subagents/vmgr/Makefile
        src/agent/subagents/winnt/Makefile
        src/agent/subagents/winperf/Makefile
        src/agent/subagents/wmi/Makefile
@@ -3134,6 +3459,8 @@ AC_CONFIG_FILES([
        src/client/nxalarm/Makefile
        src/client/nxevent/Makefile
        src/client/nxpush/Makefile
+       src/client/nxshell/Makefile
+       src/client/nxshell/java/Makefile
        src/client/nxsms/Makefile
        src/db/Makefile
        src/db/dbdrv/Makefile
@@ -3176,8 +3503,11 @@ AC_CONFIG_FILES([
        src/server/drivers/dell-pwc/Makefile
        src/server/drivers/dlink/Makefile
        src/server/drivers/ers8000/Makefile
+       src/server/drivers/extreme/Makefile
        src/server/drivers/h3c/Makefile
        src/server/drivers/hpsw/Makefile
+       src/server/drivers/ignitenet/Makefile
+       src/server/drivers/juniper/Makefile
        src/server/drivers/lib/Makefile
        src/server/drivers/lib/avaya-ers/Makefile
        src/server/drivers/lib/cisco/Makefile
@@ -3192,20 +3522,12 @@ AC_CONFIG_FILES([
        src/server/drivers/ubnt/Makefile
        src/server/hdlink/Makefile
        src/server/hdlink/jira/Makefile
+       src/server/hdlink/redmine/Makefile
        src/server/include/Makefile
        src/server/libnxsrv/Makefile
        src/server/netxmsd/Makefile
        src/server/pdsdrv/Makefile
        src/server/pdsdrv/rrdtool/Makefile
-       src/server/smsdrv/Makefile
-       src/server/smsdrv/dummy/Makefile
-       src/server/smsdrv/generic/Makefile
-       src/server/smsdrv/kannel/Makefile
-       src/server/smsdrv/nxagent/Makefile
-       src/server/smsdrv/portech/Makefile
-       src/server/smsdrv/slack/Makefile
-       src/server/smsdrv/text2reach/Makefile
-       src/server/smsdrv/websms/Makefile
        src/server/tools/Makefile
        src/server/tools/nxaction/Makefile
        src/server/tools/nxadm/Makefile
@@ -3214,7 +3536,22 @@ AC_CONFIG_FILES([
        src/server/tools/nxconfig/res/Makefile
        src/server/tools/nxdbmgr/Makefile
        src/server/tools/nxget/Makefile
+       src/server/tools/nxminfo/Makefile
        src/server/tools/nxupload/Makefile
+       src/smsdrv/Makefile
+       src/smsdrv/anysms/Makefile
+       src/smsdrv/dbemu/Makefile
+       src/smsdrv/dummy/Makefile
+       src/smsdrv/generic/Makefile
+       src/smsdrv/kannel/Makefile
+       src/smsdrv/mymobile/Makefile
+       src/smsdrv/nexmo/Makefile
+       src/smsdrv/nxagent/Makefile
+       src/smsdrv/portech/Makefile
+       src/smsdrv/slack/Makefile
+       src/smsdrv/smseagle/Makefile
+       src/smsdrv/text2reach/Makefile
+       src/smsdrv/websms/Makefile
        src/snmp/Makefile
        src/snmp/libnxsnmp/Makefile
        src/snmp/nxmibc/Makefile
@@ -3233,6 +3570,7 @@ AC_CONFIG_FILES([
        tests/test-libnetxms/Makefile
        tests/test-libnxcc/Makefile
        tests/test-libnxdb/Makefile
+       tests/test-libnxsnmp/Makefile
        tools/Makefile
 ])
 
@@ -3275,6 +3613,11 @@ if test "x$IPV6_SUPPORT" = "xyes"; then
 else
        echo "IPv6 support            : NO"
 fi
+if test "x${MQTT_SUPPORT}" = "xyes"; then
+       echo "MQTT support            : YES"
+else
+       echo "MQTT support            : NO"
+fi
 if test "x${BUILD_SERVER}" = "xyes"; then
        echo "Build Server            : YES"
        echo "Server libs             : ${SERVER_LIBS}"
@@ -3296,11 +3639,16 @@ if test "x${BUILD_SERVER}" = "xyes"; then
 else
        echo "Build Server            : NO"
 fi
-if test "x${ac_cv_lib_crypto_RSA_new}" = "xyes"; then
+if test "x${WITH_ENCRYPTION}" = "xyes"; then
        echo "Encryption enabled      : YES"
 else
        echo "Encryption enabled      : NO"
 fi
+if test "x${HAVE_LIBSSH}" = "xyes"; then
+       echo "SSH support enabled     : YES"
+else
+       echo "SSH support enabled     : NO"
+fi
 if test "x${DB_DRIVERS}" != "x"; then
        echo "Build DB-Drivers        :${DB_DRIVERS}"
 else
@@ -3313,6 +3661,7 @@ else
 fi
 if test "x${BUILD_AGENT}" = "xyes"; then
        echo "Build Agent             : YES"
+       echo "Agent extra components  : ${AGENT_DIRS}"
        echo "Subagents list          : ${SUBAGENT_DIRS}"
 else
        echo "Build Agent             : NO"
@@ -3351,12 +3700,10 @@ if test $? = 0; then
                echo "Use internal sqlite     : NO"
        fi
 fi
-if test "x${NEED_ZLIB}" = "xyes"; then
-       if test "x${HAVE_ZLIB}" = "xno"; then
-               echo "Use internal zlib       : YES"
-       else
-               echo "Use internal zlib       : NO"
-       fi
+if test "x${HAVE_ZLIB}" = "xno"; then
+       echo "Use internal zlib       : YES"
+else
+       echo "Use internal zlib       : NO"
 fi
 if test "x${FORCE_32BIT_BUILD}" = "xyes"; then
        echo "Force 32bit build       : YES"
@@ -3366,6 +3713,7 @@ fi
 
 echo "C compiler              : ${CC}"
 echo "C++ compiler            : ${CXX}"
+echo "C++ compiler info       : ${COMPILER_VERSION}"
 echo "CPPFLAGS                : ${CPPFLAGS}"
 echo "CXXFLAGS                : ${CXXFLAGS}"
 echo "CFLAGS                  : ${CFLAGS}"
@@ -3456,6 +3804,16 @@ if test "x${ZEROMQ_LDFLAGS}" != "x"; then
        echo "ZeroMQ LDFLAGS          : ${ZEROMQ_LDFLAGS}"
 fi
 
+if test "x${VMGR_CPPFLAGS}" != "x"; then
+       echo "Vmgr CPPFLAGS           : ${VMGR_CPPFLAGS}"
+fi
+if test "x${VMGR_LDFLAGS}" != "x"; then
+       echo "Vmgr LDFLAGS            : ${VMGR_LDFLAGS}"
+fi
+if test "x${VMGR_LIBS}" != "x"; then
+       echo "Vmgr LIBS               : ${VMGR_LIBS}"
+fi
+
 FLAGS_CPP="src/tools/nxdevcfg/flags.cpp"
 echo "/* Automatically generated by configure */" > $FLAGS_CPP
 echo "#include <nms_common.h>" >> $FLAGS_CPP
@@ -3469,3 +3827,6 @@ echo "const TCHAR *g_cxx = _T(\"${CXX}\");" >> $FLAGS_CPP
 echo "const TCHAR *g_ld = _T(\"${LD}\");" >> $FLAGS_CPP
 echo "const TCHAR *g_perl = _T(\"${PERL}\");" >> $FLAGS_CPP
 echo "const TCHAR *g_serverLibs = _T(\"${SERVER_LIBS}\");" >> $FLAGS_CPP
+echo "const TCHAR *g_tuxedoCppFlags = _T(\"${TUXEDO_CPPFLAGS}\");" >> $FLAGS_CPP
+echo "const TCHAR *g_tuxedoLdFlags = _T(\"${TUXEDO_LDFLAGS}\");" >> $FLAGS_CPP
+echo "const TCHAR *g_tuxedoLibs = _T(\"${TUXEDO_LIBS}\");" >> $FLAGS_CPP