* 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
* 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
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch non-8-bit-magick-quantum has been created
at dd1c8b5e0e3162477a220b28b5d3eb233a68a82e (commit)
- Log -----------------------------------------------------------------
dd1c8b5 Handle properly non 8-bit Magick::Quantum's.
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
* mln/io/magick/load.hh
(mln::io::magick::load(Image<I>&, const std::string&))
* mln/io/magick/save.hh
(mln::io::magick::impl::get_color(const value::int_u8&))
(mln::io::magick::impl::get_color(const value::rgb8&)):
Properly convert values between Magick::Quantum and
mln::value::int_u8, and vice versa.
---
milena/ChangeLog | 12 ++++++++++++
milena/mln/io/magick/load.hh | 17 +++++++++++------
milena/mln/io/magick/save.hh | 30 ++++++++++++++++++++++--------
3 files changed, 45 insertions(+), 14 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 8e8cf88..67eefef 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-28 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Handle properly non 8-bit Magick::Quantum's.
+
+ * mln/io/magick/load.hh
+ (mln::io::magick::load(Image<I>&, const std::string&))
+ * mln/io/magick/save.hh
+ (mln::io::magick::impl::get_color(const value::int_u8&))
+ (mln::io::magick::impl::get_color(const value::rgb8&)):
+ Properly convert values between Magick::Quantum and
+ mln::value::int_u8, and vice versa.
+
2010-10-27 Roland Levillain <roland(a)lrde.epita.fr>
Autoconfiscate Milena.
diff --git a/milena/mln/io/magick/load.hh b/milena/mln/io/magick/load.hh
index 7004a80..60e857e 100644
--- a/milena/mln/io/magick/load.hh
+++ b/milena/mln/io/magick/load.hh
@@ -35,8 +35,6 @@
/// <em>before</em> using any of these functions, as advised by the
/// GraphicsMagick documentation
/// (http://www.graphicsmagick.org/Magick++/Image.html).
-///
-/// \fixme: re-enable quantum size check
# include <cstdlib>
@@ -142,9 +140,6 @@ namespace mln
{
trace::entering("mln::io::magick::load");
- // Ensure a Magick++'s Quantum is an 8-bit value.
- //mln::metal::equal<Magick::Quantum, unsigned char>::check();
-
I& ima = exact(ima_);
// FIXME: Handle Magick++'s exceptions (see either
@@ -166,7 +161,17 @@ namespace mln
mln_piter(I) p(ima.domain());
for_all(p)
{
- value::rgb8 c(pixels->red, pixels->green, pixels->blue);
+ /* Each channel of a Magick++ image is coded on a
+ Magick::Quantum value, which can be an 8-, 16- or 32-bit
+ integer. Load the most significant bits of each channel
+ into a component of an mln::value::rgb8 value (i.e., into
+ an mln::value::int_u8 value). */
+ value::rgb8 c(pixels->red >> 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::red_t)),
+ pixels->green >> 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::green_t)),
+ pixels->blue >> 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::blue_t)));
mln_value(I) res;
if (!impl::do_it(c, res))
{
diff --git a/milena/mln/io/magick/save.hh b/milena/mln/io/magick/save.hh
index 2c87c88..7a91ee0 100644
--- a/milena/mln/io/magick/save.hh
+++ b/milena/mln/io/magick/save.hh
@@ -35,8 +35,6 @@
/// <em>before</em> using any of these functions, as advised by the
/// GraphicsMagick documentation
/// (http://www.graphicsmagick.org/Magick++/Image.html).
-///
-/// \fixme: re-enable quantum size check
# include <cstdlib>
@@ -95,17 +93,33 @@ namespace mln
inline
Magick::Color get_color(const value::int_u8& value)
{
- // Ensure a Magick++'s Quantum is an 8-bit value.
- //mln::metal::equal<Magick::Quantum, unsigned char>::check();
- return Magick::Color(value, value, value);
+ /* Each channel of a Magick++ image is coded on a
+ Magick::Quantum value, which can be an 8-, 16- or 32-bit
+ integer. Store the data from each mln::value::int_u8
+ values into the most significant bits of Magick::Color's
+ channels. */
+ return Magick::Color
+ (value << 8 * (sizeof(Magick::Quantum) - sizeof(value::int_u8)),
+ value << 8 * (sizeof(Magick::Quantum) - sizeof(value::int_u8)),
+ value << 8 * (sizeof(Magick::Quantum) - sizeof(value::int_u8)));
}
inline
Magick::Color get_color(const value::rgb8& value)
{
- // Ensure a Magick++'s Quantum is an 8-bit value.
- //mln::metal::equal<Magick::Quantum, unsigned char>::check();
- return Magick::Color(value.red(), value.green(), value.blue());
+ /* Each channel of a Magick++ image is coded on a
+ Magick::Quantum value, which can be an 8-, 16- or 32-bit
+ integer. Store the data from each component of
+ mln::value::rgb8 values (of type mln::value::int_u8) into
+ the most significant bits of Magick::Color's
+ channels. */
+ return Magick::Color
+ (value.red() << 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::red_t)),
+ value.green() << 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::green_t)),
+ value.blue() << 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::blue_t)));
}
} // end of namespace mln::io::magick::impl
--
1.5.6.5
* mln/io/magick/load.hh
(mln::io::magick::load(Image<I>&, const std::string&))
* mln/io/magick/save.hh
(mln::io::magick::impl::get_color(const value::int_u8&))
(mln::io::magick::impl::get_color(const value::rgb8&)):
Properly convert values between Magick::Quantum and
mln::value::int_u8, and vice versa.
---
milena/ChangeLog | 12 ++++++++++++
milena/mln/io/magick/load.hh | 17 +++++++++++------
milena/mln/io/magick/save.hh | 30 ++++++++++++++++++++++--------
3 files changed, 45 insertions(+), 14 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 8e94f5d..2b6ae78 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-28 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Handle properly non 8-bit Magick::Quantum's.
+
+ * mln/io/magick/load.hh
+ (mln::io::magick::load(Image<I>&, const std::string&))
+ * mln/io/magick/save.hh
+ (mln::io::magick::impl::get_color(const value::int_u8&))
+ (mln::io::magick::impl::get_color(const value::rgb8&)):
+ Properly convert values between Magick::Quantum and
+ mln::value::int_u8, and vice versa.
+
2010-10-27 Roland Levillain <roland(a)lrde.epita.fr>
Fix Boost.Tuple handling.
diff --git a/milena/mln/io/magick/load.hh b/milena/mln/io/magick/load.hh
index 7004a80..60e857e 100644
--- a/milena/mln/io/magick/load.hh
+++ b/milena/mln/io/magick/load.hh
@@ -35,8 +35,6 @@
/// <em>before</em> using any of these functions, as advised by the
/// GraphicsMagick documentation
/// (http://www.graphicsmagick.org/Magick++/Image.html).
-///
-/// \fixme: re-enable quantum size check
# include <cstdlib>
@@ -142,9 +140,6 @@ namespace mln
{
trace::entering("mln::io::magick::load");
- // Ensure a Magick++'s Quantum is an 8-bit value.
- //mln::metal::equal<Magick::Quantum, unsigned char>::check();
-
I& ima = exact(ima_);
// FIXME: Handle Magick++'s exceptions (see either
@@ -166,7 +161,17 @@ namespace mln
mln_piter(I) p(ima.domain());
for_all(p)
{
- value::rgb8 c(pixels->red, pixels->green, pixels->blue);
+ /* Each channel of a Magick++ image is coded on a
+ Magick::Quantum value, which can be an 8-, 16- or 32-bit
+ integer. Load the most significant bits of each channel
+ into a component of an mln::value::rgb8 value (i.e., into
+ an mln::value::int_u8 value). */
+ value::rgb8 c(pixels->red >> 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::red_t)),
+ pixels->green >> 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::green_t)),
+ pixels->blue >> 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::blue_t)));
mln_value(I) res;
if (!impl::do_it(c, res))
{
diff --git a/milena/mln/io/magick/save.hh b/milena/mln/io/magick/save.hh
index 2c87c88..7a91ee0 100644
--- a/milena/mln/io/magick/save.hh
+++ b/milena/mln/io/magick/save.hh
@@ -35,8 +35,6 @@
/// <em>before</em> using any of these functions, as advised by the
/// GraphicsMagick documentation
/// (http://www.graphicsmagick.org/Magick++/Image.html).
-///
-/// \fixme: re-enable quantum size check
# include <cstdlib>
@@ -95,17 +93,33 @@ namespace mln
inline
Magick::Color get_color(const value::int_u8& value)
{
- // Ensure a Magick++'s Quantum is an 8-bit value.
- //mln::metal::equal<Magick::Quantum, unsigned char>::check();
- return Magick::Color(value, value, value);
+ /* Each channel of a Magick++ image is coded on a
+ Magick::Quantum value, which can be an 8-, 16- or 32-bit
+ integer. Store the data from each mln::value::int_u8
+ values into the most significant bits of Magick::Color's
+ channels. */
+ return Magick::Color
+ (value << 8 * (sizeof(Magick::Quantum) - sizeof(value::int_u8)),
+ value << 8 * (sizeof(Magick::Quantum) - sizeof(value::int_u8)),
+ value << 8 * (sizeof(Magick::Quantum) - sizeof(value::int_u8)));
}
inline
Magick::Color get_color(const value::rgb8& value)
{
- // Ensure a Magick++'s Quantum is an 8-bit value.
- //mln::metal::equal<Magick::Quantum, unsigned char>::check();
- return Magick::Color(value.red(), value.green(), value.blue());
+ /* Each channel of a Magick++ image is coded on a
+ Magick::Quantum value, which can be an 8-, 16- or 32-bit
+ integer. Store the data from each component of
+ mln::value::rgb8 values (of type mln::value::int_u8) into
+ the most significant bits of Magick::Color's
+ channels. */
+ return Magick::Color
+ (value.red() << 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::red_t)),
+ value.green() << 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::green_t)),
+ value.blue() << 8 * (sizeof(Magick::Quantum)
+ - sizeof(value::rgb8::blue_t)));
}
} // end of namespace mln::io::magick::impl
--
1.5.6.5
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch autoconfiscate-subprojects has been updated
discards 86cd9e2a9ba4e3a5941c263e0eb3a049486c3550 (commit)
discards 1e1204928dfc3b14877d139f6cc530f10cc08d3f (commit)
discards 82a8284278d46caae6e13ba9d78fc1aa67ff2f98 (commit)
via ae9a8715e6cb27af6b7f0e838953287e8fadcca6 (commit)
via e0bd3016c3669933fe34cdfd7589d7c7b837427c (commit)
via 7f1221803f2ef0af6b72c02d4b2b798d7fe03205 (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (86cd9e2a9ba4e3a5941c263e0eb3a049486c3550)
\
N -- N -- N (ae9a8715e6cb27af6b7f0e838953287e8fadcca6)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
ae9a871 Add advice about the release process.
e0bd301 Have Milena be in charge of its own configuration and distribution.
7f12218 Autoconfiscate Milena.
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 7 +++++++
milena/doc/Doxyfile.in | 32 ++++++++++++++++----------------
milena/doc/gen-examples-outputs-mk | 2 +-
milena/doc/gen-split-examples-mk | 2 +-
milena/doc/programs-examples.mk | 6 +++---
milena/doc/tools/data.hh.in | 2 +-
milena/doc/tutorial.tex | 17 ++++++++---------
7 files changed, 37 insertions(+), 31 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform