---
extatica/ChangeLog | 4 +
extatica/config/boost.m4 | 437 ++++++++++++++++++++++++++++++++++-----------
2 files changed, 334 insertions(+), 107 deletions(-)
diff --git a/extatica/ChangeLog b/extatica/ChangeLog
index 64ec7e0..6e2abcc 100644
--- a/extatica/ChangeLog
+++ b/extatica/ChangeLog
@@ -1,5 +1,9 @@
2010-11-02 Roland Levillain <roland(a)lrde.epita.fr>
+ * config/boost.m4: Update to upstream version.
+
+2010-11-02 Roland Levillain <roland(a)lrde.epita.fr>
+
* configure.ac: Disable `-Werror' in DYN_CXX_WARNINGS.
2010-04-29 Roland Levillain <roland(a)lrde.epita.fr>
diff --git a/extatica/config/boost.m4 b/extatica/config/boost.m4
index b396249..ee3013f 100644
--- a/extatica/config/boost.m4
+++ b/extatica/config/boost.m4
@@ -1,11 +1,18 @@
# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
-# Copyright (C) 2007 Benoit Sigoure <tsuna(a)lrde.epita.fr>
+# Copyright (C) 2007, 2008, 2009 Benoit Sigoure <tsuna(a)lrde.epita.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -14,10 +21,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# serial 6
-# Original sources can be found at http://repo.or.cz/w/boost.m4.git
+m4_define([_BOOST_SERIAL], [m4_translit([
+# serial 12
+], [#
+], [])])
+
+# Original sources can be found at http://github.com/tsuna/boost.m4
# You can fetch the latest version of the script by doing:
-# wget 'http://repo.or.cz/w/boost.m4.git?a=blob_plain;f=build-aux/boost.m4;hb=HEAD' -O boost.m4
+# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
# ------ #
# README #
@@ -28,99 +39,138 @@
# find the Boost headers of a given (optional) minimum version and it will
# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to
# your configure so that users can specify non standard locations.
-# For more README and documentation, go to http://repo.or.cz/w/boost.m4.git
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
+# For more README and documentation, go to http://github.com/tsuna/boost.m4
# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry,
# simply read the README, it will show you what to do step by step.
m4_pattern_forbid([^_?BOOST_])
-# BOOST_REQUIRE([VERSION])
-# ------------------------
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+# PATTERN is *not* overquoted, as in AC_EGREP_CPP. It could be useful
+# to turn this into a macro which extracts the value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+dnl Beware of Windows end-of-lines, for instance if we are running
+dnl some Windows programs under Wine. In that case, boost/version.hpp
+dnl is certainly using "\r\n", but the regular Unix shell will only
+dnl strip `\n' with backquotes, not the `\r'. This results in
+dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+dnl everything else.
+dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ tr -d '\r' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+rm -rf conftest*
+])# AC_EGREP_CPP
+
+
+
+# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------
# Look for Boost. If version is given, it must either be a literal of the form
# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
# variable "$var".
# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with
# the required version, it does not check for any of the Boost libraries.
-# FIXME: Add a 2nd optional argument so that it's not fatal if Boost isn't found
-# and add an AC_DEFINE to tell whether HAVE_BOOST.
+# On # success, defines HAVE_BOOST. On failure, calls the optional
+# ACTION-IF-NOT-FOUND action if one was supplied.
+# Otherwise aborts with an error message.
AC_DEFUN([BOOST_REQUIRE],
-[dnl First find out what kind of argument we have.
-dnl If we have an empty argument, there is no constraint on the version of
-dnl Boost to use. If it's a literal version number, we can split it in M4 (so
-dnl the resulting configure script will be smaller/faster). Otherwise we do
-dnl the splitting at runtime.
-m4_bmatch([$1],
- [^ *$], [m4_pushdef([BOOST_VERSION_REQ], [])dnl
- boost_version_major=0
- boost_version_minor=0
- boost_version_subminor=0
-],
- [^[0-9]+\([-._][0-9]+\)*$],
- [m4_pushdef([BOOST_VERSION_REQ], [ version >= $1])dnl
- boost_version_major=m4_bregexp([$1], [^\([0-9]+\)], [\1])
- boost_version_minor=m4_bregexp([$1], [^[0-9]+[-._]\([0-9]+\)], [\1])
- boost_version_subminor=m4_bregexp([$1], [^[0-9]+[-._][0-9]+[-._]\([0-9]+\)], [\1])
-],
- [^\$[a-zA-Z_]+$],
- [m4_pushdef([BOOST_VERSION_REQ], [])dnl
- boost_version_major=`expr "X$1" : 'X\([[^-._]]*\)'`
- boost_version_minor=`expr "X$1" : 'X[[0-9]]*[[-._]]\([[^-._]]*\)'`
- boost_version_subminor=`expr "X$1" : 'X[[0-9]]*[[-._]][[0-9]]*[[-._]]\([[0-9]]*\)'`
- case $boost_version_major:$boost_version_minor in #(
- *: | :* | *[[^0-9]]*:* | *:*[[^0-9]]*)
- AC_MSG_ERROR([[Invalid argument for REQUIRE_BOOST: `$1']])
- ;;
- esac
-],
- [m4_fatal(Invalid argument: `$1')]
-)dnl
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_PROG_GREP])dnl
+echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
+boost_save_IFS=$IFS
+boost_version_req=$1
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
AC_ARG_WITH([boost],
[AS_HELP_STRING([--with-boost=DIR],
- [prefix of Boost]BOOST_VERSION_REQ[ @<:@guess@:>@])])dnl
+ [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+ with_boost=$BOOST_ROOT
+ else
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+ fi
+fi
AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])
- AC_CACHE_CHECK([for Boost headers[]BOOST_VERSION_REQ],
+boost_save_CPPFLAGS=$CPPFLAGS
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req],
[boost_cv_inc_path],
[boost_cv_inc_path=no
AC_LANG_PUSH([C++])dnl
- boost_subminor_chk=
- test x"$boost_version_subminor" != x \
- && boost_subminor_chk="|| (B_V_MAJ == $boost_version_major \
-&& B_V_MIN == $boost_version_minor \
-&& B_V_SUB < $boost_version_subminor)"
- for boost_dir in "$with_boost/include" '' \
- /opt/local/include /usr/local/include /opt/include /usr/include \
- "$with_boost" C:/Boost/include
+m4_pattern_allow([^BOOST_VERSION$])dnl
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+]])])
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
do
# Without --layout=system, Boost (or at least some versions) installs
# itself in <prefix>/include/boost-<version>. This inner loop helps to
# find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
# I didn't indent this loop on purpose (to avoid over-indented code)
- for boost_inc in "$boost_dir" "$boost_dir"/boost-*
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
do
- # $boost_inc can often be a symlink, so keep -e here.
- test -e "$boost_inc" || continue
- # Ensure that version.hpp exists: we're going to read it. Moreover,
- # Boost could be reachable thanks to the default include path so we can
- # mistakenly accept a wrong include path without this check.
- test -e "$boost_inc/boost/version.hpp" || continue
- boost_save_CPPFLAGS=$CPPFLAGS
- test x"$boost_inc" != x && CPPFLAGS="$CPPFLAGS -I$boost_inc"
-m4_pattern_allow([^BOOST_VERSION$])dnl
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/version.hpp>
-#ifndef BOOST_VERSION
-# error BOOST_VERSION is not defined
-#endif
-#define B_V_MAJ (BOOST_VERSION / 100000)
-#define B_V_MIN (BOOST_VERSION / 100 % 1000)
-#define B_V_SUB (BOOST_VERSION % 100)
-#if (B_V_MAJ < $boost_version_major) \
- || (B_V_MAJ == $boost_version_major \
- && B_V_MIN < $boost_version_minor) $boost_subminor_chk
-# error Boost headers version < $1
-#endif
-]])], [boost_cv_inc_path=yes], [boost_cv_version=no])
- CPPFLAGS=$boost_save_CPPFLAGS
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
if test x"$boost_cv_inc_path" = xyes; then
if test x"$boost_inc" != x; then
boost_cv_inc_path=$boost_inc
@@ -133,28 +183,49 @@ AC_LANG_POP([C++])dnl
])
case $boost_cv_inc_path in #(
no)
- AC_MSG_ERROR([Could not find Boost headers[]BOOST_VERSION_REQ])
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req"
+ m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])],
+ [AC_MSG_NOTICE([$boost_errmsg])])
+ $2
;;#(
yes)
BOOST_CPPFLAGS=
;;#(
*)
- BOOST_CPPFLAGS="-I$boost_cv_inc_path"
+ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])
;;
esac
-AC_SUBST([BOOST_CPPFLAGS])dnl
+ if test x"$boost_cv_inc_path" != xno; then
+ AC_DEFINE([HAVE_BOOST], [1],
+ [Defined if the requested minimum BOOST version is satisfied])
AC_CACHE_CHECK([for Boost's header version],
[boost_cv_lib_version],
[m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
- boost_cv_lib_version=unknown
- boost_sed_version='/^.*BOOST_LIB_VERSION.*"\([[^"]]*\)".*$/!d;s//\1/'
- boost_version_hpp="$boost_inc/boost/version.hpp"
- test -e "$boost_version_hpp" \
- && boost_cv_lib_version=`sed "$boost_sed_version" "$boost_version_hpp"`
- ])
-m4_popdef([BOOST_VERSION_REQ])dnl
+ _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;g;}],
+ [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ case $boost_major_version in #(
+ '' | *[[!0-9]]*)
+ AC_MSG_ERROR([invalid value: boost_major_version=$boost_major_version])
+ ;;
+ esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
])# BOOST_REQUIRE
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+ [AC_ARG_ENABLE([static-boost],
+ [AC_HELP_STRING([--enable-static-boost],
+ [Prefer the static boost libraries over the shared ones [no]])],
+ [enable_static_boost=yes],
+ [enable_static_boost=no])])# BOOST_STATIC
# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
# --------------------------------------------------------------------------
@@ -162,13 +233,19 @@ m4_popdef([BOOST_VERSION_REQ])dnl
# some parts of the Boost library which are only made of headers and don't
# require linking (such as Boost.Foreach).
#
-# Default ACTION-IF-NOT-FOUND: Fail with a fatal error.
+# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
+# found in the first place, in which case by default a notice is issued to the
+# user. Presumably if we haven't died already it's because it's OK to not have
+# Boost, which is why only a notice is issued instead of a hard error.
#
# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
# case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
# HAVE_BOOST_FOREACH_HPP).
AC_DEFUN([BOOST_FIND_HEADER],
[AC_REQUIRE([BOOST_REQUIRE])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
+else
AC_LANG_PUSH([C++])dnl
boost_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
@@ -178,6 +255,7 @@ AC_CHECK_HEADER([$1],
[m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
CPPFLAGS=$boost_save_CPPFLAGS
AC_LANG_POP([C++])dnl
+fi
])# BOOST_FIND_HEADER
@@ -203,9 +281,14 @@ AC_LANG_POP([C++])dnl
# ... If you want to make sure you have a specific version of Boost
# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
AC_DEFUN([BOOST_FIND_LIB],
-[AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
-AC_REQUIRE([BOOST_REQUIRE])dnl
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
+else
+dnl The else branch is huge and wasn't intended on purpose.
AC_LANG_PUSH([C++])dnl
AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
@@ -227,10 +310,18 @@ AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #(
*) boost_mt=; boost_rtopt=$2;;
esac
- # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
case $boost_rtopt in #(
- *[[a-z0-9A-Z]]*) boost_rtopt="-$boost_rtopt";;
+ *d*) boost_rt_d=$boost_rtopt;; #(
+ *[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ *) boost_rt_d='-d';;
esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
$boost_guess_use_mt && boost_mt=-mt
# Look for the abs path the static archive.
# $libext is computed by Libtool but let's make sure it's non empty.
@@ -258,7 +349,7 @@ dnl empty because the test file is generated only once above (before we
dnl start the for loops).
AC_COMPILE_IFELSE([],
[ac_objext=do_not_rm_me_plz],
- [AC_MSG_ERROR([Cannot compile a test that uses Boost $1])])
+ [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
ac_objext=$boost_save_ac_objext
boost_failed_libs=
# Don't bother to ident the 6 nested for loops, only the 2 innermost ones
@@ -269,9 +360,8 @@ for boost_mt_ in $boost_mt -mt ''; do
for boost_rtopt_ in $boost_rtopt '' -d; do
for boost_lib in \
boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
- boost_$1$boost_tag_$boost_mt_$boost_ver_ \
boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \
- boost_$1$boost_tag_$boost_mt_ \
+ boost_$1$boost_tag_$boost_mt_$boost_ver_ \
boost_$1$boost_tag_$boost_ver_
do
# Avoid testing twice the same lib
@@ -321,7 +411,8 @@ done
rm -f conftest.$ac_objext
])
case $Boost_lib in #(
- no) AC_MSG_ERROR([Could not find the flags to link with Boost $1])
+ no) _AC_MSG_LOG_CONFTEST
+ AC_MSG_ERROR([cannot not find the flags to link with Boost $1])
;;
esac
AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])
@@ -331,6 +422,7 @@ AS_VAR_POPDEF([Boost_lib])dnl
AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
AS_VAR_POPDEF([Boost_lib_LIBS])dnl
AC_LANG_POP([C++])dnl
+fi
])# BOOST_FIND_LIB
@@ -342,6 +434,20 @@ AC_LANG_POP([C++])dnl
# The page http://beta.boost.org/doc/libs is useful: it gives the first release
# version of each library (among other things).
+# BOOST_ARRAY()
+# -------------
+# Look for Boost.Array
+AC_DEFUN([BOOST_ARRAY],
+[BOOST_FIND_HEADER([boost/array.hpp])])
+
+
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+AC_DEFUN([BOOST_ASIO],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
# BOOST_BIND()
# ------------
@@ -372,12 +478,26 @@ AC_DEFUN([BOOST_DATE_TIME],
# BOOST_FILESYSTEM([PREFERRED-RT-OPT])
# ------------------------------------
-# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see the
-# documentation of BOOST_FIND_LIB above.
-# Do not check for boost/filesystem.hpp because this file was introduced in 1.34.
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
AC_DEFUN([BOOST_FILESYSTEM],
-[BOOST_FIND_LIB([filesystem], [$1],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
[boost/filesystem/path.hpp], [boost::filesystem::path p;])
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
])# BOOST_FILESYSTEM
@@ -441,6 +561,40 @@ AC_DEFUN([BOOST_LAMBDA],
[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+# BOOST_MATH()
+# ------------
+# Look for Boost.Math
+# TODO: This library isn't header-only but it comes in multiple different
+# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
+# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
+# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the
+# right thing anyway.
+AC_DEFUN([BOOST_MATH],
+[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
+
+
+# BOOST_MULTIARRAY()
+# ------------------
+# Look for Boost.MultiArray
+AC_DEFUN([BOOST_MULTIARRAY],
+[BOOST_FIND_HEADER([boost/multi_array.hpp])])
+
+
+# BOOST_NUMERIC_CONVERSION()
+# --------------------------
+# Look for Boost.NumericConversion (policy-based numeric conversion)
+AC_DEFUN([BOOST_NUMERIC_CONVERSION],
+[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
+])# BOOST_NUMERIC_CONVERSION
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+AC_DEFUN([BOOST_OPTIONAL],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
# BOOST_PREPROCESSOR()
# --------------------
# Look for Boost.Preprocessor
@@ -509,6 +663,13 @@ BOOST_FIND_HEADER([boost/shared_ptr.hpp])
])
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+AC_DEFUN([BOOST_STATICASSERT],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
# BOOST_STRING_ALGO()
# -------------------
# Look for Boost.StringAlgo
@@ -517,6 +678,18 @@ AC_DEFUN([BOOST_STRING_ALGO],
])
+# BOOST_SYSTEM([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.35.0.
+AC_DEFUN([BOOST_SYSTEM],
+[BOOST_FIND_LIB([system], [$1],
+ [boost/system/error_code.hpp],
+ [boost::system::error_code e; e.clear();])
+])# BOOST_SYSTEM
+
+
# BOOST_TEST([PREFERRED-RT-OPT])
# ------------------------------
# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the
@@ -582,6 +755,13 @@ AC_DEFUN([BOOST_TUPLE],
[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+AC_DEFUN([BOOST_TYPETRAITS],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
# BOOST_UTILITY()
# ---------------
# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
@@ -600,12 +780,33 @@ BOOST_FIND_HEADER([boost/variant.hpp])])
# BOOST_WAVE([PREFERRED-RT-OPT])
# ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREADS first.
# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
# documentation of BOOST_FIND_LIB above.
AC_DEFUN([BOOST_WAVE],
-[BOOST_FIND_LIB([wave], [$1],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS\
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS\
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
[boost/wave.hpp],
- [boost::wave::token_id id; get_token_name(id);])])
+ [boost::wave::token_id id; get_token_name(id);])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+AC_DEFUN([BOOST_XPRESSIVE],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
# ----------------- #
@@ -692,9 +893,11 @@ m4_define([_BOOST_gcc_test],
# build. The Boost build system seems to call this a `tag'.
AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag],
-[AC_LANG_PUSH([C++])dnl
- boost_cv_lib_tag=unknown
+[boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ AC_LANG_PUSH([C++])dnl
# The following tests are mostly inspired by boost/config/auto_link.hpp
# The list is sorted to most recent/common to oldest compiler (in order
# to increase the likelihood of finding the right compiler with the
@@ -708,8 +911,9 @@ AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag]
# como, edg, kcc, bck, mp, sw, tru, xlc
# I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
# the same defines as GCC's).
- # TODO: Move the test on GCC 4.3 up once it's released.
+ # TODO: Move the test on GCC 4.4 up once it's released.
for i in \
+ _BOOST_gcc_test(4, 3) \
_BOOST_gcc_test(4, 2) \
_BOOST_gcc_test(4, 1) \
_BOOST_gcc_test(4, 0) \
@@ -718,7 +922,8 @@ AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag]
|| defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
_BOOST_gcc_test(3, 4) \
_BOOST_gcc_test(3, 3) \
- "defined _MSC_VER && _MSC_VER >= 1400 @ vc80" \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
_BOOST_gcc_test(3, 2) \
"defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
_BOOST_gcc_test(3, 1) \
@@ -727,7 +932,7 @@ AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag]
"defined __ICC && (defined __unix || defined __unix__) @ il" \
"defined __ICL @ iw" \
"defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
- _BOOST_gcc_test(4, 3) \
+ _BOOST_gcc_test(4, 4) \
_BOOST_gcc_test(2, 95) \
"defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
"defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
@@ -745,20 +950,29 @@ AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag]
]])], [boost_cv_lib_tag=$boost_tag; break], [])
done
AC_LANG_POP([C++])dnl
-])
case $boost_cv_lib_tag in #(
# Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
# to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
# We can specify multiple tags in this variable because it's used by
# BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
- boost_cv_lib_tag="$boost_cv_lib_tag -gcc"
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
;; #(
unknown)
AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
boost_cv_lib_tag=
;;
esac
+fi])dnl end of AC_CACHE_CHECK
])# _BOOST_FIND_COMPILER_TAG
@@ -784,11 +998,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# rm -f conftest.$ac_objext in between to really different tests, otherwise
# you will try to link a conftest.o left behind by a previous test.
# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
-# macro)
+# macro).
+#
+# Don't use "break" in the actions, as it would short-circuit some code
+# this macro runs after the actions.
m4_define([_BOOST_AC_LINK_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest$ac_exeext
-boost_ac_ext_save=$ac_ext
+boost_save_ac_ext=$ac_ext
boost_use_source=:
# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
# tries to link the existing object file instead of compiling from source.
@@ -807,9 +1024,15 @@ dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
_AC_MSG_LOG_CONFTEST
fi
$3])
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
dnl as it would interfere with the next link command.
rm -f core conftest.err conftest_ipa8_conftest.oo \
conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:
--
1.5.6.5
* config/libiberty.m4: Remove.
* configure.ac: No longer invoke DYN_LIBIBERTY.
Configure subdirectory libiberty instead.
* src/ansidecl.h,
* src/demangle.h:
Remove these previously imported Libiberty headers.
* src/Makefile.am (libdyn_la_SOURCES): Remove ansidecl.h and
demangle.h.
(libdyn_la_LIBADD): Add $(top_builddir)/libiberty/libiberty.a.
(libiberty_inc): New variable.
(libdyn_la_CPPFLAGS): Add -I$(libiberty_inc).
* Makefile.am (SUBDIRS): Add libiberty.
---
extatica/ChangeLog | 17 +++
extatica/Makefile.am | 2 +-
extatica/config/libiberty.m4 | 36 -----
extatica/configure.ac | 4 +-
extatica/src/Makefile.am | 9 +-
extatica/src/ansidecl.h | 326 ------------------------------------------
extatica/src/demangle.h | 163 ---------------------
7 files changed, 26 insertions(+), 531 deletions(-)
delete mode 100644 extatica/config/libiberty.m4
delete mode 100644 extatica/src/ansidecl.h
delete mode 100644 extatica/src/demangle.h
diff --git a/extatica/ChangeLog b/extatica/ChangeLog
index 7f2f134..0070d55 100644
--- a/extatica/ChangeLog
+++ b/extatica/ChangeLog
@@ -1,5 +1,22 @@
2010-11-02 Roland Levillain <roland(a)lrde.epita.fr>
+ Have Extatica use the embedded GNU Libiberty.
+
+ * config/libiberty.m4: Remove.
+ * configure.ac: No longer invoke DYN_LIBIBERTY.
+ Configure subdirectory libiberty instead.
+ * src/ansidecl.h,
+ * src/demangle.h:
+ Remove these previously imported Libiberty headers.
+ * src/Makefile.am (libdyn_la_SOURCES): Remove ansidecl.h and
+ demangle.h.
+ (libdyn_la_LIBADD): Add $(top_builddir)/libiberty/libiberty.a.
+ (libiberty_inc): New variable.
+ (libdyn_la_CPPFLAGS): Add -I$(libiberty_inc).
+ * Makefile.am (SUBDIRS): Add libiberty.
+
+2010-11-02 Roland Levillain <roland(a)lrde.epita.fr>
+
Tailor GNU Libiberty for Extatica.
* config.guess: New symlink to _config/config.guess.
diff --git a/extatica/Makefile.am b/extatica/Makefile.am
index 5d8880d..aa17de5 100644
--- a/extatica/Makefile.am
+++ b/extatica/Makefile.am
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-SUBDIRS = libltdl libmd5 bin src config data test
+SUBDIRS = libltdl libiberty libmd5 bin src config data test
if SWIG_PYTHON_BINDINGS
SUBDIRS += swig
diff --git a/extatica/config/libiberty.m4 b/extatica/config/libiberty.m4
deleted file mode 100644
index e34d873..0000000
--- a/extatica/config/libiberty.m4
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- Autoconf -*-
-
-# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
-#
-# This file is part of Olena.
-#
-# Olena is free software: you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, version 2 of the License.
-#
-# Olena is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-
-
-# DYN_LIBIBERTY
-# -------------
-# Look for libiberty.
-AC_DEFUN([DYN_LIBIBERTY],
-[AC_LANG_PUSH([C++])dnl
-# Look for cplus_demangle, which is the only function we use from libiberty.
-AC_CHECK_LIB([iberty], [cplus_demangle],,
- [AC_MSG_ERROR([
-Cannot link with libiberty. If the library is installed in an unusual
-path on your system, please run configure with suitable LDFLAGS. For
-instance, if it is installed in /opt/local/lib, use:
-
- configure LDFLAGS="-L/opt/local/lib"
-])])
- LIBS="$LIBS -liberty"
- AC_LANG_POP([C++])dnl
-])
diff --git a/extatica/configure.ac b/extatica/configure.ac
index 6dd3db7..a7766af 100644
--- a/extatica/configure.ac
+++ b/extatica/configure.ac
@@ -92,12 +92,12 @@ AC_SUBST(LIBLTDL)
## Libiberty. ##
## ----------- ##
-DYN_LIBIBERTY
-
# Are we running on Darwin (Mac OS X)? If so, we'll have to deal with
# MacPorts' libiberty's issues w.r.t `environ'.
AM_CONDITIONAL([DARWIN], [echo "$host_os" | grep '^darwin'])
+AC_CONFIG_SUBDIRS([libiberty])
+
## ------ ##
## Boost. ##
## ------ ##
diff --git a/extatica/src/Makefile.am b/extatica/src/Makefile.am
index 1ca9d66..ed6830a 100644
--- a/extatica/src/Makefile.am
+++ b/extatica/src/Makefile.am
@@ -59,8 +59,7 @@ libextatica_la_SOURCES = \
function_loader.hh function_loader.cc \
name_of.hh name_of.cc \
policy.hh policy.cc \
- ruby_stream.hh ruby_stream.cc \
- ansidecl.h demangle.h
+ ruby_stream.hh ruby_stream.cc
nodist_libextatica_la_SOURCES = \
all_methods.hh all_methods.cc \
@@ -83,11 +82,14 @@ libextatica_la_LIBADD = \
$(RUBY_LIBRUBYARG_SHARED) \
$(LIBLTDL) \
$(top_builddir)/libmd5/libmd5.la \
+ $(top_builddir)/libiberty/libiberty.a \
$(BOOST_FILESYSTEM_LIBS)
libextatica_la_DEPENDENCIES = $(LTDLDEPS)
RUBY_topdir = @RUBY_topdir@
+libiberty_inc = $(top_srcdir)/include
+
libextatica_la_CPPFLAGS = \
$(LTDLINCL) \
$(BOOST_CPPFLAGS) \
@@ -95,7 +97,8 @@ libextatica_la_CPPFLAGS = \
-I$(srcdir) \
-I. \
-I$(top_srcdir)/libmd5 \
- -I$(RUBY_topdir)
+ -I$(RUBY_topdir) \
+ -I$(libiberty_inc)
libextatica_la_CXXFLAGS = $(WARNING_CXXFLAGS)
libextatica_la_LDFLAGS = -version-info 0:1:0 $(BOOST_FILESYSTEM_LDFLAGS)
diff --git a/extatica/src/ansidecl.h b/extatica/src/ansidecl.h
deleted file mode 100644
index f8f2d73..0000000
--- a/extatica/src/ansidecl.h
+++ /dev/null
@@ -1,326 +0,0 @@
-/* ANSI and traditional C compatability macros
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* ANSI and traditional C compatibility macros
-
- ANSI C is assumed if __STDC__ is #defined.
-
- Macro ANSI C definition Traditional C definition
- ----- ---- - ---------- ----------- - ----------
- ANSI_PROTOTYPES 1 not defined
- PTR `void *' `char *'
- PTRCONST `void *const' `char *'
- LONG_DOUBLE `long double' `double'
- const not defined `'
- volatile not defined `'
- signed not defined `'
- VA_START(ap, var) va_start(ap, var) va_start(ap)
-
- Note that it is safe to write "void foo();" indicating a function
- with no return value, in all K+R compilers we have been able to test.
-
- For declaring functions with prototypes, we also provide these:
-
- PARAMS ((prototype))
- -- for functions which take a fixed number of arguments. Use this
- when declaring the function. When defining the function, write a
- K+R style argument list. For example:
-
- char *strcpy PARAMS ((char *dest, char *source));
- ...
- char *
- strcpy (dest, source)
- char *dest;
- char *source;
- { ... }
-
-
- VPARAMS ((prototype, ...))
- -- for functions which take a variable number of arguments. Use
- PARAMS to declare the function, VPARAMS to define it. For example:
-
- int printf PARAMS ((const char *format, ...));
- ...
- int
- printf VPARAMS ((const char *format, ...))
- {
- ...
- }
-
- For writing functions which take variable numbers of arguments, we
- also provide the VA_OPEN, VA_CLOSE, and VA_FIXEDARG macros. These
- hide the differences between K+R <varargs.h> and C89 <stdarg.h> more
- thoroughly than the simple VA_START() macro mentioned above.
-
- VA_OPEN and VA_CLOSE are used *instead of* va_start and va_end.
- Immediately after VA_OPEN, put a sequence of VA_FIXEDARG calls
- corresponding to the list of fixed arguments. Then use va_arg
- normally to get the variable arguments, or pass your va_list object
- around. You do not declare the va_list yourself; VA_OPEN does it
- for you.
-
- Here is a complete example:
-
- int
- printf VPARAMS ((const char *format, ...))
- {
- int result;
-
- VA_OPEN (ap, format);
- VA_FIXEDARG (ap, const char *, format);
-
- result = vfprintf (stdout, format, ap);
- VA_CLOSE (ap);
-
- return result;
- }
-
-
- You can declare variables either before or after the VA_OPEN,
- VA_FIXEDARG sequence. Also, VA_OPEN and VA_CLOSE are the beginning
- and end of a block. They must appear at the same nesting level,
- and any variables declared after VA_OPEN go out of scope at
- VA_CLOSE. Unfortunately, with a K+R compiler, that includes the
- argument list. You can have multiple instances of VA_OPEN/VA_CLOSE
- pairs in a single function in case you need to traverse the
- argument list more than once.
-
- For ease of writing code which uses GCC extensions but needs to be
- portable to other compilers, we provide the GCC_VERSION macro that
- simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
- wrappers around __attribute__. Also, __extension__ will be #defined
- to nothing if it doesn't work. See below.
-
- This header also defines a lot of obsolete macros:
- CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID,
- AND, DOTS, NOARGS. Don't use them. */
-
-#ifndef _ANSIDECL_H
-#define _ANSIDECL_H 1
-
-/* Every source file includes this file,
- so they will all get the switch for lint. */
-/* LINTLIBRARY */
-
-/* Using MACRO(x,y) in cpp #if conditionals does not work with some
- older preprocessors. Thus we can't define something like this:
-
-#define HAVE_GCC_VERSION(MAJOR, MINOR) \
- (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
-
-and then test "#if HAVE_GCC_VERSION(2,7)".
-
-So instead we use the macro below and test it against specific values. */
-
-/* This macro simplifies testing whether we are using gcc, and if it
- is of a particular minimum version. (Both major & minor numbers are
- significant.) This macro will evaluate to 0 if we are not using
- gcc at all. */
-#ifndef GCC_VERSION
-#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
-#endif /* GCC_VERSION */
-
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus))
-/* All known AIX compilers implement these things (but don't always
- define __STDC__). The RISC/OS MIPS compiler defines these things
- in SVR4 mode, but does not define __STDC__. */
-/* eraxxon(a)alumni.rice.edu: The Compaq C++ compiler, unlike many other
- C++ compilers, does not define __STDC__, though it acts as if this
- was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
-
-#define ANSI_PROTOTYPES 1
-#define PTR void *
-#define PTRCONST void *const
-#define LONG_DOUBLE long double
-
-#define PARAMS(ARGS) ARGS
-#define VPARAMS(ARGS) ARGS
-#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR)
-
-/* variadic function helper macros */
-/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's
- use without inhibiting further decls and without declaring an
- actual variable. */
-#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy
-#define VA_CLOSE(AP) } va_end(AP); }
-#define VA_FIXEDARG(AP, T, N) struct Qdmy
-
-#undef const
-#undef volatile
-#undef signed
-
-/* inline requires special treatment; it's in C99, and GCC >=2.7 supports
- it too, but it's not in C89. */
-#undef inline
-#if __STDC_VERSION__ > 199901L
-/* it's a keyword */
-#else
-# if GCC_VERSION >= 2007
-# define inline __inline__ /* __inline__ prevents -pedantic warnings */
-# else
-# define inline /* nothing */
-# endif
-#endif
-
-/* These are obsolete. Do not use. */
-#ifndef IN_GCC
-#define CONST const
-#define VOLATILE volatile
-#define SIGNED signed
-
-#define PROTO(type, name, arglist) type name arglist
-#define EXFUN(name, proto) name proto
-#define DEFUN(name, arglist, args) name(args)
-#define DEFUN_VOID(name) name(void)
-#define AND ,
-#define DOTS , ...
-#define NOARGS void
-#endif /* ! IN_GCC */
-
-#else /* Not ANSI C. */
-
-#undef ANSI_PROTOTYPES
-#define PTR char *
-#define PTRCONST PTR
-#define LONG_DOUBLE double
-
-#define PARAMS(args) ()
-#define VPARAMS(args) (va_alist) va_dcl
-#define VA_START(va_list, var) va_start(va_list)
-
-#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP); { struct Qdmy
-#define VA_CLOSE(AP) } va_end(AP); }
-#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE)
-
-/* some systems define these in header files for non-ansi mode */
-#undef const
-#undef volatile
-#undef signed
-#undef inline
-#define const
-#define volatile
-#define signed
-#define inline
-
-#ifndef IN_GCC
-#define CONST
-#define VOLATILE
-#define SIGNED
-
-#define PROTO(type, name, arglist) type name ()
-#define EXFUN(name, proto) name()
-#define DEFUN(name, arglist, args) name arglist args;
-#define DEFUN_VOID(name) name()
-#define AND ;
-#define DOTS
-#define NOARGS
-#endif /* ! IN_GCC */
-
-#endif /* ANSI C. */
-
-/* Define macros for some gcc attributes. This permits us to use the
- macros freely, and know that they will come into play for the
- version of gcc in which they are supported. */
-
-#if (GCC_VERSION < 2007)
-# define __attribute__(x)
-#endif
-
-/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
-#ifndef ATTRIBUTE_MALLOC
-# if (GCC_VERSION >= 2096)
-# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-# else
-# define ATTRIBUTE_MALLOC
-# endif /* GNUC >= 2.96 */
-#endif /* ATTRIBUTE_MALLOC */
-
-/* Attributes on labels were valid as of gcc 2.93. */
-#ifndef ATTRIBUTE_UNUSED_LABEL
-# if (GCC_VERSION >= 2093)
-# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
-# else
-# define ATTRIBUTE_UNUSED_LABEL
-# endif /* GNUC >= 2.93 */
-#endif /* ATTRIBUTE_UNUSED_LABEL */
-
-#ifndef ATTRIBUTE_UNUSED
-#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-#endif /* ATTRIBUTE_UNUSED */
-
-#ifndef ATTRIBUTE_NORETURN
-#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#endif /* ATTRIBUTE_NORETURN */
-
-/* Attribute `nonnull' was valid as of gcc 3.3. */
-#ifndef ATTRIBUTE_NONNULL
-# if (GCC_VERSION >= 3003)
-# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
-# else
-# define ATTRIBUTE_NONNULL(m)
-# endif /* GNUC >= 3.3 */
-#endif /* ATTRIBUTE_NONNULL */
-
-/* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL.
- This was the case for the `printf' format attribute by itself
- before GCC 3.3, but as of 3.3 we need to add the `nonnull'
- attribute to retain this behavior. */
-#ifndef ATTRIBUTE_PRINTF
-#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m)
-#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
-#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
-#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
-#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
-#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
-#endif /* ATTRIBUTE_PRINTF */
-
-/* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A
- NULL format specifier was allowed as of gcc 3.3. */
-#ifndef ATTRIBUTE_NULL_PRINTF
-# if (GCC_VERSION >= 3003)
-# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
-# else
-# define ATTRIBUTE_NULL_PRINTF(m, n)
-# endif /* GNUC >= 3.3 */
-# define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2)
-# define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3)
-# define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4)
-# define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5)
-# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)
-#endif /* ATTRIBUTE_NULL_PRINTF */
-
-/* We use __extension__ in some places to suppress -pedantic warnings
- about GCC extensions. This feature didn't work properly before
- gcc 2.8. */
-#if GCC_VERSION < 2008
-#define __extension__
-#endif
-
-/* Bootstrap support: Adjust certain macros defined by Autoconf,
- which are only valid for the stage1 compiler. If we detect
- a modern version of GCC, we are probably in stage2 or beyond,
- so unconditionally reset the values. Note that const, inline,
- etc. have been dealt with above. */
-#if (GCC_VERSION >= 2007)
-# ifndef HAVE_LONG_DOUBLE
-# define HAVE_LONG_DOUBLE 1
-# endif
-#endif /* GCC >= 2.7 */
-
-#endif /* ansidecl.h */
diff --git a/extatica/src/demangle.h b/extatica/src/demangle.h
deleted file mode 100644
index 21e9dd3..0000000
--- a/extatica/src/demangle.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Defs for interface to demanglers.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002
- Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-
-#if !defined (DEMANGLE_H)
-#define DEMANGLE_H
-
-#include "ansidecl.h"
-
-/* Options passed to cplus_demangle (in 2nd parameter). */
-
-#define DMGL_NO_OPTS 0 /* For readability... */
-#define DMGL_PARAMS (1 << 0) /* Include function args */
-#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
-#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
-#define DMGL_VERBOSE (1 << 3) /* Include implementation details. */
-#define DMGL_TYPES (1 << 4) /* Also try to demangle type encodings. */
-
-#define DMGL_AUTO (1 << 8)
-#define DMGL_GNU (1 << 9)
-#define DMGL_LUCID (1 << 10)
-#define DMGL_ARM (1 << 11)
-#define DMGL_HP (1 << 12) /* For the HP aCC compiler;
- same as ARM except for
- template arguments, etc. */
-#define DMGL_EDG (1 << 13)
-#define DMGL_GNU_V3 (1 << 14)
-#define DMGL_GNAT (1 << 15)
-
-/* If none of these are set, use 'current_demangling_style' as the default. */
-#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT)
-
-/* Enumeration of possible demangling styles.
-
- Lucid and ARM styles are still kept logically distinct, even though
- they now both behave identically. The resulting style is actual the
- union of both. I.E. either style recognizes both "__pt__" and "__rf__"
- for operator "->", even though the first is lucid style and the second
- is ARM style. (FIXME?) */
-
-extern enum demangling_styles
-{
- no_demangling = -1,
- unknown_demangling = 0,
- auto_demangling = DMGL_AUTO,
- gnu_demangling = DMGL_GNU,
- lucid_demangling = DMGL_LUCID,
- arm_demangling = DMGL_ARM,
- hp_demangling = DMGL_HP,
- edg_demangling = DMGL_EDG,
- gnu_v3_demangling = DMGL_GNU_V3,
- java_demangling = DMGL_JAVA,
- gnat_demangling = DMGL_GNAT
-} current_demangling_style;
-
-/* Define string names for the various demangling styles. */
-
-#define NO_DEMANGLING_STYLE_STRING "none"
-#define AUTO_DEMANGLING_STYLE_STRING "auto"
-#define GNU_DEMANGLING_STYLE_STRING "gnu"
-#define LUCID_DEMANGLING_STYLE_STRING "lucid"
-#define ARM_DEMANGLING_STYLE_STRING "arm"
-#define HP_DEMANGLING_STYLE_STRING "hp"
-#define EDG_DEMANGLING_STYLE_STRING "edg"
-#define GNU_V3_DEMANGLING_STYLE_STRING "gnu-v3"
-#define JAVA_DEMANGLING_STYLE_STRING "java"
-#define GNAT_DEMANGLING_STYLE_STRING "gnat"
-
-/* Some macros to test what demangling style is active. */
-
-#define CURRENT_DEMANGLING_STYLE current_demangling_style
-#define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
-#define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
-#define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
-#define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM)
-#define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP)
-#define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
-#define GNU_V3_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU_V3)
-#define JAVA_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA)
-#define GNAT_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT)
-
-/* Provide information about the available demangle styles. This code is
- pulled from gdb into libiberty because it is useful to binutils also. */
-
-extern const struct demangler_engine
-{
- const char *const demangling_style_name;
- const enum demangling_styles demangling_style;
- const char *const demangling_style_doc;
-} libiberty_demanglers[];
-
-extern char *
-cplus_demangle PARAMS ((const char *mangled, int options));
-
-extern int
-cplus_demangle_opname PARAMS ((const char *opname, char *result, int options));
-
-extern const char *
-cplus_mangle_opname PARAMS ((const char *opname, int options));
-
-/* Note: This sets global state. FIXME if you care about multi-threading. */
-
-extern void
-set_cplus_marker_for_demangling PARAMS ((int ch));
-
-extern enum demangling_styles
-cplus_demangle_set_style PARAMS ((enum demangling_styles style));
-
-extern enum demangling_styles
-cplus_demangle_name_to_style PARAMS ((const char *name));
-
-/* V3 ABI demangling entry points, defined in cp-demangle.c. */
-extern char*
-cplus_demangle_v3 PARAMS ((const char* mangled, int options));
-
-extern char*
-java_demangle_v3 PARAMS ((const char* mangled));
-
-
-enum gnu_v3_ctor_kinds {
- gnu_v3_complete_object_ctor = 1,
- gnu_v3_base_object_ctor,
- gnu_v3_complete_object_allocating_ctor
-};
-
-/* Return non-zero iff NAME is the mangled form of a constructor name
- in the G++ V3 ABI demangling style. Specifically, return an `enum
- gnu_v3_ctor_kinds' value indicating what kind of constructor
- it is. */
-extern enum gnu_v3_ctor_kinds
- is_gnu_v3_mangled_ctor PARAMS ((const char *name));
-
-
-enum gnu_v3_dtor_kinds {
- gnu_v3_deleting_dtor = 1,
- gnu_v3_complete_object_dtor,
- gnu_v3_base_object_dtor
-};
-
-/* Return non-zero iff NAME is the mangled form of a destructor name
- in the G++ V3 ABI demangling style. Specifically, return an `enum
- gnu_v3_dtor_kinds' value, indicating what kind of destructor
- it is. */
-extern enum gnu_v3_dtor_kinds
- is_gnu_v3_mangled_dtor PARAMS ((const char *name));
-
-#endif /* DEMANGLE_H */
--
1.5.6.5
* config/libiberty.m4: Remove.
* configure.ac: No longer invoke DYN_LIBIBERTY.
Configure subdirectory libiberty instead.
* src/ansidecl.h,
* src/demangle.h:
Remove these previously imported Libiberty headers.
* src/Makefile.am (libdyn_la_SOURCES): Remove ansidecl.h and
demangle.h.
(libdyn_la_LIBADD): Add $(top_builddir)/libiberty/libiberty.a.
(libiberty_inc): New variable.
(libdyn_la_CPPFLAGS): Add -I$(libiberty_inc).
* Makefile.am (SUBDIRS): Add libiberty.
---
extatica/ChangeLog | 17 +++
extatica/Makefile.am | 2 +-
extatica/config/libiberty.m4 | 36 -----
extatica/configure.ac | 4 +-
extatica/src/Makefile.am | 9 +-
extatica/src/ansidecl.h | 326 ------------------------------------------
extatica/src/demangle.h | 163 ---------------------
7 files changed, 26 insertions(+), 531 deletions(-)
delete mode 100644 extatica/config/libiberty.m4
delete mode 100644 extatica/src/ansidecl.h
delete mode 100644 extatica/src/demangle.h
diff --git a/extatica/ChangeLog b/extatica/ChangeLog
index b96a9e6..f091a1d 100644
--- a/extatica/ChangeLog
+++ b/extatica/ChangeLog
@@ -1,5 +1,22 @@
2010-11-02 Roland Levillain <roland(a)lrde.epita.fr>
+ Have Extatica use the embedded GNU Libiberty.
+
+ * config/libiberty.m4: Remove.
+ * configure.ac: No longer invoke DYN_LIBIBERTY.
+ Configure subdirectory libiberty instead.
+ * src/ansidecl.h,
+ * src/demangle.h:
+ Remove these previously imported Libiberty headers.
+ * src/Makefile.am (libdyn_la_SOURCES): Remove ansidecl.h and
+ demangle.h.
+ (libdyn_la_LIBADD): Add $(top_builddir)/libiberty/libiberty.a.
+ (libiberty_inc): New variable.
+ (libdyn_la_CPPFLAGS): Add -I$(libiberty_inc).
+ * Makefile.am (SUBDIRS): Add libiberty.
+
+2010-11-02 Roland Levillain <roland(a)lrde.epita.fr>
+
Tailor GNU Libiberty for Extatica.
* config.guess: New symlink to _config/config.guess.
diff --git a/extatica/Makefile.am b/extatica/Makefile.am
index 5d8880d..aa17de5 100644
--- a/extatica/Makefile.am
+++ b/extatica/Makefile.am
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-SUBDIRS = libltdl libmd5 bin src config data test
+SUBDIRS = libltdl libiberty libmd5 bin src config data test
if SWIG_PYTHON_BINDINGS
SUBDIRS += swig
diff --git a/extatica/config/libiberty.m4 b/extatica/config/libiberty.m4
deleted file mode 100644
index e34d873..0000000
--- a/extatica/config/libiberty.m4
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- Autoconf -*-
-
-# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
-#
-# This file is part of Olena.
-#
-# Olena is free software: you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, version 2 of the License.
-#
-# Olena is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-
-
-# DYN_LIBIBERTY
-# -------------
-# Look for libiberty.
-AC_DEFUN([DYN_LIBIBERTY],
-[AC_LANG_PUSH([C++])dnl
-# Look for cplus_demangle, which is the only function we use from libiberty.
-AC_CHECK_LIB([iberty], [cplus_demangle],,
- [AC_MSG_ERROR([
-Cannot link with libiberty. If the library is installed in an unusual
-path on your system, please run configure with suitable LDFLAGS. For
-instance, if it is installed in /opt/local/lib, use:
-
- configure LDFLAGS="-L/opt/local/lib"
-])])
- LIBS="$LIBS -liberty"
- AC_LANG_POP([C++])dnl
-])
diff --git a/extatica/configure.ac b/extatica/configure.ac
index 6dd3db7..a7766af 100644
--- a/extatica/configure.ac
+++ b/extatica/configure.ac
@@ -92,12 +92,12 @@ AC_SUBST(LIBLTDL)
## Libiberty. ##
## ----------- ##
-DYN_LIBIBERTY
-
# Are we running on Darwin (Mac OS X)? If so, we'll have to deal with
# MacPorts' libiberty's issues w.r.t `environ'.
AM_CONDITIONAL([DARWIN], [echo "$host_os" | grep '^darwin'])
+AC_CONFIG_SUBDIRS([libiberty])
+
## ------ ##
## Boost. ##
## ------ ##
diff --git a/extatica/src/Makefile.am b/extatica/src/Makefile.am
index 1ca9d66..ed6830a 100644
--- a/extatica/src/Makefile.am
+++ b/extatica/src/Makefile.am
@@ -59,8 +59,7 @@ libextatica_la_SOURCES = \
function_loader.hh function_loader.cc \
name_of.hh name_of.cc \
policy.hh policy.cc \
- ruby_stream.hh ruby_stream.cc \
- ansidecl.h demangle.h
+ ruby_stream.hh ruby_stream.cc
nodist_libextatica_la_SOURCES = \
all_methods.hh all_methods.cc \
@@ -83,11 +82,14 @@ libextatica_la_LIBADD = \
$(RUBY_LIBRUBYARG_SHARED) \
$(LIBLTDL) \
$(top_builddir)/libmd5/libmd5.la \
+ $(top_builddir)/libiberty/libiberty.a \
$(BOOST_FILESYSTEM_LIBS)
libextatica_la_DEPENDENCIES = $(LTDLDEPS)
RUBY_topdir = @RUBY_topdir@
+libiberty_inc = $(top_srcdir)/include
+
libextatica_la_CPPFLAGS = \
$(LTDLINCL) \
$(BOOST_CPPFLAGS) \
@@ -95,7 +97,8 @@ libextatica_la_CPPFLAGS = \
-I$(srcdir) \
-I. \
-I$(top_srcdir)/libmd5 \
- -I$(RUBY_topdir)
+ -I$(RUBY_topdir) \
+ -I$(libiberty_inc)
libextatica_la_CXXFLAGS = $(WARNING_CXXFLAGS)
libextatica_la_LDFLAGS = -version-info 0:1:0 $(BOOST_FILESYSTEM_LDFLAGS)
diff --git a/extatica/src/ansidecl.h b/extatica/src/ansidecl.h
deleted file mode 100644
index f8f2d73..0000000
--- a/extatica/src/ansidecl.h
+++ /dev/null
@@ -1,326 +0,0 @@
-/* ANSI and traditional C compatability macros
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* ANSI and traditional C compatibility macros
-
- ANSI C is assumed if __STDC__ is #defined.
-
- Macro ANSI C definition Traditional C definition
- ----- ---- - ---------- ----------- - ----------
- ANSI_PROTOTYPES 1 not defined
- PTR `void *' `char *'
- PTRCONST `void *const' `char *'
- LONG_DOUBLE `long double' `double'
- const not defined `'
- volatile not defined `'
- signed not defined `'
- VA_START(ap, var) va_start(ap, var) va_start(ap)
-
- Note that it is safe to write "void foo();" indicating a function
- with no return value, in all K+R compilers we have been able to test.
-
- For declaring functions with prototypes, we also provide these:
-
- PARAMS ((prototype))
- -- for functions which take a fixed number of arguments. Use this
- when declaring the function. When defining the function, write a
- K+R style argument list. For example:
-
- char *strcpy PARAMS ((char *dest, char *source));
- ...
- char *
- strcpy (dest, source)
- char *dest;
- char *source;
- { ... }
-
-
- VPARAMS ((prototype, ...))
- -- for functions which take a variable number of arguments. Use
- PARAMS to declare the function, VPARAMS to define it. For example:
-
- int printf PARAMS ((const char *format, ...));
- ...
- int
- printf VPARAMS ((const char *format, ...))
- {
- ...
- }
-
- For writing functions which take variable numbers of arguments, we
- also provide the VA_OPEN, VA_CLOSE, and VA_FIXEDARG macros. These
- hide the differences between K+R <varargs.h> and C89 <stdarg.h> more
- thoroughly than the simple VA_START() macro mentioned above.
-
- VA_OPEN and VA_CLOSE are used *instead of* va_start and va_end.
- Immediately after VA_OPEN, put a sequence of VA_FIXEDARG calls
- corresponding to the list of fixed arguments. Then use va_arg
- normally to get the variable arguments, or pass your va_list object
- around. You do not declare the va_list yourself; VA_OPEN does it
- for you.
-
- Here is a complete example:
-
- int
- printf VPARAMS ((const char *format, ...))
- {
- int result;
-
- VA_OPEN (ap, format);
- VA_FIXEDARG (ap, const char *, format);
-
- result = vfprintf (stdout, format, ap);
- VA_CLOSE (ap);
-
- return result;
- }
-
-
- You can declare variables either before or after the VA_OPEN,
- VA_FIXEDARG sequence. Also, VA_OPEN and VA_CLOSE are the beginning
- and end of a block. They must appear at the same nesting level,
- and any variables declared after VA_OPEN go out of scope at
- VA_CLOSE. Unfortunately, with a K+R compiler, that includes the
- argument list. You can have multiple instances of VA_OPEN/VA_CLOSE
- pairs in a single function in case you need to traverse the
- argument list more than once.
-
- For ease of writing code which uses GCC extensions but needs to be
- portable to other compilers, we provide the GCC_VERSION macro that
- simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
- wrappers around __attribute__. Also, __extension__ will be #defined
- to nothing if it doesn't work. See below.
-
- This header also defines a lot of obsolete macros:
- CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID,
- AND, DOTS, NOARGS. Don't use them. */
-
-#ifndef _ANSIDECL_H
-#define _ANSIDECL_H 1
-
-/* Every source file includes this file,
- so they will all get the switch for lint. */
-/* LINTLIBRARY */
-
-/* Using MACRO(x,y) in cpp #if conditionals does not work with some
- older preprocessors. Thus we can't define something like this:
-
-#define HAVE_GCC_VERSION(MAJOR, MINOR) \
- (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
-
-and then test "#if HAVE_GCC_VERSION(2,7)".
-
-So instead we use the macro below and test it against specific values. */
-
-/* This macro simplifies testing whether we are using gcc, and if it
- is of a particular minimum version. (Both major & minor numbers are
- significant.) This macro will evaluate to 0 if we are not using
- gcc at all. */
-#ifndef GCC_VERSION
-#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
-#endif /* GCC_VERSION */
-
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus))
-/* All known AIX compilers implement these things (but don't always
- define __STDC__). The RISC/OS MIPS compiler defines these things
- in SVR4 mode, but does not define __STDC__. */
-/* eraxxon(a)alumni.rice.edu: The Compaq C++ compiler, unlike many other
- C++ compilers, does not define __STDC__, though it acts as if this
- was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
-
-#define ANSI_PROTOTYPES 1
-#define PTR void *
-#define PTRCONST void *const
-#define LONG_DOUBLE long double
-
-#define PARAMS(ARGS) ARGS
-#define VPARAMS(ARGS) ARGS
-#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR)
-
-/* variadic function helper macros */
-/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's
- use without inhibiting further decls and without declaring an
- actual variable. */
-#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy
-#define VA_CLOSE(AP) } va_end(AP); }
-#define VA_FIXEDARG(AP, T, N) struct Qdmy
-
-#undef const
-#undef volatile
-#undef signed
-
-/* inline requires special treatment; it's in C99, and GCC >=2.7 supports
- it too, but it's not in C89. */
-#undef inline
-#if __STDC_VERSION__ > 199901L
-/* it's a keyword */
-#else
-# if GCC_VERSION >= 2007
-# define inline __inline__ /* __inline__ prevents -pedantic warnings */
-# else
-# define inline /* nothing */
-# endif
-#endif
-
-/* These are obsolete. Do not use. */
-#ifndef IN_GCC
-#define CONST const
-#define VOLATILE volatile
-#define SIGNED signed
-
-#define PROTO(type, name, arglist) type name arglist
-#define EXFUN(name, proto) name proto
-#define DEFUN(name, arglist, args) name(args)
-#define DEFUN_VOID(name) name(void)
-#define AND ,
-#define DOTS , ...
-#define NOARGS void
-#endif /* ! IN_GCC */
-
-#else /* Not ANSI C. */
-
-#undef ANSI_PROTOTYPES
-#define PTR char *
-#define PTRCONST PTR
-#define LONG_DOUBLE double
-
-#define PARAMS(args) ()
-#define VPARAMS(args) (va_alist) va_dcl
-#define VA_START(va_list, var) va_start(va_list)
-
-#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP); { struct Qdmy
-#define VA_CLOSE(AP) } va_end(AP); }
-#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE)
-
-/* some systems define these in header files for non-ansi mode */
-#undef const
-#undef volatile
-#undef signed
-#undef inline
-#define const
-#define volatile
-#define signed
-#define inline
-
-#ifndef IN_GCC
-#define CONST
-#define VOLATILE
-#define SIGNED
-
-#define PROTO(type, name, arglist) type name ()
-#define EXFUN(name, proto) name()
-#define DEFUN(name, arglist, args) name arglist args;
-#define DEFUN_VOID(name) name()
-#define AND ;
-#define DOTS
-#define NOARGS
-#endif /* ! IN_GCC */
-
-#endif /* ANSI C. */
-
-/* Define macros for some gcc attributes. This permits us to use the
- macros freely, and know that they will come into play for the
- version of gcc in which they are supported. */
-
-#if (GCC_VERSION < 2007)
-# define __attribute__(x)
-#endif
-
-/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
-#ifndef ATTRIBUTE_MALLOC
-# if (GCC_VERSION >= 2096)
-# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-# else
-# define ATTRIBUTE_MALLOC
-# endif /* GNUC >= 2.96 */
-#endif /* ATTRIBUTE_MALLOC */
-
-/* Attributes on labels were valid as of gcc 2.93. */
-#ifndef ATTRIBUTE_UNUSED_LABEL
-# if (GCC_VERSION >= 2093)
-# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
-# else
-# define ATTRIBUTE_UNUSED_LABEL
-# endif /* GNUC >= 2.93 */
-#endif /* ATTRIBUTE_UNUSED_LABEL */
-
-#ifndef ATTRIBUTE_UNUSED
-#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-#endif /* ATTRIBUTE_UNUSED */
-
-#ifndef ATTRIBUTE_NORETURN
-#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#endif /* ATTRIBUTE_NORETURN */
-
-/* Attribute `nonnull' was valid as of gcc 3.3. */
-#ifndef ATTRIBUTE_NONNULL
-# if (GCC_VERSION >= 3003)
-# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
-# else
-# define ATTRIBUTE_NONNULL(m)
-# endif /* GNUC >= 3.3 */
-#endif /* ATTRIBUTE_NONNULL */
-
-/* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL.
- This was the case for the `printf' format attribute by itself
- before GCC 3.3, but as of 3.3 we need to add the `nonnull'
- attribute to retain this behavior. */
-#ifndef ATTRIBUTE_PRINTF
-#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m)
-#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
-#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
-#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
-#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
-#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
-#endif /* ATTRIBUTE_PRINTF */
-
-/* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A
- NULL format specifier was allowed as of gcc 3.3. */
-#ifndef ATTRIBUTE_NULL_PRINTF
-# if (GCC_VERSION >= 3003)
-# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
-# else
-# define ATTRIBUTE_NULL_PRINTF(m, n)
-# endif /* GNUC >= 3.3 */
-# define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2)
-# define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3)
-# define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4)
-# define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5)
-# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)
-#endif /* ATTRIBUTE_NULL_PRINTF */
-
-/* We use __extension__ in some places to suppress -pedantic warnings
- about GCC extensions. This feature didn't work properly before
- gcc 2.8. */
-#if GCC_VERSION < 2008
-#define __extension__
-#endif
-
-/* Bootstrap support: Adjust certain macros defined by Autoconf,
- which are only valid for the stage1 compiler. If we detect
- a modern version of GCC, we are probably in stage2 or beyond,
- so unconditionally reset the values. Note that const, inline,
- etc. have been dealt with above. */
-#if (GCC_VERSION >= 2007)
-# ifndef HAVE_LONG_DOUBLE
-# define HAVE_LONG_DOUBLE 1
-# endif
-#endif /* GCC >= 2.7 */
-
-#endif /* ansidecl.h */
diff --git a/extatica/src/demangle.h b/extatica/src/demangle.h
deleted file mode 100644
index 21e9dd3..0000000
--- a/extatica/src/demangle.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Defs for interface to demanglers.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002
- Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-
-#if !defined (DEMANGLE_H)
-#define DEMANGLE_H
-
-#include "ansidecl.h"
-
-/* Options passed to cplus_demangle (in 2nd parameter). */
-
-#define DMGL_NO_OPTS 0 /* For readability... */
-#define DMGL_PARAMS (1 << 0) /* Include function args */
-#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
-#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
-#define DMGL_VERBOSE (1 << 3) /* Include implementation details. */
-#define DMGL_TYPES (1 << 4) /* Also try to demangle type encodings. */
-
-#define DMGL_AUTO (1 << 8)
-#define DMGL_GNU (1 << 9)
-#define DMGL_LUCID (1 << 10)
-#define DMGL_ARM (1 << 11)
-#define DMGL_HP (1 << 12) /* For the HP aCC compiler;
- same as ARM except for
- template arguments, etc. */
-#define DMGL_EDG (1 << 13)
-#define DMGL_GNU_V3 (1 << 14)
-#define DMGL_GNAT (1 << 15)
-
-/* If none of these are set, use 'current_demangling_style' as the default. */
-#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT)
-
-/* Enumeration of possible demangling styles.
-
- Lucid and ARM styles are still kept logically distinct, even though
- they now both behave identically. The resulting style is actual the
- union of both. I.E. either style recognizes both "__pt__" and "__rf__"
- for operator "->", even though the first is lucid style and the second
- is ARM style. (FIXME?) */
-
-extern enum demangling_styles
-{
- no_demangling = -1,
- unknown_demangling = 0,
- auto_demangling = DMGL_AUTO,
- gnu_demangling = DMGL_GNU,
- lucid_demangling = DMGL_LUCID,
- arm_demangling = DMGL_ARM,
- hp_demangling = DMGL_HP,
- edg_demangling = DMGL_EDG,
- gnu_v3_demangling = DMGL_GNU_V3,
- java_demangling = DMGL_JAVA,
- gnat_demangling = DMGL_GNAT
-} current_demangling_style;
-
-/* Define string names for the various demangling styles. */
-
-#define NO_DEMANGLING_STYLE_STRING "none"
-#define AUTO_DEMANGLING_STYLE_STRING "auto"
-#define GNU_DEMANGLING_STYLE_STRING "gnu"
-#define LUCID_DEMANGLING_STYLE_STRING "lucid"
-#define ARM_DEMANGLING_STYLE_STRING "arm"
-#define HP_DEMANGLING_STYLE_STRING "hp"
-#define EDG_DEMANGLING_STYLE_STRING "edg"
-#define GNU_V3_DEMANGLING_STYLE_STRING "gnu-v3"
-#define JAVA_DEMANGLING_STYLE_STRING "java"
-#define GNAT_DEMANGLING_STYLE_STRING "gnat"
-
-/* Some macros to test what demangling style is active. */
-
-#define CURRENT_DEMANGLING_STYLE current_demangling_style
-#define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
-#define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
-#define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
-#define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM)
-#define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP)
-#define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
-#define GNU_V3_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU_V3)
-#define JAVA_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA)
-#define GNAT_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT)
-
-/* Provide information about the available demangle styles. This code is
- pulled from gdb into libiberty because it is useful to binutils also. */
-
-extern const struct demangler_engine
-{
- const char *const demangling_style_name;
- const enum demangling_styles demangling_style;
- const char *const demangling_style_doc;
-} libiberty_demanglers[];
-
-extern char *
-cplus_demangle PARAMS ((const char *mangled, int options));
-
-extern int
-cplus_demangle_opname PARAMS ((const char *opname, char *result, int options));
-
-extern const char *
-cplus_mangle_opname PARAMS ((const char *opname, int options));
-
-/* Note: This sets global state. FIXME if you care about multi-threading. */
-
-extern void
-set_cplus_marker_for_demangling PARAMS ((int ch));
-
-extern enum demangling_styles
-cplus_demangle_set_style PARAMS ((enum demangling_styles style));
-
-extern enum demangling_styles
-cplus_demangle_name_to_style PARAMS ((const char *name));
-
-/* V3 ABI demangling entry points, defined in cp-demangle.c. */
-extern char*
-cplus_demangle_v3 PARAMS ((const char* mangled, int options));
-
-extern char*
-java_demangle_v3 PARAMS ((const char* mangled));
-
-
-enum gnu_v3_ctor_kinds {
- gnu_v3_complete_object_ctor = 1,
- gnu_v3_base_object_ctor,
- gnu_v3_complete_object_allocating_ctor
-};
-
-/* Return non-zero iff NAME is the mangled form of a constructor name
- in the G++ V3 ABI demangling style. Specifically, return an `enum
- gnu_v3_ctor_kinds' value indicating what kind of constructor
- it is. */
-extern enum gnu_v3_ctor_kinds
- is_gnu_v3_mangled_ctor PARAMS ((const char *name));
-
-
-enum gnu_v3_dtor_kinds {
- gnu_v3_deleting_dtor = 1,
- gnu_v3_complete_object_dtor,
- gnu_v3_base_object_dtor
-};
-
-/* Return non-zero iff NAME is the mangled form of a destructor name
- in the G++ V3 ABI demangling style. Specifically, return an `enum
- gnu_v3_dtor_kinds' value, indicating what kind of destructor
- it is. */
-extern enum gnu_v3_dtor_kinds
- is_gnu_v3_mangled_dtor PARAMS ((const char *name));
-
-#endif /* DEMANGLE_H */
--
1.5.6.5