1dnl I'd like this to be edited in -*- Autoconf -*- mode...
2dnl
3AC_DEFUN([GST_FUNC_STRTOUL], [
4
5# Check for strtoul.  Under some versions of AIX, strtoul returns
6# an incorrect terminator pointer for the string "0".
7AC_CACHE_CHECK(for working strtoul, gst_cv_working_strtoul, [
8  exec AS_MESSAGE_FD([])>/dev/null
9  AC_CHECK_FUNC(strtoul, gst_cv_working_strtoul=yes, gst_cv_working_strtoul=no)
10  if test $gst_cv_working_strtoul = yes; then
11    AC_RUN_IFELSE([AC_LANG_SOURCE([[
12      extern int strtoul();
13      int main()
14      {
15	char *string = "0";
16	char *term;
17	int value;
18	value = strtoul(string, &term, 0);
19	exit((value != 0) || (term != (string+1)));
20      }]])],[],[gst_cv_working_strtoul=no],[gst_cv_working_strtoul=no])
21  fi
22  test "$silent" != yes && exec AS_MESSAGE_FD([])>&1
23])
24
25test "$gst_cv_working_strtoul" != yes && AC_LIBOBJ(strtoul)
26
27])dnl
28