Commit Graph

161 Commits

Author SHA1 Message Date
Kyle Evans
fe815331bb build: provide a default WARNS for all in-tree builds
The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.

Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.

There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.

Reviewed by:	emaste, brooks, ngie (all earlier version)
Reviewed by:	emaste, arichardson (depend-cleanup.sh change)
Differential Revision:	https://reviews.freebsd.org/D26455
2020-09-18 17:17:46 +00:00
Pedro F. Giffuni
aa52c719ea grep(1) outputs NOT-matched lines with multi-byte characters
PR	113343
MFC after:	2 months
2019-01-10 02:59:19 +00:00
Baptiste Daroussin
612c330d85 Use a script wrapper for <compress>grep
Import the wrapper script from zstdgrep (written by wiz@netbsd.org)

Modify it to support more than just zstd (adding support for gzip,
lzma, xz and bzip2)

Write a simple manpage dedicated for it.

Only use that new wrapper both for gnu grep and bsd grep

Next step will be removing code related to compression format from bsdgrep

Reviewed by:	kevans
Approved by:	kevans
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D15193
2018-04-25 13:23:58 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Bryan Drewery
c99b67a794 Utilize SYSROOT from r320119 in places where DESTDIR may be wanting WORLDTMP.
Since buildenv exports SYSROOT all of these uses will now look in
WORLDTMP by default.

sys/boot/efi/loader/Makefile
        A LIBSTAND hack is no longer required for buildenv.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-06-19 20:47:24 +00:00
Andrey A. Chernov
c66f176a6e Back out non-collating [a-z] ranges.
Instead of changing the whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and focus on fixing bugs in what we have now,
too many small obstacles we have choicing other way, counting ports.
Corresponding libc changes are backed out in r302824.
2016-07-14 09:47:49 +00:00
Andrey A. Chernov
ea81c8d0ef After removing collation for [a-z] ranges in r302512, do it here too.
Instead of trying to expand whole range at regcomp() stage as we do,
GNU regex allocates separate ranges [start,end] set each character
is checked against, so collation is possible and turned on for ranges here.

When something like that will be implemented or our obsoleted regex code
will be replaced to something like TRE, and in case we decide to use
collation in [a-z] ranges, all changes related to r302512 can be backed out,
but now we need consistency.
2016-07-13 19:02:59 +00:00
Pedro F. Giffuni
0009715f34 gnugrep: Update the configuration.
The only effect is that it will use our native iconv(3).

Relnotes:	yes
2016-05-22 20:17:55 +00:00
Bryan Drewery
b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
Craig Rodrigues
a74ada878b Include "system.h" for isdir() prototype.
Submitted by:          bofh
Differential Revision: https://reviews.freebsd.org/D2711
2015-11-04 05:38:08 +00:00
Bryan Drewery
ec766071e3 META_MODE: Remove DEP_MACHINE from Makefile.depend files.
This has not been needed since r246865 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:44:01 +00:00
Bryan Drewery
54c7d75a06 META_MODE: Remove DEP_RELDIR from Makefile.depend files.
This has not been needed since r284171 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:26:08 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Will Andrews
7a37b5fc17 Add a ${CP} alias for copying files in the build.
Some users build FreeBSD as non-root in Perforce workspaces.  By default,
Perforce sets files read-only unless they're explicitly being edited.
As a result, the -f argument must be used to cp in order to override the
read-only flag when copying source files to object directories.  Bare use of
'cp' should be avoided in the future.

Update all current users of 'cp' in the src tree.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	Spectra Logic
2015-01-16 21:39:08 +00:00
Baptiste Daroussin
2d2813618c Remove GNU texinfo from base along with all info pages.
To be able to info pages consider installing texinfo from ports print/texinfo or
via pkg: pkg install texinfo

Differential Revision:	https://reviews.freebsd.org/D1409
Reviewed by:	emaste, imp (previous version)
Relnotes:	yes
2015-01-02 18:45:03 +00:00
Baptiste Daroussin
ee5a34ecba Convert to LIBADD
Reduce overlinking
2014-11-25 21:18:18 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Glen Barber
4295fc3d75 Add gnugrep.1 to CLEANFILES.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2014-08-26 19:36:34 +00:00
Simon J. Gerraty
cc3f4b9965 Merge from head 2014-05-08 23:54:15 +00:00
Warner Losh
c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Simon J. Gerraty
d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Andrey A. Chernov
81191eeb58 Part of r245761 makes "grep -D skip" broken for pipes, i.e.
echo xxx | grep -D skip xxx
returns nothing. Instead of just removing added S_ISFIFO condition
(originally absent in this version of grep), make it work as latest
GNU version does: don't skip directories and devices if fd == STDIN_FILENO.
2013-08-08 11:53:47 +00:00
Jung-uk Kim
ee852b9c75 Adjust CFLAGS to pick up correct regex.h and posix/regex.h. Note this
actually reverts r250860 and r250861.

Reported by:	gjb, tinderbox
2013-06-06 11:59:38 +00:00
Jung-uk Kim
a1e98bc995 Connect libgnuregex 2.17 to the build. 2013-06-05 21:31:06 +00:00
Marcel Moolenaar
bed3a130ea Don't look for headers outside of the source or object directories. In
particular, don't use DESTDIR. Such creates an unnecessary dependency
on the build machine.

Obtained from:  Juniper Networks, Inc.
2013-05-21 17:30:27 +00:00
Pedro F. Giffuni
025069f984 grep: change some int types.
Change several int variables to size_t, ssize_t, or ptrdiff_t.
This should fix the bug described in CVE-2012-5667 when an input
line is so long that its length cannot be stored in an int
variable.

This is based on NetBSD's revision which says:

This change to NetBSD's version of GNU grep 2.5.1 (licenced under
GPLv2) was made without direct reference to any code licenced
under GPLv3.

Obtained from:	NetBSD
MFC after:	3 days
2013-05-20 03:15:25 +00:00
David E. O'Brien
d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
David Xu
87ec376216 Make "-D skip" option work with FIFO by opening file in non-blocking mode.
Reviewed by:	jhb
Tested by:	delphij
2013-01-22 03:23:14 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
David E. O'Brien
a23d1c70b3 Build and install a BSD licensed grep.
If WITH_BSD_GREP is not set, it will be 'bsdgrep' and GNUgrep will be
'[ef]grep'.  Otherwise, BSD-grep will be the grep family, and GNUgrep
will be 'gnugrep'.

Discussed with: brooks
2011-05-25 01:04:12 +00:00
David E. O'Brien
b29362d8dd For files not named on the command line, only the basename is compared
to the exclude pattern.
Change this so that "grep --exclude='*/.svn/*' -[Rr] foo *" DWIM.

Obtained from:	dave+news001@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (Dave Gibson)
Obtained from:	comp.unix.questions [Thu, 15 Mar 2007 18:54:38 +0000]
Obtained from:	http://unix.derkeiler.com/Newsgroups/comp.unix.questions/2007-03/msg00046.html
2009-01-30 00:22:08 +00:00
Tom Rhodes
1c6b148eb1 Add the -P option back, but with a note that it is not supported on FreeBSD.
Requested by:	ru
2006-10-11 09:52:32 +00:00
Tom Rhodes
ca56b49e0e grep -P xxx file.txt
"The -P option is not supported"
Removed from the manual page via this commit.

PR:	99831
2006-10-10 01:57:25 +00:00
Tim J. Robbins
7c5f1a3fc5 Correctly locate the character preceeding the matched string in -w
mode when in non-UTF-8 multibyte locales (e.g. EUC, GB2312, etc.).

PR:		91909
2006-02-19 04:27:39 +00:00
Ruslan Ermilov
b5a8bae44b Fix a markup nit.
PR:		docs/88848
Prodded by:	remko
2005-12-18 12:09:23 +00:00
Tim J. Robbins
ebeecabae3 Fix 'grep -Fw' for encodings other than UTF-8 (RH bug #161700).
PR:		87969
Obtained from:	Fedora (Tim Waugh)
2005-10-25 09:18:50 +00:00
Stefan Farfeleder
4ce619ce5a Document [:blank:]. 2005-10-23 11:19:56 +00:00
Jung-uk Kim
4a4051fe5e Remove redundant string length check from the previous commit. 2005-10-21 15:17:18 +00:00
Jung-uk Kim
354cdde5b9 Fix a longstanding buglet in bz-prefixed grep(1). 2005-10-20 21:50:44 +00:00
Tim J. Robbins
10f38d95af Pass the RE_ICASE flag to re_set_syntax() as appropriate to fix
case-insensitive matching (-i option) in certain multibyte locales.

Obtained from:	Fedora
2005-05-31 12:49:04 +00:00
Tim J. Robbins
2d97dca698 Add a note explaining what local modifications have been made to GNU grep,
and giving advice on importing future releases.
2005-05-14 06:33:23 +00:00
Tim J. Robbins
9473343264 Fixed -w handling for EGexecute.
Obtained from:	Fedora (Tim Waugh)
2005-05-14 06:13:23 +00:00
Tim J. Robbins
4475bed3d2 Automatically disable DFA when processing multibyte input. GREP_USE_DFA
environment variable overrides.

Obtained from:	Fedora (Tim Waugh)
2005-05-14 06:12:03 +00:00
Tim J. Robbins
aed59eaecf Better multibyte handling in EGexecute() and Fexecute(). Fixed -Fi for
multibyte input (RH bug #143079).

Obtained from:	Fedora (Jakub Jelinek, Tim Waugh)
2005-05-14 06:09:12 +00:00
Tim J. Robbins
712fe40aed Removed redundant (and incorrect) code in prline. Fixes grep -i --color "",
among other things.

PR:		79063
Obtained from:	Fedora (Tim Waugh)
2005-05-14 05:35:04 +00:00
Tim J. Robbins
833d4d167b Fix background colour problems with --color output (RH bug #138913).
Obtained from:	Karsten Hopp via Fedora
2005-05-14 05:26:48 +00:00
Tim J. Robbins
1bd8c187c0 Fixed a bug in the fgrep patch, exposed by the dfa-optional patch
(RH bug #138558). Removed bogus part of grep-2.5.1-fgrep patch.

Obtained from:	Fedora (Jakub Jelinek, Tim Waugh)
2005-05-14 04:17:07 +00:00
Tim J. Robbins
e20df16c79 Fix dfa multibyte character class matching when -i is used (RH bug #123363).
Obtained from:	Fedora (Tim Waugh)
2005-05-14 03:18:20 +00:00
Tim J. Robbins
52e523ead7 Remove mb-caching hack.
Obtained from:	Fedora (Tim Waugh)
2005-05-14 03:02:22 +00:00