1#!/bin/sh
2
3# A little utility function to generate header info.
4#
5# The output of this program is generally written to art_config.h,
6# which is installed in libart's include dir.
7
8
9echo "/* Automatically generated by gen_art_config */"
10echo
11echo "#define ART_SIZEOF_CHAR @ART_SIZEOF_CHAR@"
12echo "#define ART_SIZEOF_SHORT @ART_SIZEOF_SHORT@"
13echo "#define ART_SIZEOF_INT @ART_SIZEOF_INT@"
14echo "#define ART_SIZEOF_LONG @ART_SIZEOF_LONG@"
15echo
16
17if test @ART_SIZEOF_CHAR@ -eq 1; then
18  echo "typedef unsigned char art_u8;"
19else
20  echo 1>&2 "sizeof(char) != 1"
21  exit 1
22fi
23
24if test @ART_SIZEOF_SHORT@ -eq 2; then
25  echo "typedef unsigned short art_u16;"
26else
27  echo 1>&2 "sizeof(short) != 2"
28  exit 2
29fi
30
31if test @ART_SIZEOF_INT@ -eq 4; then
32  echo "typedef unsigned int art_u32;"
33else
34  if test @ART_SIZEOF_LONG@ -eq 4; then
35    echo "typedef unsigned long art_u32;"
36  else
37    echo 1>&2 "sizeof(int) != 4 and sizeof(long) != 4"
38	exit 3
39  fi
40fi
41
42exit 0
43}
44