s48_determine_pointer_size.m4 978 B

1234567891011121314151617181920212223242526272829
  1. ### s48_determine_pointer_size.m4 --- S48_DETERMINE_POINTER_SIZE macro -*- Autoconf -*-
  2. # serial 1
  3. dnl
  4. dnl
  5. dnl Determines the size of a pointer.
  6. AC_DEFUN([S48_DETERMINE_POINTER_SIZE], [dnl
  7. dnl Our own version of AC_CHECK_SIZEOF([void *])
  8. AC_MSG_CHECKING(size of void *)
  9. AC_CACHE_VAL(ac_cv_sizeof_void_p,
  10. [AC_TRY_RUN([#include <stdio.h>
  11. #include <stdlib.h>
  12. main()
  13. {
  14. FILE *f=fopen("conftestval", "w");
  15. if (!f) exit(1);
  16. fprintf(f, "%d\n", (int)sizeof(void *));
  17. exit(0);
  18. }],
  19. ac_cv_sizeof_void_p=`cat conftestval`,
  20. ac_cv_sizeof_void_p=0,
  21. AC_MSG_ERROR(failed to compile test program))])
  22. if test "$ac_cv_sizeof_void_p" = "0" -o "$ac_cv_sizeof_void_p" = ""; then
  23. AC_MSG_ERROR([Unable to determine sizeof (void *), see config.log for details.]);
  24. fi
  25. AC_MSG_RESULT($ac_cv_sizeof_void_p)
  26. AC_DEFINE_UNQUOTED(SIZEOF_VOID_P, [$ac_cv_sizeof_void_p], [Check for sizeof (void *)])
  27. ])
  28. ### s48_determine_pointer_size.m4 ends here