Debian Codegraph @

texk/xdvik/m4/xdvi-c-bitmap-type.m4

raw
1 # Autoconf macros for xdvik.
2 # Copyright (C) 1999 - 2009 Paul Vojta <[email protected]>
3 # Copyright (C) 2009 Peter Breitenlohner <[email protected]>
4 #
5 # This file is free software; the copyright holders
6 # give unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # XDVI_C_BITMAP_TYPE
10 # ------------------
11 # Determine integer type to use for bitmaps.
12 # Uses AC_CHECK_SIZEOF(TYPE) and thus works when cross compiling.
13 AC_DEFUN([XDVI_C_BITMAP_TYPE],
14 [AC_CHECK_SIZEOF([unsigned long])[]dnl
15 AC_CHECK_SIZEOF([unsigned int])[]dnl
16 AC_CHECK_SIZEOF([unsigned short])[]dnl
17 AC_CHECK_SIZEOF([unsigned char])[]dnl
18 AC_MSG_CHECKING([for integer type to use in bitmaps])
19 AC_CACHE_VAL([xdvi_cv_bitmap_type],
20 [AS_IF([(test $ac_cv_sizeof_unsigned_long = 4 || test $ac_cv_sizeof_unsigned_long = 2) \
21 && test $ac_cv_sizeof_unsigned_long != $ac_cv_sizeof_unsigned_int],
22 [xdvi_cv_bitmap_type="BMTYPE=long BMBYTES=$ac_cv_sizeof_unsigned_long"],
23 [test $ac_cv_sizeof_unsigned_int = 4 || test $ac_cv_sizeof_unsigned_int = 2],
24 [xdvi_cv_bitmap_type="BMTYPE=int BMBYTES=$ac_cv_sizeof_unsigned_int"],
25 [test $ac_cv_sizeof_unsigned_short = 4 || test $ac_cv_sizeof_unsigned_short = 2],
26 [xdvi_cv_bitmap_type="BMTYPE=short BMBYTES=$ac_cv_sizeof_unsigned_short"],
27 [xdvi_cv_bitmap_type="BMTYPE=char BMBYTES=$ac_cv_sizeof_unsigned_cher"])])
28 eval "$xdvi_cv_bitmap_type"
29 AC_DEFINE_UNQUOTED([BMTYPE], [$BMTYPE],
30 [Define to determine the integer type to be used in bitmaps.
31 The type used will be "unsigned BMTYPE".])
32 AC_DEFINE_UNQUOTED([BMBYTES], [$BMBYTES], [Define to the length (in bytes) of type BMTYPE.])
33 AC_MSG_RESULT([unsigned $BMTYPE, size = $BMBYTES])
34 ]) # XDVI_C_BITMAP_TYPE