Nmap Development mailing list archives

Re: [BUG] after pcre.h is found, configure checks for pcre/pcre.h


From: David Fifield <david () bamsoftware com>
Date: Mon, 10 Sep 2012 12:15:45 -0700

On Sat, Sep 08, 2012 at 08:52:17PM +0200, John Spencer wrote:
... thus wasting my time with bogus checks

checking pcre.h usability... yes
checking pcre.h presence... yes
checking for pcre.h... yes
checking for pcre_version in -lpcre... yes
checking pcre/pcre.h usability... no
checking pcre/pcre.h presence... no
checking for pcre/pcre.h... no

This is a bit annoying to fix, so I think we will only do so if we get a
patch.

The problem is not this part of configure.ac, which checks for pcre.h,
and then only checks for pcre/pcre.h if that fails:

# If they didn't specify it, we try to find it
if test $have_pcre != yes -a $requested_included_pcre != yes ; then
  AC_CHECK_HEADER(pcre.h,
    AC_CHECK_LIB(pcre, pcre_version, [have_pcre=yes ]),
    [AC_CHECK_HEADER(pcre/pcre.h,
      [AC_CHECK_LIB(pcre, pcre_version, [have_pcre=yes])]
    )]
  )
fi

The extra check is this one, which is done if either pcre.h or
pcre/pcre.h is found:

# We only need to check for and use this if we are NOT using included pcre
  AC_CHECK_HEADERS(pcre/pcre.h)

Notice that the first checks are done with AC_CHECK_HEADER and the
second check is done with AC_CHECK_HEADERS. AC_CHECK_HEADERS has the
effect of defining HAVE_PCRE_PCRE_H, which is used in a couple of places
like nse_pcrelib.h.

#ifdef HAVE_PCRE_PCRE_H
# include <pcre/pcre.h>
#else
# include <pcre.h>
#endif

https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Generic-Headers.html

That's the reason for the redundant check, which was introduced in
r6338. If you can make a clean patch that solves the problem, we'll
apply it.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: