acinclude.m4 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. dnl cloned from autoconf 2.13 acspecific.m4
  2. AC_DEFUN(AC_C_LONG_LONG,
  3. [AC_CACHE_CHECK(for long long, ac_cv_c_long_long,
  4. [if test "$GCC" = yes; then
  5. ac_cv_c_long_long=yes
  6. else
  7. AC_TRY_RUN([int main() {
  8. long long foo = 0;
  9. exit(sizeof(long long) < sizeof(long)); }],
  10. ac_cv_c_long_long=yes, ac_cv_c_long_long=no)
  11. fi])
  12. if test $ac_cv_c_long_long = yes; then
  13. AC_DEFINE(HAVE_LONG_LONG)
  14. fi
  15. ])
  16. dnl from autoconf 2.13 acgeneral.m4, with patch:
  17. dnl Date: Fri, 15 Jan 1999 05:52:41 -0800
  18. dnl Message-ID: <199901151352.FAA18237@shade.twinsun.com>
  19. dnl From: eggert@twinsun.com (Paul Eggert)
  20. dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars
  21. dnl Newsgroups: gnu.utils.bug
  22. dnl AC_CHECK_TYPE2(TYPE, DEFAULT)
  23. AC_DEFUN(AC_CHECK_TYPE2,
  24. [AC_REQUIRE([AC_HEADER_STDC])dnl
  25. AC_MSG_CHECKING(for $1)
  26. AC_CACHE_VAL(ac_cv_type_$1,
  27. [AC_EGREP_CPP(dnl
  28. changequote(<<,>>)dnl
  29. <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
  30. changequote([,]), [#include <sys/types.h>
  31. #if STDC_HEADERS
  32. #include <stdlib.h>
  33. #include <stddef.h>
  34. #endif], eval "ac_cv_type_$1=yes", eval "ac_cv_type_$1=no")])dnl
  35. if eval "test \"`echo '$ac_cv_type_'$1`\" = yes"; then
  36. AC_MSG_RESULT(yes)
  37. else
  38. AC_MSG_RESULT(no)
  39. AC_DEFINE_UNQUOTED($1, $2)
  40. fi
  41. ])
  42. dnl from autoconf 2.13 acgeneral.m4, with additional third argument
  43. dnl AC_CHECK_SIZEOF_INCLUDES(TYPE [, CROSS-SIZE, [INCLUDES]])
  44. AC_DEFUN(AC_CHECK_SIZEOF_INCLUDES,
  45. [changequote(<<, >>)dnl
  46. dnl The name to #define.
  47. define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
  48. dnl The cache variable name.
  49. define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
  50. changequote([, ])dnl
  51. AC_MSG_CHECKING(size of $1)
  52. AC_CACHE_VAL(AC_CV_NAME,
  53. [AC_TRY_RUN([$3
  54. #include <stdio.h>
  55. main()
  56. {
  57. FILE *f=fopen("conftestval", "w");
  58. if (!f) exit(1);
  59. fprintf(f, "%d\n", sizeof($1));
  60. exit(0);
  61. }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
  62. AC_MSG_RESULT($AC_CV_NAME)
  63. AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
  64. undefine([AC_TYPE_NAME])dnl
  65. undefine([AC_CV_NAME])dnl
  66. ])
  67. dnl AC_CHECK_SIZEOF_STDC_HEADERS(TYPE [, CROSS_SIZE])
  68. AC_DEFUN(AC_CHECK_SIZEOF_STDC_HEADERS,
  69. [AC_CHECK_SIZEOF_INCLUDES($1, $2,
  70. [#include <sys/types.h>
  71. #ifdef STDC_HEADERS
  72. #include <stdlib.h>
  73. #endif
  74. ])
  75. ])