kopia lustrzana https://gitlab.com/sane-project/backends
* configure.in, m4/stdint.m4: Update to latest version to
get latest fixes and use logic to not recreate _stdint.h if no changes (to prevent unneeded recompiles). * m4/byteorder.m4: Added support to reuse existing byteorder.h if no changes to prevent timestamp causing a recompile.merge-requests/1/head
rodzic
c290bb2e1b
commit
df7839f587
|
@ -1,3 +1,10 @@
|
|||
2009-02-24 Chris Bagwell <cbagwell-guest at users.alioth.debian.org>
|
||||
* configure.in, m4/stdint.m4: Update to latest version to
|
||||
get latest fixes and use logic to not recreate _stdint.h if
|
||||
no changes (to prevent unneeded recompiles).
|
||||
* m4/byteorder.m4: Added support to reuse existing byteorder.h if
|
||||
no changes to prevent timestamp causing a recompile.
|
||||
|
||||
2009-02-24 m. allan noah <kitno455 a t gmail d o t com>
|
||||
* frontend/scanimage.c: improved comments, simplified x/y option code,
|
||||
removed buggy -1/+1 x/y code (#311172), expose non-settable options,
|
||||
|
|
|
@ -1490,7 +1490,7 @@ FIRMWARE_DIRS = artec_eplus48u gt68xx snapscan epjitsu
|
|||
|
||||
# TODO: This really belongs together with the saned sources and
|
||||
# should be installed there as well.
|
||||
# TODO: Why are this distributed but not compiled?
|
||||
# TODO: Why are these distributed but not compiled?
|
||||
# TODO: Why are this distributed but not compiled?
|
||||
# TODO: Why are this distributed but not compiled?
|
||||
# TODO: Why are this distributed but not compiled?
|
||||
|
@ -1502,7 +1502,7 @@ FIRMWARE_DIRS = artec_eplus48u gt68xx snapscan epjitsu
|
|||
# TODO: Why are these distributed but not compiled?
|
||||
# TODO: Why are these distributed but not compiled?
|
||||
# TODO: Why are these distributed but not compiled?
|
||||
# TODO: Why are these distributed by not compiled?
|
||||
# TODO: Why are these distributed but not compiled?
|
||||
# TODO: Why are these distributed but not compiled?
|
||||
# TODO: Why are these distributed but not compiled?
|
||||
# TODO: Why are these distributed but not compiled?
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -98,7 +98,7 @@ m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[AC_MINIX])
|
|||
AC_ISC_POSIX
|
||||
|
||||
AC_NEED_BYTEORDER_H([include/byteorder.h])
|
||||
AX_NEED_STDINT_H([include/_stdint.h])
|
||||
AX_CREATE_STDINT_H([include/_stdint.h])
|
||||
|
||||
dnl ***********************************************************************
|
||||
dnl Checks for libraries
|
||||
|
|
|
@ -461,6 +461,21 @@
|
|||
/* SCSI command buffer size */
|
||||
#undef SCSIBUFFERSIZE
|
||||
|
||||
/* The size of `char', as computed by sizeof. */
|
||||
#undef SIZEOF_CHAR
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#undef SIZEOF_SHORT
|
||||
|
||||
/* The size of `void*', as computed by sizeof. */
|
||||
#undef SIZEOF_VOIDP
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at runtime.
|
||||
|
|
|
@ -32,10 +32,11 @@ $4
|
|||
dnl Create a header file that defines extended byte swapping macros
|
||||
AC_DEFUN([AC_NEED_BYTEORDER_H],
|
||||
[
|
||||
ac_byteorder_h=`echo ifelse($1, , _byteorder.h, $1)`
|
||||
changequote(, )dnl
|
||||
ac_dir=`echo $1|sed 's%/[^/][^/]*$%%'`
|
||||
ac_dir=`echo $ac_byteorder_h|sed 's%/[^/][^/]*$%%'`
|
||||
changequote([, ])dnl
|
||||
if test "$ac_dir" != "$1" && test "$ac_dir" != .; then
|
||||
if test "$ac_dir" != "$ac_byteorder" && test "$ac_dir" != .; then
|
||||
# The file is in a subdirectory.
|
||||
test ! -d "$ac_dir" && mkdir "$ac_dir"
|
||||
fi
|
||||
|
@ -47,7 +48,8 @@ if test "x$effective_target" = xNONE -o "x$effective_target" = x ; then
|
|||
fi
|
||||
AC_SUBST(effective_target)
|
||||
|
||||
cat > "$1" << EOF
|
||||
ac_byteorder=_byteorder.tmp
|
||||
cat > "$ac_byteorder" << EOF
|
||||
/* This file is generated automatically by configure */
|
||||
/* It is valid only for the system type ${effective_target} */
|
||||
|
||||
|
@ -62,7 +64,7 @@ AC_C_BIGENDIAN
|
|||
dnl Look for NetBSD-style extended byte swapping macros
|
||||
AC_HAVE_SYMBOL(le32toh,machine/endian.h,
|
||||
[HAVE_LE32TOH=1
|
||||
cat >> "$1" << EOF
|
||||
cat >> "$ac_byteorder" << EOF
|
||||
/* extended byte swapping macros are already available */
|
||||
#include <machine/endian.h>
|
||||
|
||||
|
@ -72,14 +74,14 @@ EOF],
|
|||
|
||||
dnl Look for standard byte swapping macros
|
||||
AC_HAVE_SYMBOL(ntohl,arpa/inet.h,
|
||||
[cat >> "$1" << EOF
|
||||
[cat >> "$ac_byteorder" << EOF
|
||||
/* ntohl and relatives live here */
|
||||
#include <arpa/inet.h>
|
||||
|
||||
EOF],
|
||||
|
||||
[AC_HAVE_SYMBOL(ntohl,netinet/in.h,
|
||||
[cat >> "$1" << EOF
|
||||
[cat >> "$ac_byteorder" << EOF
|
||||
/* ntohl and relatives live here */
|
||||
#include <netinet/in.h>
|
||||
|
||||
|
@ -90,7 +92,7 @@ dnl Look for generic byte swapping macros
|
|||
|
||||
dnl OpenBSD
|
||||
AC_HAVE_SYMBOL(swap32,machine/endian.h,
|
||||
[cat >> "$1" << EOF
|
||||
[cat >> "$ac_byteorder" << EOF
|
||||
/* swap32 and swap16 are defined in machine/endian.h */
|
||||
|
||||
EOF],
|
||||
|
@ -98,7 +100,7 @@ EOF],
|
|||
[
|
||||
dnl Linux GLIBC
|
||||
AC_HAVE_SYMBOL(bswap_32,byteswap.h,
|
||||
[cat >> "$1" << EOF
|
||||
[cat >> "$ac_byteorder" << EOF
|
||||
/* Define generic byte swapping functions */
|
||||
#include <byteswap.h>
|
||||
#define swap16(x) bswap_16(x)
|
||||
|
@ -111,13 +113,13 @@ EOF],
|
|||
dnl NetBSD
|
||||
AC_HAVE_SYMBOL(bswap32,machine/endian.h,
|
||||
dnl We're already including machine/endian.h if this test succeeds
|
||||
[cat >> "$1" << EOF
|
||||
[cat >> "$ac_byteorder" << EOF
|
||||
/* Define generic byte swapping functions */
|
||||
EOF
|
||||
if test "$HAVE_LE32TOH" != "1"; then
|
||||
echo '#include <machine/endian.h>'>> "$1"
|
||||
echo '#include <machine/endian.h>'>> "$ac_byteorder"
|
||||
fi
|
||||
cat >> "$1" << EOF
|
||||
cat >> "$ac_byteorder" << EOF
|
||||
#define swap16(x) bswap16(x)
|
||||
#define swap32(x) bswap32(x)
|
||||
#define swap64(x) bswap64(x)
|
||||
|
@ -127,7 +129,7 @@ EOF],
|
|||
[
|
||||
dnl FreeBSD
|
||||
AC_HAVE_SYMBOL(__byte_swap_long,sys/types.h,
|
||||
[cat >> "$1" << EOF
|
||||
[cat >> "$ac_byteorder" << EOF
|
||||
/* Define generic byte swapping functions */
|
||||
#include <sys/types.h>
|
||||
#define swap16(x) __byte_swap_word(x)
|
||||
|
@ -147,7 +149,7 @@ EOF],
|
|||
[
|
||||
dnl OS X
|
||||
AC_HAVE_SYMBOL(NXSwapLong,machine/byte_order.h,
|
||||
[cat >> "$1" << EOF
|
||||
[cat >> "$ac_byteorder" << EOF
|
||||
/* Define generic byte swapping functions */
|
||||
#include <machine/byte_order.h>
|
||||
#define swap16(x) NXSwapShort(x)
|
||||
|
@ -157,7 +159,7 @@ dnl OS X
|
|||
EOF],
|
||||
[
|
||||
if test $ac_cv_c_bigendian = yes; then
|
||||
cat >> "$1" << EOF
|
||||
cat >> "$ac_byteorder" << EOF
|
||||
/* No other byte swapping functions are available on this big-endian system */
|
||||
#define swap16(x) ((uint16_t)(((x) << 8) | ((uint16_t)(x) >> 8)))
|
||||
#define swap32(x) ((uint32_t)(((uint32_t)(x) << 24) & 0xff000000UL | \\
|
||||
|
@ -175,7 +177,7 @@ EOF],
|
|||
|
||||
EOF
|
||||
else
|
||||
cat >> "$1" << EOF
|
||||
cat >> "$ac_byteorder" << EOF
|
||||
/* Use these as generic byteswapping macros on this little endian system */
|
||||
#define swap16(x) ntohs(x)
|
||||
#define swap32(x) ntohl(x)
|
||||
|
@ -200,7 +202,7 @@ EOF
|
|||
|
||||
[
|
||||
if test "$HAVE_LE32TOH" != "1"; then
|
||||
cat >> "$1" << EOF
|
||||
cat >> "$ac_byteorder" << EOF
|
||||
/* The byte swapping macros have the form: */
|
||||
/* EENN[a]toh or htoEENN[a] where EE is be (big endian) or */
|
||||
/* le (little-endian), NN is 16 or 32 (number of bits) and a, */
|
||||
|
@ -230,7 +232,7 @@ if test "$HAVE_LE32TOH" != "1"; then
|
|||
EOF
|
||||
|
||||
if test $ac_cv_c_bigendian = yes; then
|
||||
cat >> "$1" << EOF
|
||||
cat >> "$ac_byteorder" << EOF
|
||||
/* Define our own extended byte swapping macros for big-endian machines */
|
||||
#define htole16(x) swap16(x)
|
||||
#define htole32(x) swap32(x)
|
||||
|
@ -250,7 +252,7 @@ EOF
|
|||
|
||||
EOF
|
||||
else
|
||||
cat >> "$1" << EOF
|
||||
cat >> "$ac_byteorder" << EOF
|
||||
/* On little endian machines, these macros are null */
|
||||
#define htole16(x) (x)
|
||||
#define htole32(x) (x)
|
||||
|
@ -277,7 +279,7 @@ EOF
|
|||
fi
|
||||
fi
|
||||
|
||||
cat >> "$1" << EOF
|
||||
cat >> "$ac_byteorder" << EOF
|
||||
/* Define the C99 standard length-specific integer types */
|
||||
#include <_stdint.h>
|
||||
|
||||
|
@ -285,7 +287,7 @@ EOF
|
|||
|
||||
case "${effective_target}" in
|
||||
i[3456]86-*)
|
||||
cat >> "$1" << EOF
|
||||
cat >> "$ac_byteorder" << EOF
|
||||
/* Here are some macros to create integers from a byte array */
|
||||
/* These are used to get and put integers from/into a uint8_t array */
|
||||
/* with a specific endianness. This is the most portable way to generate */
|
||||
|
@ -312,7 +314,7 @@ EOF
|
|||
;;
|
||||
|
||||
*)
|
||||
cat >> "$1" << EOF
|
||||
cat >> "$ac_byteorder" << EOF
|
||||
/* Here are some macros to create integers from a byte array */
|
||||
/* These are used to get and put integers from/into a uint8_t array */
|
||||
/* with a specific endianness. This is the most portable way to generate */
|
||||
|
@ -349,6 +351,14 @@ EOF
|
|||
esac
|
||||
]
|
||||
|
||||
cat >> "$1" << EOF
|
||||
cat >> "$ac_byteorder" << EOF
|
||||
#endif /*__BYTEORDER_H*/
|
||||
EOF])
|
||||
EOF
|
||||
|
||||
if cmp -s $ac_byteorder_h $ac_byteorder 2>/dev/null; then
|
||||
AC_MSG_NOTICE([$ac_byteorder_h is unchanged])
|
||||
else
|
||||
rm -f $ac_byteorder_h
|
||||
mv $ac_byteorder $ac_byteorder_h
|
||||
fi
|
||||
])
|
||||
|
|
147
m4/stdint.m4
147
m4/stdint.m4
|
@ -1,94 +1,48 @@
|
|||
dnl AC_NEED_STDINT_H ( HEADER-TO-GENERATE )
|
||||
dnl Copyright 2001-2002 by Dan Fandrich <dan@coneharvesters.com>
|
||||
dnl This file may be copied and used freely without restrictions. No warranty
|
||||
dnl is expressed or implied.
|
||||
dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])]
|
||||
dnl
|
||||
dnl Look for a header file that defines size-specific integer types like the
|
||||
dnl ones recommended to be in stdint.h in the C99 standard (e.g. uint32_t).
|
||||
dnl This is a dumbed-down version of the macro of the same name in the file
|
||||
dnl ac_need_stdint_h.m4 which is part of the ac-archive, available at
|
||||
dnl <URL:http://ac-archive.sourceforge.net/> (also, another macro
|
||||
dnl AC_CREATE_STDINT_H by the same author). This version is not as smart,
|
||||
dnl but works on older autoconf versions and has a different license.
|
||||
|
||||
dnl AX_CHECK_DEFINED_TYPE ( TYPE, FILE, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND )
|
||||
dnl This is similar to _AC_CHECK_TYPE_NEW (a.k.a. new syntax version of
|
||||
dnl AC_CHECK_TYPE) in autoconf 2.50 but works on older versions
|
||||
AC_DEFUN([AX_CHECK_DEFINED_TYPE],
|
||||
[AC_MSG_CHECKING([for $1 in $2])
|
||||
AC_EGREP_CPP(changequote(<<,>>)dnl
|
||||
<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
|
||||
changequote([,]), [#include <$2>],
|
||||
ac_cv_type_$1=yes, ac_cv_type_$1=no)dnl
|
||||
AC_MSG_RESULT($ac_cv_type_$1)
|
||||
if test $ac_cv_type_$1 = yes; then
|
||||
$3
|
||||
else
|
||||
$4
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Look for a header file that defines size-specific integer types
|
||||
AC_DEFUN([AX_NEED_STDINT_H],
|
||||
[
|
||||
changequote(, )dnl
|
||||
ac_dir=`echo "$1"|sed 's%/[^/][^/]*$%%'`
|
||||
changequote([, ])dnl
|
||||
if test "$ac_dir" != "$1" && test "$ac_dir" != .; then
|
||||
# The file is in a subdirectory.
|
||||
test ! -d "$ac_dir" && mkdir "$ac_dir"
|
||||
fi
|
||||
|
||||
AX_CHECK_DEFINED_TYPE(uint8_t,
|
||||
stdint.h,
|
||||
[
|
||||
cat > "$1" <<EOF
|
||||
/* This file is generated automatically by configure */
|
||||
#include <stdint.h>
|
||||
EOF],
|
||||
[AX_CHECK_DEFINED_TYPE(uint8_t,
|
||||
inttypes.h,
|
||||
[cat > "$1" <<EOF
|
||||
/* This file is generated automatically by configure */
|
||||
#include <inttypes.h>
|
||||
EOF],
|
||||
[AX_CHECK_DEFINED_TYPE(uint8_t,
|
||||
sys/types.h,
|
||||
[cat > "$1" <<EOF
|
||||
/* This file is generated automatically by configure */
|
||||
#include <sys/types.h>
|
||||
EOF],
|
||||
[AX_CHECK_DEFINED_TYPE(u_int8_t,
|
||||
sys/types.h,
|
||||
[cat > "$1" <<EOF
|
||||
/* This file is generated automatically by configure */
|
||||
#ifndef __STDINT_H
|
||||
#define __STDINT_H
|
||||
#include <sys/types.h>
|
||||
typedef u_int8_t uint8_t;
|
||||
typedef u_int16_t uint16_t;
|
||||
typedef u_int32_t uint32_t;
|
||||
EOF
|
||||
|
||||
AX_CHECK_DEFINED_TYPE(u_int64_t,
|
||||
sys/types.h,
|
||||
[cat >> "$1" <<EOF
|
||||
typedef u_int64_t uint64_t;
|
||||
#endif /*!__STDINT_H*/
|
||||
EOF],
|
||||
[cat >> "$1" <<EOF
|
||||
/* 64-bit types are not available on this system */
|
||||
/* typedef u_int64_t uint64_t; */
|
||||
#endif /*!__STDINT_H*/
|
||||
EOF])
|
||||
|
||||
],
|
||||
[AC_MSG_WARN([I can't find size-specific integer definitions on this system])
|
||||
if test -e "$1" ; then
|
||||
rm -f "$1"
|
||||
fi
|
||||
])])])])dnl
|
||||
])
|
||||
dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the
|
||||
dnl existence of an include file <stdint.h> that defines a set of
|
||||
dnl typedefs, especially uint8_t,int32_t,uintptr_t. Many older
|
||||
dnl installations will not provide this file, but some will have the
|
||||
dnl very same definitions in <inttypes.h>. In other enviroments we can
|
||||
dnl use the inet-types in <sys/types.h> which would define the typedefs
|
||||
dnl int8_t and u_int8_t respectivly.
|
||||
dnl
|
||||
dnl This macros will create a local "_stdint.h" or the headerfile given
|
||||
dnl as an argument. In many cases that file will just "#include
|
||||
dnl <stdint.h>" or "#include <inttypes.h>", while in other environments
|
||||
dnl it will provide the set of basic 'stdint's definitions/typedefs:
|
||||
dnl
|
||||
dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t
|
||||
dnl int_least32_t.. int_fast32_t.. intmax_t
|
||||
dnl
|
||||
dnl which may or may not rely on the definitions of other files, or
|
||||
dnl using the AC_CHECK_SIZEOF macro to determine the actual sizeof each
|
||||
dnl type.
|
||||
dnl
|
||||
dnl if your header files require the stdint-types you will want to
|
||||
dnl create an installable file mylib-int.h that all your other
|
||||
dnl installable header may include. So if you have a library package
|
||||
dnl named "mylib", just use
|
||||
dnl
|
||||
dnl AX_CREATE_STDINT_H(mylib-int.h)
|
||||
dnl
|
||||
dnl in configure.ac and go to install that very header file in
|
||||
dnl Makefile.am along with the other headers (mylib.h) - and the
|
||||
dnl mylib-specific headers can simply use "#include <mylib-int.h>" to
|
||||
dnl obtain the stdint-types.
|
||||
dnl
|
||||
dnl Remember, if the system already had a valid <stdint.h>, the
|
||||
dnl generated file will include it directly. No need for fuzzy
|
||||
dnl HAVE_STDINT_H things... (oops, GCC 4.2.x has deliberatly disabled
|
||||
dnl its stdint.h for non-c99 compilation and the c99-mode is not the
|
||||
dnl default. Therefore this macro will not use the compiler's stdint.h
|
||||
dnl - please complain to the GCC developers).
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author Guido U. Draheim <guidod@gmx.de>
|
||||
dnl @version 2006-10-13
|
||||
dnl @license GPLWithACException
|
||||
|
||||
AC_DEFUN([AX_CHECK_DATA_MODEL],[
|
||||
AC_CHECK_SIZEOF(char)
|
||||
|
@ -132,7 +86,8 @@ AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[
|
|||
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 m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h]) ; do
|
||||
for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h sys/types.h])
|
||||
do
|
||||
unset ac_cv_type_uintptr_t
|
||||
unset ac_cv_type_uint64_t
|
||||
AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>])
|
||||
|
@ -147,7 +102,8 @@ AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[
|
|||
AC_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 m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h stdint.h]) ; do
|
||||
for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h sys/types.h stdint.h])
|
||||
do
|
||||
unset ac_cv_type_uint32_t
|
||||
unset ac_cv_type_uint64_t
|
||||
AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>])
|
||||
|
@ -189,6 +145,11 @@ 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=""])
|
||||
if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then
|
||||
CFLAGS="-std=c99"
|
||||
AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
|
||||
[AC_MSG_WARN(your GCC compiler has a defunct stdint.h for its default-mode)])
|
||||
fi
|
||||
CXXFLAGS="$old_CXXFLAGS"
|
||||
CPPFLAGS="$old_CPPFLAGS"
|
||||
CFLAGS="$old_CFLAGS" ])
|
||||
|
@ -609,7 +570,7 @@ typedef unsigned long uintmax_t;
|
|||
#define __intptr_t_defined
|
||||
/* we encourage using "long" to store pointer values, never use "int" ! */
|
||||
#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
|
||||
typedef unsinged int uintptr_t;
|
||||
typedef unsigned int uintptr_t;
|
||||
typedef int intptr_t;
|
||||
#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
|
||||
typedef unsigned long uintptr_t;
|
||||
|
|
Ładowanie…
Reference in New Issue