X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=m4%2Fmalloc.m4;h=f8ed1128b122cce332506403f0bdb8d1bca89407;hp=a6b4c9a5ef0364fdcb0f2b9573817f7809c13e68;hb=35e4096120236db8d64a767f1ccdd6bf03a091fc;hpb=912e7e968f4888d62b3c620893a70e825599973b diff --git a/m4/malloc.m4 b/m4/malloc.m4 index a6b4c9a5..f8ed1128 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -10,7 +10,7 @@ dnl /* Define to rpl_malloc if the replacement function should be used. */ 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. @@ -23,21 +23,19 @@ AC_DEFUN(jm_FUNC_MALLOC, 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 - dnl This was: LIBOBJS="$LIBOBJS malloc.$ac_objext" AC_LIBOBJ([malloc]) AC_DEFINE(malloc, rpl_malloc, [Replacement malloc()]) fi