Remove unnecessary stdlib includes (because we use xmalloc instead of malloc).
svn path=/trunk/yasm/; revision=297
*) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
esac],[profiling=false])
+AC_ARG_ENABLE(dmalloc,
+[ --enable-dmalloc Enable debug malloc (requires dmalloc library)],
+[case "${enableval}" in
+ yes) dmalloc=true ;;
+ no) dmalloc=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-dmalloc) ;;
+esac],[dmalloc=false])
+
AC_ARG_ENABLE(check,
[ --disable-check Disable building of test suite and make check],
[case "${enableval}" in
AM_PROG_CC_STDC
if ${dev}; then
- DEVFLAGS="-g"
+ DEVFLAGS=" -g"
fi
if ${morewarn}; then
- MOREWARNFLAGS="-Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings"
+ MOREWARNFLAGS=" -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings"
fi
if ${warnerror}; then
- WARNERRORFLAGS="-Werror"
+ WARNERRORFLAGS=" -Werror"
fi
if ${profiling}; then
- PROFILINGFLAGS="-pg"
+ PROFILINGFLAGS=" -pg"
+fi
+
+if ${dmalloc}; then
+ AC_CHECK_HEADERS(dmalloc.h)
+ AC_CHECK_LIB(dmalloc, main)
+ if test "$ac_cv_header_dmalloc_h" != yes ||
+ test "$ac_cv_lib_dmalloc_main" != yes; then
+ AC_MSG_ERROR([dmalloc required for --enable-dmalloc.])
+ else
+ DMALLOCFLAGS=" -DDMALLOC"
+ fi
+else
+ DMALLOCFLAGS=" -Wredundant-decls"
fi
if test "$GCC" = yes; then
- ANSI_CFLAGS="-ansi -pedantic -Wall $MOREWARNFLAGS $WARNERRORFLAGS $DEVFLAGS $PROFILINGFLAGS"
+ ANSI_CFLAGS="-ansi -pedantic -Wall$MOREWARNFLAGS$WARNERRORFLAGS$DEVFLAGS$PROFILINGFLAGS$DMALLOCFLAGS"
else
ANSI_CFLAGS="$DEVFLAGS"
fi
*) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
esac],[profiling=false])
+AC_ARG_ENABLE(dmalloc,
+[ --enable-dmalloc Enable debug malloc (requires dmalloc library)],
+[case "${enableval}" in
+ yes) dmalloc=true ;;
+ no) dmalloc=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-dmalloc) ;;
+esac],[dmalloc=false])
+
AC_ARG_ENABLE(check,
[ --disable-check Disable building of test suite and make check],
[case "${enableval}" in
AM_PROG_CC_STDC
if ${dev}; then
- DEVFLAGS="-g"
+ DEVFLAGS=" -g"
fi
if ${morewarn}; then
- MOREWARNFLAGS="-Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings"
+ MOREWARNFLAGS=" -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings"
fi
if ${warnerror}; then
- WARNERRORFLAGS="-Werror"
+ WARNERRORFLAGS=" -Werror"
fi
if ${profiling}; then
- PROFILINGFLAGS="-pg"
+ PROFILINGFLAGS=" -pg"
+fi
+
+if ${dmalloc}; then
+ AC_CHECK_HEADERS(dmalloc.h)
+ AC_CHECK_LIB(dmalloc, main)
+ if test "$ac_cv_header_dmalloc_h" != yes ||
+ test "$ac_cv_lib_dmalloc_main" != yes; then
+ AC_MSG_ERROR([dmalloc required for --enable-dmalloc.])
+ else
+ DMALLOCFLAGS=" -DDMALLOC"
+ fi
+else
+ DMALLOCFLAGS=" -Wredundant-decls"
fi
if test "$GCC" = yes; then
- ANSI_CFLAGS="-ansi -pedantic -Wall $MOREWARNFLAGS $WARNERRORFLAGS $DEVFLAGS $PROFILINGFLAGS"
+ ANSI_CFLAGS="-ansi -pedantic -Wall$MOREWARNFLAGS$WARNERRORFLAGS$DEVFLAGS$PROFILINGFLAGS$DMALLOCFLAGS"
else
ANSI_CFLAGS="$DEVFLAGS"
fi
#include "preproc.h"
#include "parser.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#ifndef countof
/* MODULE IMPORTS: */
/*****************************************************************************/
#ifdef STDC_HEADERS
-#include <stdlib.h> /* MODULE TYPE: (sys) */
#include <limits.h> /* MODULE TYPE: (sys) */
#include <string.h> /* MODULE TYPE: (sys) */
#include <ctype.h> /* MODULE TYPE: (sys) */
/*****************************************************************************/
#include "bitvect.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* ToolBox.h */
#include <stdio.h>
#ifdef STDC_HEADERS
-# include <stdlib.h>
# include <string.h>
#endif
#include "bytecode.h"
#include "section.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
struct effaddr {
#include "globals.h"
#include "errwarn.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* Total error count for entire assembler run.
#include "expr.h"
#include "symrec.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* Types listed in canonical sorting order. See expr_order_terms(). */
#include <ctype.h>
#ifdef STDC_HEADERS
-# include <stdlib.h>
# include <string.h>
#endif
#include "errwarn.h"
#include "floatnum.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* 97-bit internal floating point format:
#include <ctype.h>
#ifdef STDC_HEADERS
-# include <stdlib.h>
# include <string.h>
#endif
#include "errwarn.h"
#include "intnum.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#define BITVECT_ALLOC_SIZE 80
#include "util.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#if defined(LIBC_SCCS) && !defined(lint)
#ifdef STDC_HEADERS
# include <errno.h>
-# include <stdlib.h>
# include <string.h>
#endif
#include <stdio.h>
#ifdef STDC_HEADERS
-# include <stdlib.h>
# include <string.h>
#endif
#include "section.h"
#include "objfmt.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
struct section {
#include <stdio.h>
#ifdef STDC_HEADERS
-# include <stdlib.h>
# include <string.h>
#endif
#include "bytecode.h"
#include "section.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* DEFINED is set with EXTERN and COMMON below */
#include "errwarn.h"
+#ifndef DMALLOC
+
RCSID("$IdPath$");
void *
return newmem;
}
+#endif
#ifdef STDC_HEADERS
# include <stddef.h>
-# include <stdlib.h>
# include <string.h>
#else
size_t strlen(const char *);
# endif
#endif
+#ifndef DMALLOC
+
RCSID("$IdPath$");
char *
memcpy(copy, str, len);
return (copy);
}
+#endif
#include "util.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#if defined(LIBC_SCCS) && !defined(lint)
#ifdef STDC_HEADERS
# include <errno.h>
-# include <stdlib.h>
# include <string.h>
#endif
#include "expr.h"
#include "symrec.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* Types listed in canonical sorting order. See expr_order_terms(). */
#include "expr.h"
#include "symrec.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* Types listed in canonical sorting order. See expr_order_terms(). */
#include "section.h"
#include "objfmt.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#define YYDEBUG 1
#include "section.h"
#include "objfmt.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#define YYDEBUG 1
#include <stdio.h>
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif
-
#include "errwarn.h"
#include "bytecode.h"
#include <stdio.h>
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif
-
#include "errwarn.h"
#include "bytecode.h"
#include "bison.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#define YY_NEVER_INTERACTIVE 1
#include "expr.h"
#include "symrec.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* Types listed in canonical sorting order. See expr_order_terms(). */
#include "expr.h"
#include "symrec.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* Types listed in canonical sorting order. See expr_order_terms(). */
/* MODULE IMPORTS: */
/*****************************************************************************/
#ifdef STDC_HEADERS
-#include <stdlib.h> /* MODULE TYPE: (sys) */
#include <limits.h> /* MODULE TYPE: (sys) */
#include <string.h> /* MODULE TYPE: (sys) */
#include <ctype.h> /* MODULE TYPE: (sys) */
/*****************************************************************************/
#include "bitvect.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* ToolBox.h */
#include <stdio.h>
#ifdef STDC_HEADERS
-# include <stdlib.h>
# include <string.h>
#endif
#include "bytecode.h"
#include "section.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
struct effaddr {
#include "globals.h"
#include "errwarn.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* Total error count for entire assembler run.
#include "expr.h"
#include "symrec.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* Types listed in canonical sorting order. See expr_order_terms(). */
#include <ctype.h>
#ifdef STDC_HEADERS
-# include <stdlib.h>
# include <string.h>
#endif
#include "errwarn.h"
#include "floatnum.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* 97-bit internal floating point format:
#include <ctype.h>
#ifdef STDC_HEADERS
-# include <stdlib.h>
# include <string.h>
#endif
#include "errwarn.h"
#include "intnum.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#define BITVECT_ALLOC_SIZE 80
#include "preproc.h"
#include "parser.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#ifndef countof
#include "util.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#if defined(LIBC_SCCS) && !defined(lint)
#ifdef STDC_HEADERS
# include <errno.h>
-# include <stdlib.h>
# include <string.h>
#endif
#include <stdio.h>
#ifdef STDC_HEADERS
-# include <stdlib.h>
# include <string.h>
#endif
#include "preproc.h"
#include "parser.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* NULL-terminated list of all available parsers.
#include "section.h"
#include "objfmt.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#define YYDEBUG 1
#include "section.h"
#include "objfmt.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#define YYDEBUG 1
#include <stdio.h>
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif
-
#include "errwarn.h"
#include "bytecode.h"
#include <stdio.h>
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif
-
#include "errwarn.h"
#include "bytecode.h"
#include "bison.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
#define YY_NEVER_INTERACTIVE 1
#include <stdio.h>
#ifdef STDC_HEADERS
-# include <stdlib.h>
# include <string.h>
#endif
#include "section.h"
#include "objfmt.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
struct section {
#include <stdio.h>
#ifdef STDC_HEADERS
-# include <stdlib.h>
# include <string.h>
#endif
#include "bytecode.h"
#include "section.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* DEFINED is set with EXTERN and COMMON below */
#include <stdio.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
#include "errwarn.h"
#include "ternary.h"
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
RCSID("$IdPath$");
/* Non-recursive so we don't waste stack space/time on large
#include "errwarn.h"
+#ifndef DMALLOC
+
RCSID("$IdPath$");
void *
return newmem;
}
+#endif
#ifdef STDC_HEADERS
# include <stddef.h>
-# include <stdlib.h>
# include <string.h>
#else
size_t strlen(const char *);
# endif
#endif
+#ifndef DMALLOC
+
RCSID("$IdPath$");
char *
memcpy(copy, str, len);
return (copy);
}
+#endif