Subject: bug#26050: 25.2; configure: no libxml2 support with libxml2 installed

From: [email-masked] (N. Jackson)
Date: Fri, 10 Mar 2017 11:07:19 -0500

With Emacs from the emacs-25.2.rc2 release candidate tarball,
configure is omitting support for libxml2. (I discovered this
because eww no longer works.)

(The released version of emacs-25.1, also built from the tarball
(on 2016-09-19) did not have this problem.)

  $ ./configure
  .
  .
  .
  checking for LIBXML2... no
  .
  .
  .
    Does Emacs use -lxml2?                                  no
  .
  .
  .

  $ dnf list libxml2
  Last metadata expiration check: 1:42:01 ago on Fri Mar 10 08:15:37 2017.
  Installed Packages
  libxml2.x86_64                         2.9.3-4.fc25                          @anaconda

FWIW, the indentation of the conditional structures in the
relevant part of configure is confusing; the indentation belies
the logical nesting. Also some of the lines are excessively long.
In any case:

      16321 ### Use libxml (-lxml2) if available
      16322 ### mingw32 doesn't use -lxml2, since it loads the library dynamically.
      16323 HAVE_LIBXML2=no
true  16324 if test "${with_xml2}" != "no"; then
      16325   ### I'm not sure what the version number should be, so I just guessed.
      16326 
      16327 pkg_failed=no
      16328 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML2" >&5
      16329 $as_echo_n "checking for LIBXML2... " >&6; }
      16330 
false 16331 if test -n "$LIBXML2_CFLAGS"; then
      16332     pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS"
true  16333  elif test -n "$PKG_CONFIG"; then
false 16334     if test -n "$PKG_CONFIG" && \
      16335     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 > 2.6.17\""; } >&5
      16336   ($PKG_CONFIG --exists --print-errors "libxml-2.0 > 2.6.17") 2>&5
      16337   ac_status=$?
      16338   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
      16339   test $ac_status = 0; }; then
      16340   pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 > 2.6.17" 2>/dev/null`
      16341                 test "x$?" != "x0" && pkg_failed=yes
      16342 else
-->   16343   pkg_failed=yes
      16344 fi
      16345  else
      16346     pkg_failed=untried
      16347 fi
false 16348 if test -n "$LIBXML2_LIBS"; then
      16349     pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS"
true  16350  elif test -n "$PKG_CONFIG"; then
false 16351     if test -n "$PKG_CONFIG" && \
      16352     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 > 2.6.17\""; } >&5
      16353   ($PKG_CONFIG --exists --print-errors "libxml-2.0 > 2.6.17") 2>&5
      16354   ac_status=$?
      16355   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
      16356   test $ac_status = 0; }; then
      16357   pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0 > 2.6.17" 2>/dev/null`
      16358                 test "x$?" != "x0" && pkg_failed=yes
      16359 else
-->   16360   pkg_failed=yes
      16361 fi
      16362  else
      16363     pkg_failed=untried
      16364 fi

The marginal annotations show which conditionals test true and
which test false, and shows where we set pkg_failed to yes.

In GNU Emacs 25.2.11 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.8)
 of 2017-03-03 built on moondust.localdomain
Windowing system distributor 'Fedora Project', version 11.0.11901000
System Description:	Fedora release 25 (Twenty Five)

Configured using:
 'configure CFLAGS=-O3'

Configured features:
XPM JPEG TIFF GIF PNG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY GNUTLS
FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_CA.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix

Features:
(shadow bbdb-message emacsbug sendmail gnus-async qp mail-extr gnus-ml
disp-table mm-archive url-handlers nnrss xml nndraft nnmh utf-7 server
pinentry epa-file epa derived nnfolder bbdb-gnus bbdb-mua nnnil
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp
gnus-cache sh-script smie executable bat-mode misearch multi-isearch
network-stream nsm starttls url-http url-gw url-cache url-auth eww
mm-url url-queue shr dom browse-url goto-addr thingatpt view linum
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs flyspell ispell sage sage-load rx emms-bookmarks
emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort
emms-last-played emms-player-xine emms-player-mpd emms-playing-time
emms-lyrics emms-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse url-vars
emms-streams emms-tag-editor emms-mark emms-mode-line emms-cache
emms-info-ogginfo emms-info-mp3info emms-info later-do
emms-playlist-mode emms-player-vlc emms-player-mplayer
emms-player-simple emms-source-playlist emms-source-file locate
emms-setup emms emms-compat calfw-org calfw holidays hol-loaddefs cl
pdf-occur ibuf-ext ibuffer tablist tablist-filter semantic/wisent/comp
semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util
semantic semantic/tag semantic/lex semantic/fw mode-local cedet
pdf-isearch let-alist pdf-misc imenu pdf-tools compile cus-edit pdf-view
bookmark pp pdf-cache pdf-info tq pdf-util org-contacts org-capture
gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap gnus-sum
gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls
gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range message
rfc822 mml mml-sec epg mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums gmm-utils mailheader gnus-win gnus gnus-ems
nnheader mail-utils org-eldoc org-w3m org-rmail org-mhe org-irc org-info
org-habit org-gnus org-docview doc-view subr-x jka-compr image-mode
dired org-bibtex bibtex org-bbdb org-agenda org-element avl-tree org
org-macro org-footnote org-pcomplete org-list org-faces org-entities
noutline outline easy-mmode org-version ob-latex ob-emacs-lisp ob
ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint tramp
tramp-compat auth-source cl-seq eieio eieio-core cl-macs gnus-util
mm-util help-fns mail-prsvr password-cache tramp-loaddefs trampver
ucs-normalize shell pcomplete advice comint ansi-color ring ob-core
ob-eval org-compat org-macs org-loaddefs format-spec find-func
bbdb-anniv diary-lib diary-loaddefs cal-menu calendar cal-loaddefs
bbdb-com crm mailabbrev bbdb bbdb-site timezone bbdb-loaddefs finder-inf
tex-site info package epg-config seq byte-opt gv bytecomp byte-compile
cl-extra help-mode cconv edmacro kmacro recentf tree-widget wid-edit
easymenu battery time wheatgrass-theme paren savehist saveplace
elec-pair desktop frameset cl-loaddefs pcase cl-lib delsel cua-base
cus-start cus-load time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 840029 275156)
 (symbols 48 104067 77)
 (miscs 40 19960 6933)
 (strings 32 203674 9947)
 (string-bytes 1 9233489)
 (vectors 16 78401)
 (vector-slots 8 1246250 9319)
 (floats 8 634 928)
 (intervals 56 34155 0)
 (buffers 976 80))