📄 aclocal.m4
字号:
# generated automatically by aclocal 1.7.5 -*- Autoconf -*-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002# Free Software Foundation, Inc.# This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY, to the extent permitted by law; without# even the implied warranty of MERCHANTABILITY or FITNESS FOR A# PARTICULAR PURPOSE.dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])]dnldnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires thednl existence of an include file <stdint.h> that defines a set of dnl typedefs, especially uint8_t,int32_t,uintptr_t.dnl Many older installations will not provide this file, but some willdnl have the very same definitions in <inttypes.h>. In other enviromentsdnl we can use the inet-types in <sys/types.h> which would define thednl typedefs int8_t and u_int8_t respectivly.dnldnl This macros will create a local "_stdint.h" or the headerfile given as dnl an argument. In many cases that file will just "#include <stdint.h>" dnl or "#include <inttypes.h>", while in other environments it will provide dnl the set of basic 'stdint's definitions/typedefs: dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_tdnl int_least32_t.. int_fast32_t.. intmax_tdnl which may or may not rely on the definitions of other files,dnl or using the AC_COMPILE_CHECK_SIZEOF macro to determine the actualdnl sizeof each type.dnldnl if your header files require the stdint-types you will want to create andnl installable file mylib-int.h that all your other installable headerdnl may include. So if you have a library package named "mylib", just usednl AX_CREATE_STDINT_H(mylib-int.h) dnl in configure.ac and go to install that very header file in Makefile.amdnl along with the other headers (mylib.h) - and the mylib-specific headersdnl can simply use "#include <mylib-int.h>" to obtain the stdint-types.dnldnl Remember, if the system already had a valid <stdint.h>, the generateddnl file will include it directly. No need for fuzzy HAVE_STDINT_H things...dnldnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/)dnl @version $Id: acinclude.m4,v 1.4 2003/06/12 21:33:06 srw Exp $dnl @author Guido Draheim <guidod@gmx.de> AC_DEFUN([AX_CREATE_STDINT_H],[# ------ AX CREATE STDINT H -------------------------------------AC_MSG_CHECKING([for stdint types])ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`# try to shortcircuit - if the default include path of the compiler# can find a "stdint.h" header then we assume that all compilers can.AC_CACHE_VAL([ac_cv_header_stdint_t],[old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS=""old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS=""old_CFLAGS="$CFLAGS" ; CFLAGS=""AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],[ac_cv_stdint_result="(assuming C99 compatible system)" ac_cv_header_stdint_t="stdint.h"; ],[ac_cv_header_stdint_t=""])CXXFLAGS="$old_CXXFLAGS"CPPFLAGS="$old_CPPFLAGS"CFLAGS="$old_CFLAGS" ])v="... $ac_cv_header_stdint_h"if test "$ac_stdint_h" = "stdint.h" ; then AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)])elif test "$ac_stdint_h" = "inttypes.h" ; then AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)])elif test "_$ac_cv_header_stdint_t" = "_" ; then AC_MSG_RESULT([(putting them into $ac_stdint_h)$v])else ac_cv_header_stdint="$ac_cv_header_stdint_t" AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)])fiif test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit..dnl .....intro message done, now do a few system checks.....dnl btw, all CHECK_TYPE macros do automatically "DEFINE" a type, thereforednl we use the autoconf implementation detail _AC CHECK_TYPE_NEW insteadinttype_headers=`echo $2 | sed -e 's/,/ /g'`ac_cv_stdint_result="(no helpful system typedefs seen)"AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) AC_MSG_RESULT([(..)]) for i in stdint.h inttypes.h sys/inttypes.h $inttype_headers ; do unset ac_cv_type_uintptr_t unset ac_cv_type_uint64_t _AC_CHECK_TYPE_NEW(uintptr_t,[ac_cv_header_stdint_x=$i],dnl continue,[#include <$i>]) AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) ac_cv_stdint_result="(seen uintptr_t$and64 in $i)" break; done AC_MSG_CHECKING([for stdint uintptr_t]) ])if test "_$ac_cv_header_stdint_x" = "_" ; thenAC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) AC_MSG_RESULT([(..)]) for i in inttypes.h sys/inttypes.h stdint.h $inttype_headers ; do unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],dnl continue,[#include <$i>]) AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) ac_cv_stdint_result="(seen uint32_t$and64 in $i)" break; done AC_MSG_CHECKING([for stdint uint32_t]) ])fiif test "_$ac_cv_header_stdint_x" = "_" ; thenif test "_$ac_cv_header_stdint_o" = "_" ; thenAC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) AC_MSG_RESULT([(..)]) for i in sys/types.h inttypes.h sys/inttypes.h $inttype_headers ; do unset ac_cv_type_u_int32_t unset ac_cv_type_u_int64_t AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],dnl continue,[#include <$i>]) AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) ac_cv_stdint_result="(seen u_int32_t$and64 in $i)" break; done AC_MSG_CHECKING([for stdint u_int32_t]) ])fi fidnl if there was no good C99 header file, do some typedef checks...if test "_$ac_cv_header_stdint_x" = "_" ; then AC_MSG_CHECKING([for stdint datatype model]) AC_MSG_RESULT([(..)]) AC_COMPILE_CHECK_SIZEOF(char) AC_COMPILE_CHECK_SIZEOF(short) AC_COMPILE_CHECK_SIZEOF(int) AC_COMPILE_CHECK_SIZEOF(long) AC_COMPILE_CHECK_SIZEOF(void*) ac_cv_stdint_char_model="" ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_char" ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_short" ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_int" ac_cv_stdint_long_model="" ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_int" ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_long" ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_voidp" name="$ac_cv_stdint_long_model" case "$ac_cv_stdint_char_model/$ac_cv_stdint_long_model" in 122/242) name="$name, IP16 (standard 16bit machine)" ;; 122/244) name="$name, LP32 (standard 32bit mac/win)" ;; 122/*) name="$name (unusual int16 model)" ;; 124/444) name="$name, ILP32 (standard 32bit unixish)" ;; 124/488) name="$name, LP64 (standard 64bit unixish)" ;; 124/448) name="$name, LLP64 (unusual 64bit unixish)" ;; 124/*) name="$name (unusual int32 model)" ;; 128/888) name="$name, ILP64 (unusual 64bit numeric)" ;; 128/*) name="$name (unusual int64 model)" ;; 222/*|444/*) name="$name (unusual dsptype)" ;; *) name="$name (very unusal model)" ;; esac AC_MSG_RESULT([combined for stdint datatype model... $name])fiif test "_$ac_cv_header_stdint_x" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_x"elif test "_$ac_cv_header_stdint_o" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_o"elif test "_$ac_cv_header_stdint_u" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_u"else ac_cv_header_stdint="stddef.h"fiAC_MSG_CHECKING([for extra inttypes in chosen header])AC_MSG_RESULT([($ac_cv_header_stdint)])dnl see if int_least and int_fast types are present in _this_ header.unset ac_cv_type_int_least32_tunset ac_cv_type_int_fast32_tAC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>])fi # shortcircut to system "stdint.h"# ------------------ PREPARE VARIABLES ------------------------------if test "$GCC" = "yes" ; thenac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` elseac_cv_stdint_message="using $CC"fiAC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl$ac_cv_stdint_result])# ----------------- DONE inttypes.h checks START header -------------AC_CONFIG_COMMANDS([$ac_stdint_h],[AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h)ac_stdint=$tmp/_stdint.hecho "#ifndef" $_ac_stdint_h >$ac_stdintecho "#define" $_ac_stdint_h "1" >>$ac_stdintecho "#ifndef" _GENERATED_STDINT_H >>$ac_stdintecho "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdintecho "/* generated $ac_cv_stdint_message */" >>$ac_stdintif test "_$ac_cv_header_stdint_t" != "_" ; then echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdintficat >>$ac_stdint <<STDINT_EOF/* ................... shortcircuit part ........................... */#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H#include <stdint.h>#else#include <stddef.h>/* .................... configured part ............................ */STDINT_EOFecho "/* whether we have a C99 compatible stdint header file */" >>$ac_stdintif test "_$ac_cv_header_stdint_x" != "_" ; then ac_header="$ac_cv_header_stdint_x" echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdintelse echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdintfiecho "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdintif test "_$ac_cv_header_stdint_o" != "_" ; then ac_header="$ac_cv_header_stdint_o" echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdintelse echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdintfiecho "/* whether we have a BSD compatible inet types header */" >>$ac_stdintif test "_$ac_cv_header_stdint_u" != "_" ; then ac_header="$ac_cv_header_stdint_u" echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdintelse echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdintfiecho "" >>$ac_stdintif test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then echo "#include <$ac_header>" >>$ac_stdint echo "" >>$ac_stdintfi fiecho "/* which 64bit typedef has been found */" >>$ac_stdintif test "$ac_cv_type_uint64_t" = "yes" ; thenecho "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdintelseecho "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdintfiif test "$ac_cv_type_u_int64_t" = "yes" ; thenecho "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdintelseecho "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdintfiecho "" >>$ac_stdintecho "/* which type model has been detected */" >>$ac_stdintif test "_$ac_cv_stdint_char_model" != "_" ; thenecho "#define _STDINT_CHAR_MODEL" "$ac_cv_stdint_char_model" >>$ac_stdintecho "#define _STDINT_LONG_MODEL" "$ac_cv_stdint_long_model" >>$ac_stdintelseecho "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdintecho "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdintfiecho "" >>$ac_stdintecho "/* whether int_least types were detected */" >>$ac_stdintif test "$ac_cv_type_int_least32_t" = "yes"; thenecho "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdintelseecho "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdintfiecho "/* whether int_fast types were detected */" >>$ac_stdintif test "$ac_cv_type_int_fast32_t" = "yes"; thenecho "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdintelseecho "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdintfiecho "/* whether intmax_t type was detected */" >>$ac_stdintif test "$ac_cv_type_intmax_t" = "yes"; thenecho "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdintelseecho "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdintfiecho "" >>$ac_stdint cat >>$ac_stdint <<STDINT_EOF/* .................... detections part ............................ *//* whether we need to define bitspecific types from compiler base types */#ifndef _STDINT_HEADER_INTPTR#ifndef _STDINT_HEADER_UINT32#ifndef _STDINT_HEADER_U_INT32#define _STDINT_NEED_INT_MODEL_T#else#define _STDINT_HAVE_U_INT_TYPES#endif#endif#endif#ifdef _STDINT_HAVE_U_INT_TYPES#undef _STDINT_NEED_INT_MODEL_T#endif#ifdef _STDINT_CHAR_MODEL#if _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124#ifndef _STDINT_BYTE_MODEL#define _STDINT_BYTE_MODEL 12#endif#endif#endif#ifndef _STDINT_HAVE_INT_LEAST32_T#define _STDINT_NEED_INT_LEAST_T#endif#ifndef _STDINT_HAVE_INT_FAST32_T#define _STDINT_NEED_INT_FAST_T#endif#ifndef _STDINT_HEADER_INTPTR#define _STDINT_NEED_INTPTR_T#ifndef _STDINT_HAVE_INTMAX_T#define _STDINT_NEED_INTMAX_T#endif#endif/* .................... definition part ............................ *//* some system headers have good uint64_t */#ifndef _HAVE_UINT64_T#if defined _STDINT_HAVE_UINT64_T || defined HAVE_UINT64_T#define _HAVE_UINT64_T#elif defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T#define _HAVE_UINT64_Ttypedef u_int64_t uint64_t;#endif#endif#ifndef _HAVE_UINT64_T/* .. here are some common heuristics using compiler runtime specifics */#if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L#define _HAVE_UINT64_Ttypedef long long int64_t;typedef unsigned long long uint64_t;#elif !defined __STRICT_ANSI__#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__#define _HAVE_UINT64_Ttypedef __int64 int64_t;typedef unsigned __int64 uint64_t;#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__/* note: all ELF-systems seem to have loff-support which needs 64-bit */#if !defined _NO_LONGLONG#define _HAVE_UINT64_Ttypedef long long int64_t;typedef unsigned long long uint64_t;#endif#elif defined __alpha || (defined __mips && defined _ABIN32)#if !defined _NO_LONGLONGtypedef long int64_t;typedef unsigned long uint64_t;#endif /* compiler/cpu type to define int64_t */#endif#endif#endif#if defined _STDINT_HAVE_U_INT_TYPES/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */typedef u_int8_t uint8_t;typedef u_int16_t uint16_t;typedef u_int32_t uint32_t;/* glibc compatibility */#ifndef __int8_t_defined#define __int8_t_defined#endif#endif#ifdef _STDINT_NEED_INT_MODEL_T/* we must guess all the basic types. Apart from byte-adressable system, *//* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} *//* (btw, those nibble-addressable systems are way off, or so we assume) */dnl /* have a look at "64bit and data size neutrality" at */dnl /* http://unix.org/version2/whatsnew/login_64bit.html */dnl /* (the shorthand "ILP" types always have a "P" part) */#if defined _STDINT_BYTE_MODEL#if _STDINT_LONG_MODEL+0 == 242/* 2:4:2 = IP16 = a normal 16-bit system */typedef unsigned char uint8_t;typedef unsigned short uint16_t;typedef unsigned long uint32_t;#ifndef __int8_t_defined#define __int8_t_definedtypedef char int8_t;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -