Author: jez
Date: 2006-08-10 12:52:57 +0100 (Thu, 10 Aug 2006)
New Revision: 616
Added:
branches/autoconfing/m4/has_parser.m4
branches/autoconfing/src/arabica.cpp
Removed:
branches/autoconfing/src/ArabicaConfig.S
branches/autoconfing/src/ParserConfig.S
branches/autoconfing/src/saxlib.S
Modified:
branches/autoconfing/configure.ac
branches/autoconfing/m4/ax_boost_base.m4
branches/autoconfing/m4/expat.m4
branches/autoconfing/m4/libxml2.m4
branches/autoconfing/m4/xerces.m4
branches/autoconfing/src/
branches/autoconfing/src/Makefile.am
Log:
It builds a library\!
Modified: branches/autoconfing/configure.ac
===================================================================
--- branches/autoconfing/configure.ac 2006-08-09 23:10:28 UTC (rev 615)
+++ branches/autoconfing/configure.ac 2006-08-10 11:52:57 UTC (rev 616)
@@ -1,22 +1,19 @@
-AC_INIT(src/ArabicaConfig.S)
-AC_CONFIG_HEADERS(config.h)
+AC_INIT(src/arabica.cpp)
+AC_CONFIG_HEADERS(include/SAX/ArabicaConfig.h)
AM_INIT_AUTOMAKE(arabica, Aug2006)
-AC_PROG_CC
AC_PROG_CXX
AM_PROG_LIBTOOL
-AM_SANITY_CHECK
AC_LANG_CPLUSPLUS
-AC_PROG_INSTALL
+ARABICA_HAS_BOOST([1.32])
+ARABICA_HAS_EXPAT
+ARABICA_HAS_LIBXML2
+ARABICA_HAS_XERCES
+ARABICA_HAS_XML_PARSER
-AM_WITH_EXPAT
-AM_WITH_LIBXML2
-AM_WITH_XERCES
-AX_BOOST([1.32])
-
AC_OUTPUT(Makefile \
arabica-aug2006.pc \
src/Makefile
Modified: branches/autoconfing/m4/ax_boost_base.m4
===================================================================
--- branches/autoconfing/m4/ax_boost_base.m4 2006-08-09 23:10:28 UTC (rev 615)
+++ branches/autoconfing/m4/ax_boost_base.m4 2006-08-10 11:52:57 UTC (rev 616)
@@ -1,6 +1,5 @@
-
-AC_DEFUN([AX_BOOST],
+AC_DEFUN([ARABICA_HAS_BOOST],
[
AC_ARG_WITH([boost],
AS_HELP_STRING([--with-boost=DIR],
Modified: branches/autoconfing/m4/expat.m4
===================================================================
--- branches/autoconfing/m4/expat.m4 2006-08-09 23:10:28 UTC (rev 615)
+++ branches/autoconfing/m4/expat.m4 2006-08-10 11:52:57 UTC (rev 616)
@@ -7,7 +7,7 @@
dnl In addition, an Automake conditional EXPAT_INSTALLED is set accordingly.
dnl This is necessary to adapt a whole lot of packages that have expat
dnl bundled as a static library.
-AC_DEFUN([AM_WITH_EXPAT],
+AC_DEFUN([ARABICA_HAS_EXPAT],
[ AC_ARG_WITH(expat,
[ --with-expat=PREFIX Use system Expat library],
, with_expat=yes)
@@ -30,13 +30,10 @@
expat_found=yes ],
[ expat_found=no ],
"$EXPAT_LIBS")
- if test $expat_found = no; then
- AC_MSG_ERROR([Could not find the Expat library])
- fi
+ if test $expat_found = yes; then
+ HAVE_EXPAT=1
+ fi
fi
CFLAGS="$expat_save_CFLAGS"
fi
-
- AC_SUBST(EXPAT_CFLAGS)
- AC_SUBST(EXPAT_LIBS)
])
Added: branches/autoconfing/m4/has_parser.m4
===================================================================
--- branches/autoconfing/m4/has_parser.m4 (rev 0)
+++ branches/autoconfing/m4/has_parser.m4 2006-08-10 11:52:57 UTC (rev 616)
@@ -0,0 +1,23 @@
+AC_DEFUN([ARABICA_HAS_XML_PARSER],
+[
+ if test "$HAVE_LIBXML2-$HAVE_EXPAT-$HAVE_XERCES" = "--"; then
+ AC_MSG_ERROR([[Cannot find an XML parser library. Arabica needs one of Expat, LibXML2 or Xerces]])
+ fi
+
+ if test "$HAVE_EXPAT-" != "-"; then
+ AC_DEFINE(USE_EXPAT, ,[define to build against Expat])
+ PARSER_HEADERS=$EXPAT_CFLAGS
+ PARSER_LIBS=$EXPAT_LIBS
+ elif test "$HAVE_LIBXML2-" != "-"; then
+ AC_DEFINE(USE_LIBXML2, ,[define to build against LibXML2])
+ PARSER_HEADERS=$LIBXML2_CFLAGS
+ PARSER_LIBS=$LIBXML2_LIBS
+ elif test "$HAVE_XERCES-" != "-"; then
+ AC_DEFINE(USE_XERCES, ,[define to build against Xerces])
+ PARSER_HEADERS=$XERCES_CFLAGS
+ PARSER_LIBS=$XERCES_LIBS
+ fi
+
+ AC_SUBST(PARSER_HEADERS)
+ AC_SUBST(PARSER_LIBS)
+])
Modified: branches/autoconfing/m4/libxml2.m4
===================================================================
--- branches/autoconfing/m4/libxml2.m4 2006-08-09 23:10:28 UTC (rev 615)
+++ branches/autoconfing/m4/libxml2.m4 2006-08-10 11:52:57 UTC (rev 616)
@@ -1,4 +1,4 @@
-AC_DEFUN([AM_WITH_LIBXML2],
+AC_DEFUN([ARABICA_HAS_LIBXML2],
[ AC_ARG_WITH(libxml2,
[ --with-libxml2=PREFIX Use system libxml2 library],
, with_libxml2=yes)
@@ -28,6 +28,7 @@
fi
CXXFLAGS="$libxml2_save_CXXFLAGS"
done
+ CXXFLAGS="$libxml2_save_CXXFLAGS"
AC_MSG_RESULT($libxml2_found)
if test $libxml2_found = yes; then
AC_CHECK_LIB(xml2, xmlInitParser,
@@ -35,13 +36,9 @@
libxml2_found=yes ],
[ libxml2_found=no ],
"$LIBXML2_LIBS")
- if test $libxml2_found = no; then
- AC_MSG_ERROR([Could not find the libxml2 library])
+ if test $libxml2_found = yes; then
+ HAVE_LIBXML2=1
fi
- AC_DEFINE(HAVE_LIBXML2,,[define if libxml2 is available])
fi
fi
-
- AC_SUBST(LIBXML2_CFLAGS)
- AC_SUBST(LIBXML2_LIBS)
])
Modified: branches/autoconfing/m4/xerces.m4
===================================================================
--- branches/autoconfing/m4/xerces.m4 2006-08-09 23:10:28 UTC (rev 615)
+++ branches/autoconfing/m4/xerces.m4 2006-08-10 11:52:57 UTC (rev 616)
@@ -1,4 +1,4 @@
-AC_DEFUN([AM_WITH_XERCES],
+AC_DEFUN([ARABICA_HAS_XERCES],
[ AC_ARG_WITH(xerces,
[ --with-xerces=PREFIX Use system xerces library],
, with_xerces=yes)
@@ -28,6 +28,7 @@
fi
CXXFLAGS="$xerces_save_CXXFLAGS"
done
+ CXXFLAGS="$xerces_save_CXXFLAGS"
AC_MSG_RESULT($xerces_found)
if test $xerces_found = yes; then
AC_MSG_CHECKING([for XMLPlatformUtils::Initialize in -lxerces-c])
@@ -37,14 +38,10 @@
[AS_VAR_SET(xerces_found, yes)],
[AS_VAR_SET(xerces_found, no)])
AC_MSG_RESULT($xerces_found)
- if test $xerces_found = no; then
- AC_MSG_ERROR([Could not find the Xerces library])
+ if test $xerces_found = yes; then
+ HAVE_XERCES=1
fi
- AC_DEFINE(HAVE_XERCES,,[define if xerces is available])
CXXFLAGS="$xerces_save_CXXFLAGS"
fi
fi
-
- AC_SUBST(XERCES_CFLAGS)
- AC_SUBST(XERCES_LIBS)
])
Property changes on: branches/autoconfing/src
___________________________________________________________________
Name: svn:ignore
- Makefile.in
Makefile
.deps
Debug
saxlib.cpp
Release
libArabica.so
libArabica.dll
+ Makefile.in
Makefile
.libs
.deps
Debug
saxlib.cpp
Release
libArabica.so
libArabica.dll
Deleted: branches/autoconfing/src/ArabicaConfig.S
===================================================================
--- branches/autoconfing/src/ArabicaConfig.S 2006-08-09 23:10:28 UTC (rev 615)
+++ branches/autoconfing/src/ArabicaConfig.S 2006-08-10 11:52:57 UTC (rev 616)
@@ -1,40 +0,0 @@
-#define pasty(m, n) m##n
-#define include pasty(#, include)
-#define ifdef pasty(#, ifdef)
-#define ifndef pasty(#, ifndef)
-#define endif pasty(#, endif)
-#define define pasty(#, define)
-#define message pasty(#, pragma message)
-#define undef pasty(#, undef)
-#define error pasty(#, error)
-#define else pasty(#, else)
-#define comment pasty(#, pragma comment)
-
-
-ifndef ARABICA_ARABICA_CONFIG_H
-define ARABICA_ARABICA_CONFIG_H
-
-#ifdef ARABICA_NO_WCHAR_T
-#undef ARABICA_NO_WCHAR_T
-define ARABICA_NO_WCHAR_T
-#endif
-
-#ifdef _MSC_VER
-#if (_MSC_VER < 1300)
-define ARABICA_VS6_WORKAROUND
-#endif
-
-define ARABICA_NO_CODECVT_SPECIALISATIONS
-#endif
-
-#ifdef _WIN32
-define ARABICA_WINDOWS
-#endif
-
-#if defined(_DEBUG) || (__DEBUG__)
-define ARABICA_DEBUG
-#endif
-
-endif
-
-
Modified: branches/autoconfing/src/Makefile.am
===================================================================
--- branches/autoconfing/src/Makefile.am 2006-08-09 23:10:28 UTC (rev 615)
+++ branches/autoconfing/src/Makefile.am 2006-08-10 11:52:57 UTC (rev 616)
@@ -1,6 +1,6 @@
h_sources =
-cc_sources = saxlib.cpp \
+cc_sources = arabica.cpp \
SAX/helpers/InputSourceResolver.cpp \
Utils/rot13codecvt.cpp \
Utils/utf8ucs2codecvt.cpp \
@@ -18,8 +18,8 @@
library_includedir=$(includedir)
-INCLUDES = -I$(top_srcdir)/include
+INCLUDES = -I$(top_srcdir)/include $(PARSER_HEADERS)
lib_LTLIBRARIES = libarabica.la
libarabica_la_SOURCES= $(cc_sources)
-libarabica_la_LDFLAGS= $(EXPAT_LIBS)
+libarabica_la_LDFLAGS= $(PARSER_LIBS)
Deleted: branches/autoconfing/src/ParserConfig.S
===================================================================
--- branches/autoconfing/src/ParserConfig.S 2006-08-09 23:10:28 UTC (rev 615)
+++ branches/autoconfing/src/ParserConfig.S 2006-08-10 11:52:57 UTC (rev 616)
@@ -1,92 +0,0 @@
-#define pasty(m, n) m##n
-#define include pasty(#, include)
-#define ifdef pasty(#, ifdef)
-#define ifndef pasty(#, ifndef)
-#define endif pasty(#, endif)
-#define define pasty(#, define)
-#define message pasty(#, pragma message)
-#define undef pasty(#, undef)
-#define error pasty(#, error)
-#define else pasty(#, else)
-#define comment pasty(#, pragma comment)
-
-
-ifndef ARABICA_PARSERCONFIG_H
-define ARABICA_PARSERCONFIG_H
-
-#ifdef USE_LIBXML2
-include <SAX/wrappers/saxlibxml2.h>
-undef DEF_SAX_P
-define DEF_SAX_P libxml2_wrapper
-#ifdef _MSC_VER
-message("Including libxml2")
-comment(lib, "libxml2.lib")
-#endif
-#endif
-#ifdef USE_MSXML
-#ifndef _MSC_VER
-error "Can only use MSXML on Windows"
-#endif
-message("Including MSXML")
-include <SAX/wrappers/saxmsxml2.h>
-undef DEF_SAX_P
-define DEF_SAX_P msxml2_wrapper
-#endif
-#ifdef USE_XERCES1
-include <SAX/wrappers/saxxerces.h>
-undef DEF_SAX_P
-define DEF_SAX_P xerces_wrapper
-#ifdef _MSC_VER
-message("Including Xerces 1")
-comment(lib, "xerces-c_1.lib")
-#endif
-#endif
-#ifdef USE_XERCES
-include <SAX/wrappers/saxxerces.h>
-undef DEF_SAX_P
-define DEF_SAX_P xerces_wrapper
-#ifdef _MSC_VER
-message("Including Xerces")
-comment(lib, "xerces-c_2.lib")
-#endif
-#endif
-#ifdef USE_GARDEN
-#ifdef _MSC_VER
-message("Including Garden")
-#endif
-include <SAX/parsers/saxgarden.h>
-undef DEF_SAX_P
-define DEF_SAX_P Garden
-#endif
-#ifdef USE_EXPAT
-include <SAX/wrappers/saxexpat.h>
-undef DEF_SAX_P
-define DEF_SAX_P expat_wrapper
-#ifdef _MSC_VER
-message("Including Expat")
-comment(lib, "libexpat.lib")
-#endif
-#endif
-
-#ifdef _MSC_VER
-comment(lib, "wsock32.lib")
-#endif
-
-
-ifndef NO_DEFAULT_PARSER
-ifdef DEF_SAX_P
-namespace SAX
-{
- template<class string_type, class T0 = Arabica::nil_t, class T1 = Arabica::nil_t>
- class XMLReader : public DEF_SAX_P<string_type, T0, T1> { };
-} // namespace SAX
-else
-error "No default parser defined."
-endif
-endif
-
-undef DEF_P
-
-endif
-
-
Added: branches/autoconfing/src/arabica.cpp
===================================================================
--- branches/autoconfing/src/arabica.cpp (rev 0)
+++ branches/autoconfing/src/arabica.cpp 2006-08-10 11:52:57 UTC (rev 616)
@@ -0,0 +1,55 @@
+
+#ifdef _MSC_VER
+// turn off the useless "template name is too long" warning
+#pragma warning(disable: 4786)
+#endif
+
+#include <SAX/ArabicaConfig.h>
+
+#ifdef USE_EXPAT
+#include "SAX/wrappers/saxexpat.cpp"
+#ifdef _MSC_VER
+#pragma message("Pulling in Expat wrappers")
+#endif
+#endif
+
+#ifdef USE_LIBXML2
+#include "SAX/wrappers/saxlibxml2.cpp"
+#ifdef _MSC_VER
+#pragma message("Pulling in libxml2 wrappers")
+#endif
+#endif
+
+#ifdef USE_XERCES
+#include "SAX/wrappers/saxxerces.cpp"
+#ifdef _MSC_VER
+#pragma message("Pulling in Xerces wrappers")
+#endif
+#endif
+
+#ifdef USE_MSXML
+#ifdef _MSC_VER
+#pragma message("Using MSXML")
+#else
+#error "USE_MSXML is only valid for Visual Studio builds"
+#endif
+#endif
+
+#ifdef USE_GARDEN
+#ifdef _MSC_VER
+#pragma message("Using Garden")
+#endif
+#endif
+
+#ifdef __GNUWIN32__
+#ifdef _LIB
+#include <windows.h>
+
+BOOL APIENTRY DllMain(HINSTANCE hInst,
+ DWORD reason,
+ LPVOID reserved)
+{
+ return TRUE;
+}
+#endif
+#endif
Deleted: branches/autoconfing/src/saxlib.S
===================================================================
--- branches/autoconfing/src/saxlib.S 2006-08-09 23:10:28 UTC (rev 615)
+++ branches/autoconfing/src/saxlib.S 2006-08-10 11:52:57 UTC (rev 616)
@@ -1,90 +0,0 @@
-#define pasty(m, n) m##n
-#define include pasty(#, include)
-#define ifdef pasty(#, ifdef)
-#define ifndef pasty(#, ifndef)
-#define endif pasty(#, endif)
-#define define pasty(#, define)
-#define message pasty(#, pragma message)
-#define undef pasty(#, undef)
-#define error pasty(#, error)
-#define else pasty(#, else)
-#define comment pasty(#, pragma comment)
-
-#ifdef _MSC_VER
-// turn off the useless "template name is too long" warning
-#pragma warning(disable: 4786)
-#endif
-
-include <SAX/ArabicaConfig.h>
-
-define NO_DEFAULT_PARSER
-include <SAX/XMLReader.h>
-
-#ifdef USE_LIBXML2
-include "SAX/wrappers/saxlibxml2.cpp"
-#ifdef _MSC_VER
-message("Pulling in libxml2 wrappers.")
-#endif
-#endif
-
-#ifdef USE_MSXML
-#ifndef _MSC_VER
-error "USE_MSXML is only valid for VisualC++ builds"
-#else
-message("Nothing to pull in for MSXML.")
-#endif
-#endif
-
-#ifdef USE_XERCES
-include "SAX/wrappers/saxxerces.cpp"
-#ifdef _MSC_VER
-message("Pulling in Xerces wrappers.")
-#endif
-#endif
-
-#ifdef USE_GARDEN
-#ifdef _MSC_VER
-message("Nothing to pull in for Garden.")
-#endif
-#endif
-
-#ifdef USE_EXPAT
-include "SAX/wrappers/saxexpat.cpp"
-#ifdef _MSC_VER
-message("Pulling in Expat wrappers.")
-#endif
-#endif
-
-ifndef ARABICA_NO_CODECVT_SPECIALISATIONS
-include "Utils/impl/codecvt_specialisations.cpp"
-endif
-
-#ifdef __GNUWIN32__
-#ifdef _LIB
-include <windows.h>
-
-BOOL APIENTRY DllMain(
- HINSTANCE hInst
- , DWORD reason
- , LPVOID reserved
-)
-{
- switch (reason)
- {
- case DLL_PROCESS_ATTACH:
- break;
-
- case DLL_PROCESS_DETACH:
- break;
-
- case DLL_THREAD_ATTACH:
- break;
-
- case DLL_THREAD_DETACH:
- break;
- }
-
- return TRUE;
-}
-#endif
-#endif
|