| 1 | AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
|
|---|
| 2 | [changequote(<<, >>)dnl
|
|---|
| 3 | dnl The name to #define.
|
|---|
| 4 | define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
|
|---|
| 5 | dnl The cache variable name.
|
|---|
| 6 | define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
|
|---|
| 7 | changequote([, ])dnl
|
|---|
| 8 | AC_MSG_CHECKING(size of $1)
|
|---|
| 9 | AC_CACHE_VAL(AC_CV_NAME,
|
|---|
| 10 | [for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence.
|
|---|
| 11 | AC_TRY_COMPILE([#include "confdefs.h"
|
|---|
| 12 | #include <sys/types.h>
|
|---|
| 13 | $2
|
|---|
| 14 | ], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
|
|---|
| 15 | if test x$AC_CV_NAME != x ; then break; fi
|
|---|
| 16 | done
|
|---|
| 17 | ])
|
|---|
| 18 | if test x$AC_CV_NAME = x ; then
|
|---|
| 19 | AC_MSG_ERROR([cannot determine a size for $1])
|
|---|
| 20 | fi
|
|---|
| 21 | AC_MSG_RESULT($AC_CV_NAME)
|
|---|
| 22 | AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
|
|---|
| 23 | undefine([AC_TYPE_NAME])dnl
|
|---|
| 24 | undefine([AC_CV_NAME])dnl
|
|---|
| 25 | ])
|
|---|
| 26 |
|
|---|
| 27 | AC_DEFUN(LIBGCJ_CONFIGURE,
|
|---|
| 28 | [
|
|---|
| 29 | dnl Default to --enable-multilib
|
|---|
| 30 | AC_ARG_ENABLE(multilib,
|
|---|
| 31 | [ --enable-multilib build many library versions (default)],
|
|---|
| 32 | [case "${enableval}" in
|
|---|
| 33 | yes) multilib=yes ;;
|
|---|
| 34 | no) multilib=no ;;
|
|---|
| 35 | *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
|
|---|
| 36 | esac], [multilib=yes])dnl
|
|---|
| 37 |
|
|---|
| 38 | dnl We may get other options which we don't document:
|
|---|
| 39 | dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
|
|---|
| 40 |
|
|---|
| 41 | # When building with srcdir == objdir, links to the source files will
|
|---|
| 42 | # be created in directories within the target_subdir. We have to
|
|---|
| 43 | # adjust toplevel_srcdir accordingly, so that configure finds
|
|---|
| 44 | # install-sh and other auxiliary files that live in the top-level
|
|---|
| 45 | # source directory.
|
|---|
| 46 | if test "${srcdir}" = "."; then
|
|---|
| 47 | if test -z "${with_target_subdir}"; then
|
|---|
| 48 | toprel=".."
|
|---|
| 49 | else
|
|---|
| 50 | if test "${with_target_subdir}" != "."; then
|
|---|
| 51 | toprel="${with_multisrctop}../.."
|
|---|
| 52 | else
|
|---|
| 53 | toprel="${with_multisrctop}.."
|
|---|
| 54 | fi
|
|---|
| 55 | fi
|
|---|
| 56 | else
|
|---|
| 57 | toprel=".."
|
|---|
| 58 | fi
|
|---|
| 59 |
|
|---|
| 60 | libgcj_basedir=$srcdir/$toprel/$1/libjava
|
|---|
| 61 | AC_SUBST(libgcj_basedir)
|
|---|
| 62 |
|
|---|
| 63 | AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
|
|---|
| 64 | if :; then :; else
|
|---|
| 65 | # This overrides the previous occurrence for automake, but not for
|
|---|
| 66 | # autoconf, which is exactly what we want.
|
|---|
| 67 | AC_CONFIG_AUX_DIR(..)
|
|---|
| 68 | fi
|
|---|
| 69 |
|
|---|
| 70 | # This works around an automake problem.
|
|---|
| 71 | mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
|
|---|
| 72 | AC_SUBST(mkinstalldirs)
|
|---|
| 73 |
|
|---|
| 74 | AC_CANONICAL_SYSTEM
|
|---|
| 75 |
|
|---|
| 76 | dnl This shouldn't be needed, as long as top-level dependencies are
|
|---|
| 77 | dnl defined correctly and shared-library paths are set up so that
|
|---|
| 78 | dnl execution tests succeed. FIXME.
|
|---|
| 79 | define([AC_PROG_CC_WORKS],[])
|
|---|
| 80 | define([AC_PROG_CXX_WORKS],[])
|
|---|
| 81 |
|
|---|
| 82 | AC_PROG_CC
|
|---|
| 83 |
|
|---|
| 84 | # We use the libstdc++-v3 version of LIB_AC_PROG_CXX, but use
|
|---|
| 85 | # glibjava_CXX instead of glibcpp_CXX. That's because we're passed a
|
|---|
|
|---|