Small reorganization.
[pspp] / m4 / vasnprintf.m4
index 72c9a13e2fb977b3bda0fb4bb8979b3805179e42..e7b51dc413203c29942d1ce832c4de2de83c06ef 100644 (file)
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 7
-dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 8
+dnl Copyright (C) 2002-2004, 2006-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,18 +7,28 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_VASNPRINTF],
 [
   AC_REQUIRE([gl_EOVERFLOW])
-  AC_REPLACE_FUNCS(vasnprintf)
+  AC_CHECK_FUNCS([vasnprintf])
   if test $ac_cv_func_vasnprintf = no; then
-    AC_LIBOBJ(printf-args)
-    AC_LIBOBJ(printf-parse)
-    AC_LIBOBJ(asnprintf)
-    gl_PREREQ_PRINTF_ARGS
-    gl_PREREQ_PRINTF_PARSE
-    gl_PREREQ_VASNPRINTF
-    gl_PREREQ_ASNPRINTF
+    gl_REPLACE_VASNPRINTF
   fi
 ])
 
+AC_DEFUN([gl_REPLACE_VASNPRINTF],
+[
+  AC_LIBOBJ([vasnprintf])
+  AC_LIBOBJ([printf-args])
+  AC_LIBOBJ([printf-parse])
+  AC_LIBOBJ([asnprintf])
+  if test $ac_cv_func_vasnprintf = yes; then
+    AC_DEFINE([REPLACE_VASNPRINTF], 1,
+      [Define if vasnprintf exists but is overridden by gnulib.])
+  fi
+  gl_PREREQ_PRINTF_ARGS
+  gl_PREREQ_PRINTF_PARSE
+  gl_PREREQ_VASNPRINTF
+  gl_PREREQ_ASNPRINTF
+])
+
 # Prequisites of lib/printf-args.h, lib/printf-args.c.
 AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
 [