------------------------------------------------------------ revno: 117068 committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-05-06 14:13:37 -0700 message: * image.c: Do not use libpng if HAVE_NS, as NS does its own thing. [HAVE_NS]: Do not include png.h. (x_query_frame_background_color): New function. (png_load_body, imagemagick_load_image, svg_load_image): Use it. (png_load_body): Coalesce duplicate code. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-04 21:28:08 +0000 +++ src/ChangeLog 2014-05-06 21:13:37 +0000 @@ -1,3 +1,11 @@ +2014-05-06 Paul Eggert + + * image.c: Do not use libpng if HAVE_NS, as NS does its own thing. + [HAVE_NS]: Do not include png.h. + (x_query_frame_background_color): New function. + (png_load_body, imagemagick_load_image, svg_load_image): Use it. + (png_load_body): Coalesce duplicate code. + 2014-05-04 Paul Eggert Consult libpng-config more consistently (Bug#17339). === modified file 'src/image.c' --- src/image.c 2014-05-04 21:28:08 +0000 +++ src/image.c 2014-05-06 21:13:37 +0000 @@ -21,10 +21,6 @@ #include "sysstdio.h" #include -#ifdef HAVE_PNG -# include -#endif - #include #include @@ -1229,6 +1225,18 @@ return img->background_transparent; } +/* Store F's background color into *BGCOLOR. */ +static void +x_query_frame_background_color (struct frame *f, XColor *bgcolor) +{ +#ifndef HAVE_NS + bgcolor->pixel = FRAME_BACKGROUND_PIXEL (f); + x_query_color (f, bgcolor); +#else + ns_query_color (FRAME_BACKGROUND_COLOR (f), bgcolor, 1); +#endif +} + /*********************************************************************** Helper functions for X image types @@ -5502,7 +5510,9 @@ #endif /* HAVE_PNG || HAVE_NS */ -#ifdef HAVE_PNG +#if defined HAVE_PNG && !defined HAVE_NS + +#include #ifdef WINDOWSNT /* PNG library details. */ @@ -5880,43 +5890,23 @@ /* png_color_16 *image_bg; */ Lisp_Object specified_bg = image_spec_value (img->spec, QCbackground, NULL); - int shift = (bit_depth == 16) ? 0 : 8; + XColor color; - if (STRINGP (specified_bg)) + /* If the user specified a color, try to use it; if not, use the + current frame background, ignoring any default background + color set by the image. */ + if (STRINGP (specified_bg) + ? x_defined_color (f, SSDATA (specified_bg), &color, false) + : (x_query_frame_background_color (f, &color), true)) /* The user specified `:background', use that. */ { - XColor color; - if (x_defined_color (f, SSDATA (specified_bg), &color, 0)) - { - png_color_16 user_bg; - - memset (&user_bg, 0, sizeof user_bg); - user_bg.red = color.red >> shift; - user_bg.green = color.green >> shift; - user_bg.blue = color.blue >> shift; - - fn_png_set_background (png_ptr, &user_bg, - PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); - } - } - else - { - /* We use the current frame background, ignoring any default - background color set by the image. */ -#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) - XColor color; - png_color_16 frame_background; - - color.pixel = FRAME_BACKGROUND_PIXEL (f); - x_query_color (f, &color); - - memset (&frame_background, 0, sizeof frame_background); - frame_background.red = color.red >> shift; - frame_background.green = color.green >> shift; - frame_background.blue = color.blue >> shift; -#endif /* HAVE_X_WINDOWS */ - - fn_png_set_background (png_ptr, &frame_background, + int shift = bit_depth == 16 ? 0 : 8; + png_color_16 bg = { 0 }; + bg.red = color.red >> shift; + bg.green = color.green >> shift; + bg.blue = color.blue >> shift; + + fn_png_set_background (png_ptr, &bg, PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); } } @@ -6058,9 +6048,8 @@ return png_load_body (f, img, &c); } -#else /* HAVE_PNG */ +#elif defined HAVE_NS -#ifdef HAVE_NS static bool png_load (struct frame *f, struct image *img) { @@ -6068,10 +6057,8 @@ image_spec_value (img->spec, QCfile, NULL), image_spec_value (img->spec, QCdata, NULL)); } -#endif /* HAVE_NS */ - - -#endif /* !HAVE_PNG */ + +#endif /* HAVE_NS */ @@ -8225,14 +8212,7 @@ specified_bg = image_spec_value (img->spec, QCbackground, NULL); if (!STRINGP (specified_bg) || !x_defined_color (f, SSDATA (specified_bg), &bgcolor, 0)) - { -#ifndef HAVE_NS - bgcolor.pixel = FRAME_BACKGROUND_PIXEL (f); - x_query_color (f, &bgcolor); -#else - ns_query_color (FRAME_BACKGROUND_COLOR (f), &bgcolor, 1); -#endif - } + x_query_frame_background_color (f, &bgcolor); bg_wand = NewPixelWand (); PixelSetRed (bg_wand, (double) bgcolor.red / 65535); @@ -8868,14 +8848,7 @@ specified_bg = image_spec_value (img->spec, QCbackground, NULL); if (!STRINGP (specified_bg) || !x_defined_color (f, SSDATA (specified_bg), &background, 0)) - { -#ifndef HAVE_NS - background.pixel = FRAME_BACKGROUND_PIXEL (f); - x_query_color (f, &background); -#else - ns_query_color (FRAME_BACKGROUND_COLOR (f), &background, 1); -#endif - } + x_query_frame_background_color (f, &background); /* SVG pixmaps specify transparency in the last byte, so right shift 8 bits to get rid of it, since emacs doesn't support ------------------------------------------------------------ revno: 117067 committer: Glenn Morris branch nick: trunk timestamp: Tue 2014-05-06 16:36:40 -0400 message: * configure.ac: Comment. diff: === modified file 'configure.ac' --- configure.ac 2014-05-04 21:28:08 +0000 +++ configure.ac 2014-05-06 20:36:40 +0000 @@ -84,6 +84,7 @@ AC_CONFIG_SRCDIR(src/lisp.h) AC_CONFIG_AUX_DIR(build-aux) dnl automake 1.13 and later understand this, making -I m4 unnecessary. +dnl With older versions this is a no-op. AC_CONFIG_MACRO_DIR(m4) xcsdkdir= ------------------------------------------------------------ revno: 117066 committer: Glenn Morris branch nick: trunk timestamp: Tue 2014-05-06 09:02:45 -0700 message: * etc/MACHINES: Misc small edits. Update Irix info. Remove details of obsoleted platforms. diff: === modified file 'etc/MACHINES' --- etc/MACHINES 2014-03-22 23:47:20 +0000 +++ etc/MACHINES 2014-05-06 16:02:45 +0000 @@ -102,103 +102,21 @@ ** Irix 6.5 - It *may* be possible to build Emacs on Irix 6.5 with an old version - (3.1) of gcc. Newer versions of gcc may not work. None of the - current Emacs developers use Irix, though. If you want to help - make Emacs on Irix work, see . + Emacs versions later than 24.4 will not compile on Irix by default. + (Note that SGI stopped supporting Irix in December 2013.) + You should be able to work around the problem either by porting the + Emacs undumping code to GCC under Irix, or by configuring --with-wide-int. + Older versions of Emacs 24 (and 23?) also had problems on Irix. + It *may* be possible to build Emacs <= 24.4 on Irix 6.5 with an old + version (3.1) of gcc. Newer versions of gcc may not work. + See . * Obsolete platforms -Support for the following obsolete platforms was removed in Emacs 23.1 -(the names in parentheses state the files in src/ that were removed): - - Apollo SR10.x (unexapollo.c) - Convex (unexconvex.c and m/convex.c) - Xenix (unexenix.c and s/xenix.h) - Iris (unexmips.c m/iris4d.h m/irist.h s/iris3-5.h s/iris3-6.h) - Gould (m/gould*) - Siemens machines running Sinix (unexsni.c) - Harris CXUX (s/cxux*) - ESIX, a variant of v.5.3 for the 386 (s/esix*) - Interactive (ISC) Unix (s/isc*) - Sony News (s/newsos*) - RTU 3.0, ucb universe (s/rtu.h) - UniSoft's UniPlus 5.2 (s/uniplus.h) - UMAX (s/umax.h) - AT&T UNIX PC model 7300 (m/7300.h) - Acorn - Alliant (m/alliant*) - Amdahl (m/amdahl*) - Altos 3068 Unix System V Release 2 (m/altos.h) - Apollo (m/apollo.h) - AT&T 3b (m/att3b.h) - Aviion (m/aviion*) - Berkeley 4.1 (m/bsd4.1.h) - Berkeley 4.2 (m/bsd4.2.h) - Berkeley 4.3 (m/bsd4.3.h) - Celerity (m/celerity.h) - clipper (m/clipper.h) - convergent S series (m/cnvrgnt.h) - cydra (m/cydra5.h) - Motorola System V/88 machines (m/delta88k.h) - Bull DPX/2 range (m/dpx2.h) - Dual machines using unisoft port (m/dual.h) - Elxsi machine (running enix) (m/elxsi.h) - Fujitsu F301 machine (m/f301.h) - i860 (m/i860.h) - ibm ps/2 aix386 (m/ibmps2-aix.h) - ISI 68000's (m/is*) - Masscomp 5000 series running RTU, ucb universe (m/masscomp.h) - Megatest 68000's (m/mega68.h) - Whitechapel Computer Works MG1 (ns16000 based) (m/mg1.h) - Harris Night Hawk Series 1200 and Series 3000 (m/nh3000.h m/nh4000.h) - ns16000 (m/ns16000.h) - National Semiconductor 32000, running Genix (m/ns32000.h) - TI Nu machines using system V (m/nu.h) - HLH Orion (m/orion.h m/orion105.h) - Paragon i860 (m/paragon.h) - PFU A-series (m/pfa50.h) - Plexus running System V.2 (m/plexus.h) - pyramid. (m/pyramid.h) - Bull SPS-7 (m/sps7.h) - Hitachi SR2001/SR2201 (m/sr2k.h) - Stride (m/stride.h) - Sun 1 (m/sun1.h) - Sun 2 (m/sun2.h) - SEQUENT SYMMETRY (m/symmetry.h) - Tadpole 68k machines (m/tad68k.h) - tahoe (m/tahoe.h) - targon31 (m/targon31.h) - Tektronix* (m/tek4300.h m/tekxd88.h) - NCR Tower 32 running System V.2 (m/tower32.h) - NCR Tower 32 running System V.3 (m/tower32v3.h) - U-station (Nihon Unisys, SS5E; Sumitomo Denkoh, U-Station E30) (m/ustation.h) - Wicat (m/wicat.h) - Honeywell XPS100 running UNIX System V.2 (m/xps100.h) - Data General's DG/UX (s/dgux*) - Irix before version 6 - osf1 (s/osf*) - SunOS4 (s/sunos*) - RISCiX (s/riscix*) - SCO 3.2v4 (s/sco4.h) - SCO 3.2v5 (s/sco5.h) - Sun's 386-based RoadRunner (m/sun386.h) - Sun3 machines (m/sun3*) - Integrated Solutions 386 machine (m/is386.h) - Integrated Solutions `Optimum V' -- m68k-isi-bsd4.2 or -bsd4.3 - Harris Power PC (powerpc-harris-powerunix) - Hewlett-Packard 9000 series 200 or 300 on some platforms -- m68k-hp-bsd or - m68k-hp-hpux; note m68k-*-netbsd* still works - IBM PS/2 -- i386-ibm-aix1.1 or i386-ibm-aix1.2 - GEC 63 -- local-gec63-usg5.2 - Tandem Integrity S2 -- mips-tandem-sysv - System V rel 0 -- usg5.0 - System V rel 2 -- usg5.2 - System V rel 2.2 -- usg5.2.2 - System V rel 3 -- usg5.3 - Ultrix -- bsd4.3 - VMS (s/vms.h) +Support for many obsolete platforms was removed in Emacs 23.1. +If for some reason you encounter an ancient machine where current +Emacs does not compile, try an older release like Emacs 22.3. Local variables: ------------------------------------------------------------ revno: 117065 committer: Glenn Morris branch nick: trunk timestamp: Mon 2014-05-05 13:22:32 -0400 message: * autogen.sh: Check any pre-existing ACLOCAL_PATH. diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-04 21:28:08 +0000 +++ ChangeLog 2014-05-05 17:22:32 +0000 @@ -1,3 +1,7 @@ +2014-05-05 Glenn Morris + + * autogen.sh: Check any pre-existing ACLOCAL_PATH. + 2014-05-04 Paul Eggert Consult libpng-config more consistently (Bug#17339). === modified file 'autogen.sh' --- autogen.sh 2014-05-04 21:18:30 +0000 +++ autogen.sh 2014-05-05 17:22:32 +0000 @@ -212,27 +212,44 @@ AUTORECONF_ENV= env_space= ac_dir=`aclocal --print-ac-dir` && test -r "$ac_dir/pkg.m4" || { - oIFS=$IFS - IFS=: - before_first_aclocal=true - for dir in $PATH; do - if test -x "$dir/aclocal"; then - if $before_first_aclocal; then - before_first_aclocal=false - elif ac_dir=`"$dir/aclocal" --print-ac-dir` && test -r "$ac_dir/pkg.m4" - then - case $ACLOCAL_PATH in - '') ACLOCAL_PATH=$ac_dir;; - ?*) ACLOCAL_PATH=$ACLOCAL_PATH:$ac_dir;; - esac - export ACLOCAL_PATH - AUTORECONF_ENV="ACLOCAL_PATH='$ACLOCAL_PATH'" - env_space=' ' - break - fi - fi - done - IFS=$oIFS + + # Maybe ACLOCAL_PATH is already set-up. + if test -n "$ACLOCAL_PATH"; then + oIFS=$IFS + IFS=: + for dir in $ACLOCAL_PATH; do + if test -r "$dir/pkg.m4"; then + AUTORECONF_ENV="ACLOCAL_PATH='$ACLOCAL_PATH'" + env_space=' ' + break + fi + done + IFS=$oIFS + fi + + if test -z "$AUTORECONF_ENV"; then + oIFS=$IFS + IFS=: + before_first_aclocal=true + for dir in $PATH; do + if test -x "$dir/aclocal"; then + if $before_first_aclocal; then + before_first_aclocal=false + elif ac_dir=`"$dir/aclocal" --print-ac-dir` && test -r "$ac_dir/pkg.m4" + then + case $ACLOCAL_PATH in + '') ACLOCAL_PATH=$ac_dir;; + ?*) ACLOCAL_PATH=$ACLOCAL_PATH:$ac_dir;; + esac + export ACLOCAL_PATH + AUTORECONF_ENV="ACLOCAL_PATH='$ACLOCAL_PATH'" + env_space=' ' + break + fi + fi + done + IFS=$oIFS + fi ## OK, maybe pkg-config is in a weird place (eg on hydra). if test -z "$AUTORECONF_ENV"; then