X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Ffree.m4;h=a2ab15cc2788bbbad51ff67e0f34bbf25368ea8a;hb=80a029602f5b2707ca8d2487843ecb9e0df74a6a;hp=ef6022b8485313df7595b0aec6c088bfcde18076;hpb=441aa3044f43e5572f58c354f01e6bc070acd5c7;p=gnulib.git diff --git a/m4/free.m4 b/m4/free.m4 index ef6022b84..a2ab15cc2 100644 --- a/m4/free.m4 +++ b/m4/free.m4 @@ -1,6 +1,6 @@ # Check whether free (NULL) is supposed to work. -# Copyright (C) 2003, 2004, 2005, 2009 Free Software Foundation, Inc. +# Copyright (C) 2003-2005, 2009-2012 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,21 +16,26 @@ AC_DEFUN([gl_FUNC_FREE], [ + AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether free (NULL) is known to work], [gl_cv_func_free], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[@%:@include ]], - [[@%:@if _POSIX_VERSION < 199009L && \ - (defined unix || defined _unix || defined _unix_ \ - || defined __unix || defined __unix__) - @%:@error "'free (NULL)' is not known to work" - @%:@endif]])], - [gl_cv_func_free=yes], - [gl_cv_func_free=no])]) + [case "$host_os" in + mingw*) gl_cv_func_free=yes ;; + *) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include ]], + [[@%:@if _POSIX_VERSION < 199009L && \ + (defined unix || defined _unix || defined _unix_ \ + || defined __unix || defined __unix__) + @%:@error "'free (NULL)' is not known to work" + @%:@endif]])], + [gl_cv_func_free=yes], + [gl_cv_func_free=no]) + esac + ]) if test $gl_cv_func_free = no; then - AC_LIBOBJ([free]) AC_DEFINE([free], [rpl_free], [Define to rpl_free if the replacement function should be used.]) fi