libtre iuntegrated into unix build; configure cleanup; started work on unix unicode...
authorVictor Kirhenshtein <victor@netxms.org>
Thu, 27 Jan 2011 14:31:53 +0000 (14:31 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Thu, 27 Jan 2011 14:31:53 +0000 (14:31 +0000)
configure.ac
src/libnetxms/Makefile.am
src/libnetxms/config.cpp
src/libnxcl/Makefile.am
src/libnxlp/Makefile.am
src/libnxmap/Makefile.am
src/libnxsl/Makefile.am
src/libtre/Makefile.am
src/snmp/libnxsnmp/Makefile.am

index 15c38c8..06f7e9a 100644 (file)
@@ -45,7 +45,6 @@ BUILD_CLIENT="no"
 BUILD_NXHTTPD="no"
 BUILD_STATIC_AGENT="no"
 NEED_ZLIB="no"
-NEED_WXWIDGETS="no"
 MODULES="libnetxms tools install"
 STATIC_SUBAGENT_LIST=""
 SUBAGENT_DIRS=""
@@ -56,7 +55,6 @@ TOP_LEVEL_MODULES=""
 CONTRIB_MODULES=""
 CLIENT_COMPONENTS=""
 BUILD_UNICODE="no"
-WX_UNICODE="no"
 ORACLE_LIBS=""
 PGSQL_LIBS=""
 MYSQL_LIBS=""
@@ -276,6 +274,13 @@ AC_ARG_ENABLE(encryption,
        DISABLE_ENCRYPTION="yes"
 ])
 
+AC_ARG_ENABLE(unicode,
+[AS_HELP_STRING(--enable-unicode,enable UNICODE build)],
+[
+       BUILD_UNICODE="yes"
+       CPPFLAGS="$CPPFLAGS -DUNICODE"
+])
+
 AC_ARG_ENABLE(unstable,
 [AS_HELP_STRING(--enable-unstable,build experimental/unstable components)],
 [
@@ -920,6 +925,20 @@ fi
 if test "x$HAVE_LIBTRE" = "xno"; then
        MODULES="libtre $MODULES"
        AC_DEFINE(USE_BUNDLED_LIBTRE,1,Define to 1 if bundled libtre is used)
+
+       tre_version_1=`0`
+       tre_version_2=`8`
+       tre_version_3=`0`
+       tre_version=$tre_version_1.$tre_version_2.$tre_version_3
+       AC_DEFINE_UNQUOTED(TRE_VERSION,  "$tre_version",  [ TRE version string.  ])
+       AC_DEFINE_UNQUOTED(TRE_VERSION_1, $tre_version_1, [ TRE version level 1. ])
+       AC_DEFINE_UNQUOTED(TRE_VERSION_2, $tre_version_2, [ TRE version level 2. ])
+       AC_DEFINE_UNQUOTED(TRE_VERSION_3, $tre_version_3, [ TRE version level 3. ])
+       AC_SUBST(TRE_VERSION, $tre_version)
+
+       AC_DEFINE(TRE_REGEX_T_FIELD,value,[Define to a field in the regex_t struct where TRE should store a pointer to the internal tre_tnfa_t structure])
+       AC_DEFINE(TRE_APPROX, 1, [ Define if you want to enable approximate matching functionality. ])
+       AM_CONDITIONAL(TRE_APPROX, true)
 fi
 
 #--------------------------------------------------------------------
@@ -1201,39 +1220,6 @@ fi
 
 
 #--------------------------------------------------------------------
-# Check for wxWidgets
-#--------------------------------------------------------------------
-
-if test "x$NEED_WXWIDGETS" = "xyes"; then
-       AC_PATH_PROGS([WXCONF], [wx-config wxgtk2-2.8-config], [no], [$PATH:/usr/local/bin])
-       if test "x$WXCONF" = "xno"; then
-               AC_MSG_ERROR([*** wxWidgets not installed - unable to build GUI components ***])
-       else
-               AC_PATH_PROGS([WXRC], [wxrc wxrc-gtk2-2.8], [no], [$PATH:/usr/local/bin])
-               if test "x$WXRC" = "xno"; then
-                       AC_MSG_ERROR([*** wxWidgets resource compiler not found - unable to build GUI components ***])
-               else
-                       NEED_UNICODE=`$WXCONF --selected-config | grep unicode | wc -l`
-                       if test $NEED_UNICODE -eq 1; then
-                               BUILD_UNICODE="yes"
-                               WX_UNICODE="yes"
-                       fi
-                       CXXFLAGS="$CXXFLAGS `$WXCONF --cxxflags --debug=$ENABLE_DEBUG`"
-                       LDFLAGS="$LDFLAGS `$WXCONF --libs --debug=$ENABLE_DEBUG`"
-               fi
-       fi
-       $WXCONF --cxxflags | grep error >/dev/null
-       if test $? = 0; then
-               echo "wx-config output:"
-               echo "*** BEGIN ***"
-               $WXCONF --cxxflags
-               echo "*** END ***"
-               AC_MSG_ERROR([*** wxWidgets is not configured properly - see wx-config output above ***])
-       fi
-fi
-
-
-#--------------------------------------------------------------------
 # Check for UNICODE stuff
 #--------------------------------------------------------------------
 
@@ -1538,12 +1524,22 @@ if test "x$ac_found_iconv" = "xyes"; then
     [Define as const if the declaration of iconv() needs const.])
 fi
 
-if test $ac_cv_sizeof_wchar_t -eq 2; then
-       AC_DEFINE(UNICODE_UCS2, 1, Define to 1 if you have 2-byte wchar_t)
-fi
+if test "x$ac_cv_type_wchar_t" = "xyes"; then
+       if test $ac_cv_sizeof_wchar_t -eq 2; then
+               AC_DEFINE(UNICODE_UCS2, 1, Define to 1 if you have 2-byte wchar_t)
+       fi
 
-if test $ac_cv_sizeof_wchar_t -eq 4; then
-       AC_DEFINE(UNICODE_UCS4, 1, Define to 1 if you have 4-byte wchar_t)
+       if test $ac_cv_sizeof_wchar_t -eq 4; then
+               AC_DEFINE(UNICODE_UCS4, 1, Define to 1 if you have 4-byte wchar_t)
+       fi
+
+       if test "x$USE_INTERNAL_LIBTRE" = "xyes"; then
+               AC_DEFINE(TRE_WCHAR, 1,    [ Define to enable wide character support in libtre.])
+       fi
+else
+       if test "x$BUILD_UNICODE" = "xyes"; then
+               AC_MSG_ERROR(wchar_t is required for UNICODE build)
+       fi
 fi
 
 
@@ -1666,7 +1662,6 @@ fi
 
 CPPFLAGS="$CPPFLAGS -DPREFIX=\\\"\${prefix}\\\" -DPREFIXW=L\\\"\${prefix}\\\" -DDATADIR=\\\"\${pkgdatadir}\\\" -DBINDIR=\\\"\${bindir}\\\" -DLIBDIR=\\\"\${libdir}\\\""
 
-AM_CONDITIONAL([BUILD_UNICODE_LIBS], [test "x$BUILD_UNICODE" = "xyes"])
 AM_CONDITIONAL([USE_INTERNAL_EXPAT], [test "x$HAVE_LIBEXPAT" = "xno"])
 AM_CONDITIONAL([USE_INTERNAL_LIBTRE], [test "x$HAVE_LIBTRE" = "xno"])
 
@@ -1686,7 +1681,6 @@ AC_SUBST(STATIC_SUBAGENT_LIST)
 AC_SUBST(SUBAGENT_LIBS)
 AC_SUBST(BUILD_SERVER)
 AC_SUBST(UNSTABLE_SUBAGENT_DIRS)
-AC_SUBST(WXRC)
 AC_SUBST(MYSQL_LIBS)
 AC_SUBST(PGSQL_LIBS)
 AC_SUBST(ORACLE_LIBS)
@@ -1812,6 +1806,8 @@ AC_CONFIG_FILES([
        src/libnxlp/Makefile
        src/libnxmap/Makefile
        src/libnxsl/Makefile
+       src/libtre/Makefile
+       src/libtre/win32/Makefile
        src/nxscript/Makefile
        src/server/Makefile
        src/server/core/Makefile
@@ -1915,9 +1911,9 @@ else
        echo "Build Static Agent      : NO"
 fi
 if test "x${BUILD_UNICODE}" = "xyes"; then
-       echo "Build UNICODE libraries : YES"
+       echo "UNICODE build           : YES"
 else
-       echo "Build UNICODE libraries : NO"
+       echo "UNICODE build           : NO"
 fi
 if test "x${HAVE_LIBEXPAT}" = "xno"; then
        echo "Use internal libexpat   : YES"
index 3820373..5fff465 100644 (file)
@@ -10,23 +10,16 @@ SOURCES = agent.cpp base64.cpp config.cpp crypto.cpp gen_uuid.c \
          table.cpp threads.cpp tools.cpp unicode.cpp uuid.c wcstoll.c \
          wcstoull.c xml.cpp
 
-if BUILD_UNICODE_LIBS
-lib_LTLIBRARIES = libnetxms.la libnetxmsw.la
-else
 lib_LTLIBRARIES = libnetxms.la
-endif
 
 libnetxms_la_SOURCES = $(SOURCES)
 libnetxms_la_LDFLAGS = -version-info $(NETXMS_LIBRARY_VERSION)
+libnetxms_la_LIBADD =
 if USE_INTERNAL_EXPAT
-libnetxms_la_LIBADD = ../libexpat/libexpat/libnxexpat.la
+libnetxms_la_LIBADD += ../libexpat/libexpat/libnxexpat.la
 endif
-
-libnetxmsw_la_SOURCES = $(SOURCES)
-libnetxmsw_la_CPPFLAGS = -DUNICODE
-libnetxmsw_la_LDFLAGS = -version-info $(NETXMS_LIBRARY_VERSION)
-if USE_INTERNAL_EXPAT
-libnetxmsw_la_LIBADD = ../libexpat/libexpat/libnxexpat.la
+if USE_INTERNAL_LIBTRE
+libnetxms_la_LIBADD += ../libtre/libnxtre.la
 endif
 
 EXTRA_DIST = \
index 08b6ced..0f24124 100644 (file)
@@ -947,7 +947,11 @@ static void StartElement(void *userData, const char *name, const char **attrs)
 
                                MultiByteToWideChar(CP_UTF8, 0, name, -1, wname, MAX_PATH);
                                wname[MAX_PATH - 1] = 0;
+#ifdef _WIN32
                                _snwprintf(entryName, MAX_PATH, L"%s#%u", wname, (unsigned int)id);
+#else
+                               swprintf(entryName, MAX_PATH, L"%S#%u", wname, (unsigned int)id);
+#endif
                        }
                        else
                        {
index 7d6689f..7acb99a 100644 (file)
@@ -7,21 +7,12 @@ SOURCES = actions.cpp agentcfg.cpp alarms.cpp cert.cpp comm.cpp \
           server.cpp session.cpp situation.cpp snmptrap.cpp \
          snmp.cpp users.cpp
 
-if BUILD_UNICODE_LIBS
-lib_LTLIBRARIES = libnxcl.la libnxclw.la
-else
 lib_LTLIBRARIES = libnxcl.la
-endif
 
 libnxcl_la_SOURCES = $(SOURCES)
 libnxcl_la_LDFLAGS = -version-info $(NETXMS_LIBRARY_VERSION)
 libnxcl_la_LIBADD = ../libnetxms/libnetxms.la ../libnxmap/libnxmap.la
 
-libnxclw_la_SOURCES = $(SOURCES)
-libnxclw_la_CPPFLAGS = -DUNICODE
-libnxclw_la_LDFLAGS = -version-info $(NETXMS_LIBRARY_VERSION)
-libnxclw_la_LIBADD = ../libnetxms/libnetxmsw.la ../libnxmap/libnxmapw.la
-
 EXTRA_DIST = \
        libnxcl.vcproj libnxclw.vcproj \
        libnxcl.vcp libnxcl.vcw \
index 62fbf7f..76c0140 100644 (file)
@@ -13,6 +13,9 @@ libnxlp_la_LIBADD = @top_srcdir@/src/libnetxms/libnetxms.la
 if USE_INTERNAL_EXPAT
 libnxlp_la_LIBADD += @top_srcdir@/src/libexpat/libexpat/libnxexpat.la
 endif
+if USE_INTERNAL_LIBTRE
+libnxlp_la_LIBADD += @top_srcdir@/src/libtre/libnxtre.la
+endif
 
 EXTRA_DIST = \
        libnxlp.vcproj \
index 027a0c5..bd9b0d1 100644 (file)
@@ -3,21 +3,12 @@ INCLUDES=-I@top_srcdir@/include
 SOURCES = element.cpp graph.cpp link.cpp main.cpp map.cpp objlist.cpp \
           radial.cpp rt.cpp submap.cpp vertex.cpp
 
-if BUILD_UNICODE_LIBS
-lib_LTLIBRARIES = libnxmap.la libnxmapw.la
-else
 lib_LTLIBRARIES = libnxmap.la
-endif
 
 libnxmap_la_SOURCES = $(SOURCES)
 libnxmap_la_LDFLAGS = -version-info $(NETXMS_LIBRARY_VERSION)
 libnxmap_la_LIBADD = ../libnetxms/libnetxms.la
 
-libnxmapw_la_SOURCES = $(SOURCES)
-libnxmapw_la_CPPFLAGS = -DUNICODE
-libnxmapw_la_LDFLAGS = -version-info $(NETXMS_LIBRARY_VERSION)
-libnxmapw_la_LIBADD = ../libnetxms/libnetxmsw.la
-
 EXTRA_DIST = \
        libnxmap.vcproj libnxmapw.vcproj \
        libnxmap.h
index 69a6b38..6803246 100644 (file)
@@ -8,6 +8,9 @@ libnxsl_la_SOURCES = lex.parser.cpp parser.tab.cpp \
                     variable.cpp
 libnxsl_la_LDFLAGS = -version-info $(NETXMS_LIBRARY_VERSION)
 libnxsl_la_LIBADD = ../libnetxms/libnetxms.la
+if USE_INTERNAL_LIBTRE
+libnxsl_la_LIBADD += ../libtre/libnxtre.la
+endif
 
 EXTRA_DIST = libnxsl.vcproj libnxsl.h parser.l parser.y parser.tab.hpp
 
index 5697ac6..143e84c 100644 (file)
@@ -2,9 +2,8 @@
 
 SUBDIRS = win32
 
-lib_LTLIBRARIES = libtre.la
-libtre_la_LDFLAGS = -no-undefined -version-info 5:0:0 $(LDFLAGS)
-libtre_la_LIBADD = $(LTLIBINTL)
+lib_LTLIBRARIES = libnxtre.la
+libnxtre_la_LDFLAGS = -no-undefined -version-info 5:0:0 $(LDFLAGS)
 
 noinst_HEADERS =               \
        tre-ast.h               \
@@ -16,7 +15,7 @@ noinst_HEADERS =              \
        tre-stack.h             \
        xmalloc.h
 
-libtre_la_SOURCES =            \
+libnxtre_la_SOURCES =          \
        tre-ast.c               \
        tre-compile.c           \
        tre-match-approx.c      \
@@ -28,3 +27,12 @@ libtre_la_SOURCES =          \
        regcomp.c               \
        regexec.c               \
        regerror.c
+
+EXTRA_DIST = 
+       AUTHORS \
+       LICENSE \
+       README \
+       THANKS \
+       libtre.def \
+       libtre.vcproj \
+       windll.cpp
index 40485ac..e33198d 100644 (file)
@@ -3,21 +3,12 @@ INCLUDES=-I@top_srcdir@/include
 SOURCES = ber.cpp engine.cpp main.cpp mib.cpp oid.cpp pdu.cpp \
           security.cpp transport.cpp variable.cpp zfile.cpp
 
-if BUILD_UNICODE_LIBS
-lib_LTLIBRARIES = libnxsnmp.la libnxsnmpw.la
-else
 lib_LTLIBRARIES = libnxsnmp.la
-endif
 
 libnxsnmp_la_SOURCES = $(SOURCES)
 libnxsnmp_la_LDFLAGS = -version-info $(NETXMS_LIBRARY_VERSION)
 libnxsnmp_la_LIBADD = ../../libnetxms/libnetxms.la
 
-libnxsnmpw_la_SOURCES = $(SOURCES)
-libnxsnmpw_la_CPPFLAGS = -DUNICODE
-libnxsnmpw_la_LDFLAGS = -version-info $(NETXMS_LIBRARY_VERSION)
-libnxsnmpw_la_LIBADD = ../../libnetxms/libnetxmsw.la
-
 EXTRA_DIST = \
        libnxsnmp.vcproj libnxsnmpw.vcproj \
        libnxsnmp.h