1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-20 00:15:31 +00:00

Autoupdated configure.in and config/m4/*.m4. Obsolete macros removed.

This commit is contained in:
Witold Filipczyk 2007-07-05 15:03:59 +02:00 committed by Kalle Olavi Niemitalo
parent 6bbd8e1686
commit 899df61a9c
9 changed files with 57 additions and 95 deletions

View File

@ -5,10 +5,7 @@ dnl From Bruno Haible.
AC_DEFUN([AM_LANGINFO_CODESET],
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
[AC_TRY_LINK([#include <langinfo.h>],
[char* cs = nl_langinfo(CODESET);],
am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no)
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[char* cs = nl_langinfo(CODESET);]])],[am_cv_langinfo_codeset=yes],[am_cv_langinfo_codeset=no])
])
if test $am_cv_langinfo_codeset = yes; then
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,

View File

@ -125,7 +125,7 @@ AC_DEFUN([EL_CHECK_CODE],
[
$2=yes;
AC_MSG_CHECKING([for $1])
AC_TRY_COMPILE([$3], [$4], [EL_DEFINE($2, [$1])], $2=no)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$3]], [[$4]])],[EL_DEFINE($2, [$1])],[$2=no])
AC_MSG_RESULT([$]$2)
])
@ -134,10 +134,9 @@ AC_DEFUN([EL_CHECK_TYPE],
[
EL_CHECK_TYPE_LOCAL=yes;
AC_MSG_CHECKING([for $1])
AC_TRY_COMPILE([
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
], [int a = sizeof($1);],
[EL_CHECK_TYPE_LOCAL=yes], [EL_CHECK_TYPE_LOCAL=no])
]], [[int a = sizeof($1);]])],[EL_CHECK_TYPE_LOCAL=yes],[EL_CHECK_TYPE_LOCAL=no])
AC_MSG_RESULT([$]EL_CHECK_TYPE_LOCAL)
if test "x[$]EL_CHECK_TYPE_LOCAL" != "xyes"; then
AC_DEFINE($1, $2, [Define to $2 if <sys/types.h> doesn't define.])

View File

@ -20,22 +20,18 @@ AC_DEFUN([AM_ICONV],
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
#include <iconv.h>]], [[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_func_iconv=yes)
iconv_close(cd);]])],[am_cv_func_iconv=yes],[])
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
#include <iconv.h>]], [[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_lib_iconv=yes
am_cv_func_iconv=yes)
iconv_close(cd);]])],[am_cv_lib_iconv=yes
am_cv_func_iconv=yes],[])
LIBS="$am_save_LIBS"
fi
])
@ -43,7 +39,7 @@ AC_DEFUN([AM_ICONV],
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
AC_TRY_COMPILE([
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdlib.h>
#include <iconv.h>
extern
@ -55,7 +51,7 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si
#else
size_t iconv();
#endif
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
]], [[]])],[am_cv_proto_iconv_arg1=""],[am_cv_proto_iconv_arg1="const"])
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);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([$]{ac_t:-

View File

@ -4,8 +4,8 @@
# because gettext's gettext.m4 (distributed in the automake package)
# still uses it. Otherwise, the use in gettext.m4 makes autoheader
# give these diagnostics:
# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
# configure.in:556: AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) was called before AC_ISC_POSIX
# configure.in:556: AC_RUN_IFELSE([AC_LANG_SOURCE([[]])],[],[],[]) was called before AC_ISC_POSIX
undefine([AC_ISC_POSIX])

View File

@ -13,8 +13,7 @@
AC_DEFUN([AM_LC_MESSAGES],
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <locale.h>]], [[return LC_MESSAGES]])],[am_cv_val_LC_MESSAGES=yes],[am_cv_val_LC_MESSAGES=no])])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES, 1,
[Define if your <locale.h> file defines LC_MESSAGES.])

View File

@ -6,8 +6,7 @@ AC_DEFUN([EL_CONFIG_OS_OS2],
EL_SAVE_FLAGS
CFLAGS="$CFLAGS -Zmt"
AC_TRY_LINK([#include <stdlib.h>],
[_beginthread(NULL, NULL, 0, NULL)], cf_result=yes, cf_result=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>]], [[_beginthread(NULL, NULL, 0, NULL)]])],[cf_result=yes],[cf_result=no])
AC_MSG_RESULT($cf_result)
if test "$cf_result" = yes; then
@ -28,14 +27,10 @@ AC_DEFUN([EL_CONFIG_OS_OS2],
if test -n "$X11ROOT"; then
CFLAGS="$CFLAGS_X -I$X11ROOT/XFree86/include"
LIBS="$LIBS_X -L$X11ROOT/XFree86/lib -lxf86_gcc"
AC_TRY_LINK([#include <pty.h>],
[struct winsize win;ptioctl(1, TIOCGWINSZ, &win)],
cf_result=yes, cf_result=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pty.h>]], [[struct winsize win;ptioctl(1, TIOCGWINSZ, &win)]])],[cf_result=yes],[cf_result=no])
if test "$cf_result" = no; then
LIBS="$LIBS_X -L$X11ROOT/XFree86/lib -lxf86"
AC_TRY_LINK([#include <pty.h>],
[struct winsize win;ptioctl(1, TIOCGWINSZ, &win)],
cf_result=yes, cf_result=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pty.h>]], [[struct winsize win;ptioctl(1, TIOCGWINSZ, &win)]])],[cf_result=yes],[cf_result=no])
fi
fi

View File

@ -78,9 +78,7 @@ if test "$CONFIG_SCRIPTING_RUBY" = "yes"; then
CFLAGS="$RUBY_CFLAGS $CFLAGS"
CPPFLAGS="$CPPFLAGS $RUBY_CFLAGS"
AC_TRY_LINK([#include <ruby.h>],
[ruby_init();],
CONFIG_SCRIPTING_RUBY=yes, CONFIG_SCRIPTING_RUBY=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ruby.h>]], [[ruby_init();]])],[CONFIG_SCRIPTING_RUBY=yes],[CONFIG_SCRIPTING_RUBY=no])
else
AC_MSG_RESULT([Ruby header files not found])
fi

View File

@ -5,8 +5,7 @@ AC_DEFUN([EL_CONFIG_OS_WIN32],
EL_SAVE_FLAGS
AC_TRY_LINK([#include <stdlib.h>],
[_beginthread(NULL, NULL, 0, NULL)], cf_result=yes, cf_result=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>]], [[_beginthread(NULL, NULL, 0, NULL)]])],[cf_result=yes],[cf_result=no])
AC_MSG_RESULT($cf_result)
if test "$cf_result" = yes; then

View File

@ -4,7 +4,8 @@ dnl Autoconf 2.13 generates an incomplete config.h.in; see ELinks bug 936.
dnl Autoconf 2.59 is installed in the computer that generates our daily
dnl snapshots, so we need to be compatible with that.
AC_PREREQ(2.59)
AC_INIT(src/main/main.c)
AC_INIT
AC_CONFIG_SRCDIR([src/main/main.c])
AC_CONFIG_AUX_DIR(config)
PACKAGE=elinks
@ -107,7 +108,7 @@ EL_CONFIG_DEPENDS(CONFIG_MANUAL, [MANUAL_ASCIIDOC MANUAL_XMLTO MANUAL_JW], [Manu
EL_CONFIG_DEPENDS(CONFIG_MANPAGE, [MAN_ASCIIDOC MAN_XMLTO], [Man Page Formats])
dnl gcc specific options (to be continued at the bottom of configure)
if test "x$ac_cv_prog_gcc" = "xyes"; then
if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
dnl We want to see all warnings and live with none.
dnl We can't set up -Werror here as there may be some warnings in test
dnl suite of configure, and we don't want to fail them.
@ -124,9 +125,9 @@ AC_DEFUN([EL_CHECK_COMPILER_MACROS],
AC_MSG_CHECKING([for $2])
for flag in $3; do
AC_TRY_COMPILE(, [#ifndef $flag
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef $flag
kill me!
#endif ], $1=yes, $1=no)
#endif ]])],[$1=yes],[$1=no])
if test "[$]$1" = yes; then
EL_CONFIG([$1], [$2])
break
@ -262,7 +263,7 @@ dnl happily ignoring it and stderr not being checked for error messages.
AC_MSG_CHECKING([for -rdynamic])
LDFLAGS_X="$LDFLAGS"
LDFLAGS="$LDFLAGS -rdynamic"
AC_TRY_LINK([], [], have_rdynamic=yes, have_rdynamic=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[have_rdynamic=yes],[have_rdynamic=no])
test "$have_rdynamic" = no && LDFLAGS="$LDFLAGS_X"
AC_MSG_RESULT($have_rdynamic)
@ -289,7 +290,7 @@ AC_CHECK_FUNCS(getifaddrs getpwnam inet_pton inet_ntop)
AC_CHECK_FUNCS(fflush fsync fseeko ftello sigaction)
AC_CHECK_FUNCS(gettimeofday clock_gettime)
AC_HAVE_FUNCS(cygwin_conv_to_full_win32_path)
AC_CHECK_FUNCS([cygwin_conv_to_full_win32_path])
AC_CHECK_FUNCS(setenv putenv, HAVE_SETENV_OR_PUTENV=yes)
AC_CHECK_FUNCS(getuid, HAVE_GETUID=yes)
@ -305,28 +306,26 @@ AC_CHECK_FUNCS(kill, HAVE_KILL=yes)
if test x"$HAVE_RAISE" = x; then
if test x"$HAVE_KILL" = x || test x"$HAVE_GETPID" = x; then
AC_ERROR([Unable to emulate raise()])
AC_MSG_ERROR([Unable to emulate raise()])
fi
fi
AC_CACHE_CHECK([for __va_copy],el_cv_HAVE_VA_COPY,[
AC_TRY_LINK([#include <stdarg.h>
va_list ap1,ap2;], [__va_copy(ap1,ap2);],
el_cv_HAVE_VA_COPY=yes,el_cv_HAVE_VA_COPY=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])],[el_cv_HAVE_VA_COPY=yes],[el_cv_HAVE_VA_COPY=no])])
if test x"$el_cv_HAVE_VA_COPY" = x"yes"; then
EL_DEFINE(HAVE_VA_COPY, __va_copy)
fi
AC_CACHE_CHECK([for sysconf(_SC_PAGE_SIZE)],el_cv_HAVE_SC_PAGE_SIZE,[
AC_TRY_LINK([#include <unistd.h>
], [int page_size = sysconf(_SC_PAGE_SIZE);],
el_cv_HAVE_SC_PAGE_SIZE=yes,el_cv_HAVE_SC_PAGE_SIZE=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
]], [[int page_size = sysconf(_SC_PAGE_SIZE);]])],[el_cv_HAVE_SC_PAGE_SIZE=yes],[el_cv_HAVE_SC_PAGE_SIZE=no])])
if test x"$el_cv_HAVE_SC_PAGE_SIZE" = x"yes"; then
EL_DEFINE(HAVE_SC_PAGE_SIZE, _SC_PAGE_SIZE)
fi
AC_CACHE_CHECK([for C99 vsnprintf],el_cv_HAVE_C99_VSNPRINTF,[
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
@ -358,8 +357,7 @@ void foo(const char *format, ...) {
exit(0);
}
main() { foo("hello\n"); }
],
el_cv_HAVE_C99_VSNPRINTF=yes,el_cv_HAVE_C99_VSNPRINTF=no,el_cv_HAVE_C99_VSNPRINTF=cross)])
]])],[el_cv_HAVE_C99_VSNPRINTF=yes],[el_cv_HAVE_C99_VSNPRINTF=no],[el_cv_HAVE_C99_VSNPRINTF=cross])])
if test x"$el_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
EL_DEFINE(HAVE_C99_VSNPRINTF, [C99 compliant vsnprintf()])
fi
@ -592,10 +590,10 @@ if test "$enable_see" = "yes"; then
SEE_CFLAGS="`$SEE_CONFIG --cppflags`"
CPPFLAGS="$SEE_CFLAGS $CPPFLAGS"
LIBS="$SEE_LIBS $LIBS_X"
AC_TRY_LINK([#include <see/see.h>],[#if SEE_VERSION_API_MAJOR < 2
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <see/see.h>]], [[#if SEE_VERSION_API_MAJOR < 2
#error SEE too old
#endif
], cf_result=yes, cf_result=no)
]])],[cf_result=yes],[cf_result=no])
EL_RESTORE_FLAGS
if test "$cf_result" = yes; then
LIBS="$SEE_LIBS $LIBS"
@ -643,10 +641,8 @@ if test -z "$disable_spidermonkey"; then
CFLAGS="$CFLAGS_X $SPIDERMONKEY_CFLAGS"
CPPFLAGS="$CPPFLAGS_X $SPIDERMONKEY_CFLAGS"
AC_TRY_LINK([#define XP_UNIX
#include <jsapi.h>],
[JS_GetReservedSlot(NULL, NULL, 0, NULL)],
cf_result=yes, cf_result=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define XP_UNIX
#include <jsapi.h>]], [[JS_GetReservedSlot(NULL, NULL, 0, NULL)]])],[cf_result=yes],[cf_result=no])
fi
done
done
@ -777,29 +773,24 @@ if test "$enable_perl" = "yes"; then
LIBS="$PERL_LIBS $LIBS"
CFLAGS="$PERL_CFLAGS $CFLAGS"
CPPFLAGS="$CPPFLAGS $PERL_CFLAGS"
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <EXTERN.h>
#include <perl.h>
#include <perlapi.h>
],
[PerlInterpreter *my_perl = perl_alloc();],
cf_result=yes, cf_result=no)
]], [[PerlInterpreter *my_perl = perl_alloc();]])],[cf_result=yes],[cf_result=no])
fi
if test "$cf_result"; then AC_MSG_RESULT($cf_result); fi
AC_MSG_CHECKING([whether POPpx works without an n_a variable])
AC_TRY_COMPILE([
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <EXTERN.h>
#include <perl.h>
extern PerlInterpreter *my_perl;
],
[dSP; (void) POPpx;],
[AC_MSG_RESULT([yes])
]], [[dSP; (void) POPpx;]])],[AC_MSG_RESULT([yes])
AC_DEFINE([CONFIG_PERL_POPPX_WITHOUT_N_A], [1],
[Define if using Perl 5.8.8 or later, where the "POPpx" macro
no longer needs an "n_a" variable like it did in 5.8.7])],
[AC_MSG_RESULT([no])])
no longer needs an "n_a" variable like it did in 5.8.7])],[AC_MSG_RESULT([no])])
if test "$cf_result" != "yes"; then
EL_RESTORE_FLAGS
@ -843,9 +834,7 @@ if test "$enable_python" = "yes"; then
PYTHON_LIBS="`$PYTHON -c 'from distutils import sysconfig; var = sysconfig.get_config_var; print "%s %s %s -L%s -lpython%s" % (var("LINKFORSHARED"), var("LIBS"), var("SYSLIBS"), var("LIBPL"), var("VERSION"))'`"
LIBS="$PYTHON_LIBS $LIBS"
CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
AC_TRY_LINK([#include <Python.h>],
[Py_Initialize();],
cf_result=yes, cf_result=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <Python.h>]], [[Py_Initialize();]])],[cf_result=yes],[cf_result=no])
if test "$cf_result" != "yes"; then
EL_RESTORE_FLAGS
@ -909,17 +898,15 @@ if test -z "$disable_lua"; then
CPPFLAGS="$CPPFLAGS_X $LUA_CFLAGS"
# Check that it is a compatible Lua version
AC_TRY_LINK([ #include <lua.h>
#include <lualib.h>],
[ lua_State *L = lua_open();
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <lua.h>
#include <lualib.h>]], [[ lua_State *L = lua_open();
luaopen_base(L);
luaopen_table(L);
luaopen_io(L);
luaopen_string(L);
luaopen_math(L);
lua_pushboolean(L, 1);
lua_close(L);],
cf_result=yes, cf_result=no)
lua_close(L);]])],[cf_result=yes],[cf_result=no])
fi
done
done
@ -1017,13 +1004,9 @@ else
else
LIBS="-lssl -lcrypto $LIBS_X"
fi
AC_TRY_LINK([#include <openssl/ssl.h>],
[OpenSSL_add_all_algorithms()],
cf_result=yes, cf_result=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], [[OpenSSL_add_all_algorithms()]])],[cf_result=yes],[cf_result=no])
if test "$cf_result" != yes; then
AC_TRY_LINK([#include <openssl/ssl.h>],
[SSLeay_add_ssl_algorithms()],
cf_result=yes, cf_result=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], [[SSLeay_add_ssl_algorithms()]])],[cf_result=yes],[cf_result=no])
fi
fi
done
@ -1081,10 +1064,8 @@ else
# Verify if it's really usable. gnutls_session was
# renamed to gnutls_session_t before GNU TLS 1.2.0
# (on 2004-06-13); ELinks now requires this.
AC_TRY_LINK([#include <gnutls/gnutls.h>],
[gnutls_session_t dummy;
gnutls_check_version(NULL)],
cf_result=yes, cf_result=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]], [[gnutls_session_t dummy;
gnutls_check_version(NULL)]])],[cf_result=yes],[cf_result=no])
fi
if test "$cf_result" = yes; then
@ -1156,8 +1137,7 @@ if test x"$no_x" != xyes; then
LDFLAGS="$LDFLAGS -L$x_libraries"
fi
LIBS="-lX11 $LIBS"
AC_TRY_LINK([#include <X11/Xlib.h>],[XrmInitialize()],
cf_result=yes, cf_result=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]], [[XrmInitialize()]])],[cf_result=yes],[cf_result=no])
EL_RESTORE_FLAGS
if test "$cf_result" = yes; then
if test -n "$x_libraries"; then
@ -1415,7 +1395,7 @@ dnl ===================================================================
dnl A little fine tuning of gcc specific options (continued)
dnl ===================================================================
if test "x$ac_cv_prog_gcc" = "xyes"; then
if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
if test "$CONFIG_DEBUG" = "yes"; then
dnl We want to see all warnings and live with none (in debug mode).
CFLAGS="$CFLAGS -Werror"
@ -1452,9 +1432,7 @@ if test "x$ac_cv_prog_gcc" = "xyes"; then
AC_MSG_CHECKING([whether $CC accepts -Wno-always-true])
EL_SAVE_FLAGS
CFLAGS="$CFLAGS -Wno-always-true"
AC_TRY_COMPILE([], [],
[AC_MSG_RESULT([yes])],
[EL_RESTORE_FLAGS
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[AC_MSG_RESULT([yes])],[EL_RESTORE_FLAGS
AC_MSG_RESULT([no])])
fi
@ -1476,7 +1454,7 @@ dnl ===================================================================
dnl Generated files
dnl ===================================================================
AC_OUTPUT([ \
AC_CONFIG_FILES([ \
Makefile.config \
contrib/elinks.spec \
contrib/lua/hooks.lua \
@ -1485,6 +1463,7 @@ AC_OUTPUT([ \
src/intl/gettext/ref-add.sed \
src/intl/gettext/ref-del.sed
])
AC_OUTPUT
abs_srcdir="$(cd "$srcdir" && pwd)"
# builddir is always absolute!