OSDN Git Service

6540dd5915a96629955a2bb2424f0c9ee5e1d9c4
[pf3gnuchains/gcc-fork.git] / libjava / acinclude.m4
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 if test "[$]{srcdir}" = "."; then
16   if test "[$]{with_target_subdir}" != "."; then
17     libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
18   else
19     libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
20   fi
21 else
22   libgcj_basedir="[$]{srcdir}/$1"
23 fi
24 AC_SUBST(libgcj_basedir)
25 AC_CONFIG_AUX_DIR($libgcj_basedir/..)
26 if :; then :; else
27   # This overrides the previous occurrence for automake, but not for
28   # autoconf, which is exactly what we want.
29   AC_CONFIG_AUX_DIR(..)
30 fi
31
32 AC_CANONICAL_SYSTEM
33
34 dnl This shouldn't be needed, as long as top-level dependencies are
35 dnl defined correctly and shared-library paths are set up so that
36 dnl execution tests succeed.  FIXME.
37 define([AC_PROG_CC_WORKS],[])
38 define([AC_PROG_CXX_WORKS],[])
39
40 AC_PROG_CC
41 AC_PROG_CXX
42
43 dnl version is pulled out to make it a bit easier to change using sed.
44 version=0.0.7
45 dnl Still use "libjava" here to placate dejagnu.
46 AM_INIT_AUTOMAKE(libjava, $version)
47
48 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we dont
49 # run it explicitly here, it will be run implicitly before
50 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
51 # be run before AC_CANONICAL_HOST.
52 AC_CANONICAL_BUILD
53
54 AC_CHECK_TOOL(AS, as)
55 AC_CHECK_TOOL(AR, ar)
56 AC_CHECK_TOOL(RANLIB, ranlib, :)
57
58 AC_PROG_INSTALL
59
60 AM_MAINTAINER_MODE
61
62 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
63 # at least currently, we never actually build a program, so we never
64 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
65 # fails, because we are probably configuring with a cross compiler
66 # which cant create executables.  So we include AC_EXEEXT to keep
67 # automake happy, but we dont execute it, since we dont care about
68 # the result.
69 if false; then
70   # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
71   # to nothing, so nothing would remain between `then' and `fi' if it
72   # were not for the `:' below.
73   :
74   AC_EXEEXT
75 fi
76
77 # configure.host sets the following important variables
78 #       libgcj_cflags    - host specific C compiler flags
79 #       libgcj_cxxflags  - host specific C++ compiler flags
80 #       libgcj_javaflags - host specific Java compiler flags
81
82 libgcj_cflags=
83 libgcj_cxxflags=
84 libgcj_javaflags=
85
86 . [$]{libgcj_basedir}/configure.host
87
88 case [$]{libgcj_basedir} in
89 /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{libgcj_basedir} ;;
90 *) libgcj_flagbasedir='[$](top_builddir)/'[$]{libgcj_basedir} ;;
91 esac
92
93 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
94 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
95 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
96 AC_SUBST(LIBGCJ_CFLAGS)
97 AC_SUBST(LIBGCJ_CXXFLAGS)
98 AC_SUBST(LIBGCJ_JAVAFLAGS)
99 ])dnl
100
101 sinclude(../libtool.m4)
102 dnl The lines below arrange for aclocal not to bring libtool.m4
103 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
104 dnl to add a definition of LIBTOOL to Makefile.in.
105 ifelse(yes,no,[
106 AC_DEFUN([AM_PROG_LIBTOOL],)
107 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
108 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
109 AC_DEFUN([LT_AC_PROG_GCJ],)
110 AC_SUBST(GCJ)
111 AC_SUBST(LIBTOOL)
112 ])