LibVNC / x11vnc

a VNC server for real X displays
GNU General Public License v2.0
723 stars 142 forks source link

--without-v4l breaks configure script (with autoconf 2.71) #221

Open fweimer-rh opened 1 year ago

fweimer-rh commented 1 year ago

The configure.ac contains this:

if test "x$with_v4l" != "xno"; then
    AC_CHECK_HEADER(libv4l1-videodev.h,
        [AC_DEFINE(HAVE_LIBV4L1_VIDEODEV_H)],,)
    AC_CHECK_HEADER(linux/videodev.h,
        [AC_DEFINE(HAVE_LINUX_VIDEODEV_H)],,)
    AC_CHECK_HEADER(linux/videodev2.h,
        [AC_DEFINE(HAVE_LINUX_VIDEODEV2_H)],,)
fi

The first AC_CHECK_HEADER is where autoconf 2.71 chooses to inject all the system header probes. If --without-v4l is specified, these probes never run, and HAVE_SYS_STAT_H is not set. This causes the lstat check to go from

checking whether lstat correctly handles trailing slash... yes

to

checking whether lstat correctly handles trailing slash... no

because it no longer includes <sys/stat.h>.

I believe there is a rule that AC_CHECK_HEADER must not be called conditionally. I have asked about it on the autoconf list:

Related to:

fweimer-rh commented 1 year ago

Upstream for autoconf provided the following reference:

This macro should be used instead of plain if in code outside of an AC_DEFUN macro, when the contents of the if' useAC_REQUIRE` directly or indirectly (see Prerequisite Macros).

Common Shell Constructs