On May 5, 2017 8:39 AM, "Dimitry Andric" <d...@freebsd.org> wrote:

On 5 May 2017, at 11:31, Vladimir Zakharov <zakharov...@gmail.com> wrote:
> Cannot build world due to error in compiling lib/libsysdecode.
> --- all_subdir_lib/libsysdecode ---
> ioctl.c:30:10: fatal error: 'cam/cam_compat.h:#define' file not found
> #include <cam/cam_compat.h:#define>
>         ^~~~~~~~~~~~~~~~~~~~~~~~~~
> $ cat /etc/src.conf

This appears to be caused by bsdgrep. :-/ The build for lib/libsysdecode
uses a shell script, mkioctls, to generate a ioctl.c file at build time.
This script contains the following fragment:

        cd $includedir
        find -H -s * -name '*.h' | \
        egrep -v '(.*disk.*|net/pfvar|net/if_pfsync)\.h' | \
                xargs egrep -l \
'^#[    ]*define[       ]+[A-Za-z_][A-Za-z0-9_]*[       ]+_IO[^a-z0-9_]' |
                awk '{printf("#include <%s>\\n", $1)}'

The idea is that all headers are searched for defines of ioctl macros,
which start with _IO.  The -l option to egrep is used to print only the
matching filenames, not the matched content itself.

However, this option seems to be broken in bsdgrep, as it *does* display
the matched content:

$ gnugrep -l printf /usr/include/stdio.h

$ bsdgrep -l printf /usr/include/stdio.h
#define __SSTR  0x0200          /* this is an sprintf/snprintf string */

I did a quick check, and this option seems to have been accidentally
broken by r317703 [1] ("bsdgrep: fix -w flag matching with an empty

Ed, Kyle, any idea where the problem might be?


[1] https://svnweb.freebsd.org/base?view=revision&revision=317703


This is addressed by https://reviews.freebsd.org/D10607


Kyle Evans
freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to