server and client compiles on HP-UX with aCC
authorVictor Kirhenshtein <victor@netxms.org>
Fri, 6 May 2011 13:01:38 +0000 (13:01 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Fri, 6 May 2011 13:01:38 +0000 (13:01 +0000)
.gitattributes
configure.ac
src/agent/subagents/aix/Makefile.am
src/libnxcl/comm.cpp
src/libnxcl/main.cpp
src/server/core/netmap.cpp
src/snmp/libnxsnmp/Makefile.am
src/zlib/Makefile.am [new file with mode: 0644]

index 63babd6..951e3d1 100644 (file)
@@ -2317,6 +2317,7 @@ src/webui/webapp/src/main/webapp/resources/themes/slate/images/slate/window/left
 src/webui/webapp/src/main/webapp/resources/themes/slate/images/slate/window/left-right.png -text
 src/webui/webapp/src/main/webapp/resources/themes/slate/images/slate/window/right-corners.png -text
 src/webui/webapp/src/main/webapp/resources/themes/slate/images/slate/window/top-bottom.png -text
+src/zlib/Makefile.am -text
 src/zlib/nxzlib.vcproj -text
 tools/flex_bison.rule -text
 tools/mc.rule -text
index 7dd8734..bab214c 100644 (file)
@@ -62,6 +62,8 @@ ODBC_LIBS=""
 FORCE_INTERNAL_EXPAT="no"
 USE_INTERNAL_LIBTRE="no"
 FORCE_INTERNAL_LIBTRE="no"
+USE_INTERNAL_ZLIB="no"
+FORCE_INTERNAL_ZLIB="no"
 FORCE_32BIT_BUILD="no"
 
 
@@ -136,6 +138,12 @@ AC_ARG_WITH(internal-libtre,
        FORCE_INTERNAL_LIBTRE="yes"
 ])
 
+AC_ARG_WITH(internal-zlib,
+[AS_HELP_STRING(--with-internal-zlib,force use of bundled zlib)],
+[
+       FORCE_INTERNAL_ZLIB="yes"
+])
+
 AC_ARG_WITH(sqlite,
 [AS_HELP_STRING(--with-sqlite,build SQLite database driver)],
 [ if test "x$withval" != "xno" ; then
@@ -302,7 +310,7 @@ AC_ARG_ENABLE(64bit,
 AC_ARG_WITH(dist,
 [AS_HELP_STRING(--with-dist,for maintainers only)],
        DB_DRIVERS=" mysql pgsql odbc mssql sqlite oracle db2"
-       MODULES="libexpat libtre libnetxms install sqlite snmp libnxsl libnxlp db server agent libnxmap libnxcl client nxscript tools webui"
+       MODULES="libexpat libtre zlib libnetxms install sqlite snmp libnxsl libnxlp db server agent libnxmap libnxcl client nxscript tools webui"
        SUBAGENT_DIRS="linux freebsd openbsd netbsd sunos aix ipso hpux"
        NXCONFIG="nxconfig"
        TOP_LEVEL_MODULES="sql images"
@@ -931,8 +939,18 @@ if test "x$BUILD_SERVER" = "xyes" ; then
 fi
 
 if test "x$NEED_ZLIB" = "xyes"; then
-       AC_CHECK_HEADER(zlib.h,,AC_MSG_ERROR([*** ZLib development package not installed - please install first ***]))
-       AC_CHECK_LIB(z, deflate)
+       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
 fi
 
 if test "x$FORCE_INTERNAL_EXPAT" = "xyes"; then
@@ -1712,6 +1730,7 @@ CPPFLAGS="$CPPFLAGS -DPREFIX=\\\"\${prefix}\\\" -DPREFIXW=L\\\"\${prefix}\\\" -D
 
 AM_CONDITIONAL([USE_INTERNAL_EXPAT], [test "x$HAVE_LIBEXPAT" = "xno"])
 AM_CONDITIONAL([USE_INTERNAL_LIBTRE], [test "x$HAVE_LIBTRE" = "xno"])
+AM_CONDITIONAL([USE_INTERNAL_ZLIB], [test "$NEED_ZLIB/$HAVE_ZLIB" = "yes/no"])
 
 
 #--------------------------------------------------------------------
@@ -1900,6 +1919,7 @@ AC_CONFIG_FILES([
        src/webui/nxhttpd/static/images/ctrlpanel/Makefile
        src/webui/nxhttpd/static/images/objects/Makefile
        src/webui/nxhttpd/static/images/status/Makefile
+       src/zlib/Makefile
        sql/Makefile
        tools/Makefile
 ])
@@ -1978,6 +1998,13 @@ if test "x${HAVE_LIBTRE}" = "xno"; then
 else
        echo "Use internal libtre     : NO"
 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
+fi
 if test "x${FORCE_32BIT_BUILD}" = "xyes"; then
        echo "Force 32bit build       : YES"
 else
index 9bac368..84e4bf1 100644 (file)
@@ -2,7 +2,7 @@ INCLUDES=-I@top_srcdir@/include
 
 lib_LTLIBRARIES = libnsm_aix.la
 libnsm_aix_la_SOURCES = disk.cpp main.cpp net.cpp proc.cpp system.cpp
-libnsm_aix_la_LDFLAGS = ../../../libnetxms/libnetxms.la
+libnsm_aix_la_LIBADD = ../../../libnetxms/libnetxms.la
 
 EXTRA_DIST = aix_subagent.h
 
index 56fedad..ad57fe1 100644 (file)
@@ -241,6 +241,9 @@ THREAD_RESULT THREAD_CALL NetReceiver(NXCL_Session *pSession)
 // Connect to server
 //
 
+#ifdef __HP_aCC
+extern "C"
+#endif
 DWORD LIBNXCL_EXPORTABLE NXCConnect(DWORD dwFlags, const TCHAR *pszServer, const TCHAR *pszLogin, 
                                     const TCHAR *pszPassword, DWORD dwCertLen,
                                     BOOL (* pfSign)(BYTE *, DWORD, BYTE *, DWORD *, void *),
index f4b0156..2624113 100644 (file)
@@ -409,7 +409,7 @@ const TCHAR LIBNXCL_EXPORTABLE *NXCGetErrorText(DWORD dwError)
                _T("Zone ID is already in use"),
                _T("Invalid zone ID")
    };
-       return ((dwError >= 0) && (dwError <= RCC_INVALID_ZONE_ID)) ? pszErrorText[dwError] : _T("No text message for this error");
+       return (dwError <= RCC_INVALID_ZONE_ID) ? pszErrorText[dwError] : _T("No text message for this error");
 }
 
 
index 1a14e19..542c646 100644 (file)
@@ -154,10 +154,10 @@ BOOL NetworkMap::SaveToDB(DB_HANDLE hdb)
    for(int i = 0; i < m_numLinks; i++)
    {
       _sntprintf(query, 1024, _T("INSERT INTO network_map_links (map_id,element1,element2,link_type,link_name,connector_name1,connector_name2) VALUES (%d,%d,%d,%d,%s,%s,%s)"),
-                          m_dwId, m_links[i]->getElement1(), m_links[i]->getElement2(),
+                          (int)m_dwId, (int)m_links[i]->getElement1(), (int)m_links[i]->getElement2(),
                                          m_links[i]->getType(), (const TCHAR *)DBPrepareString(hdb, m_links[i]->getName(), 255),
                                          (const TCHAR *)DBPrepareString(hdb, m_links[i]->getConnector1Name(), 63),
-                                         (const TCHAR *)DBPrepareString(hdb, m_links[i]->getConnector2Name()), 63);
+                                         (const TCHAR *)DBPrepareString(hdb, m_links[i]->getConnector2Name(), 63));
       DBQuery(hdb, query);
    }
 
index e33198d..29eac8f 100644 (file)
@@ -6,9 +6,15 @@ SOURCES = ber.cpp engine.cpp main.cpp mib.cpp oid.cpp pdu.cpp \
 lib_LTLIBRARIES = libnxsnmp.la
 
 libnxsnmp_la_SOURCES = $(SOURCES)
+libnxsnmp_la_CPPFLAGS = 
 libnxsnmp_la_LDFLAGS = -version-info $(NETXMS_LIBRARY_VERSION)
 libnxsnmp_la_LIBADD = ../../libnetxms/libnetxms.la
 
+if USE_INTERNAL_ZLIB
+libnxsnmp_la_CPPFLAGS += -I../../zlib
+libnxsnmp_la_LIBADD += ../../zlib/libnxzlib.la
+endif
+
 EXTRA_DIST = \
        libnxsnmp.vcproj libnxsnmpw.vcproj \
        libnxsnmp.h
diff --git a/src/zlib/Makefile.am b/src/zlib/Makefile.am
new file mode 100644 (file)
index 0000000..87e30d1
--- /dev/null
@@ -0,0 +1,36 @@
+## Process this file with automake to produce Makefile.in
+
+lib_LTLIBRARIES = libnxzlib.la
+libnxzlib_la_LDFLAGS = -no-undefined -version-info 1:0:0 $(LDFLAGS)
+
+noinst_HEADERS = \
+       crc32.h \
+       deflate.h \
+       inffast.h \
+       inffixed.h \
+       inflate.h \
+       inftrees.h \
+       trees.h \
+       zconf.h \
+       zlib.h \
+       zutil.h
+
+libnxzlib_la_SOURCES = \
+       adler32.c \
+       compress.c \
+       crc32.c \
+       deflate.c \
+       gzio.c \
+       infback.c \
+       inffast.c \
+       inflate.c \
+       inftrees.c \
+       trees.c \
+       uncompr.c \
+       zutil.c
+
+EXTRA_DIST = \
+       ChangeLog \
+       README \
+       nxzlib.def \
+       nxzlib.vcproj