Initial import
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/xerces-c-3.0.0@1 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
Executable
+256
@@ -0,0 +1,256 @@
|
||||
dnl
|
||||
dnl NOTE: This file was modified for Xerces-C++. See the comments
|
||||
dnl starting with 'XERCES' for more information.
|
||||
dnl
|
||||
dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
dnl
|
||||
dnl @summary figure out how to build C programs using POSIX threads
|
||||
dnl
|
||||
dnl This macro figures out how to build C programs using POSIX threads.
|
||||
dnl It sets the PTHREAD_LIBS output variable to the threads library and
|
||||
dnl linker flags, and the PTHREAD_CFLAGS output variable to any special
|
||||
dnl C compiler flags that are needed. (The user can also force certain
|
||||
dnl compiler flags/libs to be tested by setting these environment
|
||||
dnl variables.)
|
||||
dnl
|
||||
dnl Also sets PTHREAD_CC to any special C compiler that is needed for
|
||||
dnl multi-threaded programs (defaults to the value of CC otherwise).
|
||||
dnl (This is necessary on AIX to use the special cc_r compiler alias.)
|
||||
dnl
|
||||
dnl NOTE: You are assumed to not only compile your program with these
|
||||
dnl flags, but also link it with them as well. e.g. you should link
|
||||
dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
|
||||
dnl $LIBS
|
||||
dnl
|
||||
dnl If you are only building threads programs, you may wish to use
|
||||
dnl these variables in your default LIBS, CFLAGS, and CC:
|
||||
dnl
|
||||
dnl LIBS="$PTHREAD_LIBS $LIBS"
|
||||
dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
dnl CC="$PTHREAD_CC"
|
||||
dnl
|
||||
dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
|
||||
dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
|
||||
dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
dnl
|
||||
dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
|
||||
dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
||||
dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
||||
dnl default action will define HAVE_PTHREAD.
|
||||
dnl
|
||||
dnl Please let the authors know if this macro fails on any platform, or
|
||||
dnl if you have any other suggestions or comments. This macro was based
|
||||
dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with
|
||||
dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros
|
||||
dnl posted by Alejandro Forero Cuervo to the autoconf macro repository.
|
||||
dnl We are also grateful for the helpful feedback of numerous users.
|
||||
dnl
|
||||
dnl @category InstalledPackages
|
||||
dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
dnl @version 2006-05-29
|
||||
dnl @license GPLWithACException
|
||||
|
||||
AC_DEFUN([ACX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
acx_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
|
||||
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
# names; the ordering is very important because some systems
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items starting with a "-" are
|
||||
# C compiler flags, and other items are library names, except for "none"
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
# XERCES: On GNU/Linux with gcc both -pthread and -lpthread are valid.
|
||||
# However, libtool links libraries with -nostdlib which results in
|
||||
# -pthread being stripped from the linker command line. To resolve
|
||||
# this we move pthread from after -mthreads to after pthreads.
|
||||
#
|
||||
acx_pthread_flags="pthreads pthread none -Kthread -kthread lthread -pthread -pthreads -mthreads --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
|
||||
# pthreads: AIX (must check this before -lpthread)
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
||||
# -pthreads: Solaris/gcc
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||
# also defines -D_REENTRANT)
|
||||
# ... -mt is also the pthreads flag for HP/aCC
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||
# a function called by this macro, so we could check for that, but
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
|
||||
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
for flag in $acx_pthread_flags; do
|
||||
|
||||
case $flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $flag])
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
|
||||
if test x"$acx_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
PTHREAD_LIBS="-l$flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
# need a special flag -Kthread to make this header compile.)
|
||||
# We check for pthread_join because it is in -lpthread on IRIX
|
||||
# while pthread_create is in libc. We check for pthread_attr_init
|
||||
# due to DEC craziness with -lpthreads. We check for
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
|
||||
# XERCES: Add tests for pthread_mutexattr_init and
|
||||
# pthread_mutexattr_destroy.
|
||||
#
|
||||
AC_TRY_LINK([#include <pthread.h>],
|
||||
[pthread_t th; pthread_join(th, 0);
|
||||
pthread_attr_init(0); pthread_cleanup_push(0, 0);
|
||||
pthread_create(0,0,0,0); pthread_cleanup_pop(0);
|
||||
pthread_mutexattr_init(0); pthread_mutexattr_destroy(0);],
|
||||
[acx_pthread_ok=yes])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
|
||||
[attr_name=$attr; break])
|
||||
done
|
||||
AC_MSG_RESULT($attr_name)
|
||||
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
|
||||
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
|
||||
esac
|
||||
AC_MSG_RESULT(${flag})
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
# More AIX lossage: must compile with xlc_r or cc_r
|
||||
if test x"$GCC" != xyes; then
|
||||
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
|
||||
else
|
||||
PTHREAD_CC=$CC
|
||||
fi
|
||||
else
|
||||
PTHREAD_CC="$CC"
|
||||
fi
|
||||
|
||||
AC_SUBST(PTHREAD_LIBS)
|
||||
AC_SUBST(PTHREAD_CFLAGS)
|
||||
AC_SUBST(PTHREAD_CC)
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$acx_pthread_ok" = xyes; then
|
||||
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
|
||||
:
|
||||
else
|
||||
acx_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_RESTORE
|
||||
])dnl ACX_PTHREAD
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
dnl @synopsis AC_CXX_HAVE_BOOL
|
||||
dnl
|
||||
dnl If the compiler recognizes bool as a separate built-in type, define
|
||||
dnl HAVE_BOOL. Note that a typedef is not a separate type since you
|
||||
dnl cannot overload a function such that it accepts either the basic
|
||||
dnl type or the typedef.
|
||||
dnl
|
||||
dnl @category Cxx
|
||||
dnl @author Todd Veldhuizen
|
||||
dnl @author Luc Maisonobe <luc@spaceroots.org>
|
||||
dnl @version 2004-02-04
|
||||
dnl @license AllPermissive
|
||||
|
||||
AC_DEFUN([AC_CXX_HAVE_BOOL],
|
||||
[AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type,
|
||||
ac_cv_cxx_have_bool,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_COMPILE([
|
||||
int f(int x){return 1;}
|
||||
int f(char x){return 1;}
|
||||
int f(bool x){return 1;}
|
||||
],[bool b = true; return f(b);],
|
||||
ac_cv_cxx_have_bool=yes, ac_cv_cxx_have_bool=no)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
if test "$ac_cv_cxx_have_bool" = yes; then
|
||||
AC_DEFINE(HAVE_BOOL,,[define if bool is a built-in type])
|
||||
fi
|
||||
])
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
dnl @synopsis AC_CXX_HAVE_LSTRING
|
||||
dnl
|
||||
dnl If the compiler can prevent names clashes using namespaces, define
|
||||
dnl HAVE_LSTRING.
|
||||
dnl
|
||||
dnl @category Cxx
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-02-21
|
||||
dnl @license AllPermissive
|
||||
|
||||
AC_DEFUN([AC_CXX_HAVE_LSTRING],
|
||||
[AC_CACHE_CHECK([whether the compiler implements L"widestring"],
|
||||
ac_cv_cxx_have_lstring,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_COMPILE_IFELSE(
|
||||
AC_LANG_SOURCE(
|
||||
[[const wchar_t* s=L"wide string";]]),
|
||||
ac_cv_cxx_have_lstring=yes, ac_cv_cxx_have_lstring=no)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
if test "$ac_cv_cxx_have_lstring" = yes; then
|
||||
AC_DEFINE(HAVE_LSTRING,,[define if the compiler implements L"widestring"])
|
||||
fi
|
||||
])
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
dnl @synopsis AC_CXX_HAVE_NAMESPACES
|
||||
dnl
|
||||
dnl If the compiler can prevent names clashes using namespaces, define
|
||||
dnl HAVE_NAMESPACES.
|
||||
dnl
|
||||
dnl @category Cxx
|
||||
dnl @author Todd Veldhuizen
|
||||
dnl @author Luc Maisonobe <luc@spaceroots.org>
|
||||
dnl @version 2004-02-04
|
||||
dnl @license AllPermissive
|
||||
|
||||
AC_DEFUN([AC_CXX_HAVE_NAMESPACES],
|
||||
[AC_CACHE_CHECK(whether the compiler implements namespaces,
|
||||
ac_cv_cxx_have_namespaces,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
|
||||
[using namespace Outer::Inner; return i;],
|
||||
ac_cv_cxx_have_namespaces=yes, ac_cv_cxx_have_namespaces=no)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
if test "$ac_cv_cxx_have_namespaces" = yes; then
|
||||
AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
|
||||
fi
|
||||
])
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
dnl @synopsis AC_CXX_HAVE_STD_LIBS
|
||||
dnl
|
||||
dnl If the compiler supports ISO C++ standard library (i.e., can
|
||||
dnl include the files iostream, map, iomanip and cmath}), define
|
||||
dnl HAVE_STD_LIBS.
|
||||
dnl
|
||||
dnl @category Cxx
|
||||
dnl @author Todd Veldhuizen
|
||||
dnl @author Luc Maisonobe <luc@spaceroots.org>
|
||||
dnl @version 2004-02-04
|
||||
dnl @license AllPermissive
|
||||
|
||||
AC_DEFUN([AC_CXX_HAVE_STD_LIBS],
|
||||
[AC_CACHE_CHECK(whether the compiler supports ISO C++ standard library,
|
||||
ac_cv_cxx_have_std_libs,
|
||||
[AC_REQUIRE([AC_CXX_HAVE_NAMESPACES])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_COMPILE([#include <iostream>
|
||||
#include <map>
|
||||
#include <iomanip>
|
||||
#include <cmath>
|
||||
#ifdef HAVE_NAMESPACES
|
||||
using namespace std;
|
||||
#endif],[return 0;],
|
||||
ac_cv_cxx_have_std_libs=yes, ac_cv_cxx_have_std_libs=no)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
if test "$ac_cv_cxx_have_std_libs" = yes; then
|
||||
AC_DEFINE(HAVE_STD_LIBS,,[define if the compiler supports ISO C++ standard library])
|
||||
fi
|
||||
])
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
dnl @synopsis AC_CXX_HAVE_STD_NAMESPACE
|
||||
dnl
|
||||
dnl If the compiler supports the std namespace, define
|
||||
dnl HAVE_STD_NAMESPACE.
|
||||
dnl
|
||||
dnl @category Cxx
|
||||
dnl @author Todd Veldhuizen
|
||||
dnl @author Luc Maisonobe <luc@spaceroots.org>
|
||||
dnl @version 2004-02-04
|
||||
dnl @license AllPermissive
|
||||
|
||||
AC_DEFUN([AC_CXX_HAVE_STD_NAMESPACE],
|
||||
[AC_CACHE_CHECK(whether the compiler supports the std namespace,
|
||||
ac_cv_cxx_have_std_namespace,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_COMPILE([#include <iostream>
|
||||
std::istream& is = std::cin;
|
||||
],[return 0;],
|
||||
ac_cv_cxx_have_std_namespace=yes, ac_cv_cxx_have_std_namespace=no)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
if test "$ac_cv_cxx_have_std_namespace" = yes; then
|
||||
AC_DEFINE(HAVE_STD_NAMESPACE,,[define if the compiler supports the std namespace])
|
||||
fi
|
||||
])
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
dnl @synopsis XERCES_CURL_PREFIX
|
||||
dnl
|
||||
dnl Determines the prefix for libcurl
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-05-23
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_curl_prefix.m4 467290 2006-10-24 09:23:14Z amassari $
|
||||
|
||||
AC_DEFUN([XERCES_CURL_PREFIX],
|
||||
[
|
||||
AC_ARG_WITH([curl],
|
||||
[AS_HELP_STRING([--with-curl[[[[=DIR]]]]],[Specify location of libcurl])],
|
||||
[with_curl=m4_if($with_curl, [yes], [], $with_curl)],
|
||||
[with_curl=])
|
||||
|
||||
# Determine if curl is available
|
||||
AC_CACHE_CHECK([for libcurl], [xerces_cv_curl_prefix],
|
||||
[
|
||||
xerces_cv_curl_prefix=
|
||||
if test x"$with_curl" != x"no"; then
|
||||
search_list="$with_curl /usr/local /usr"
|
||||
for i in $search_list; do
|
||||
if test -r "$i/include/curl/easy.h" -a -r "$i/include/curl/multi.h" ; then
|
||||
xerces_cv_curl_prefix=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
AC_SUBST([CURL_PREFIX], [$xerces_cv_curl_prefix])
|
||||
]
|
||||
)
|
||||
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
dnl @synopsis XERCES_FILEMGR_SELECTION
|
||||
dnl
|
||||
dnl Determines the which filemgr to use
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-05-25
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_filemgr_selection.m4 676848 2008-07-15 09:22:54Z borisk $
|
||||
|
||||
AC_DEFUN([XERCES_FILEMGR_SELECTION],
|
||||
[
|
||||
|
||||
AC_MSG_CHECKING([for which File Manager to use])
|
||||
filemgr=
|
||||
|
||||
# Platform specific checks
|
||||
case $host_os in
|
||||
windows* | mingw*)
|
||||
filemgr=Windows;
|
||||
AC_DEFINE([XERCES_USE_FILEMGR_WINDOWS], 1, [Define to use the Windows file mgr])
|
||||
;;
|
||||
esac
|
||||
|
||||
# Fall back to using posix files
|
||||
AS_IF([test -z "$filemgr"],
|
||||
[filemgr=POSIX;
|
||||
AC_DEFINE([XERCES_USE_FILEMGR_POSIX], 1, [Define to use the POSIX file mgr])
|
||||
])
|
||||
|
||||
AC_MSG_RESULT($filemgr)
|
||||
|
||||
# Define the auto-make conditionals which determine what actually gets compiled
|
||||
# Note that these macros can't be executed conditionally, which is why they're here, not above.
|
||||
AM_CONDITIONAL([XERCES_USE_FILEMGR_POSIX], [test x"$filemgr" = xPOSIX])
|
||||
AM_CONDITIONAL([XERCES_USE_FILEMGR_WINDOWS],[test x"$filemgr" = xWindows])
|
||||
|
||||
]
|
||||
)
|
||||
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
dnl @synopsis XERCES_ICU_PREFIX
|
||||
dnl
|
||||
dnl Determines the prefix for icu
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-05-23
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_icu_prefix.m4 467290 2006-10-24 09:23:14Z amassari $
|
||||
|
||||
AC_DEFUN([XERCES_ICU_PREFIX],
|
||||
[
|
||||
AC_ARG_WITH([icu],
|
||||
[AS_HELP_STRING([--with-icu[[[[=DIR]]]]],[Specify location of icu])],
|
||||
[with_icu=m4_if($with_icu, [yes], [], $with_icu)],
|
||||
[with_icu=])
|
||||
|
||||
# Determine if icu is available
|
||||
AC_CACHE_CHECK([for icu], [xerces_cv_icu_prefix],
|
||||
[
|
||||
xerces_cv_icu_prefix=
|
||||
if test x"$with_icu" != x"no"; then
|
||||
search_list="$with_icu /usr/local /usr"
|
||||
for i in $search_list; do
|
||||
if test -r $i/include/unicode/ucnv.h; then
|
||||
xerces_cv_icu_prefix=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
AC_SUBST([ICU_PREFIX], [$xerces_cv_icu_prefix])
|
||||
]
|
||||
)
|
||||
|
||||
Executable
+187
@@ -0,0 +1,187 @@
|
||||
dnl @synopsis XERCES_INT_TYPES
|
||||
dnl
|
||||
dnl Determines what int types to use for various
|
||||
dnl Xerces standard integer types.
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-06-07
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_int_types.m4 672614 2008-06-29 09:47:07Z borisk $
|
||||
|
||||
AC_DEFUN([XERCES_INT_TYPES],
|
||||
[
|
||||
AC_CHECK_HEADERS([inttypes.h])
|
||||
AC_CHECK_SIZEOF(short)
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(long long)
|
||||
AC_CHECK_SIZEOF(__int64)
|
||||
AC_CHECK_TYPE(int16_t)
|
||||
AC_CHECK_TYPE(int32_t)
|
||||
AC_CHECK_TYPE(int64_t)
|
||||
AC_CHECK_TYPE(uint16_t)
|
||||
AC_CHECK_TYPE(uint32_t)
|
||||
AC_CHECK_TYPE(uint64_t)
|
||||
|
||||
#
|
||||
# Select a signed 16 bit integer type
|
||||
#
|
||||
AC_CACHE_CHECK([for an appropriate signed 16 bit integer type], [xerces_cv_type_s16bit_int], [
|
||||
AS_IF([test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_int16_t = xyes],
|
||||
[xerces_cv_type_s16bit_int=int16_t],
|
||||
[
|
||||
case $ac_cv_sizeof_int in
|
||||
2*) xerces_cv_type_s16bit_int=int;;
|
||||
*)
|
||||
case $ac_cv_sizeof_short in
|
||||
2*) xerces_cv_type_s16bit_int=short;;
|
||||
*) AC_MSG_ERROR([Couldn't find a signed 16 bit int type]);;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
])
|
||||
])
|
||||
|
||||
#
|
||||
# Select an unsigned 16 bit integer type
|
||||
#
|
||||
AC_CACHE_CHECK([for an appropriate unsigned 16 bit integer type], [xerces_cv_type_u16bit_int], [
|
||||
AS_IF([test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_uint16_t = xyes],
|
||||
[xerces_cv_type_u16bit_int=uint16_t],
|
||||
[
|
||||
case $ac_cv_sizeof_int in
|
||||
2*) xerces_cv_type_u16bit_int="unsigned int";;
|
||||
*)
|
||||
case $ac_cv_sizeof_short in
|
||||
2*) xerces_cv_type_u16bit_int="unsigned short";;
|
||||
*) AC_MSG_ERROR([Couldn't find an unsigned 16 bit int type]);;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
#
|
||||
# Select a signed 32 bit integer type
|
||||
#
|
||||
AC_CACHE_CHECK([for an appropriate signed 32 bit integer type], [xerces_cv_type_s32bit_int], [
|
||||
AS_IF([test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_int32_t = xyes],
|
||||
[xerces_cv_type_s32bit_int=int32_t],
|
||||
[
|
||||
case $ac_cv_sizeof_int in
|
||||
4*) xerces_cv_type_s32bit_int=int;;
|
||||
*)
|
||||
case $ac_cv_sizeof_long in
|
||||
4*) xerces_cv_type_s32bit_int=long;;
|
||||
*) AC_MSG_ERROR([Couldn't find a signed 32 bit int type]);;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
])
|
||||
])
|
||||
|
||||
#
|
||||
# Select an unsigned 32 bit integer type
|
||||
#
|
||||
AC_CACHE_CHECK([for an appropriate unsigned 32 bit integer type], [xerces_cv_type_u32bit_int], [
|
||||
AS_IF([test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_uint32_t = xyes],
|
||||
[xerces_cv_type_u32bit_int=uint32_t],
|
||||
[
|
||||
case $ac_cv_sizeof_int in
|
||||
4*) xerces_cv_type_u32bit_int="unsigned int";;
|
||||
*)
|
||||
case $ac_cv_sizeof_long in
|
||||
4*) xerces_cv_type_u32bit_int="unsigned long";;
|
||||
*) AC_MSG_ERROR([Couldn't find an unsigned 32 bit int type]);;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
])
|
||||
])
|
||||
|
||||
#
|
||||
# Select an signed 64 bit integer type
|
||||
#
|
||||
AC_CACHE_CHECK([for an appropriate signed 64 bit integer type], [xerces_cv_type_s64bit_int], [
|
||||
AS_IF([test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_int64_t = xyes],
|
||||
[
|
||||
xerces_cv_type_s64bit_int=int64_t
|
||||
xerces_cv_sizeof_int64=8
|
||||
],
|
||||
[
|
||||
case $ac_cv_sizeof_int in
|
||||
8*) xerces_cv_type_s64bit_int="int"
|
||||
xerces_cv_sizeof_int64=8
|
||||
;;
|
||||
*)
|
||||
case $ac_cv_sizeof_long in
|
||||
8*) xerces_cv_type_s64bit_int="long"
|
||||
xerces_cv_sizeof_int64=8
|
||||
;;
|
||||
*)
|
||||
case $ac_cv_sizeof_long_long in
|
||||
8*) xerces_cv_type_s64bit_int="long long"
|
||||
xerces_cv_sizeof_int64=8
|
||||
;;
|
||||
*)
|
||||
case $ac_cv_sizeof___int64 in
|
||||
8*) xerces_cv_type_s64bit_int="__int64"
|
||||
xerces_cv_sizeof_int64=8
|
||||
;;
|
||||
*) xerces_cv_type_s64bit_int=$xerces_cv_type_s32bit_int
|
||||
xerces_cv_sizeof_int64=4
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
])
|
||||
])
|
||||
|
||||
#
|
||||
# Select an unsigned 64 bit integer type
|
||||
#
|
||||
AC_CACHE_CHECK([for an appropriate unsigned 64 bit integer type], [xerces_cv_type_u64bit_int], [
|
||||
AS_IF([test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_uint64_t = xyes],
|
||||
[xerces_cv_type_u64bit_int=uint64_t],
|
||||
[
|
||||
case $ac_cv_sizeof_int in
|
||||
8*) xerces_cv_type_u64bit_int="unsigned int";;
|
||||
*)
|
||||
case $ac_cv_sizeof_long in
|
||||
8*) xerces_cv_type_u64bit_int="unsigned long";;
|
||||
*)
|
||||
case $ac_cv_sizeof_long_long in
|
||||
8*) xerces_cv_type_u64bit_int="unsigned long long";;
|
||||
*)
|
||||
case $ac_cv_sizeof___int64 in
|
||||
8*) xerces_cv_type_u64bit_int="unsigned __int64";;
|
||||
*) xerces_cv_type_u64bit_int=$xerces_cv_type_u32bit_int;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED([XERCES_S16BIT_INT], $xerces_cv_type_s16bit_int, [An appropriate signed 16 bit integer type])
|
||||
AC_DEFINE_UNQUOTED([XERCES_U16BIT_INT], $xerces_cv_type_u16bit_int, [An appropriate unsigned 16 bit integer type])
|
||||
AC_DEFINE_UNQUOTED([XERCES_S32BIT_INT], $xerces_cv_type_s32bit_int, [An appropriate signed 32 bit integer type])
|
||||
AC_DEFINE_UNQUOTED([XERCES_U32BIT_INT], $xerces_cv_type_u32bit_int, [An appropriate unsigned 32 bit integer type])
|
||||
AC_DEFINE_UNQUOTED([XERCES_S64BIT_INT], $xerces_cv_type_s64bit_int, [An appropriate signed 64 bit integer type])
|
||||
AC_DEFINE_UNQUOTED([XERCES_U64BIT_INT], $xerces_cv_type_u64bit_int, [An appropriate unsigned 64 bit integer type])
|
||||
|
||||
AC_DEFINE_UNQUOTED([XERCES_SIZEOF_INT], $ac_cv_sizeof_int, [Size of the int type as returned by sizeof])
|
||||
AC_DEFINE_UNQUOTED([XERCES_SIZEOF_LONG], $ac_cv_sizeof_long, [Size of the long type as returned by sizeof])
|
||||
AC_DEFINE_UNQUOTED([XERCES_SIZEOF_INT64], $xerces_cv_sizeof_int64, [Size of the presumably int64 type which on lesser platforms can be int32])
|
||||
]
|
||||
)
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
dnl @synopsis XERCES_LINK_DARWIN_FRAMEWORK
|
||||
dnl
|
||||
dnl Adds the specified framework to LIBS if it's not already there.
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-02-20
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_link_darwin_framework.m4 190921 2005-06-16 14:18:12Z jberry $
|
||||
|
||||
AC_DEFUN([XERCES_LINK_DARWIN_FRAMEWORK], [
|
||||
case $host_os in
|
||||
darwin*)
|
||||
test -z "${xerces_darwin_frameworks}" && xerces_darwin_frameworks="-"
|
||||
case ${xerces_darwin_frameworks} in
|
||||
*-$1-*)
|
||||
;;
|
||||
*)
|
||||
xerces_darwin_frameworks="-$1${xerces_darwin_frameworks}"
|
||||
LIBS="-Wl,-framework -Wl,$1 $LIBS"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
Executable
+138
@@ -0,0 +1,138 @@
|
||||
dnl @synopsis XERCES_MSGLOADER_SELECTION
|
||||
dnl
|
||||
dnl Determine which msgloader to use.
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-05-23
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_msgloader_selection.m4 695468 2008-09-15 13:32:32Z borisk $
|
||||
|
||||
AC_DEFUN([XERCES_MSGLOADER_SELECTION],
|
||||
[
|
||||
|
||||
######################################################
|
||||
# Test for availability of each msgloader on this host.
|
||||
# For each msgloader that's available, and hasn't been disabled, add it to our list.
|
||||
# If the msgloader has been explicitly "enable"d, then vote for it strongly,
|
||||
# in upper case.
|
||||
######################################################
|
||||
|
||||
ml_list=
|
||||
|
||||
# Check for inmemory msgloader
|
||||
AC_MSG_CHECKING([whether we support the InMemory MsgLoader])
|
||||
list_add=
|
||||
AS_IF([true], [
|
||||
AC_ARG_ENABLE([msgloader-inmemory],
|
||||
AS_HELP_STRING([--enable-msgloader-inmemory],
|
||||
[Enable InMemory MsgLoader support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=INMEMORY])],
|
||||
[list_add=inmemory])
|
||||
])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[ml_list="$ml_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
# Check for ICU
|
||||
AC_REQUIRE([XERCES_ICU_PREFIX])
|
||||
AC_MSG_CHECKING([whether we support the ICU MsgLoader])
|
||||
list_add=
|
||||
AS_IF([test x"$xerces_cv_icu_prefix" != x -a -x $xerces_cv_icu_prefix/bin/genrb], [
|
||||
AC_ARG_ENABLE([msgloader-icu],
|
||||
AS_HELP_STRING([--enable-msgloader-icu],
|
||||
[Enable ICU-based MsgLoader support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=ICU])],
|
||||
[list_add=icu])
|
||||
])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[ml_list="$ml_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
# Check for iconv support
|
||||
no_iconv=false
|
||||
AC_CHECK_HEADERS([nl_types.h], [], [no_iconv=true])
|
||||
AC_CHECK_FUNCS([catopen catclose catgets], [], [no_iconv=true])
|
||||
AC_MSG_CHECKING([whether we can support the iconv MsgLoader])
|
||||
list_add=
|
||||
AS_IF([! $no_iconv], [
|
||||
AC_ARG_ENABLE([msgloader-iconv],
|
||||
AS_HELP_STRING([--enable-msgloader-iconv],
|
||||
[Enable Iconv-based MsgLoader support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=ICONV])],
|
||||
[list_add=iconv])
|
||||
])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[ml_list="$ml_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
# TODO: Add test for additional msgloaders
|
||||
|
||||
|
||||
######################################################
|
||||
# Determine which msgloader to use.
|
||||
#
|
||||
# We do this in two passes. MsgLoaders that have been enabled with "yes",
|
||||
# and which start out in upper case, get the top priority on the first pass.
|
||||
# On the second pass, we consider those which are simply available, but
|
||||
# which were not "disable"d (these won't even be in our list).
|
||||
######################################################
|
||||
msgloader=
|
||||
az_lower=abcdefghijklmnopqrstuvwxyz
|
||||
az_upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
AC_MSG_CHECKING([for which MsgLoader to use (choices:$ml_list)])
|
||||
for i in 1 2; do
|
||||
# Swap upper/lower case in the ml_list. Cannot use tr ranges
|
||||
# because of the portability issues.
|
||||
#
|
||||
ml_list=`echo $ml_list | tr "$az_lower$az_upper" "$az_upper$az_lower"`
|
||||
|
||||
# Check for each msgloader, in implicit rank order
|
||||
case $ml_list in
|
||||
*-inmemory-*)
|
||||
AC_DEFINE([XERCES_USE_MSGLOADER_INMEMORY], 1, [Define to use the InMemory MsgLoader])
|
||||
msgloader=inmemory
|
||||
break
|
||||
;;
|
||||
|
||||
*-icu-*)
|
||||
AC_DEFINE([XERCES_USE_MSGLOADER_ICU], 1, [Define to use the ICU-based MsgLoader])
|
||||
msgloader=icu
|
||||
LIBS="${LIBS} -L${xerces_cv_icu_prefix}/lib -licuuc -licudata"
|
||||
break
|
||||
;;
|
||||
|
||||
*-iconv-*)
|
||||
AC_DEFINE([XERCES_USE_MSGLOADER_ICONV], 1, [Define to use the iconv-based MsgLoader])
|
||||
msgloader=iconv
|
||||
break
|
||||
;;
|
||||
|
||||
*)
|
||||
AS_IF([test $i -eq 2], [
|
||||
AC_MSG_RESULT([none])
|
||||
AC_MSG_ERROR([Xerces cannot function without a MsgLoader])
|
||||
]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if test x"$msgloader" != x; then
|
||||
AC_MSG_RESULT($msgloader)
|
||||
fi
|
||||
|
||||
# Define the auto-make conditionals which determine what actually gets compiled
|
||||
# Note that these macros can't be executed conditionally, which is why they're here, not above.
|
||||
AM_CONDITIONAL([XERCES_USE_MSGLOADER_ICU], [test x"$msgloader" = xicu])
|
||||
AM_CONDITIONAL([XERCES_USE_MSGLOADER_ICONV], [test x"$msgloader" = xiconv])
|
||||
AM_CONDITIONAL([XERCES_USE_MSGLOADER_INMEMORY], [test x"$msgloader" = xinmemory])
|
||||
|
||||
]
|
||||
)
|
||||
Executable
+71
@@ -0,0 +1,71 @@
|
||||
dnl @synopsis XERCES_MUTEXMGR_SELECTION
|
||||
dnl
|
||||
dnl Determines the which XMLMutexMgr to use
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-05-25
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_mutexmgr_selection.m4 467302 2006-10-24 10:45:35Z amassari $
|
||||
|
||||
AC_DEFUN([XERCES_MUTEXMGR_SELECTION],
|
||||
[
|
||||
AC_REQUIRE([XERCES_NO_THREADS])
|
||||
AC_REQUIRE([ACX_PTHREAD])
|
||||
|
||||
AC_MSG_CHECKING([for which Mutex Manager to use])
|
||||
mutexmgr=
|
||||
|
||||
# If no threads is specified, use the NoThread Mutex Mgr
|
||||
AS_IF([test x$xerces_cv_no_threads = xyes],
|
||||
[
|
||||
mutexmgr=NoThreads
|
||||
AC_DEFINE([XERCES_USE_MUTEXMGR_NOTHREAD], 1, [Define to use the NoThread mutex mgr])
|
||||
])
|
||||
|
||||
# Platform specific checks
|
||||
AS_IF([test -z "$mutexmgr"],
|
||||
[
|
||||
case $host_os in
|
||||
windows* | cygwin* | mingw*)
|
||||
mutexmgr=Windows;
|
||||
AC_DEFINE([XERCES_USE_MUTEXMGR_WINDOWS], 1, [Define to use the Windows mutex mgr])
|
||||
|
||||
case $host_os in
|
||||
mingw*)
|
||||
CXXFLAGS="${CXXFLAGS} -mthreads"
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Fall back to using posix mutex id we can
|
||||
AS_IF([test -z "$mutexmgr" && test x$acx_pthread_ok = xyes],
|
||||
[
|
||||
mutexmgr=POSIX;
|
||||
AC_DEFINE([XERCES_USE_MUTEXMGR_POSIX], 1, [Define to use the POSIX mutex mgr])
|
||||
|
||||
# Set additional flags for link and compile
|
||||
LIBS="${LIBS} ${PTHREAD_LIBS}"
|
||||
CXXFLAGS="${CXXFLAGS} ${PTHREAD_CFLAGS}"
|
||||
])
|
||||
|
||||
# If we still didn't find a mutex package, bail
|
||||
AS_IF([test -z "$mutexmgr"],
|
||||
[AC_MSG_ERROR([Xerces cannot function without mutex support. You may want to --disable-threads.])])
|
||||
|
||||
AC_MSG_RESULT($mutexmgr)
|
||||
|
||||
# Define the auto-make conditionals which determine what actually gets compiled
|
||||
# Note that these macros can't be executed conditionally, which is why they're here, not above.
|
||||
AM_CONDITIONAL([XERCES_USE_MUTEXMGR_NOTHREAD], [test x"$mutexmgr" = xNoThreads])
|
||||
AM_CONDITIONAL([XERCES_USE_MUTEXMGR_POSIX], [test x"$mutexmgr" = xPOSIX])
|
||||
AM_CONDITIONAL([XERCES_USE_MUTEXMGR_WINDOWS], [test x"$mutexmgr" = xWindows])
|
||||
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Executable
+203
@@ -0,0 +1,203 @@
|
||||
dnl @synopsis XERCES_NETACCESSOR_SELECTION
|
||||
dnl
|
||||
dnl Determines the which netaccessor to use
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-05-23
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_netaccessor_selection.m4 697787 2008-09-22 11:55:10Z borisk $
|
||||
|
||||
AC_DEFUN([XERCES_NETACCESSOR_SELECTION],
|
||||
[
|
||||
|
||||
network=yes
|
||||
AC_ARG_ENABLE(
|
||||
[network],
|
||||
AS_HELP_STRING([--disable-network], [Disable network support (enabled by default)]),
|
||||
[AS_IF([test x"$enableval" = xno], [network=no])])
|
||||
|
||||
# If network is disabled we don't need to check any of the
|
||||
# netaccessors.
|
||||
#
|
||||
na_list=
|
||||
|
||||
if test x"$network" = xyes; then
|
||||
|
||||
# Checks for libraries.
|
||||
AC_CHECK_LIB([socket], [socket])
|
||||
AC_CHECK_LIB([nsl], [gethostbyname])
|
||||
|
||||
XERCES_CURL_PREFIX
|
||||
|
||||
######################################################
|
||||
# Test for availability of each netaccessor on this host.
|
||||
# For each netaccessor that's available, and hasn't been disabled, add it to our list.
|
||||
# If the netaccessor has been explicitly "enable"d, then vote for it strongly,
|
||||
# in upper case.
|
||||
######################################################
|
||||
|
||||
AC_REQUIRE([XERCES_CURL_PREFIX])
|
||||
AC_MSG_CHECKING([whether we can support the libcurl-based NetAccessor])
|
||||
list_add=
|
||||
AS_IF([test x"$xerces_cv_curl_prefix" != x], [
|
||||
AC_ARG_ENABLE([netaccessor-curl],
|
||||
AS_HELP_STRING([--enable-netaccessor-curl],
|
||||
[Enable libcurl-based NetAccessor support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=CURL])],
|
||||
[list_add=curl])
|
||||
])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[na_list="$na_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether we can support the sockets-based NetAccessor])
|
||||
list_add=
|
||||
AS_IF([test x"$ac_cv_header_sys_socket_h" = xyes],
|
||||
[AC_ARG_ENABLE([netaccessor-socket],
|
||||
AS_HELP_STRING([--enable-netaccessor-socket],
|
||||
[Enable sockets-based NetAccessor support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=SOCKET])],
|
||||
[list_add=socket])
|
||||
])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[na_list="$na_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
# Check for OS-specific transcoders
|
||||
case $host_os in
|
||||
darwin*)
|
||||
list_add=
|
||||
AC_MSG_CHECKING([whether we can support the CFURL NetAccessor (Mac OS X)])
|
||||
AS_IF([test x"$ac_cv_header_CoreServices_CoreServices_h" = xyes], [
|
||||
AC_ARG_ENABLE([netaccessor-cfurl],
|
||||
AS_HELP_STRING([--enable-netaccessor-cfurl],
|
||||
[Enable cfurl-based NetAccessor support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=CFURL])],
|
||||
[list_add=cfurl])
|
||||
]
|
||||
)
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[na_list="$na_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
windows* | mingw*)
|
||||
list_add=
|
||||
no_winsock=false
|
||||
AC_CHECK_HEADERS([winsock2.h], [], [no_winsock=true])
|
||||
AC_MSG_CHECKING([whether we can support the WinSock NetAccessor (Windows)])
|
||||
AS_IF([! $no_winsock], [
|
||||
AC_ARG_ENABLE([netaccessor-winsock],
|
||||
AS_HELP_STRING([--enable-netaccessor-winsock],
|
||||
[Enable winsock-based NetAccessor support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=WINSOCK])],
|
||||
[list_add=winsock])
|
||||
])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[na_list="$na_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
cygwin*)
|
||||
# Only add it to the list if the user explicitly asked
|
||||
# for it.
|
||||
#
|
||||
list_add=
|
||||
no_winsock=false
|
||||
AC_CHECK_HEADERS([winsock2.h], [], [no_winsock=true])
|
||||
AC_MSG_CHECKING([whether to use the WinSock NetAccessor (Windows)])
|
||||
AS_IF([! $no_winsock], [
|
||||
AC_ARG_ENABLE([netaccessor-winsock],
|
||||
AS_HELP_STRING([--enable-netaccessor-winsock],
|
||||
[Enable winsock-based NetAccessor support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=WINSOCK])])
|
||||
])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[na_list="$na_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
######################################################
|
||||
# Determine which netaccessor to use.
|
||||
#
|
||||
# We do this in two passes. Accessors that have been enabled with "yes",
|
||||
# and which start out in upper case, get the top priority on the first pass.
|
||||
# On the second pass, we consider those which are simply available, but
|
||||
# which were not "disable"d (these won't even be in our list).
|
||||
######################################################
|
||||
netaccessor=
|
||||
az_lower=abcdefghijklmnopqrstuvwxyz
|
||||
az_upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
AC_MSG_CHECKING([for which NetAccessor to use (choices:$na_list)])
|
||||
for i in 1 2; do
|
||||
# Swap upper/lower case in the na_list. Cannot use tr ranges
|
||||
# because of the portability issues.
|
||||
#
|
||||
na_list=`echo $na_list | tr "$az_lower$az_upper" "$az_upper$az_lower"`
|
||||
|
||||
# Check for each netaccessor, in implicit rank order
|
||||
case $na_list in
|
||||
*-curl-*)
|
||||
netaccessor=curl
|
||||
AC_DEFINE([XERCES_USE_NETACCESSOR_CURL], 1, [Define to use the CURL NetAccessor])
|
||||
LIBS="${LIBS} -L${xerces_cv_curl_prefix}/lib -lcurl"
|
||||
break
|
||||
;;
|
||||
|
||||
*-winsock-*)
|
||||
netaccessor=winsock
|
||||
AC_DEFINE([XERCES_USE_NETACCESSOR_WINSOCK], 1, [Define to use the WinSock NetAccessor])
|
||||
break
|
||||
;;
|
||||
|
||||
*-socket-*)
|
||||
netaccessor=socket
|
||||
AC_DEFINE([XERCES_USE_NETACCESSOR_SOCKET], 1, [Define to use the Sockets-based NetAccessor])
|
||||
break
|
||||
;;
|
||||
|
||||
*-cfurl-*)
|
||||
netaccessor=cfurl
|
||||
AC_DEFINE([XERCES_USE_NETACCESSOR_CFURL], 1, [Define to use the Mac OS X CFURL NetAccessor])
|
||||
XERCES_LINK_DARWIN_FRAMEWORK([CoreServices])
|
||||
break
|
||||
;;
|
||||
*)
|
||||
AS_IF([test $i -eq 2], [
|
||||
AC_MSG_RESULT([none available; there will be no network access!!!])
|
||||
]
|
||||
)
|
||||
;;
|
||||
|
||||
esac
|
||||
done
|
||||
|
||||
if test x"$netaccessor" != x; then
|
||||
AC_MSG_RESULT($netaccessor)
|
||||
fi
|
||||
|
||||
else # network
|
||||
netaccessor=disabled # for the report
|
||||
fi
|
||||
|
||||
# Define the auto-make conditionals which determine what actually gets compiled
|
||||
# Note that these macros can't be executed conditionally, which is why they're here, not above.
|
||||
AM_CONDITIONAL([XERCES_USE_NETACCESSOR_CURL], [test x"$netaccessor" = xcurl])
|
||||
AM_CONDITIONAL([XERCES_USE_NETACCESSOR_CFURL], [test x"$netaccessor" = xcfurl])
|
||||
AM_CONDITIONAL([XERCES_USE_NETACCESSOR_WINSOCK], [test x"$netaccessor" = xwinsock])
|
||||
AM_CONDITIONAL([XERCES_USE_NETACCESSOR_SOCKET], [test x"$netaccessor" = xsocket])
|
||||
|
||||
]
|
||||
)
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
dnl @synopsis XERCES_NO_THREADS
|
||||
dnl
|
||||
dnl Determines the whether we've been configured for no threads,
|
||||
dnl or whether threads are not used for some other reason.
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-05-23
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_no_threads.m4 678145 2008-07-19 12:10:43Z borisk $
|
||||
|
||||
AC_DEFUN([XERCES_NO_THREADS],
|
||||
[
|
||||
AC_ARG_ENABLE([threads],
|
||||
AS_HELP_STRING([--disable-threads],
|
||||
[Disable threads (enabled by default)]),
|
||||
[AS_IF([test x"$enableval" = xno],
|
||||
[xerces_cv_no_threads=yes])],
|
||||
[xerces_cv_no_threads=no])
|
||||
AS_IF([test x$xerces_cv_no_threads = xyes],
|
||||
[AC_DEFINE([APP_NO_THREADS], 1, [Define to specify no threading is used])])
|
||||
]
|
||||
)
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
dnl @synopsis XERCES_PATH_DELIMITERS
|
||||
dnl
|
||||
dnl Configures the path delimiter characters.
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-06-07
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_path_delimiters.m4 676848 2008-07-15 09:22:54Z borisk $
|
||||
|
||||
AC_DEFUN([XERCES_PATH_DELIMITERS],
|
||||
[
|
||||
AC_MSG_CHECKING([for which path delimiter characters to accept])
|
||||
|
||||
dnl We accept / in all cases.
|
||||
path_delims=/
|
||||
|
||||
case $host_os in
|
||||
msdos* | windows* | mingw*)
|
||||
AC_DEFINE([XERCES_PATH_DELIMITER_BACKSLASH], 1, [Define to use backslash as an extra path delimiter character])
|
||||
path_delims="${path_delims}\\"
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_MSG_RESULT($path_delims)
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
dnl @synopsis XERCES_PRETTY_MAKE
|
||||
dnl
|
||||
dnl Determines the whether we're doing a pretty make
|
||||
dnl --enable-pretty-make=yes is the default
|
||||
dnl
|
||||
dnl @category Xerces
|
||||
dnl @author Axel Weiss and James Berry
|
||||
dnl @version 2005-05-27
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_pretty_make.m4 678145 2008-07-19 12:10:43Z borisk $
|
||||
|
||||
AC_DEFUN([XERCES_PRETTY_MAKE],
|
||||
[
|
||||
AC_MSG_CHECKING([whether we'll generate prettier make output])
|
||||
AC_ARG_ENABLE([pretty-make],
|
||||
AS_HELP_STRING([--disable-pretty-make],
|
||||
[Disable prettier make output (enabled by default)]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[xerces_pretty_make=yes],
|
||||
[xerces_pretty_make=no])],
|
||||
[xerces_pretty_make=yes])
|
||||
AC_MSG_RESULT([$xerces_pretty_make])
|
||||
|
||||
# Define the auto-make conditionals which determine what actually gets compiled
|
||||
# Note that these macros can't be executed conditionally, which is why they're here, not above.
|
||||
AM_CONDITIONAL([XERCES_PRETTY_MAKE], [test x"$xerces_pretty_make" = xyes])
|
||||
|
||||
]
|
||||
)
|
||||
Executable
+206
@@ -0,0 +1,206 @@
|
||||
dnl @synopsis XERCES_TRANSCODER_SELECTION
|
||||
dnl
|
||||
dnl Determines the which transcoder to use
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author James Berry
|
||||
dnl @version 2005-05-23
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl $Id: xerces_transcoder_selection.m4 697787 2008-09-22 11:55:10Z borisk $
|
||||
|
||||
AC_DEFUN([XERCES_TRANSCODER_SELECTION],
|
||||
[
|
||||
|
||||
######################################################
|
||||
# Test for availability of each transcoder on this host.
|
||||
# For each transcoder that's available, and hasn't been disabled, add it to our list.
|
||||
# If the transcoder has been explicitly "enable"d, then vote for it strongly,
|
||||
# in upper case.
|
||||
######################################################
|
||||
|
||||
tc_list=
|
||||
|
||||
# Check for GNU iconv support
|
||||
no_GNUiconv=false
|
||||
AC_CHECK_HEADERS([iconv.h wchar.h string.h stdlib.h stdio.h ctype.h locale.h errno.h endian.h], [], [no_GNUiconv=true])
|
||||
AC_CHECK_FUNCS([iconv_open iconv_close iconv], [], [no_GNUiconv=true])
|
||||
AC_MSG_CHECKING([whether we can support the GNU iconv Transcoder])
|
||||
list_add=
|
||||
AS_IF([! $no_GNUiconv], [
|
||||
AC_ARG_ENABLE([transcoder-gnuiconv],
|
||||
AS_HELP_STRING([--enable-transcoder-gnuiconv],
|
||||
[Enable GNU iconv-based transcoder support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=GNUICONV])],
|
||||
[list_add=gnuiconv])
|
||||
])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[tc_list="$tc_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
# Check for iconv support
|
||||
no_iconv=false
|
||||
AC_CHECK_HEADERS([wchar.h], [], [no_iconv=true])
|
||||
AC_CHECK_FUNCS([mblen wcstombs mbstowcs], [], [no_iconv=true])
|
||||
AC_MSG_CHECKING([whether we can support the iconv Transcoder])
|
||||
list_add=
|
||||
AS_IF([! $no_iconv], [
|
||||
AC_ARG_ENABLE([transcoder-iconv],
|
||||
AS_HELP_STRING([--enable-transcoder-iconv],
|
||||
[Enable iconv-based transcoder support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=ICONV])],
|
||||
[list_add=iconv])
|
||||
])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[tc_list="$tc_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
# Check for ICU
|
||||
AC_REQUIRE([XERCES_ICU_PREFIX])
|
||||
AC_MSG_CHECKING([whether we can support the ICU Transcoder])
|
||||
list_add=
|
||||
AS_IF([test x"$xerces_cv_icu_prefix" != x], [
|
||||
AC_ARG_ENABLE([transcoder-icu],
|
||||
AS_HELP_STRING([--enable-transcoder-icu],
|
||||
[Enable icu-based transcoder support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=ICU])],
|
||||
[list_add=icu])
|
||||
])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[tc_list="$tc_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
|
||||
# Check for platform-specific transcoders
|
||||
list_add=
|
||||
case $host_os in
|
||||
darwin*)
|
||||
AC_MSG_CHECKING([whether we can support the MacOSUnicodeConverter Transcoder])
|
||||
AS_IF([test x"$ac_cv_header_CoreServices_CoreServices_h" = xyes], [
|
||||
AC_ARG_ENABLE([transcoder-macosunicodeconverter],
|
||||
AS_HELP_STRING([--enable-transcoder-macosunicodeconverter],
|
||||
[Enable MacOSUnicodeConverter-based transcoder support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=MACOSUNICODECONVERTER])],
|
||||
[list_add=macosunicodeconverter])
|
||||
])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[tc_list="$tc_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
windows* | mingw*)
|
||||
AC_MSG_CHECKING([whether we can support the Windows Transcoder])
|
||||
AC_ARG_ENABLE([transcoder-windows],
|
||||
AS_HELP_STRING([--enable-transcoder-windows],
|
||||
[Enable Windows-based transcoder support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=WINDOWS])],
|
||||
[list_add=windows])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[tc_list="$tc_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
cygwin*)
|
||||
# Only add it to the list if the user explicitly asked
|
||||
# for it.
|
||||
#
|
||||
AC_MSG_CHECKING([whether to use the Windows Transcoder])
|
||||
AC_ARG_ENABLE([transcoder-windows],
|
||||
AS_HELP_STRING([--enable-transcoder-windows],
|
||||
[Enable Windows-based transcoder support]),
|
||||
[AS_IF([test x"$enableval" = xyes],
|
||||
[list_add=WINDOWS])])
|
||||
AS_IF([test x"$list_add" != x],
|
||||
[tc_list="$tc_list -$list_add-"; AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
# TODO: Tests for additional transcoders
|
||||
|
||||
######################################################
|
||||
# Determine which transcoder to use.
|
||||
#
|
||||
# We do this in two passes. Transcoders that have been enabled with "yes",
|
||||
# and which start out in upper case, get the top priority on the first pass.
|
||||
# On the second pass, we consider those which are simply available, but
|
||||
# which were not "disable"d (these won't even be in our list).
|
||||
######################################################
|
||||
transcoder=
|
||||
az_lower=abcdefghijklmnopqrstuvwxyz
|
||||
az_upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
AC_MSG_CHECKING([for which Transcoder to use (choices:$tc_list)])
|
||||
for i in 1 2; do
|
||||
# Swap upper/lower case in the tc_list. Cannot use tr ranges
|
||||
# because of the portability issues.
|
||||
#
|
||||
tc_list=`echo $tc_list | tr "$az_lower$az_upper" "$az_upper$az_lower"`
|
||||
|
||||
# Check for each transcoder, in implicit rank order
|
||||
case $tc_list in
|
||||
|
||||
*-icu-*)
|
||||
transcoder=icu
|
||||
AC_DEFINE([XERCES_USE_TRANSCODER_ICU], 1, [Define to use the ICU-based transcoder])
|
||||
AC_SUBST([ICU_CXXFLAGS], [-I$xerces_cv_icu_prefix/include])
|
||||
LIBS="${LIBS} -L${xerces_cv_icu_prefix}/lib -licuuc -licudata"
|
||||
break
|
||||
;;
|
||||
|
||||
*-macosunicodeconverter-*)
|
||||
transcoder=macosunicodeconverter
|
||||
AC_DEFINE([XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER], 1, [Define to use the Mac OS UnicodeConverter-based transcoder])
|
||||
XERCES_LINK_DARWIN_FRAMEWORK([CoreServices])
|
||||
break
|
||||
;;
|
||||
|
||||
*-gnuiconv-*)
|
||||
transcoder=gnuiconv
|
||||
AC_DEFINE([XERCES_USE_TRANSCODER_GNUICONV], 1, [Define to use the GNU iconv transcoder])
|
||||
break
|
||||
;;
|
||||
|
||||
*-windows-*)
|
||||
transcoder=windows
|
||||
AC_DEFINE([XERCES_USE_TRANSCODER_WINDOWS], 1, [Define to use the Windows transcoder])
|
||||
break
|
||||
;;
|
||||
|
||||
*-iconv-*)
|
||||
transcoder=iconv
|
||||
AC_DEFINE([XERCES_USE_TRANSCODER_ICONV], 1, [Define to use the iconv transcoder])
|
||||
break
|
||||
;;
|
||||
|
||||
*)
|
||||
AS_IF([test $i -eq 2], [
|
||||
AC_MSG_RESULT([none])
|
||||
AC_MSG_ERROR([Xerces cannot function without a transcoder])
|
||||
]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if test x"$transcoder" != x; then
|
||||
AC_MSG_RESULT($transcoder)
|
||||
fi
|
||||
|
||||
# Define the auto-make conditionals which determine what actually gets compiled
|
||||
# Note that these macros can't be executed conditionally, which is why they're here, not above.
|
||||
AM_CONDITIONAL([XERCES_USE_TRANSCODER_ICU], [test x"$transcoder" = xicu])
|
||||
AM_CONDITIONAL([XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER], [test x"$transcoder" = xmacosunicodeconverter])
|
||||
AM_CONDITIONAL([XERCES_USE_TRANSCODER_GNUICONV], [test x"$transcoder" = xgnuiconv])
|
||||
AM_CONDITIONAL([XERCES_USE_TRANSCODER_ICONV], [test x"$transcoder" = xiconv])
|
||||
AM_CONDITIONAL([XERCES_USE_TRANSCODER_WINDOWS], [test x"$transcoder" = xwindows])
|
||||
|
||||
]
|
||||
)
|
||||
Reference in New Issue
Block a user