mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-09-11 11:50:52 +03:00
execinfo: new module
This is for Emacs. Currently, it provides a no-effect stub on all platforms where it does not already work. It already works on glibc-based systems, and on Solaris 11. * lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4, modules/execinfo: New files. * doc/glibc-headers/execinfo.texi (execinfo.h): * MODULES.html.sh (Misc): Document it.
This commit is contained in:
11
ChangeLog
11
ChangeLog
@@ -1,3 +1,14 @@
|
||||
2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
execinfo: new module
|
||||
This is for Emacs. Currently, it provides a no-effect stub
|
||||
on all platforms where it does not already work.
|
||||
It already works on glibc-based systems, and on Solaris 11.
|
||||
* lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4, modules/execinfo:
|
||||
New files.
|
||||
* doc/glibc-headers/execinfo.texi (execinfo.h):
|
||||
* MODULES.html.sh (Misc): Document it.
|
||||
|
||||
2012-08-20 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
extern-inline: support old GCC 'inline'
|
||||
|
@@ -2000,6 +2000,7 @@ func_all_modules ()
|
||||
func_module crc
|
||||
func_module diacrit
|
||||
func_module diffseq
|
||||
func_module execinfo
|
||||
func_module getline
|
||||
func_module getdelim
|
||||
func_module getnline
|
||||
|
@@ -21,11 +21,14 @@ Gnulib module: ---
|
||||
|
||||
Portability problems fixed by Gnulib:
|
||||
@itemize
|
||||
This header file is missing on some platforms:
|
||||
Mac OS X 10.3, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin, mingw, MSVC 9, Interix 3.5, BeOS.
|
||||
@end itemize
|
||||
|
||||
Portability problems not fixed by Gnulib:
|
||||
@itemize
|
||||
@item
|
||||
This header file is missing on some platforms:
|
||||
Mac OS X 10.3, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin, mingw, MSVC 9, Interix 3.5, BeOS.
|
||||
On platforms where the header file is missing,
|
||||
the Gnulib substitute implementation is just a stub,
|
||||
and does nothing.
|
||||
@end itemize
|
||||
|
3
lib/execinfo.c
Normal file
3
lib/execinfo.c
Normal file
@@ -0,0 +1,3 @@
|
||||
#include <config.h>
|
||||
#define _GL_EXECINFO_INLINE _GL_EXTERN_INLINE
|
||||
#include "execinfo.h"
|
54
lib/execinfo.in.h
Normal file
54
lib/execinfo.in.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/* Information about executables.
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
#ifndef _GL_EXECINFO_H
|
||||
#define _GL_EXECINFO_H
|
||||
|
||||
_GL_INLINE_HEADER_BEGIN
|
||||
#ifndef _GL_EXECINFO_INLINE
|
||||
# define _GL_EXECINFO_INLINE _GL_INLINE
|
||||
#endif
|
||||
|
||||
_GL_EXECINFO_INLINE int
|
||||
backtrace (void **buffer, int size)
|
||||
{
|
||||
(void) buffer;
|
||||
(void) size;
|
||||
return 0;
|
||||
}
|
||||
|
||||
_GL_EXECINFO_INLINE char **
|
||||
backtrace_symbols (void *const *buffer, int size)
|
||||
{
|
||||
(void) buffer;
|
||||
(void) size;
|
||||
return 0;
|
||||
}
|
||||
|
||||
_GL_EXECINFO_INLINE void
|
||||
backtrace_symbols_fd (void *const *buffer, int size, int fd)
|
||||
{
|
||||
(void) buffer;
|
||||
(void) size;
|
||||
(void) fd;
|
||||
}
|
||||
|
||||
_GL_INLINE_HEADER_END
|
||||
|
||||
#endif
|
21
m4/execinfo.m4
Normal file
21
m4/execinfo.m4
Normal file
@@ -0,0 +1,21 @@
|
||||
# Check for GNU-style execinfo.h.
|
||||
|
||||
dnl Copyright 2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_EXECINFO_H],
|
||||
[
|
||||
AC_CHECK_HEADERS_ONCE([execinfo.h])
|
||||
|
||||
if test $ac_cv_header_execinfo_h = yes; then
|
||||
EXECINFO_H=''
|
||||
else
|
||||
EXECINFO_H='execinfo.h'
|
||||
AC_LIBOBJ([execinfo])
|
||||
fi
|
||||
|
||||
AC_SUBST([EXECINFO_H])
|
||||
AM_CONDITIONAL([GL_GENERATE_EXECINFO_H], [test -n "$EXECINFO_H"])
|
||||
])
|
40
modules/execinfo
Normal file
40
modules/execinfo
Normal file
@@ -0,0 +1,40 @@
|
||||
Description:
|
||||
A GNU-like <execinfo.h>.
|
||||
|
||||
Files:
|
||||
lib/execinfo.c
|
||||
lib/execinfo.in.h
|
||||
m4/execinfo.m4
|
||||
|
||||
Depends-on:
|
||||
extern-inline
|
||||
|
||||
configure.ac:
|
||||
gl_EXECINFO_H
|
||||
|
||||
Makefile.am:
|
||||
BUILT_SOURCES += $(EXECINFO_H)
|
||||
|
||||
# We need the following in order to create <execinfo.h> when the system
|
||||
# doesn't have one that works.
|
||||
if GL_GENERATE_EXECINFO_H
|
||||
execinfo.h: execinfo.in.h $(top_builddir)/config.status
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
cat $(srcdir)/execinfo.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
else
|
||||
execinfo.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += execinfo.h execinfo.h-t
|
||||
|
||||
Include:
|
||||
<execinfo.h>
|
||||
|
||||
License:
|
||||
LGPLv2+
|
||||
|
||||
Maintainer:
|
||||
all
|
Reference in New Issue
Block a user