dnl #undef malloc
dnl
-AC_DEFUN(jm_FUNC_MALLOC,
+AC_DEFUN([jm_FUNC_MALLOC],
[
if test x = y; then
dnl This code is deliberately never run via ./configure.
fi
dnl xmalloc.c requires that this symbol be defined so it doesn't
dnl mistakenly use a broken malloc -- as it might if this test were omitted.
- ac_kludge=HAVE_DONE_WORKING_MALLOC_CHECK
- AC_DEFINE_UNQUOTED($ac_kludge)
+ AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1, [Needed for xmalloc.c])
AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
- [AC_TRY_RUN([
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([
char *malloc ();
int
main ()
{
exit (malloc (0) ? 0 : 1);
}
- ],
- jm_cv_func_working_malloc=yes,
- jm_cv_func_working_malloc=no,
- dnl When crosscompiling, assume malloc is broken.
- jm_cv_func_working_malloc=no)
+ ])],
+ [jm_cv_func_working_malloc=yes],
+ [jm_cv_func_working_malloc=no],
+ [When crosscompiling])
])
if test $jm_cv_func_working_malloc = no; then
- LIBOBJS="$LIBOBJS malloc.o"
- AC_DEFINE_UNQUOTED(malloc, rpl_malloc)
+ AC_LIBOBJ([malloc])
+ AC_DEFINE(malloc, rpl_malloc, [Replacement malloc()])
fi
])