1 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
2 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
3 # are probably using a cross compiler, which will not be able to fully
4 # link an executable. This should really be fixed in autoconf
7 AC_DEFUN(LIBGCJ_CONFIGURE,
9 dnl Default to --enable-multilib
10 AC_ARG_ENABLE(multilib,
11 [ --enable-multilib build many library versions (default)],
12 [case "${enableval}" in
15 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
16 esac], [multilib=yes])dnl
18 dnl We may get other options which we dont document:
19 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
21 if test "[$]{srcdir}" = "."; then
22 if test "[$]{with_target_subdir}" != "."; then
23 libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
25 libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
28 libgcj_basedir="[$]{srcdir}/$1"
30 AC_SUBST(libgcj_basedir)
34 dnl Still use "libjava" here to placate dejagnu.
35 AM_INIT_AUTOMAKE(libjava, 0.0.7)
37 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
38 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
39 # are probably using a cross compiler, which will not be able to fully
40 # link an executable. This should really be fixed in autoconf
43 AC_DEFUN(LIB_AC_PROG_CC,
44 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
45 AC_CHECK_PROG(CC, gcc, gcc)
46 if test -z "$CC"; then
47 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
48 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
53 if test $ac_cv_prog_gcc = yes; then
55 dnl Check whether -g works, even if CFLAGS is set, in case the package
56 dnl plays around with CFLAGS (such as to build both debugging and
57 dnl normal versions of a library), tasteless as that idea is.
58 ac_test_CFLAGS="${CFLAGS+set}"
59 ac_save_CFLAGS="$CFLAGS"
62 if test "$ac_test_CFLAGS" = set; then
63 CFLAGS="$ac_save_CFLAGS"
64 elif test $ac_cv_prog_cc_g = yes; then
71 test "${CFLAGS+set}" = set || CFLAGS="-g"
77 # Likewise for AC_PROG_CXX.
78 AC_DEFUN(LIB_AC_PROG_CXX,
79 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
80 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
81 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
85 if test $ac_cv_prog_gxx = yes; then
87 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
88 dnl plays around with CXXFLAGS (such as to build both debugging and
89 dnl normal versions of a library), tasteless as that idea is.
90 ac_test_CXXFLAGS="${CXXFLAGS+set}"
91 ac_save_CXXFLAGS="$CXXFLAGS"
94 if test "$ac_test_CXXFLAGS" = set; then
95 CXXFLAGS="$ac_save_CXXFLAGS"
96 elif test $ac_cv_prog_cxx_g = yes; then
103 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
109 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we dont
110 # run it explicitly here, it will be run implicitly before
111 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
112 # be run before AC_CANONICAL_HOST.
115 AC_CHECK_TOOL(AS, as)
116 AC_CHECK_TOOL(AR, ar)
117 AC_CHECK_TOOL(RANLIB, ranlib, :)
123 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
124 # at least currently, we never actually build a program, so we never
125 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
126 # fails, because we are probably configuring with a cross compiler
127 # which cant create executables. So we include AC_EXEEXT to keep
128 # automake happy, but we dont execute it, since we dont care about
134 # configure.host sets the following important variables
135 # libgcj_cflags - host specific C compiler flags
136 # libgcj_cxxflags - host specific C++ compiler flags
137 # libgcj_javaflags - host specific Java compiler flags
143 . [$]{libgcj_basedir}/configure.host
145 case [$]{libgcj_basedir} in
146 /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{libgcj_basedir} ;;
147 *) libgcj_flagbasedir='[$](top_builddir)/'[$]{libgcj_basedir} ;;
150 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
151 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
152 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
153 AC_SUBST(LIBGCJ_CFLAGS)
154 AC_SUBST(LIBGCJ_CXXFLAGS)
155 AC_SUBST(LIBGCJ_JAVAFLAGS)