From: hno <> Date: Sat, 13 Apr 2002 23:45:39 +0000 (+0000) Subject: AC_CHECK_SIZEOF_SYSTYPE (forgot to add acinclude.m4 previously) X-Git-Tag: SQUID_3_0_PRE1~1083 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=384d17e3d4bb28148f2da5a6a1ecd0af4b818b8f;p=thirdparty%2Fsquid.git AC_CHECK_SIZEOF_SYSTYPE (forgot to add acinclude.m4 previously) --- diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000000..6f599c2435 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,34 @@ +dnl AC_CHECK_SIZEOF_SYSTYPE is as the standard AC_CHECK_SIZEOF macro +dnl but also capable of checking the size of system defined types, not +dnl only compiler defined types. + +dnl AC_CHECK_SIZEOF_SYSTYPE(TYPE [, CROSS-SIZE]) +AC_DEFUN(AC_CHECK_SIZEOF_SYSTYPE, +[changequote(<<, >>)dnl +dnl The name to #define. +define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl +dnl The cache variable name. +define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl +changequote([, ])dnl +AC_MSG_CHECKING(size of $1) +AC_CACHE_VAL(AC_CV_NAME, +[AC_TRY_RUN([#include +#if HAVE_STDINT_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +int main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) return(1); + fprintf(f, "%d\n", sizeof($1)); + return(0); +}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl +AC_MSG_RESULT($AC_CV_NAME) +AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) +undefine([AC_TYPE_NAME])dnl +undefine([AC_CV_NAME])dnl +]) +