Skip to content

Commit

Permalink
add check for MALLINFO2
Browse files Browse the repository at this point in the history
  • Loading branch information
teuben committed Jan 4, 2025
1 parent acbf03b commit 8d95fd2
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
62 changes: 62 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -10429,6 +10429,68 @@ then :
fi


{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing mallinfo2" >&5
printf %s "checking for library containing mallinfo2... " >&6; }
if test ${ac_cv_search_mallinfo2+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char mallinfo2 ();
int
main (void)
{
return mallinfo2 ();
;
return 0;
}
_ACEOF
for ac_lib in '' malloc
do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_search_mallinfo2=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext
if test ${ac_cv_search_mallinfo2+y}
then :
break
fi
done
if test ${ac_cv_search_mallinfo2+y}
then :

else $as_nop
ac_cv_search_mallinfo2=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mallinfo2" >&5
printf "%s\n" "$ac_cv_search_mallinfo2" >&6; }
ac_res=$ac_cv_search_mallinfo2
if test "$ac_res" != no
then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

printf "%s\n" "#define HAVE_MALLINFO2 1" >>confdefs.h

fi





Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,10 @@ AC_SEARCH_LIBS(sin, m)
AC_SEARCH_LIBS(cblas_daxpy, gslcblas)
AC_SEARCH_LIBS(gsl_version, gsl)

dnl mallinfo is optional; the code can compile (minus features) without it
AC_SEARCH_LIBS(mallinfo2,malloc,AC_DEFINE([HAVE_MALLINFO2],[1],
[Define if mallinfo2() is available on this platform.]))

dnl AC_CHECK_LIB(c, strsignal)

dnl Checks for header files.
Expand Down

0 comments on commit 8d95fd2

Please sign in to comment.