configure.in: Support cross-compiling.

* configure.in: Support cross-compiling.
	* configure: Regenerate.
	* aclocal.m4 (gcc_AC_COMPILE_CHECK_SIZEOF): New.
	(gcc_AC_EXAMINE_OBJECT): New.
	(fastjar_AC_COMPILE_C_BIGENDIAN): New.

From-SVN: r54216
This commit is contained in:
Geoffrey Keating 2002-06-03 17:59:29 +00:00 committed by Geoffrey Keating
parent a1a56c25fb
commit 824030c624
4 changed files with 351 additions and 260 deletions

View File

@ -1,3 +1,11 @@
2002-06-03 Geoffrey Keating <geoffk@redhat.com>
* configure.in: Support cross-compiling.
* configure: Regenerate.
* aclocal.m4 (gcc_AC_COMPILE_CHECK_SIZEOF): New.
(gcc_AC_EXAMINE_OBJECT): New.
(fastjar_AC_COMPILE_C_BIGENDIAN): New.
2002-03-18 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* jartool.c (expand_options): Handle tar-style argument list with a

111
fastjar/aclocal.m4 vendored
View File

@ -158,3 +158,114 @@ else
$1_FALSE=
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 Utility macro used by next two tests.
dnl AC_EXAMINE_OBJECT(C source code,
dnl commands examining object file,
dnl [commands to run if compile failed]):
dnl
dnl Compile the source code to an object file; then convert it into a
dnl printable representation. All unprintable characters and
dnl asterisks (*) are replaced by dots (.). All white space is
dnl deleted. Newlines (ASCII 0x10) in the input are preserved in the
dnl output, but runs of newlines are compressed to a single newline.
dnl Finally, line breaks are forcibly inserted so that no line is
dnl longer than 80 columns and the file ends with a newline. The
dnl result of all this processing is in the file conftest.dmp, which
dnl may be examined by the commands in the second argument.
dnl
AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
[AC_LANG_SAVE
AC_LANG_C
dnl Next bit cribbed from AC_TRY_COMPILE.
cat > conftest.$ac_ext <<EOF
[#line __oline__ "configure"
#include "confdefs.h"
$1
]EOF
if AC_TRY_EVAL(ac_compile); then
od -c conftest.o |
sed ['s/^[0-7]*[ ]*/ /
s/\*/./g
s/ \\n/*/g
s/ [0-9][0-9][0-9]/./g
s/ \\[^ ]/./g'] |
tr -d '
' | tr -s '*' '
' | fold | sed '$a\
' > conftest.dmp
$2
ifelse($3, , , else
$3
)dnl
fi
rm -rf conftest*
AC_LANG_RESTORE])
dnl Host endianness probe.
dnl Differs from AC_C_BIGENDIAN in that it does not require
dnl running a program on the host.
dnl
AC_DEFUN([fastjar_AC_COMPILE_C_BIGENDIAN],
[AC_CACHE_CHECK(byte ordering, ac_cv_c_compile_endian,
[ac_cv_c_compile_endian=unknown
gcc_AC_EXAMINE_OBJECT([
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
/* This structure must have no internal padding. */
struct {
char prefix[sizeof "\nendian:" - 1];
short word;
char postfix[2];
} tester = {
"\nendian:",
#if SIZEOF_SHORT == 4
('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) |
#endif
('A' << CHAR_BIT) | 'B',
'X', '\n'
};],
[if grep 'endian:AB' conftest.dmp >/dev/null 2>&1; then
ac_cv_c_compile_endian=big-endian
elif grep 'endian:BA' conftest.dmp >/dev/null 2>&1; then
ac_cv_c_compile_endian=little-endian
fi])
])
if test $ac_cv_c_compile_endian = unknown; then
AC_MSG_ERROR([*** unable to determine endianness])
elif test $ac_cv_c_compile_endian = big-endian; then
AC_DEFINE(WORDS_BIG_ENDIAN, 1,
[Define if the host machine stores words of multi-word integers in
big-endian order.])
fi
])

480
fastjar/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -31,14 +31,14 @@ AC_TYPE_OFF_T
AC_STRUCT_TM
dnl Check for type-widths
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
gcc_AC_COMPILE_CHECK_SIZEOF(char)
gcc_AC_COMPILE_CHECK_SIZEOF(short)
gcc_AC_COMPILE_CHECK_SIZEOF(int)
gcc_AC_COMPILE_CHECK_SIZEOF(long)
gcc_AC_COMPILE_CHECK_SIZEOF(long long)
dnl Check byte order
AC_C_BIGENDIAN
fastjar_AC_COMPILE_C_BIGENDIAN
AC_ARG_WITH(system-zlib,
[ --with-system-zlib use installed libz])