Annotation of embedaddon/php/ext/date/lib/timelib.m4, revision 1.1.1.2

1.1       misho       1: dnl
1.1.1.2 ! misho       2: dnl $Id$
1.1       misho       3: dnl
                      4: dnl
                      5: dnl TL_DEF_HAVE(what [, why])
                      6: dnl
                      7: dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [WHY])'
                      8: dnl
                      9: AC_DEFUN([TL_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___),1,[ $2 ])])dnl
                     10: 
                     11: dnl
                     12: dnl TL_CHECK_INT_TYPE(type)
                     13: dnl
                     14: AC_DEFUN([TL_CHECK_INT_TYPE],[
                     15: AC_CACHE_CHECK([for $1], ac_cv_int_type_$1, [
                     16: AC_TRY_COMPILE([
                     17: #if HAVE_SYS_TYPES_H
                     18: # include <sys/types.h>
                     19: #endif
                     20: #if HAVE_INTTYPES_H
                     21: # include <inttypes.h>
                     22: #elif HAVE_STDINT_H   
                     23: # include <stdint.h>  
                     24: #endif],
                     25: [if (($1 *) 0)
                     26:   return 0;   
                     27: if (sizeof ($1))
                     28:   return 0;
                     29: ], [ac_cv_int_type_$1=yes], [ac_cv_int_type_$1=no])
                     30: ])
                     31: if test "$ac_cv_int_type_$1" = "yes"; then
                     32:   TL_DEF_HAVE($1, [Define if $1 type is present.])
                     33: fi
                     34: ])dnl
                     35: 
                     36: dnl
                     37: dnl AC_TIMELIB_C_BIGENDIAN
                     38: dnl Replacement macro for AC_C_BIGENDIAN
                     39: dnl
                     40: AC_DEFUN([AC_TIMELIB_C_BIGENDIAN],
                     41: [AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
                     42:  [
                     43:   ac_cv_c_bigendian_php=unknown
                     44:   AC_TRY_RUN(
                     45:   [
                     46: int main(void)
                     47: {
                     48:         short one = 1;
                     49:         char *cp = (char *)&one;
                     50: 
                     51:         if (*cp == 0) {
                     52:                 return(0);
                     53:         } else {
                     54:                 return(1);
                     55:         }
                     56: } 
                     57:   ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
                     58:  ])
                     59:  if test $ac_cv_c_bigendian_php = yes; then
                     60:    AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
                     61:  fi
                     62: ])dnl
                     63: 
                     64: dnl Check for types, sizes, etc. needed by timelib
                     65: AC_CHECK_SIZEOF(long, 8)
                     66: AC_CHECK_SIZEOF(int, 4)
                     67: TL_CHECK_INT_TYPE(int32_t)
                     68: TL_CHECK_INT_TYPE(uint32_t)
                     69: 
                     70: dnl Check for headers needed by timelib
                     71: AC_CHECK_HEADERS([ \
                     72: sys/types.h \
                     73: inttypes.h \
                     74: stdint.h \
                     75: string.h \
                     76: stdlib.h
                     77: ])
                     78: 
                     79: dnl Check for strtoll, atoll
                     80: AC_CHECK_FUNCS(strtoll atoll strftime)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>