Skip to content

Commit

Permalink
Disabling AC_FUNC_MALLOC to avoid cross-compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Qi Zheng committed Nov 30, 2017
1 parent 2b63784 commit 5769dbb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 78 deletions.
6 changes: 1 addition & 5 deletions src/libdivsufsort/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
/* Define to 1 if you have the `malloc' function. */
#define HAVE_MALLOC 1

/* Define to 1 if you have the <memory.h> header file. */
Expand Down Expand Up @@ -87,9 +86,6 @@
such a type exists and the standard includes do not define it. */
/* #undef int64_t */

/* Define to rpl_malloc if the replacement function should be used. */
/* #undef malloc */

/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */

Expand Down
6 changes: 1 addition & 5 deletions src/libdivsufsort/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H

/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
/* Define to 1 if you have the `malloc' function. */
#undef HAVE_MALLOC

/* Define to 1 if you have the <memory.h> header file. */
Expand Down Expand Up @@ -86,9 +85,6 @@
such a type exists and the standard includes do not define it. */
#undef int64_t

/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc

/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t

Expand Down
69 changes: 1 addition & 68 deletions src/libdivsufsort/configure
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ ac_includes_default="\
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
RANLIB
LIBOBJS
RANLIB
EGREP
GREP
CPP
Expand Down Expand Up @@ -4499,73 +4499,6 @@ _ACEOF
fi
done
for ac_header in stdlib.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
if test "x$ac_cv_header_stdlib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STDLIB_H 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
if ${ac_cv_func_malloc_0_nonnull+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
ac_cv_func_malloc_0_nonnull=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined STDC_HEADERS || defined HAVE_STDLIB_H
# include <stdlib.h>
#else
char *malloc ();
#endif
int
main ()
{
return ! malloc (0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
ac_cv_func_malloc_0_nonnull=yes
else
ac_cv_func_malloc_0_nonnull=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
if test $ac_cv_func_malloc_0_nonnull = yes; then :
$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
else
$as_echo "#define HAVE_MALLOC 0" >>confdefs.h
case " $LIBOBJS " in
*" malloc.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS malloc.$ac_objext"
;;
esac
$as_echo "#define malloc rpl_malloc" >>confdefs.h
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
Expand Down

0 comments on commit 5769dbb

Please sign in to comment.