source: trunk/third/gcc/libjava/acinclude.m4 @ 16960

Revision 16960, 5.8 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r16959, which included commits to RCS files with non-trunk default branches.
Line 
1AC_DEFUN(LIBGCJ_CONFIGURE,
2[
3dnl Default to --enable-multilib
4AC_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
12dnl We may get other options which we dont document:
13dnl --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.
20if 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
30else
31  toprel=".."
32fi
33
34libgcj_basedir=$srcdir/$toprel/$1/libjava
35AC_SUBST(libgcj_basedir)
36
37AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
38if :; 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(..)
42fi
43
44# This works around an automake problem.
45mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
46AC_SUBST(mkinstalldirs)
47
48AC_CANONICAL_SYSTEM
49
50dnl This shouldn't be needed, as long as top-level dependencies are
51dnl defined correctly and shared-library paths are set up so that
52dnl execution tests succeed.  FIXME.
53define([AC_PROG_CC_WORKS],[])
54define([AC_PROG_CXX_WORKS],[])
55
56AC_PROG_CC
57AC_PROG_CXX
58
59dnl version is pulled out to make it a bit easier to change using sed.
60version=0.0.7
61dnl Still use "libjava" here to placate dejagnu.
62AM_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.
68AC_CANONICAL_BUILD
69
70AC_CHECK_TOOL(AS, as)
71AC_CHECK_TOOL(AR, ar)
72AC_CHECK_TOOL(RANLIB, ranlib, :)
73
74AC_PROG_INSTALL
75
76AM_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.
85if false; then
86  AC_EXEEXT
87fi
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
94libgcj_cflags=
95libgcj_cxxflags=
96libgcj_javaflags=
97
98. [$]{srcdir}/configure.host
99
100LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
101LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
102LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
103AC_SUBST(LIBGCJ_CFLAGS)
104AC_SUBST(LIBGCJ_CXXFLAGS)
105AC_SUBST(LIBGCJ_JAVAFLAGS)
106])dnl
107
108sinclude(../libtool.m4)
109dnl The lines below arrange for aclocal not to bring libtool.m4
110dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
111dnl to add a definition of LIBTOOL to Makefile.in.
112ifelse(yes,no,[
113AC_DEFUN([AM_PROG_LIBTOOL],)
114AC_DEFUN([AC_LIBTOOL_DLOPEN],)
115AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
116AC_DEFUN([LT_AC_PROG_GCJ],)
117AC_SUBST(GCJ)
118AC_SUBST(LIBTOOL)
119])
120
121#serial AM2
122
123dnl From Bruno Haible.
124
125AC_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>
172extern
173#ifdef __cplusplus
174"C"
175#endif
176#if defined(__STDC__) || defined(__cplusplus)
177size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
178#else
179size_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])
Note: See TracBrowser for help on using the repository browser.