1 sinclude(../config/accross.m4)
2 sinclude(../config/acx.m4)
4 sinclude(../libtool.m4)
5 dnl The lines below arrange for aclocal not to bring libtool.m4
6 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
7 dnl to add a definition of LIBTOOL to Makefile.in.
9 AC_DEFUN([AM_PROG_LIBTOOL],)
10 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
11 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
12 AC_DEFUN([LT_AC_PROG_GCJ],)
19 dnl From Bruno Haible.
23 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
24 dnl those with the standalone portable GNU libiconv installed).
26 am_cv_lib_iconv_ldpath=
27 AC_ARG_WITH([libiconv-prefix],
28 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
29 for dir in `echo "$withval" | tr : ' '`; do
30 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
31 if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
35 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
36 am_cv_func_iconv="no, consider installing GNU libiconv"
38 AC_TRY_LINK([#include <stdlib.h>
40 [iconv_t cd = iconv_open("","");
41 iconv(cd,NULL,NULL,NULL,NULL);
44 if test "$am_cv_func_iconv" != yes; then
46 LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
47 AC_TRY_LINK([#include <stdlib.h>
49 [iconv_t cd = iconv_open("","");
50 iconv(cd,NULL,NULL,NULL,NULL);
57 if test "$am_cv_func_iconv" = yes; then
58 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
59 AC_MSG_CHECKING([for iconv declaration])
60 AC_CACHE_VAL(am_cv_proto_iconv, [
68 #if defined(__STDC__) || defined(__cplusplus)
69 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
73 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
74 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);"])
75 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
76 AC_MSG_RESULT([$]{ac_t:-
77 }[$]am_cv_proto_iconv)
78 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
79 [Define as const if the declaration of iconv() needs const.])
82 if test "$am_cv_lib_iconv" = yes; then
83 LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
88 # Check whether LC_MESSAGES is available in <locale.h>.
89 # Ulrich Drepper <drepper@cygnus.com>, 1995.
91 # This file can be copied and used freely without restrictions. It can
92 # be used in projects which are not available under the GNU General Public
93 # License or the GNU Library General Public License but which still want
94 # to provide support for the GNU gettext functionality.
95 # Please note that the actual code of the GNU gettext library is covered
96 # by the GNU Library General Public License, and the rest of the GNU
97 # gettext package package is covered by the GNU General Public License.
98 # They are *not* in the public domain.
102 AC_DEFUN([AM_LC_MESSAGES],
103 [AC_CHECK_HEADERS(locale.h)
104 if test $ac_cv_header_locale_h = yes; then
105 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
106 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
107 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
108 if test $am_cv_val_LC_MESSAGES = yes; then
109 AC_DEFINE(HAVE_LC_MESSAGES, 1,
110 [Define if your <locale.h> file defines LC_MESSAGES.])
114 AC_DEFUN([CHECK_FOR_BROKEN_MINGW_LD],
116 AC_MSG_CHECKING(whether 'ld' is at least 2.13)
117 LD_PROG=`$CC --print-prog-name=ld`
118 LD_VERSION=`$LD_PROG --version`
119 LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
120 LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
121 if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
124 if expr "$LD_VERSION_MAJOR" = 2 && expr "$LD_VERSION_MINOR" \>= 13 > /dev/null; then
128 if test "x$LD_OK" != x; then
129 AC_MSG_RESULT([yes; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
131 AC_MSG_RESULT([no; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
132 AC_MSG_WARN([ld <2.13 detected; enabling JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS hack...])
133 AC_DEFINE(JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS, 1,
134 [Indicate that linker is not able to 8-byte align static data])
136 ])# CHECK_FOR_BROKEN_MINGW_LD
138 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
139 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
140 dnl also defines GSTUFF_PKG_ERRORS on error
141 AC_DEFUN(PKG_CHECK_MODULES, [
144 if test -z "$PKG_CONFIG"; then
145 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
148 if test "$PKG_CONFIG" = "no" ; then
149 echo "*** The pkg-config script could not be found. Make sure it is"
150 echo "*** in your path, or set the PKG_CONFIG environment variable"
151 echo "*** to the full path to pkg-config."
152 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
154 PKG_CONFIG_MIN_VERSION=0.9.0
155 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
156 AC_MSG_CHECKING(for $2)
158 if $PKG_CONFIG --exists "$2" ; then
162 AC_MSG_CHECKING($1_CFLAGS)
163 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
164 AC_MSG_RESULT($$1_CFLAGS)
166 AC_MSG_CHECKING($1_LIBS)
167 $1_LIBS=`$PKG_CONFIG --libs "$2"`
168 AC_MSG_RESULT($$1_LIBS)
172 ## If we have a custom action on failure, don't print errors, but
173 ## do set a variable so people can do so.
174 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
175 ifelse([$4], ,echo $$1_PKG_ERRORS,)
181 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
182 echo "*** See http://www.freedesktop.org/software/pkgconfig"
186 if test $succeeded = yes; then
187 ifelse([$3], , :, [$3])
189 ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])