mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-30 00:49:57 +02:00
bash-3.1 remove leftover and stray files
This commit is contained in:
@@ -1,138 +0,0 @@
|
||||
# Skeleton Makefile for the GNU malloc code
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1996 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 USA.
|
||||
|
||||
srcdir = @srcdir@
|
||||
VPATH = .:@srcdir@
|
||||
topdir = @top_srcdir@
|
||||
BUILD_DIR = @BUILD_DIR@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
CC = @CC@
|
||||
RANLIB = @RANLIB@
|
||||
AR = @AR@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
RM = rm -f
|
||||
CP = cp
|
||||
MV = mv
|
||||
|
||||
SHELL = @MAKE_SHELL@
|
||||
|
||||
PROFILE_FLAGS = @PROFILE_FLAGS@
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
LOCAL_CFLAGS = @LOCAL_CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
DEFS = @DEFS@
|
||||
LOCAL_DEFS = @LOCAL_DEFS@
|
||||
|
||||
LIBBUILD = ${BUILD_DIR}/lib
|
||||
|
||||
BASHINCDIR = ${topdir}/include
|
||||
|
||||
INTL_LIBSRC = ${topdir}/lib/intl
|
||||
INTL_BUILDDIR = ${LIBBUILD}/intl
|
||||
INTL_INC = @INTL_INC@
|
||||
LIBINTL_H = @LIBINTL_H@
|
||||
|
||||
INCLUDES = -I. -I../.. -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib $(INTL_INC)
|
||||
|
||||
CCFLAGS = ${PROFILE_FLAGS} ${INCLUDES} $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) \
|
||||
$(CFLAGS) $(MALLOC_CFLAGS) $(CPPFLAGS)
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CCFLAGS) -c $<
|
||||
|
||||
.s.o:
|
||||
$(CC) $(CCFLAGS) -c $<
|
||||
|
||||
MALLOC_SOURCE = malloc.c
|
||||
STUB_SOURCE = stub.c
|
||||
|
||||
ALLOCA_SOURCE = alloca.c
|
||||
ALLOCA_OBJECT = alloca.o
|
||||
|
||||
MALLOC_SRC = @MALLOC_SRC@
|
||||
MALLOC = @MALLOC@
|
||||
ALLOCA = @ALLOCA@
|
||||
|
||||
MALLOC_OBJS = malloc.o $(ALLOCA) trace.o stats.o table.o watch.o
|
||||
STUB_OBJS = $(ALLOCA) stub.o
|
||||
|
||||
.PHONY: malloc stubmalloc
|
||||
|
||||
all: malloc
|
||||
|
||||
malloc: ${MALLOC_OBJS}
|
||||
${RM} libmalloc.a
|
||||
${AR} ${ARFLAGS} libmalloc.a ${MALLOC_OBJS}
|
||||
-test -n "$(RANLIB)" && $(RANLIB) libmalloc.a
|
||||
|
||||
stubmalloc: ${STUB_OBJS}
|
||||
${RM} libmalloc.a
|
||||
${AR} ${ARFLAGS} libmalloc.a ${STUB_OBJS}
|
||||
-test -n "$(RANLIB)" && $(RANLIB) libmalloc.a
|
||||
|
||||
alloca: ${ALLOCA}
|
||||
${RM} libmalloc.a
|
||||
${AR} ${ARFLAGS} libmalloc.a ${ALLOCA}
|
||||
-test -n "$(RANLIB)" && $(RANLIB) libmalloc.a
|
||||
|
||||
alloca.o: $(srcdir)/$(ALLOCA_SOURCE)
|
||||
$(CC) $(CCFLAGS) -c $(srcdir)/$(ALLOCA_SOURCE)
|
||||
@- if test "$(ALLOCA_OBJECT)" != alloca.o ; then \
|
||||
mv $(ALLOCA_OBJECT) alloca.o >/dev/null 2>&1 ; \
|
||||
fi
|
||||
|
||||
mostlyclean clean:
|
||||
$(RM) *.o libmalloc.a
|
||||
|
||||
distclean realclean maintainer-clean: clean
|
||||
$(RM) Makefile
|
||||
|
||||
alloca.o: $(BUILD_DIR)/config.h
|
||||
malloc.o: $(BUILD_DIR)/config.h $(topdir)/bashtypes.h getpagesize.h
|
||||
xmalloc.o: $(BUILD_DIR)/config.h $(BASHINCDIR)/ansi_stdlib.h
|
||||
trace.o: ${BUILD_DIR}/config.h
|
||||
table.o: ${BUILD_DIR}/config.h
|
||||
|
||||
malloc.o: ${srcdir}/imalloc.h ${srcdir}/mstats.h
|
||||
malloc.o: ${srcdir}/table.h ${srcdir}/watch.h
|
||||
stats.o: ${srcdir}/imalloc.h ${srcdir}/mstats.h
|
||||
trace.o: ${srcdir}/imalloc.h
|
||||
table.o: ${srcdir}/imalloc.h ${srcdir}/table.h
|
||||
watch.o: ${srcdir}/imalloc.h ${srcdir}/watch.h
|
||||
|
||||
malloc.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h
|
||||
stats.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h
|
||||
trace.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h
|
||||
table.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h
|
||||
watch.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h
|
||||
|
||||
# Rules for deficient makes, like SunOS and Solaris
|
||||
stub.o: stub.c
|
||||
malloc.o: malloc.c
|
||||
table.o: table.c
|
||||
trace.o: trace.c
|
||||
stats.o: stats.c
|
||||
watch.o: watch.c
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,68 +0,0 @@
|
||||
/* Functions (currently) for use by the shell to do malloc debugging and
|
||||
tracking. */
|
||||
/* Copyright (C) 2001-2003 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 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 USA. */
|
||||
|
||||
#ifndef _SH_MALLOC_H
|
||||
#define _SH_MALLOC_H
|
||||
|
||||
#ifndef __P
|
||||
# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
|
||||
# define __P(protos) protos
|
||||
# else
|
||||
# define __P(protos) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Generic pointer type. */
|
||||
#ifndef PTR_T
|
||||
|
||||
#if defined (__STDC__)
|
||||
# define PTR_T void *
|
||||
#else
|
||||
# define PTR_T char *
|
||||
#endif
|
||||
|
||||
#endif /* PTR_T */
|
||||
|
||||
|
||||
extern PTR_T sh_malloc __P((size_t, const char *, int));
|
||||
extern PTR_T sh_realloc __P((PTR_T, size_t, const char *, int));
|
||||
extern void sh_free __P((PTR_T, const char *, int));
|
||||
|
||||
extern PTR_T sh_memalign __P((unsigned int, size_t, const char *, int));
|
||||
|
||||
extern PTR_T sh_calloc __P((size_t, size_t, const char *, int));
|
||||
extern void sh_cfree __P((PTR_T, const char *, int));
|
||||
|
||||
extern PTR_T sh_valloc __P((size_t, const char *, int));
|
||||
|
||||
/* trace.c */
|
||||
extern int malloc_set_trace __P((int));
|
||||
extern void malloc_set_tracefp (); /* full prototype requires stdio.h */
|
||||
extern void malloc_set_tracefn __P((char *, char *));
|
||||
|
||||
/* table.c */
|
||||
extern void mregister_dump_table __P((void));
|
||||
extern void mregister_table_init __P((void));
|
||||
extern int malloc_set_register __P((int));
|
||||
|
||||
/* stats.c */
|
||||
extern void print_malloc_stats __P((char *));
|
||||
extern void fprint_malloc_stats (); /* full prototype requires stdio.h */
|
||||
extern void trace_malloc_stats __P((char *, char *));
|
||||
|
||||
#endif
|
||||
@@ -1,122 +0,0 @@
|
||||
/* trace.c - tracing functions for malloc */
|
||||
|
||||
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
Bash 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.
|
||||
|
||||
Bash 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 Bash; see the file COPYING. If not, write to the Free Software
|
||||
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "imalloc.h"
|
||||
|
||||
extern int malloc_trace;
|
||||
|
||||
static int _mtrace_verbose = 0;
|
||||
|
||||
extern FILE *_imalloc_fopen __P((char *, char *, char *, char *, size_t));
|
||||
|
||||
#ifdef MALLOC_TRACE
|
||||
|
||||
FILE *_mtrace_fp = NULL;
|
||||
extern char _malloc_trace_buckets[];
|
||||
|
||||
void
|
||||
mtrace_alloc (tag, mem, size, file, line)
|
||||
const char *tag;
|
||||
PTR_T mem;
|
||||
size_t size;
|
||||
const char *file;
|
||||
int line;
|
||||
{
|
||||
if (_mtrace_fp == NULL)
|
||||
_mtrace_fp = stderr;
|
||||
|
||||
if (_mtrace_verbose)
|
||||
fprintf (_mtrace_fp, "alloc: %s: %p (%d bytes) from '%s:%d'\n",
|
||||
tag, mem, size, file ? file : "unknown", line);
|
||||
else
|
||||
fprintf (_mtrace_fp, "alloc:%p:%d:%s:%d\n",
|
||||
mem, size, file ? file : "unknown", line);
|
||||
}
|
||||
|
||||
void
|
||||
mtrace_free (mem, size, file, line)
|
||||
PTR_T mem;
|
||||
int size;
|
||||
const char *file;
|
||||
int line;
|
||||
{
|
||||
if (_mtrace_fp == NULL)
|
||||
_mtrace_fp = stderr;
|
||||
|
||||
if (_mtrace_verbose)
|
||||
fprintf (_mtrace_fp, "free: %p (%d bytes) from '%s:%d'\n",
|
||||
mem, size, file ? file : "unknown", line);
|
||||
else
|
||||
fprintf (_mtrace_fp, "free:%p:%d:%s:%d\n",
|
||||
mem, size, file ? file : "unknown", line);
|
||||
}
|
||||
#endif /* MALLOC_TRACE */
|
||||
|
||||
int
|
||||
malloc_set_trace (n)
|
||||
int n;
|
||||
{
|
||||
int old;
|
||||
|
||||
old = malloc_trace;
|
||||
malloc_trace = n;
|
||||
_mtrace_verbose = (n > 1);
|
||||
return old;
|
||||
}
|
||||
|
||||
void
|
||||
malloc_set_tracefp (fp)
|
||||
FILE *fp;
|
||||
{
|
||||
#ifdef MALLOC_TRACE
|
||||
_mtrace_fp = fp ? fp : stderr;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
malloc_trace_bin (n)
|
||||
int n;
|
||||
{
|
||||
#ifdef MALLOC_TRACE
|
||||
_malloc_trace_buckets[n] = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define TRACEROOT "/var/tmp/maltrace/trace."
|
||||
|
||||
void
|
||||
malloc_set_tracefn (s, fn)
|
||||
char *s;
|
||||
char *fn;
|
||||
{
|
||||
#ifdef MALLOC_TRACE
|
||||
FILE *fp;
|
||||
char defname[sizeof (TRACEROOT) + 64];
|
||||
|
||||
fp = _imalloc_fopen (s, fn, TRACEROOT, defname, sizeof (defname));
|
||||
if (fp)
|
||||
malloc_set_tracefp (fp);
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user