------------------------------------------------------------ revno: 117101 committer: Glenn Morris branch nick: trunk timestamp: Tue 2014-05-13 23:35:36 -0700 message: Optimize away some compat-cruft in printing.el * lisp/printing.el (subst-char-in-string, make-temp-file, pr-get-symbol): Optimize on Emacs, which has the relevant functions for ages. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-13 20:34:12 +0000 +++ lisp/ChangeLog 2014-05-14 06:35:36 +0000 @@ -1,3 +1,8 @@ +2014-05-14 Glenn Morris + + * printing.el (subst-char-in-string, make-temp-file, pr-get-symbol): + Optimize on Emacs, which has the relevant functions for ages. + 2014-05-13 Stefan Monnier * simple.el (undo-make-selective-list): Obey undo-no-redo. === modified file 'lisp/printing.el' --- lisp/printing.el 2014-05-12 06:59:30 +0000 +++ lisp/printing.el 2014-05-14 06:35:36 +0000 @@ -1038,20 +1038,27 @@ ;; To avoid compilation gripes -(or (fboundp 'subst-char-in-string) ; hacked from subr.el - (defun subst-char-in-string (fromchar tochar string &optional inplace) - "Replace FROMCHAR with TOCHAR in STRING each time it occurs. +;; Emacs has this since at least 21.1. +(when (featurep 'xemacs) + (or (fboundp 'subst-char-in-string) ; hacked from subr.el + (defun subst-char-in-string (fromchar tochar string &optional inplace) + "Replace FROMCHAR with TOCHAR in STRING each time it occurs. Unless optional argument INPLACE is non-nil, return a new string." - (let ((i (length string)) - (newstr (if inplace string (copy-sequence string)))) - (while (> (setq i (1- i)) 0) - (if (eq (aref newstr i) fromchar) - (aset newstr i tochar))) - newstr))) - - -(or (fboundp 'make-temp-file) ; hacked from subr.el - (defun make-temp-file (prefix &optional dir-flag suffix) + (let ((i (length string)) + (newstr (if inplace string (copy-sequence string)))) + (while (> (setq i (1- i)) 0) + (if (eq (aref newstr i) fromchar) + (aset newstr i tochar))) + newstr)))) + + +;; Emacs has this since at least 21.1, but the SUFFIX argument +;; (which this file uses) only since 22.1. So the fboundp test +;; wasn't even correct/adequate. Whatever, no-one is using +;; this file on older Emacs version, so it's irrelevant. +(when (featurep 'xemacs) + (or (fboundp 'make-temp-file) ; hacked from subr.el + (defun make-temp-file (prefix &optional dir-flag suffix) "Create a temporary file. The returned file name (created by appending some random characters at the end of PREFIX, and expanding against `temporary-file-directory' if necessary), @@ -1086,7 +1093,7 @@ nil) file) ;; Reset the umask. - (set-default-file-modes umask))))) + (set-default-file-modes umask)))))) (eval-when-compile @@ -3192,9 +3199,10 @@ (defalias 'pr-get-symbol - (if (fboundp 'easy-menu-intern) ; hacked from easymenu.el - 'easy-menu-intern - (lambda (s) (if (stringp s) (intern s) s)))) + (if (featurep 'emacs) 'easy-menu-intern ; since 22.1 + (if (fboundp 'easy-menu-intern) ; hacked from easymenu.el + 'easy-menu-intern + (lambda (s) (if (stringp s) (intern s) s))))) (defconst pr-menu-spec ------------------------------------------------------------ revno: 117100 committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-05-13 16:15:48 -0700 message: * texinfo.tex: Update from gnulib. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-05-08 03:41:21 +0000 +++ doc/misc/ChangeLog 2014-05-13 23:15:48 +0000 @@ -1,3 +1,7 @@ +2014-05-13 Paul Eggert + + * texinfo.tex: Update from gnulib. + 2014-05-08 Michael Albinus * tramp.texi (Frequently Asked Questions): Mention HISTFILE === modified file 'doc/misc/texinfo.tex' --- doc/misc/texinfo.tex 2014-03-26 04:16:13 +0000 +++ doc/misc/texinfo.tex 2014-05-13 23:15:48 +0000 @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2014-03-17.07} +\def\texinfoversion{2014-05-05.10} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -2146,7 +2146,7 @@ \let\tenttsl=\secttsl \def\curfontsize{sec}% \def\lsize{subsec}\def\lllsize{reduced}% - \resetmathfonts \setleading{16pt}} + \resetmathfonts \setleading{17pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc ------------------------------------------------------------ revno: 117099 committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-05-13 16:15:01 -0700 message: * merge-gnulib: Defer to autogen.sh for ACLOCAL_PATH computation. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2014-05-12 06:59:30 +0000 +++ admin/ChangeLog 2014-05-13 23:15:01 +0000 @@ -1,3 +1,7 @@ +2014-05-13 Paul Eggert + + * merge-gnulib: Defer to autogen.sh for ACLOCAL_PATH computation. + 2014-05-12 Glenn Morris * find-gc.el: Move here from ../lisp/emacs-lisp. === modified file 'admin/merge-gnulib' --- admin/merge-gnulib 2014-03-07 18:57:11 +0000 +++ admin/merge-gnulib 2014-05-13 23:15:01 +0000 @@ -96,4 +96,5 @@ "$src"m4/gnulib-cache.m4"$src" m4/warn-on-use.m4 && cp -- "$gnulib_srcdir"/build-aux/texinfo.tex "$src"doc/misc && cp -- "$gnulib_srcdir"/build-aux/move-if-change "$src"build-aux && -autoreconf -i -I m4 -- ${src:+"$src"} +{ test -z "$src" || cd "$src"; } && +./autogen.sh ------------------------------------------------------------ revno: 117098 committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-05-13 15:59:36 -0700 message: * keyboard.c (Qdeactivate_mark): Now static. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-13 14:18:54 +0000 +++ src/ChangeLog 2014-05-13 22:59:36 +0000 @@ -1,3 +1,7 @@ +2014-05-13 Paul Eggert + + * keyboard.c (Qdeactivate_mark): Now static. + 2014-05-13 Dmitry Antipov If available, use Xfixes extension to do pointer blanking. === modified file 'src/keyboard.c' --- src/keyboard.c 2014-05-08 03:41:21 +0000 +++ src/keyboard.c 2014-05-13 22:59:36 +0000 @@ -235,7 +235,7 @@ static Lisp_Object Qinput_method_function; -Lisp_Object Qdeactivate_mark; +static Lisp_Object Qdeactivate_mark; Lisp_Object Qrecompute_lucid_menubar, Qactivate_menubar_hook; ------------------------------------------------------------ revno: 117097 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-05-13 16:34:12 -0400 message: * lisp/simple.el (undo-make-selective-list): Obey undo-no-redo. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-12 16:14:24 +0000 +++ lisp/ChangeLog 2014-05-13 20:34:12 +0000 @@ -1,3 +1,7 @@ +2014-05-13 Stefan Monnier + + * simple.el (undo-make-selective-list): Obey undo-no-redo. + 2014-05-12 Sam Steingold * calendar/time-date.el (seconds-to-string): New function to === modified file 'lisp/simple.el' --- lisp/simple.el 2014-05-01 23:25:28 +0000 +++ lisp/simple.el 2014-05-13 20:34:12 +0000 @@ -2437,6 +2437,9 @@ undo-deltas undo-elt) (while ulist + (when undo-no-redo + (while (gethash ulist undo-equiv-table) + (setq ulist (gethash ulist undo-equiv-table)))) (setq undo-elt (car ulist)) (cond ((null undo-elt) ------------------------------------------------------------ revno: 117096 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2014-05-13 18:18:54 +0400 message: If available, use Xfixes extension to do pointer blanking. * configure.ac (HAVE_XFIXES): Define if available. (XFIXES_CFLAGS, XFIXES_LIBS): New AC_SUBSTs. * src/Makefile.in (XFIXES_CFLAGS, XFIXES_LIBS): New var. * src/xfns.c (x_set_mouse_color): Do not call make_invisible_cursor here. (make_invisible_cursor): Move to... * src/xterm.c (make_invisible_cursor): ...here. (x_probe_xfixes_extension, xfixes_toggle_visible_pointer) (x_toggle_visible_pointer, x_setup_pointer_blanking): New functions. (x_term_init): Call to x_setup_pointer_blanking. (XTtoggle_invisible_pointer): Use blanking specific to this display. * src/xterm.h (struct x_display_info): New member toggle_visible_pointer. diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-13 11:12:05 +0000 +++ ChangeLog 2014-05-13 14:18:54 +0000 @@ -1,6 +1,8 @@ 2014-05-13 Dmitry Antipov - * configure.ac (--enable-link-time-optimization): Add clang support. + * configure.ac (HAVE_XFIXES): Define if available. + (XFIXES_CFLAGS, XFIXES_LIBS): New AC_SUBSTs. + (--enable-link-time-optimization): Add clang support. * INSTALL: Mention it. 2014-05-12 Katsumi Yamaoka === modified file 'configure.ac' --- configure.ac 2014-05-13 11:12:05 +0000 +++ configure.ac 2014-05-13 14:18:54 +0000 @@ -3304,6 +3304,26 @@ AC_SUBST(XINERAMA_CFLAGS) AC_SUBST(XINERAMA_LIBS) +### Use Xfixes (-lXfixes) if available +HAVE_XFIXES=no +if test "${HAVE_X11}" = "yes"; then + XFIXES_REQUIRED=4.0.0 + XFIXES_MODULES="xfixes >= $XFIXES_REQUIRED" + EMACS_CHECK_MODULES([XFIXES], [$XFIXES_MODULES]) + if test $HAVE_XFIXES = no; then + # Test old way in case pkg-config doesn't have it (older machines). + AC_CHECK_HEADER(X11/extensions/Xfixes.h, + [AC_CHECK_LIB(Xfixes, XFixesHideCursor, HAVE_XFIXES=yes)]) + if test $HAVE_XFIXES = yes; then + XFIXES_LIBS=-lXfixes + fi + fi + if test $HAVE_XFIXES = yes; then + AC_DEFINE(HAVE_XFIXES, 1, [Define to 1 if you have the Xfixes extension.]) + fi +fi +AC_SUBST(XFIXES_CFLAGS) +AC_SUBST(XFIXES_LIBS) ### Use libxml (-lxml2) if available ### mingw32 doesn't use -lxml2, since it loads the library dynamically. === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-12 08:57:59 +0000 +++ src/ChangeLog 2014-05-13 14:18:54 +0000 @@ -1,3 +1,16 @@ +2014-05-13 Dmitry Antipov + + If available, use Xfixes extension to do pointer blanking. + * Makefile.in (XFIXES_CFLAGS, XFIXES_LIBS): New var. + * xfns.c (x_set_mouse_color): Do not call make_invisible_cursor here. + (make_invisible_cursor): Move to... + * xterm.c (make_invisible_cursor): ...here. + (x_probe_xfixes_extension, xfixes_toggle_visible_pointer) + (x_toggle_visible_pointer, x_setup_pointer_blanking): New functions. + (x_term_init): Call to x_setup_pointer_blanking. + (XTtoggle_invisible_pointer): Use blanking specific to this display. + * xterm.h (struct x_display_info): New member toggle_visible_pointer. + 2014-05-12 YAMAMOTO Mitsuharu * xdisp.c (draw_glyphs): Set clipping to highlight boundaries. === modified file 'src/Makefile.in' --- src/Makefile.in 2014-05-04 21:28:08 +0000 +++ src/Makefile.in 2014-05-13 14:18:54 +0000 @@ -231,6 +231,9 @@ XINERAMA_LIBS = @XINERAMA_LIBS@ XINERAMA_CFLAGS = @XINERAMA_CFLAGS@ +XFIXES_LIBS = @XFIXES_LIBS@ +XFIXES_CFLAGS = @XFIXES_CFLAGS@ + ## widget.o if USE_X_TOOLKIT, otherwise empty. WIDGET_OBJ=@WIDGET_OBJ@ @@ -326,8 +329,8 @@ -I$(lib) -I$(srcdir)/../lib \ $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ $(GNUSTEP_CFLAGS) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(IMAGEMAGICK_CFLAGS) \ - $(PNG_CFLAGS) \ - $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) $(XRANDR_CFLAGS) $(XINERAMA_CFLAGS) \ + $(PNG_CFLAGS) $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) \ + $(XRANDR_CFLAGS) $(XINERAMA_CFLAGS) $(XFIXES_CFLAGS) \ $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \ $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \ $(LIBGNUTLS_CFLAGS) $(GFILENOTIFY_CFLAGS) \ @@ -407,7 +410,7 @@ $(LIBX_OTHER) $(LIBSOUND) \ $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_ACL) $(LIB_CLOCK_GETTIME) \ $(LIB_EACCESS) $(LIB_FDATASYNC) $(LIB_TIMER_TIME) $(DBUS_LIBS) \ - $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) \ + $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) $(XFIXES_LIBS) \ $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ === modified file 'src/xfns.c' --- src/xfns.c 2014-04-03 20:46:04 +0000 +++ src/xfns.c 2014-05-13 14:18:54 +0000 @@ -577,35 +577,6 @@ } } -static Cursor -make_invisible_cursor (struct frame *f) -{ - Display *dpy = FRAME_X_DISPLAY (f); - static char const no_data[] = { 0 }; - Pixmap pix; - XColor col; - Cursor c = 0; - - x_catch_errors (dpy); - pix = XCreateBitmapFromData (dpy, FRAME_DISPLAY_INFO (f)->root_window, - no_data, 1, 1); - if (! x_had_errors_p (dpy) && pix != None) - { - Cursor pixc; - col.pixel = 0; - col.red = col.green = col.blue = 0; - col.flags = DoRed | DoGreen | DoBlue; - pixc = XCreatePixmapCursor (dpy, pix, pix, &col, &col, 0, 0); - if (! x_had_errors_p (dpy) && pixc != None) - c = pixc; - XFreePixmap (dpy, pix); - } - - x_uncatch_errors (); - - return c; -} - static void x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { @@ -723,9 +694,6 @@ XDefineCursor (dpy, FRAME_X_WINDOW (f), f->output_data.x->current_cursor = cursor); - if (FRAME_DISPLAY_INFO (f)->invisible_cursor == 0) - FRAME_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f); - if (cursor != x->text_cursor && x->text_cursor != 0) XFreeCursor (dpy, x->text_cursor); === modified file 'src/xterm.c' --- src/xterm.c 2014-04-18 23:36:51 +0000 +++ src/xterm.c 2014-05-13 14:18:54 +0000 @@ -32,6 +32,11 @@ #include "xterm.h" #include +/* If we have Xfixes extension, use it for pointer blanking. */ +#ifdef HAVE_XFIXES +#include +#endif + /* Load sys/types.h if not already loaded. In some systems loading it twice is suicidal. */ #ifndef makedev @@ -3096,16 +3101,7 @@ XTtoggle_invisible_pointer (struct frame *f, int invisible) { block_input (); - if (invisible) - { - if (FRAME_DISPLAY_INFO (f)->invisible_cursor != 0) - XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - FRAME_DISPLAY_INFO (f)->invisible_cursor); - } - else - XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - f->output_data.x->current_cursor); - f->pointer_invisible = invisible; + FRAME_DISPLAY_INFO (f)->toggle_visible_pointer (f, invisible); unblock_input (); } @@ -9720,6 +9716,94 @@ } #endif +/* Create invisible cursor on X display referred by DPYINFO. */ + +static Cursor +make_invisible_cursor (struct x_display_info *dpyinfo) +{ + Display *dpy = dpyinfo->display; + static char const no_data[] = { 0 }; + Pixmap pix; + XColor col; + Cursor c = 0; + + x_catch_errors (dpy); + pix = XCreateBitmapFromData (dpy, dpyinfo->root_window, no_data, 1, 1); + if (! x_had_errors_p (dpy) && pix != None) + { + Cursor pixc; + col.pixel = 0; + col.red = col.green = col.blue = 0; + col.flags = DoRed | DoGreen | DoBlue; + pixc = XCreatePixmapCursor (dpy, pix, pix, &col, &col, 0, 0); + if (! x_had_errors_p (dpy) && pixc != None) + c = pixc; + XFreePixmap (dpy, pix); + } + + x_uncatch_errors (); + + return c; +} + +/* True if DPY supports Xfixes extension >= 4. */ + +static bool +x_probe_xfixes_extension (Display *dpy) +{ +#ifdef HAVE_XFIXES + int major, minor; + return XFixesQueryVersion (dpy, &major, &minor) && major >= 4; +#else + return false; +#endif /* HAVE_XFIXES */ +} + +/* Toggle mouse pointer visibility on frame F by using Xfixes functions. */ + +static void +xfixes_toggle_visible_pointer (struct frame *f, bool invisible) +{ +#ifdef HAVE_XFIXES + if (invisible) + XFixesHideCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); + else + XFixesShowCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); + f->pointer_invisible = invisible; +#else + emacs_abort (); +#endif /* HAVE_XFIXES */ +} + +/* Toggle mouse pointer visibility on frame F by using invisible cursor. */ + +static void +x_toggle_visible_pointer (struct frame *f, bool invisible) +{ + eassert (FRAME_DISPLAY_INFO (f)->invisible_cursor != 0); + if (invisible) + XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + FRAME_DISPLAY_INFO (f)->invisible_cursor); + else + XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + f->output_data.x->current_cursor); + f->pointer_invisible = invisible; +} + +/* Setup pointer blanking, prefer Xfixes if available. */ + +static void +x_setup_pointer_blanking (struct x_display_info *dpyinfo) +{ + if (x_probe_xfixes_extension (dpyinfo->display)) + dpyinfo->toggle_visible_pointer = xfixes_toggle_visible_pointer; + else + { + dpyinfo->toggle_visible_pointer = x_toggle_visible_pointer; + dpyinfo->invisible_cursor = make_invisible_cursor (dpyinfo); + } +} + /* Current X display connection identifier. Incremented for each next connection established. */ static unsigned x_display_id; @@ -10148,6 +10232,8 @@ gray_bits, gray_width, gray_height, 1, 0, 1); + x_setup_pointer_blanking (dpyinfo); + #ifdef HAVE_X_I18N xim_initialize (dpyinfo, resource_name); #endif === modified file 'src/xterm.h' --- src/xterm.h 2014-04-05 19:30:36 +0000 +++ src/xterm.h 2014-05-13 14:18:54 +0000 @@ -174,9 +174,13 @@ /* The cursor to use for vertical scroll bars. */ Cursor vertical_scroll_bar_cursor; - /* The invisible cursor used for pointer blanking. */ + /* The invisible cursor used for pointer blanking. + Unused if this display supports Xfixes extension. */ Cursor invisible_cursor; + /* Function used to toggle pointer visibility on this display. */ + void (*toggle_visible_pointer) (struct frame *, bool); + #ifdef USE_GTK /* The GDK cursor for scroll bars and popup menus. */ GdkCursor *xg_cursor; ------------------------------------------------------------ revno: 117095 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2014-05-13 15:12:05 +0400 message: * configure.ac (--enable-link-time-optimization): Add clang support. * INSTALL: Mention it. * etc/PROBLEMS: Mention potential problems with --enable-link-time-optimization and clang on Fedora 20. diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-12 06:09:27 +0000 +++ ChangeLog 2014-05-13 11:12:05 +0000 @@ -1,3 +1,8 @@ +2014-05-13 Dmitry Antipov + + * configure.ac (--enable-link-time-optimization): Add clang support. + * INSTALL: Mention it. + 2014-05-12 Katsumi Yamaoka * configure.ac (EMACS_CHECK_MODULES): Fix typo in previous change. === modified file 'INSTALL' --- INSTALL 2014-03-27 19:41:57 +0000 +++ INSTALL 2014-05-13 11:12:05 +0000 @@ -331,12 +331,17 @@ there should be no warnings; on older and on non-GNU systems the generated warnings may still be useful. -Use --enable-link-time-optimization to enable link-time optimizer, which -is available in GNU compiler since version 4.5.0. If your compiler is not -GNU or older than version 4.5.0, this option does nothing. If `configure' -can determine number of online CPUS on your system, final link-time -optimization and code generation is executed in parallel using one job -per each available online CPU. +Use --enable-link-time-optimization to enable link-time optimizer. If +you're using GNU compiler, this feature is supported since version 4.5.0. +If `configure' can determine number of online CPUS on your system, final +link-time optimization and code generation is executed in parallel using +one job per each available online CPU. + +This option is also supported for clang. You should have GNU binutils +with `gold' linker and plugin support, and clang with LLVMgold.so plugin. +Read http://llvm.org/docs/GoldPlugin.html for details. Also note that +this feature is still experimental, so prepare to build binutils and +clang from the corresponding source code repositories. The `--prefix=PREFIXDIR' option specifies where the installation process should put emacs and its data files. This defaults to `/usr/local'. === modified file 'configure.ac' --- configure.ac 2014-05-12 06:59:30 +0000 +++ configure.ac 2014-05-13 11:12:05 +0000 @@ -762,32 +762,6 @@ [gl_gcc_warnings=no] ) -AC_ARG_ENABLE(link-time-optimization, -[AS_HELP_STRING([--enable-link-time-optimization], - [build emacs with link-time optimization. - This is supported only for GCC since 4.5.0.])], -if test "${enableval}" != "no"; then - AC_MSG_CHECKING([whether link-time optimization is supported]) - ac_lto_supported=no - if test x$GCC = xyes; then - CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null` - if test x$CPUS != x; then - LTO="-flto=$CPUS" - else - LTO="-flto" - fi - old_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $LTO" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [ac_lto_supported=yes], [ac_lto_supported=no]) - CFLAGS="$old_CFLAGS" - fi - AC_MSG_RESULT([$ac_lto_supported]) - if test "$ac_lto_supported" = "yes"; then - CFLAGS="$CFLAGS $LTO" - fi -fi) - # clang is unduly picky about some things. AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang], [AC_COMPILE_IFELSE( @@ -913,7 +887,51 @@ s/^ // " - +AC_ARG_ENABLE(link-time-optimization, +[AS_HELP_STRING([--enable-link-time-optimization], + [build emacs with link-time optimization. + This is supported for gcc since 4.5.0 and clang. + Note that clang support is experimental - see INSTALL])], +if test "${enableval}" != "no"; then + ac_lto_supported=no + if test $emacs_cv_clang = yes; then + AC_MSG_CHECKING([whether link-time optimization is supported by clang]) + GOLD_PLUGIN=`$CC -print-file-name=LLVMgold.so 2>/dev/null` + if test -x "$GOLD_PLUGIN"; then + LTO="-flto" + fi + elif test x$GCC = xyes; then + AC_MSG_CHECKING([whether link-time optimization is supported by gcc]) + CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null` + if test x$CPUS != x; then + LTO="-flto=$CPUS" + else + LTO="-flto" + fi + else + AC_MSG_ERROR([Link-time optimization is not supported with your compiler.]) + fi + if test -z "$LTO"; then + ac_lto_supported=no + else + old_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $LTO" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [ac_lto_supported=yes], [ac_lto_supported=no]) + CFLAGS="$old_CFLAGS" + fi + AC_MSG_RESULT([$ac_lto_supported]) + if test "$ac_lto_supported" = "yes"; then + CFLAGS="$CFLAGS $LTO" + if test x$emacs_cv_clang = xyes; then + AC_MSG_WARN([Please read INSTALL before using link-time optimization with clang]) + # WARNING: 'ar --plugin ...' doesn't work without + # command, so plugin name is appended to ARFLAGS. + ARFLAGS="cru --plugin $GOLD_PLUGIN" + RANLIB="$RANLIB --plugin $GOLD_PLUGIN" + fi + fi +fi) dnl Some other nice autoconf tests. dnl These are commented out, since gl_EARLY and/or Autoconf already does them. === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-05-04 00:16:58 +0000 +++ etc/ChangeLog 2014-05-13 11:12:05 +0000 @@ -1,3 +1,8 @@ +2014-05-13 Dmitry Antipov + + * PROBLEMS: Mention potential problems with + --enable-link-time-optimization and clang on Fedora 20. + 2014-05-04 Leo Liu * NEWS: Mention support for Chinese dates in calendar and diary. === modified file 'etc/PROBLEMS' --- etc/PROBLEMS 2014-05-03 07:09:16 +0000 +++ etc/PROBLEMS 2014-05-13 11:12:05 +0000 @@ -836,6 +836,20 @@ by another key (e.g. C-\) by modifying ~/.fcitx/config, or be accustomed to use C-@ for `set-mark-command'. +*** Link-time optimization with clang doesn't work on Fedora 20. + +As of May 2014, Fedora 20 has broken LLVMgold.so plugin support in clang +(tested with clang-3.4-6.fc20) - `clang --print-file-name=LLVMgold.so' +prints `LLVMgold.so' instead of full path to plugin shared library, and +`clang -flto' is unable to find the plugin with the following error: + +/bin/ld: error: /usr/bin/../lib/LLVMgold.so: could not load plugin library: +/usr/bin/../lib/LLVMgold.so: cannot open shared object file: No such file +or directory + +The only way to avoid this is to build your own clang from source code +repositories, as described at http://clang.llvm.org/get_started.html. + *** M-SPC seems to be ignored as input. See if your X server is set up to use this as a command ------------------------------------------------------------ revno: 117094 committer: Sam Steingold branch nick: trunk timestamp: Mon 2014-05-12 19:56:22 -0400 message: avoid function from `cl' diff: === modified file 'lisp/calendar/time-date.el' --- lisp/calendar/time-date.el 2014-05-12 16:14:24 +0000 +++ lisp/calendar/time-date.el 2014-05-12 23:56:22 +0000 @@ -404,7 +404,7 @@ (t (let ((sts seconds-to-string) here) (while (and (car (setq here (pop sts))) (<= (car here) delay))) - (concat (format "%.2f" (/ delay (third here))) (second here)))))) + (concat (format "%.2f" (/ delay (car (cddr here)))) (cadr here)))))) (provide 'time-date)