X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/401bf9b4708c19d3c86c888ce482014ca559a5b8..de316778414d14e1cd489994c8812f17b60716c8:/configure.in diff --git a/configure.in b/configure.in index 11b7ad4db0..f46645c1bd 100644 --- a/configure.in +++ b/configure.in @@ -229,7 +229,7 @@ AC_ARG_ENABLE(maintainer-mode, [enable make rules and dependencies not useful (and sometimes confusing) to the casual installer])], USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) + USE_MAINTAINER_MODE=yes) if test $USE_MAINTAINER_MODE = yes; then MAINT= else @@ -294,7 +294,7 @@ if test x$ac_gc_check_stringbytes != x ; then strings is redundantly recorded in sdata structures so that it can be compared to the sizes recorded in Lisp strings.]) fi -if test x$ac_gc_check_stringoverrun != x ; then +if test x$ac_gc_check_string_overrun != x ; then AC_DEFINE(GC_CHECK_STRING_OVERRUN, 1, [Define this to check for short string overrun.]) fi @@ -664,11 +664,11 @@ if test x"$GCC" != xyes && test x"$emacs_check_sunpro_c" = xyes && \ test x"$CPP" = x; then AC_MSG_CHECKING([whether we are using a Sun C compiler]) AC_CACHE_VAL(emacs_cv_sunpro_c, - [AC_TRY_LINK([], -[#ifndef __SUNPRO_C + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], +[[#ifndef __SUNPRO_C fail; #endif -], emacs_cv_sunpro_c=yes, emacs_cv_sunpro_c=no)]) +]])], emacs_cv_sunpro_c=yes, emacs_cv_sunpro_c=no)]) AC_MSG_RESULT($emacs_cv_sunpro_c) if test x"$emacs_cv_sunpro_c" = xyes; then @@ -703,7 +703,7 @@ fi AC_MSG_CHECKING([whether gcc understands -Wdeclaration-after-statement]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wdeclaration-after-statement" -AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no) if test $has_option = yes; then C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH" fi @@ -717,7 +717,7 @@ unset SAVE_CFLAGS AC_MSG_CHECKING([whether gcc understands -Wold-style-definition]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wold-style-definition" -AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no) if test $has_option = yes; then C_WARNINGS_SWITCH="-Wold-style-definition $C_WARNINGS_SWITCH" fi @@ -730,7 +730,7 @@ unset SAVE_CFLAGS AC_MSG_CHECKING([whether gcc understands -Wimplicit-function-declaration]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wimplicit-function-declaration" -AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no) if test $has_option = yes; then C_WARNINGS_SWITCH="-Wimplicit-function-declaration $C_WARNINGS_SWITCH" fi @@ -987,6 +987,9 @@ else CPPFLAGS="$C_SWITCH_SYSTEM $C_SWITCH_MACHINE $CPPFLAGS" fi +# Suppress obsolescent Autoconf test for size_t; Emacs assumes C89 or better. +AC_DEFUN([AC_TYPE_SIZE_T]) + dnl Do this early because it can frob feature test macros for Unix-98 &c. AC_SYS_LARGEFILE @@ -1137,12 +1140,12 @@ if test "${with_sound}" != "no"; then SAVE_LDFLAGS="$LDFLAGS" CFLAGS="$ALSA_CFLAGS $CFLAGS" LDFLAGS="$ALSA_LIBS $LDFLAGS" - AC_TRY_COMPILE([#include ], [snd_lib_error_set_handler (0);], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[snd_lib_error_set_handler (0);]])], emacs_alsa_normal=yes, emacs_alsa_normal=no) if test "$emacs_alsa_normal" != yes; then - AC_TRY_COMPILE([#include ], - [snd_lib_error_set_handler (0);], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[snd_lib_error_set_handler (0);]])], emacs_alsa_subdir=yes, emacs_alsa_subdir=no) if test "$emacs_alsa_subdir" != yes; then @@ -1181,7 +1184,7 @@ AC_CHECK_HEADERS(sys/select.h sys/time.h unistd.h utime.h \ sys/utsname.h pwd.h utmp.h dirent.h util.h) AC_MSG_CHECKING(if personality LINUX32 can be set) -AC_TRY_COMPILE([#include ], [personality (PER_LINUX32)], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[personality (PER_LINUX32)]])], emacs_cv_personality_linux32=yes, emacs_cv_personality_linux32=no) AC_MSG_RESULT($emacs_cv_personality_linux32) @@ -1209,7 +1212,7 @@ AC_HEADER_SYS_WAIT dnl Some systems have utime.h but don't declare the struct anyplace. AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf, -AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME #include #include #else @@ -1221,18 +1224,15 @@ AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME #endif #ifdef HAVE_UTIME_H #include -#endif], [static struct utimbuf x; x.actime = x.modtime;], +#endif]], [[static struct utimbuf x; x.actime = x.modtime;]])], emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no)) if test $emacs_cv_struct_utimbuf = yes; then AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is declared by .]) fi -dnl checks for typedefs -AC_TYPE_SIGNAL - dnl Check for speed_t typedef. AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t, - [AC_TRY_COMPILE([#include ], [speed_t x = 1;], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[speed_t x = 1;]])], emacs_cv_speed_t=yes, emacs_cv_speed_t=no)]) if test $emacs_cv_speed_t = yes; then AC_DEFINE(HAVE_SPEED_T, 1, @@ -1240,7 +1240,7 @@ if test $emacs_cv_speed_t = yes; then fi AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval, -AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME #include #include #else @@ -1249,7 +1249,7 @@ AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME #else #include #endif -#endif], [static struct timeval x; x.tv_sec = x.tv_usec;], +#endif]], [[static struct timeval x; x.tv_sec = x.tv_usec;]])], emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no)) HAVE_TIMEVAL=$emacs_cv_struct_timeval if test $emacs_cv_struct_timeval = yes; then @@ -1257,8 +1257,8 @@ if test $emacs_cv_struct_timeval = yes; then fi AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception, -AC_TRY_COMPILE([#include ], -[static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], +[[static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;]])], emacs_cv_struct_exception=yes, emacs_cv_struct_exception=no)) HAVE_EXCEPTION=$emacs_cv_struct_exception if test $emacs_cv_struct_exception != yes; then @@ -1301,7 +1301,7 @@ dnl This isn't useful because we can't turn on use of `inline' unless dnl the compiler groks `extern inline'. dnl AC_C_INLINE AC_CACHE_CHECK([for void * support], emacs_cv_void_star, - [AC_TRY_COMPILE(, [void * foo;], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[void * foo;]])], emacs_cv_void_star=yes, emacs_cv_void_star=no)]) if test $emacs_cv_void_star = yes; then AC_DEFINE(POINTER_TYPE, void) @@ -1349,7 +1349,7 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then AC_MSG_CHECKING([whether gcc understands -MMD -MF]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -MMD -MF deps.d" - AC_TRY_COMPILE([], [], , ac_enable_autodepend=no) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], , ac_enable_autodepend=no) CFLAGS="$SAVE_CFLAGS" test -f deps.d || ac_enable_autodepend=no rm -rf deps.d @@ -1359,7 +1359,7 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then DEPFLAGS='-MMD -MF ${DEPDIR}/$*.d' ## In parallel builds, another make might create depdir between ## the first test and mkdir, so stick another test on the end. - ## Or use mkinstalldirs? mkdir -p is not portable. + ## Or use install-sh -d? mkdir -p is not portable. MKDEPDIR='test -d ${DEPDIR} || mkdir ${DEPDIR} || test -d ${DEPDIR}' deps_frag=autodeps.mk fi @@ -1582,7 +1582,7 @@ AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no) AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no) AC_CACHE_CHECK(whether __after_morecore_hook exists, emacs_cv_var___after_morecore_hook, -[AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0], +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern void (* __after_morecore_hook)();]],[[__after_morecore_hook = 0]])], emacs_cv_var___after_morecore_hook=yes, emacs_cv_var___after_morecore_hook=no)]) if test $emacs_cv_var___after_morecore_hook = no; then @@ -1634,7 +1634,7 @@ fi use_mmap_for_buffers=no case "$opsys" in - freebsd|irix6-5) use_mmap_for_buffers=yes ;; + cygwin|freebsd|irix6-5) use_mmap_for_buffers=yes ;; esac AC_FUNC_MMAP @@ -1680,7 +1680,7 @@ aix*) esac LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc - AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])], [], [gdb_cv_bigtoc=]) ]) ;; esac @@ -1710,8 +1710,8 @@ if test "${HAVE_X11}" = "yes"; then if test "${opsys}" = "gnu-linux"; then AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link) - AC_TRY_LINK([], - [XOpenDisplay ("foo");], + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[XOpenDisplay ("foo");]])], [xlinux_first_failure=no], [xlinux_first_failure=yes]) if test "${xlinux_first_failure}" = "yes"; then @@ -1723,8 +1723,8 @@ if test "${HAVE_X11}" = "yes"; then C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout" CPPFLAGS="$CPPFLAGS -b i486-linuxaout" LIBS="$LIBS -b i486-linuxaout" - AC_TRY_LINK([], - [XOpenDisplay ("foo");], + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[XOpenDisplay ("foo");]])], [xlinux_second_failure=no], [xlinux_second_failure=yes]) if test "${xlinux_second_failure}" = "yes"; then @@ -1746,9 +1746,9 @@ if test "${HAVE_X11}" = "yes"; then # Reportedly, some broken Solaris systems have XKBlib.h but are missing # header files included from there. AC_MSG_CHECKING(for Xkb) - AC_TRY_LINK([#include -#include ], - [XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);], + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], + [[XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);]])], emacs_xkb=yes, emacs_xkb=no) AC_MSG_RESULT($emacs_xkb) if test $emacs_xkb = yes; then @@ -1762,11 +1762,11 @@ fi if test "${window_system}" = "x11"; then AC_MSG_CHECKING(X11 version 6) AC_CACHE_VAL(emacs_cv_x11_version_6, - [AC_TRY_LINK([#include ], -[#if XlibSpecificationRelease < 6 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], +[[#if XlibSpecificationRelease < 6 fail; #endif -], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)]) +]])], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)]) if test $emacs_cv_x11_version_6 = yes; then AC_MSG_RESULT(6 or newer) AC_DEFINE(HAVE_X11R6, 1, @@ -1808,7 +1808,10 @@ fi HAVE_IMAGEMAGICK=no if test "${HAVE_X11}" = "yes"; then if test "${with_imagemagick}" != "no"; then - IMAGEMAGICK_MODULE="Wand" + ## 6.2.8 is the earliest version known to work, but earlier versions + ## might work - let us know if you find one. + ## 6.0.7 does not work. See bug#7955. + IMAGEMAGICK_MODULE="Wand >= 6.2.8" PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :) AC_SUBST(IMAGEMAGICK_CFLAGS) AC_SUBST(IMAGEMAGICK_LIBS) @@ -1972,12 +1975,22 @@ fi AC_SUBST(LIBSELINUX_LIBS) HAVE_GNUTLS=no +HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY=no if test "${with_gnutls}" = "yes" ; then - PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.2.4], HAVE_GNUTLS=yes, HAVE_GNUTLS=no) + PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.6.0], HAVE_GNUTLS=yes, HAVE_GNUTLS=no) if test "${HAVE_GNUTLS}" = "yes"; then AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.]) fi + + CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" + LIBS="$LIBGNUTLS_LIBS $LIBS" + AC_CHECK_FUNCS(gnutls_certificate_set_verify_function, HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY=yes) + + if test "${HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY}" = "yes"; then + AC_DEFINE(HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY, 1, [Define if using GnuTLS certificate verification callbacks.]) + fi fi + AC_SUBST(LIBGNUTLS_LIBS) AC_SUBST(LIBGNUTLS_CFLAGS) @@ -1989,10 +2002,10 @@ if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then if test "$with_xaw3d" != no; then AC_MSG_CHECKING(for xaw3d) AC_CACHE_VAL(emacs_cv_xaw3d, - [AC_TRY_LINK([ + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -#include ], - [], +#include ]], + [[]])], [AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, emacs_cv_xaw3d=yes, emacs_cv_xaw3d=no)], emacs_cv_xaw3d=no)]) @@ -2010,10 +2023,10 @@ if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then AC_MSG_RESULT(no) AC_MSG_CHECKING(for libXaw) AC_CACHE_VAL(emacs_cv_xaw, - [AC_TRY_LINK([ + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -#include ], - [], +#include ]], + [[]])], emacs_cv_xaw=yes, emacs_cv_xaw=no)]) if test $emacs_cv_xaw = yes; then @@ -2035,11 +2048,11 @@ LIBXTR6= if test "${USE_X_TOOLKIT}" != "none"; then AC_MSG_CHECKING(X11 toolkit version) AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6, - [AC_TRY_LINK([#include ], -[#if XtSpecificationRelease < 6 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], +[[#if XtSpecificationRelease < 6 fail; #endif -], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)]) +]])], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)]) HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6 if test $emacs_cv_x11_toolkit_version_6 = yes; then AC_MSG_RESULT(6 or newer) @@ -2088,12 +2101,12 @@ fi LIBXP= if test "${USE_X_TOOLKIT}" = "MOTIF"; then AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1, - [AC_TRY_COMPILE([#include ], - [#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1) + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1) int x = 5; #else Motif version prior to 2.1. -#endif], +#endif]])], emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)]) if test $emacs_cv_motif_version_2_1 = yes; then AC_CHECK_LIB(Xp, XpCreateContext, LIBXP=-lXp) @@ -2106,8 +2119,8 @@ Motif version prior to 2.1. OLD_CFLAGS=$CFLAGS CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS" CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS" - [AC_TRY_COMPILE([#include ], - [int x = 5;], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int x = 5;]])], emacs_cv_lesstif=yes, emacs_cv_lesstif=no)]) if test $emacs_cv_lesstif = yes; then # Make sure this -I option remains in CPPFLAGS after it is set @@ -2151,10 +2164,10 @@ if test "${with_toolkit_scroll_bars}" != "no"; then fi dnl See if XIM is available. -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include - #include ], - [XIMProc callback;], + #include ]], + [[XIMProc callback;]])], [HAVE_XIM=yes AC_DEFINE(HAVE_XIM, 1, [Define to 1 if XIM is available])], HAVE_XIM=no) @@ -2172,10 +2185,10 @@ if test "${HAVE_XIM}" != "no"; then if test "$GCC" = yes; then CFLAGS="$CFLAGS --pedantic-errors" fi - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -#include ], -[Display *display; +#include ]], +[[Display *display; XrmDatabase db; char *res_name; char *res_class; @@ -2188,7 +2201,7 @@ extern Bool XRegisterIMInstantiateCallback(Display*, XrmDatabase, char*, char*, XIMProc, XPointer*); #endif (void)XRegisterIMInstantiateCallback(display, db, res_name, res_class, callback, - client_data);], + client_data);]])], [emacs_cv_arg6_star=yes]) AH_TEMPLATE(XRegisterIMInstantiateCallback_arg6, [Define to the type of the 6th arg of XRegisterIMInstantiateCallback, @@ -2256,7 +2269,7 @@ if test "${HAVE_X11}" = "yes"; then dnl if -lfreetype is not specified. dnl The following is needed to set FREETYPE_LIBS. PKG_CHECK_MODULES(FREETYPE, freetype2, HAVE_FREETYPE=yes, - HAVE_FREETYPE=no) + HAVE_FREETYPE=no) test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(libxft requires libfreetype) fi @@ -2540,8 +2553,8 @@ AC_SUBST(LIBXML2_CFLAGS) # If netdb.h doesn't declare h_errno, we must declare it by hand. AC_CACHE_CHECK(whether netdb declares h_errno, emacs_cv_netdb_declares_h_errno, -[AC_TRY_LINK([#include ], - [return h_errno;], +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[return h_errno;]])], emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no)]) if test $emacs_cv_netdb_declares_h_errno = yes; then AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.]) @@ -2722,11 +2735,11 @@ case "$opsys" in freebsd) AC_MSG_CHECKING([whether FreeBSD is new enough to use terminfo]) AC_CACHE_VAL(emacs_cv_freebsd_terminfo, - [AC_TRY_LINK([#include ], -[#if __FreeBSD_version < 400000 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], +[[#if __FreeBSD_version < 400000 fail; #endif -], emacs_cv_freebsd_terminfo=yes, emacs_cv_freebsd_terminfo=no)]) +]])], emacs_cv_freebsd_terminfo=yes, emacs_cv_freebsd_terminfo=no)]) AC_MSG_RESULT($emacs_cv_freebsd_terminfo) @@ -2776,19 +2789,19 @@ AC_SUBST(TERMCAP_OBJ) # Do we have res_init, for detecting changes in /etc/resolv.conf? resolv=no -AC_TRY_LINK([#include +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include -#include ], - [return res_init();], +#include ]], + [[return res_init();]])], have_res_init=yes, have_res_init=no) if test "$have_res_init" = no; then OLIBS="$LIBS" LIBS="$LIBS -lresolv" AC_MSG_CHECKING(for res_init with -lresolv) - AC_TRY_LINK([#include + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include -#include ], - [return res_init();], +#include ]], + [[return res_init();]])], have_res_init=yes, have_res_init=no) AC_MSG_RESULT($have_res_init) if test "$have_res_init" = yes ; then @@ -2924,7 +2937,7 @@ AC_CHECK_LIB(intl, dgettext) AC_MSG_CHECKING(whether localtime caches TZ) AC_CACHE_VAL(emacs_cv_localtime_cache, [if test x$ac_cv_func_tzset = xyes; then -AC_TRY_RUN([#include +AC_RUN_IFELSE([AC_LANG_SOURCE([[#include char TZ_GMT0[] = "TZ=GMT0"; char TZ_PST8[] = "TZ=PST8"; main() @@ -2944,7 +2957,7 @@ main() if (localtime (&now)->tm_hour != hour_unset) exit (1); exit (0); -}], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes, +}]])], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes, [# If we have tzset, assume the worst when cross-compiling. emacs_cv_localtime_cache=yes]) else @@ -2963,7 +2976,7 @@ if test "x$HAVE_TIMEVAL" = xyes; then if test $ac_cv_func_gettimeofday = yes; then AC_CACHE_CHECK(whether gettimeofday can accept two arguments, emacs_cv_gettimeofday_two_arguments, - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef TIME_WITH_SYS_TIME #include #include @@ -2973,9 +2986,9 @@ if test "x$HAVE_TIMEVAL" = xyes; then #else #include #endif -#endif], - [struct timeval time; - gettimeofday (&time, 0);], +#endif]], + [[struct timeval time; + gettimeofday (&time, 0);]])], emacs_cv_gettimeofday_two_arguments=yes, emacs_cv_gettimeofday_two_arguments=no)]) if test $emacs_cv_gettimeofday_two_arguments = no; then @@ -3016,8 +3029,8 @@ AC_FUNC_FORK dnl Adapted from Haible's version. AC_CACHE_CHECK([for nl_langinfo and CODESET], emacs_cv_langinfo_codeset, - [AC_TRY_LINK([#include ], - [char* cs = nl_langinfo(CODESET);], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[char* cs = nl_langinfo(CODESET);]])], emacs_cv_langinfo_codeset=yes, emacs_cv_langinfo_codeset=no) ]) @@ -3026,12 +3039,10 @@ if test $emacs_cv_langinfo_codeset = yes; then [Define if you have and nl_langinfo(CODESET).]) fi -AC_CHECK_TYPES(size_t) - AC_TYPE_MBSTATE_T AC_CACHE_CHECK([for C restricted array declarations], emacs_cv_c_restrict_arr, - [AC_TRY_COMPILE([void fred (int x[__restrict]);], [], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void fred (int x[__restrict]);]], [[]])], emacs_cv_c_restrict_arr=yes, emacs_cv_c_restrict_arr=no)]) if test "$emacs_cv_c_restrict_arr" = yes; then AC_DEFINE(__restrict_arr, __restrict, @@ -3493,11 +3504,6 @@ AH_BOTTOM([ # define SYSTEM_PURESIZE_EXTRA 30000 #endif -/* SIGTYPE is the macro we actually use. */ -#ifndef SIGTYPE -#define SIGTYPE RETSIGTYPE -#endif - #ifdef emacs /* Don't do this for lib-src. */ /* Tell regex.c to use a type compatible with Emacs. */ #define RE_TRANSLATE_TYPE Lisp_Object @@ -3512,7 +3518,8 @@ AH_BOTTOM([ #endif /* These default definitions are good for almost all machines. - The exceptions override them in m/MACHINE.h. */ + Any exceptions should override them in m/MACHINE.h. + They must be usable in preprocessor conditionals. */ #ifndef BITS_PER_CHAR #define BITS_PER_CHAR 8 @@ -3522,9 +3529,6 @@ AH_BOTTOM([ #define BITS_PER_SHORT 16 #endif -/* Note that lisp.h uses this in a preprocessor conditional, so it - would not work to use sizeof. That being so, we do all of them - without sizeof, for uniformity's sake. */ #ifndef BITS_PER_INT #define BITS_PER_INT 32 #endif @@ -3537,6 +3541,10 @@ AH_BOTTOM([ #endif #endif +#if !defined BITS_PER_LONG_LONG && HAVE_LONG_LONG_INT +#define BITS_PER_LONG_LONG 64 +#endif + /* Define if the compiler supports function prototypes. It may do so but not define __STDC__ (e.g. DEC C by default) or may define it as zero. */ #undef PROTOTYPES @@ -3558,10 +3566,6 @@ extern "C" void *alloca (size_t); #endif -#ifndef HAVE_SIZE_T -typedef unsigned size_t; -#endif - #ifndef HAVE_STRCHR #define strchr(a, b) index (a, b) #endif @@ -3589,6 +3593,20 @@ typedef unsigned size_t; #define EXTERNALLY_VISIBLE #endif +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#else +# define ATTRIBUTE_FORMAT(spec) /* empty */ +#endif + +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) +# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ + ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument)) +#else +# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ + ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) +#endif + /* Some versions of GNU/Linux define noinline in their headers. */ #ifdef noinline #undef noinline @@ -3665,7 +3683,7 @@ echo " Does Emacs use -lgpm? ${HAVE_GPM}" echo " Does Emacs use -ldbus? ${HAVE_DBUS}" echo " Does Emacs use -lgconf? ${HAVE_GCONF}" echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" -echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" +echo " Does Emacs use -lgnutls (2.6.x or higher)? ${HAVE_GNUTLS}" echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}"