[16959] | 1 | AC_DEFUN(LIBGCJ_CONFIGURE, |
---|
| 2 | [ |
---|
| 3 | dnl Default to --enable-multilib |
---|
| 4 | AC_ARG_ENABLE(multilib, |
---|
| 5 | [ --enable-multilib build many library versions (default)], |
---|
| 6 | [case "${enableval}" in |
---|
| 7 | yes) multilib=yes ;; |
---|
| 8 | no) multilib=no ;; |
---|
| 9 | *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; |
---|
| 10 | esac], [multilib=yes])dnl |
---|
| 11 | |
---|
| 12 | dnl We may get other options which we dont document: |
---|
| 13 | dnl --with-target-subdir, --with-multisrctop, --with-multisubdir |
---|
| 14 | |
---|
| 15 | # When building with srcdir == objdir, links to the source files will |
---|
| 16 | # be created in directories within the target_subdir. We have to |
---|
| 17 | # adjust toplevel_srcdir accordingly, so that configure finds |
---|
| 18 | # install-sh and other auxiliary files that live in the top-level |
---|
| 19 | # source directory. |
---|
| 20 | if test "${srcdir}" = "."; then |
---|
| 21 | if test -z "${with_target_subdir}"; then |
---|
| 22 | toprel=".." |
---|
| 23 | else |
---|
| 24 | if test "${with_target_subdir}" != "."; then |
---|
| 25 | toprel="${with_multisrctop}../.." |
---|
| 26 | else |
---|
| 27 | toprel="${with_multisrctop}.." |
---|
| 28 | fi |
---|
| 29 | fi |
---|
| 30 | else |
---|
| 31 | toprel=".." |
---|
| 32 | fi |
---|
| 33 | |
---|
| 34 | libgcj_basedir=$srcdir/$toprel/$1/libjava |
---|
| 35 | AC_SUBST(libgcj_basedir) |
---|
| 36 | |
---|
| 37 | AC_CONFIG_AUX_DIR(${srcdir}/$toprel) |
---|
| 38 | if :; then :; else |
---|
| 39 | # This overrides the previous occurrence for automake, but not for |
---|
| 40 | # autoconf, which is exactly what we want. |
---|
| 41 | AC_CONFIG_AUX_DIR(..) |
---|
| 42 | fi |
---|
| 43 | |
---|
| 44 | # This works around an automake problem. |
---|
| 45 | mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" |
---|
| 46 | AC_SUBST(mkinstalldirs) |
---|
| 47 | |
---|
| 48 | AC_CANONICAL_SYSTEM |
---|
| 49 | |
---|
| 50 | dnl This shouldn't be needed, as long as top-level dependencies are |
---|
| 51 | dnl defined correctly and shared-library paths are set up so that |
---|
| 52 | dnl execution tests succeed. FIXME. |
---|
| 53 | define([AC_PROG_CC_WORKS],[]) |
---|
| 54 | define([AC_PROG_CXX_WORKS],[]) |
---|
| 55 | |
---|
| 56 | AC_PROG_CC |
---|
| 57 | AC_PROG_CXX |
---|
| 58 | |
---|
| 59 | dnl version is pulled out to make it a bit easier to change using sed. |
---|
| 60 | version=0.0.7 |
---|
| 61 | dnl Still use "libjava" here to placate dejagnu. |
---|
| 62 | AM_INIT_AUTOMAKE(libjava, $version) |
---|
| 63 | |
---|
| 64 | # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we dont |
---|
| 65 | # run it explicitly here, it will be run implicitly before |
---|
| 66 | # LIBGCJ_CONFIGURE, which doesn't work because that means that it will |
---|
| 67 | # be run before AC_CANONICAL_HOST. |
---|
| 68 | AC_CANONICAL_BUILD |
---|
| 69 | |
---|
| 70 | AC_CHECK_TOOL(AS, as) |
---|
| 71 | AC_CHECK_TOOL(AR, ar) |
---|
| 72 | AC_CHECK_TOOL(RANLIB, ranlib, :) |
---|
| 73 | |
---|
| 74 | AC_PROG_INSTALL |
---|
| 75 | |
---|
| 76 | AM_MAINTAINER_MODE |
---|
| 77 | |
---|
| 78 | # We need AC_EXEEXT to keep automake happy in cygnus mode. However, |
---|
| 79 | # at least currently, we never actually build a program, so we never |
---|
| 80 | # need to use $(EXEEXT). Moreover, the test for EXEEXT normally |
---|
| 81 | # fails, because we are probably configuring with a cross compiler |
---|
| 82 | # which cant create executables. So we include AC_EXEEXT to keep |
---|
| 83 | # automake happy, but we dont execute it, since we dont care about |
---|
| 84 | # the result. |
---|
| 85 | if false; then |
---|
| 86 | AC_EXEEXT |
---|
| 87 | fi |
---|
| 88 | |
---|
| 89 | # configure.host sets the following important variables |
---|
| 90 | # libgcj_cflags - host specific C compiler flags |
---|
| 91 | # libgcj_cxxflags - host specific C++ compiler flags |
---|
| 92 | # libgcj_javaflags - host specific Java compiler flags |
---|
| 93 | |
---|
| 94 | libgcj_cflags= |
---|
| 95 | libgcj_cxxflags= |
---|
| 96 | libgcj_javaflags= |
---|
| 97 | |
---|
| 98 | . [$]{srcdir}/configure.host |
---|
| 99 | |
---|
| 100 | LIBGCJ_CFLAGS="[$]{libgcj_cflags}" |
---|
| 101 | LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}" |
---|
| 102 | LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}" |
---|
| 103 | AC_SUBST(LIBGCJ_CFLAGS) |
---|
| 104 | AC_SUBST(LIBGCJ_CXXFLAGS) |
---|
| 105 | AC_SUBST(LIBGCJ_JAVAFLAGS) |
---|
| 106 | ])dnl |
---|
| 107 | |
---|
| 108 | sinclude(../libtool.m4) |
---|
| 109 | dnl The lines below arrange for aclocal not to bring libtool.m4 |
---|
| 110 | dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake |
---|
| 111 | dnl to add a definition of LIBTOOL to Makefile.in. |
---|
| 112 | ifelse(yes,no,[ |
---|
| 113 | AC_DEFUN([AM_PROG_LIBTOOL],) |
---|
| 114 | AC_DEFUN([AC_LIBTOOL_DLOPEN],) |
---|
| 115 | AC_DEFUN([AC_LIBLTDL_CONVENIENCE],) |
---|
| 116 | AC_DEFUN([LT_AC_PROG_GCJ],) |
---|
| 117 | AC_SUBST(GCJ) |
---|
| 118 | AC_SUBST(LIBTOOL) |
---|
| 119 | ]) |
---|
| 120 | |
---|
| 121 | #serial AM2 |
---|
| 122 | |
---|
| 123 | dnl From Bruno Haible. |
---|
| 124 | |
---|
| 125 | AC_DEFUN([AM_ICONV], |
---|
| 126 | [ |
---|
| 127 | dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and |
---|
| 128 | dnl those with the standalone portable GNU libiconv installed). |
---|
| 129 | |
---|
| 130 | ICONV_LDFLAGS= |
---|
| 131 | AC_ARG_WITH([libiconv-prefix], |
---|
| 132 | [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ |
---|
| 133 | for dir in `echo "$withval" | tr : ' '`; do |
---|
| 134 | if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi |
---|
| 135 | if test -d $dir/lib; then |
---|
| 136 | LDFLAGS="$LDFLAGS -L$dir/lib" |
---|
| 137 | ICONV_LDFLAGS=-L$dir/lib |
---|
| 138 | fi |
---|
| 139 | done |
---|
| 140 | ]) |
---|
| 141 | AC_SUBST(ICONV_LDFLAGS) |
---|
| 142 | |
---|
| 143 | AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ |
---|
| 144 | am_cv_func_iconv="no, consider installing GNU libiconv" |
---|
| 145 | am_cv_lib_iconv=no |
---|
| 146 | AC_TRY_LINK([#include <stdlib.h> |
---|
| 147 | #include <iconv.h>], |
---|
| 148 | [iconv_t cd = iconv_open("",""); |
---|
| 149 | iconv(cd,NULL,NULL,NULL,NULL); |
---|
| 150 | iconv_close(cd);], |
---|
| 151 | am_cv_func_iconv=yes) |
---|
| 152 | if test "$am_cv_func_iconv" != yes; then |
---|
| 153 | am_save_LIBS="$LIBS" |
---|
| 154 | LIBS="$LIBS -liconv" |
---|
| 155 | AC_TRY_LINK([#include <stdlib.h> |
---|
| 156 | #include <iconv.h>], |
---|
| 157 | [iconv_t cd = iconv_open("",""); |
---|
| 158 | iconv(cd,NULL,NULL,NULL,NULL); |
---|
| 159 | iconv_close(cd);], |
---|
| 160 | am_cv_lib_iconv=yes |
---|
| 161 | am_cv_func_iconv=yes) |
---|
| 162 | LIBS="$am_save_LIBS" |
---|
| 163 | fi |
---|
| 164 | ]) |
---|
| 165 | if test "$am_cv_func_iconv" = yes; then |
---|
| 166 | AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) |
---|
| 167 | AC_MSG_CHECKING([for iconv declaration]) |
---|
| 168 | AC_CACHE_VAL(am_cv_proto_iconv, [ |
---|
| 169 | AC_TRY_COMPILE([ |
---|
| 170 | #include <stdlib.h> |
---|
| 171 | #include <iconv.h> |
---|
| 172 | extern |
---|
| 173 | #ifdef __cplusplus |
---|
| 174 | "C" |
---|
| 175 | #endif |
---|
| 176 | #if defined(__STDC__) || defined(__cplusplus) |
---|
| 177 | size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); |
---|
| 178 | #else |
---|
| 179 | size_t iconv(); |
---|
| 180 | #endif |
---|
| 181 | ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") |
---|
| 182 | am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) |
---|
| 183 | am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` |
---|
| 184 | AC_MSG_RESULT([$]{ac_t:- |
---|
| 185 | }[$]am_cv_proto_iconv) |
---|
| 186 | AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, |
---|
| 187 | [Define as const if the declaration of iconv() needs const.]) |
---|
| 188 | fi |
---|
| 189 | LIBICONV= |
---|
| 190 | if test "$am_cv_lib_iconv" = yes; then |
---|
| 191 | LIBICONV="-liconv" |
---|
| 192 | fi |
---|
| 193 | AC_SUBST(LIBICONV) |
---|
| 194 | ]) |
---|