check for mallinfo in -lmalloc

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@35649 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2012-10-07 13:48:51 +00:00
parent 60fa58396d
commit 8bf58d7f29
3 changed files with 81 additions and 0 deletions

View file

@ -19,6 +19,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `malloc' library (-lmalloc). */
#undef HAVE_LIBMALLOC
/* Define if you have libreadline */
#undef HAVE_LIBREADLINE

76
configure vendored
View file

@ -4222,6 +4222,82 @@ done
{ $as_echo "$as_me:$LINENO: checking for mallinfo in -lmalloc" >&5
$as_echo_n "checking for mallinfo in -lmalloc... " >&6; }
if test "${ac_cv_lib_malloc_mallinfo+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lmalloc $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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. */
#ifdef __cplusplus
extern "C"
#endif
char mallinfo ();
int
main ()
{
return mallinfo ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_lib_malloc_mallinfo=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_malloc_mallinfo=no
fi
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_malloc_mallinfo" >&5
$as_echo "$ac_cv_lib_malloc_mallinfo" >&6; }
if test "x$ac_cv_lib_malloc_mallinfo" = x""yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBMALLOC 1
_ACEOF
LIBS="-lmalloc $LIBS"
fi
# Check whether --with-readline was given.
if test "${with_readline+set}" = set; then
withval=$with_readline;

View file

@ -21,6 +21,8 @@ AC_TYPE_MODE_T
AC_CHECK_FUNCS(getpid setpgid)
AC_CHECK_LIB([malloc],[mallinfo])
AC_ARG_WITH([readline],
[AS_HELP_STRING([--with-readline],
[support fancy command line editing @<:@default=check@:>@])],