summaryrefslogtreecommitdiff
path: root/gcc/aclocal.m4
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-14 00:58:32 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-14 00:58:32 +0000
commit02be28b39d2c30bcde56930bd200f008068f51a5 (patch)
treeccab7edf12c9ffc3898e11aebb74de9fd06f46a0 /gcc/aclocal.m4
parenta00bb681a14b69dee24c0af16148309ed4a3e5b6 (diff)
downloadgcc-02be28b39d2c30bcde56930bd200f008068f51a5.tar.gz
* aclocal.m4 (gcc_AC_COMPILE_CHECK_SIZEOF, gcc_AC_C_CHAR_BIT,
gcc_AC_C_LONG_LONG): New. * configure.in: Use them. Probe the size of short, int, long, and long long/__int64 if we have them. Move all the AC_C_* checks together, except gcc_AC_C_CHAR_BIT which has to go after AC_CHECK_HEADERS(limits.h). Take hwint.h out of host_xm_file and build_xm_file. * hwint.h: Unconditionally define HOST_BITS_PER_CHAR, HOST_BITS_PER_SHORT, HOST_BITS_PER_INT, HOST_BITS_PER_LONG, and HOST_BITS_PER_LONGLONG in terms of SIZEOF_* and CHAR_BIT. Move the HOST_WIDEST_INT setup logic here from system.h. Provide HOST_WIDEST_INT even if HOST_BITS_PER_LONGLONG is not defined. * system.h: Include hwint.h after limits.h. HOST_WIDEST_INT is now handled by hwint.h. * config/alpha/xm-alpha-interix.h, config/alpha/xm-vms.h, config/c4x/xm-c4x.h, config/i370/xm-oe.h, config/ia64/xm-ia64.h: Don't define any of: HOST_BITS_PER_LONG, HOST_BITS_PER_CHAR, HOST_BITS_PER_SHORT, HOST_BITS_PER_LONGLONG. * config/alpha/xm-alpha.h, config/dsp16xx/xm-dsp16xx.h, config/h8300/xm-h8300.h, config/mips/iris6.h, config/mn10200/xm-mn10200.h, config/pa/xm-pa64hpux.h, config/sparc/xm-sp64.h: Delete. * config.gcc: Remove references to deleted files. * config/arm/xm-arm.h, config/mips/xm-mips.h: Don't define HOST_FLOAT_FORMAT to IEEE_FLOAT_FORMAT. * config/i370/xm-linux.h: Clarify floating-point situation in a comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40446 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/aclocal.m4')
-rw-r--r--gcc/aclocal.m4106
1 files changed, 106 insertions, 0 deletions
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index 128dc9773ab..92e16fb333a 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -1123,3 +1123,109 @@ else
gcc_cv_prog_$2_modern=no
fi
])
+
+dnl Determine if enumerated bitfields are unsigned. ISO C says they can
+dnl be either signed or unsigned.
+dnl
+AC_DEFUN(gcc_AC_C_ENUM_BF_UNSIGNED,
+[AC_CACHE_CHECK(for unsigned enumerated bitfields, gcc_cv_enum_bf_unsigned,
+[AC_TRY_RUN(#include <stdlib.h>
+enum t { BLAH = 128 } ;
+struct s_t { enum t member : 8; } s ;
+int main(void)
+{
+ s.member = BLAH;
+ if (s.member < 0) exit(1);
+ exit(0);
+
+}, gcc_cv_enum_bf_unsigned=yes, gcc_cv_enum_bf_unsigned=no, gcc_cv_enum_bf_unsigned=yes)])
+if test $gcc_cv_enum_bf_unsigned = yes; then
+ AC_DEFINE(ENUM_BITFIELDS_ARE_UNSIGNED, 1,
+ [Define if enumerated bitfields are treated as unsigned values.])
+fi])
+
+dnl Host type sizes probe.
+dnl By Kaveh R. Ghazi. One typo fixed since.
+dnl
+AC_DEFUN([gcc_AC_COMPILE_CHECK_SIZEOF],
+[changequote(<<, >>)dnl
+dnl The name to #define.
+define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
+dnl The cache variable name.
+define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
+changequote([, ])dnl
+AC_MSG_CHECKING(size of $1)
+AC_CACHE_VAL(AC_CV_NAME,
+[for ac_size in 4 8 1 2 16 $3 ; do # List sizes in rough order of prevalence.
+ AC_TRY_COMPILE([#include "confdefs.h"
+#include <sys/types.h>
+$2
+], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
+ if test x$AC_CV_NAME != x ; then break; fi
+done
+])
+if test x$AC_CV_NAME = x ; then
+ AC_MSG_ERROR([cannot determine a size for $1])
+fi
+AC_MSG_RESULT($AC_CV_NAME)
+AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
+undefine([AC_TYPE_NAME])dnl
+undefine([AC_CV_NAME])dnl
+])
+
+dnl Probe number of bits in a byte.
+dnl Note C89 requires CHAR_BIT >= 8.
+dnl
+AC_DEFUN(gcc_AC_C_CHAR_BIT,
+[AC_CACHE_CHECK(for CHAR_BIT, gcc_cv_decl_char_bit,
+[AC_EGREP_CPP(found,
+[#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef CHAR_BIT
+found
+#endif], gcc_cv_decl_char_bit=yes, gcc_cv_decl_char_bit=no)
+])
+if test $gcc_cv_decl_char_bit = no; then
+ AC_CACHE_CHECK(number of bits in a byte, gcc_cv_c_nbby,
+[i=8
+ gcc_cv_c_nbby=
+ while test $i -lt 65; do
+ AC_TRY_COMPILE(,
+ [switch(0) { case 0: case (char)(1 << $i) && (char)(1 << $i) != 1: ; }],
+ gcc_cv_c_nbby=$i
+ break)
+ i=`expr $i + 1`
+ done
+ test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed
+])
+if test $gcc_cv_c_nbby = failed; then
+ AC_MSG_ERROR(cannot determine number of bits in a byte)
+else
+ AC_DEFINE_UNQUOTED(CHAR_BIT, $gcc_cv_c_nbby,
+ [Define as the number of bits in a byte, if \`limits.h' doesn't.])
+fi
+fi])
+
+dnl Checking for long long.
+dnl By Caolan McNamara <caolan@skynet.ie>
+dnl Added check for __int64, Zack Weinberg <zackw@stanford.edu>
+dnl
+AC_DEFUN([gcc_AC_C_LONG_LONG],
+[AC_CACHE_CHECK(for long long int, ac_cv_c_long_long,
+ [AC_TRY_COMPILE(,[long long int i;],
+ ac_cv_c_long_long=yes,
+ ac_cv_c_long_long=no)])
+ if test $ac_cv_c_long_long = yes; then
+ AC_DEFINE(HAVE_LONG_LONG, 1,
+ [Define if your compiler supports the \`long long' type.])
+ fi
+AC_CACHE_CHECK(for __int64, ac_cv_c___int64,
+ [AC_TRY_COMPILE(,[__int64 i;],
+ ac_cv_c___int64=yes,
+ ac_cv_c___int64=no)])
+ if test $ac_cv_c___int64 = yes; then
+ AC_DEFINE(HAVE___INT64, 1,
+ [Define if your compiler supports the \`__int64' type.])
+ fi
+])