Commit Graph

1977 Commits

Author SHA1 Message Date
Baptiste Daroussin
dec0135828 Enforce -lpthread and -lc to always be the 2 last components of the link list
Differential Revision:	https://reviews.freebsd.org/D1118
Suggested by:		kib
2014-11-22 12:48:09 +00:00
Craig Rodrigues
7502a3d8f6 Make MLINKS text match text in bsd.man.mk added by wosch@ in 1996. 2014-11-21 17:55:38 +00:00
Warner Losh
590461a4b8 Acutally, replaces NO_INCS with WITHOUT_INCLUDES and make
WITHOUT_TOOLCHAIN imply it instead.

Sponsored by: Netflix
2014-11-18 17:06:44 +00:00
Andrew Turner
124cd6410c Add OBJDUMP to sys.mk. The EFI loader uses it however without this it can
be set but empty.

Obtained from:	ABT Systems
Sponsored by:	The FreeBSD Foundation
2014-11-14 14:45:36 +00:00
Mark Johnston
e977d70f45 Revert r274200. Implicitly setting DEBUG_FLAGS when WITH_CTF is true is
not the right way to do this.

Requested by:	kan
2014-11-08 18:16:39 +00:00
Mark Johnston
59a9e2ca26 Automatically build with debug symbols when building with WITH_CTF.
Otherwise there's nothing for ctfconvert to do, and it ends up emitting an
error for each object file. Also remove some redundant checks from
bsd.prog.mk and bsd.lib.mk.

Differential Revision:	https://reviews.freebsd.org/D1111
Reviewed by:		imp
2014-11-06 22:46:40 +00:00
Warner Losh
bd808d4133 Ignore errors from rm -rf to support high -j builds. This is, at best,
a kludge. However, it also effectively works around the issues for
high -j builds on systems that do not have the rm fixes.

A better fix would be to rmdir here, and fix the places where we're
sloppy and not list all the files we create in CLEANFILES, should
anybody have the time to chase them all to ground.
2014-11-06 17:19:41 +00:00
Devin Teske
041394f38a Add new libraries/utilities for data throughput visualization.
dpv(3): dialog progress view library
dpv(1): stream data from stdin or multiple paths with dialog progress view
figpar(3): configuration file parsing library

Reviews:	D714
Reviewed by:	jelischer, shurd
Discussed at:	MeetBSD California 2014 Vendor/Dev Summit
Discussed on:	-current
MFC after:	21 days
X-MFC-to:	stable/10 stable/9
2014-11-04 23:46:01 +00:00
Enji Cooper
068ebf3274 Import proper fix for misc/49356 (/usr/include/atf-c/config.h) after atf-c/config.h
was removed from the build

Pointyhat to: me (again, for not running make delete-old after running test builds)
2014-11-04 05:02:22 +00:00
Enji Cooper
db572ab644 As an optimization (in simple, well used cases) only call cat ${.ALLSRC} when
generating files from various sources instead of calling cat ${.ALLSRC} | sed

The perl case was skipped because it's not being used in the tree at this time
2014-11-04 01:57:31 +00:00
Enji Cooper
37e4638f2e Add Makefile snippet to ease porting NetBSD testcases to FreeBSD from
contrib/netbsd-tests

This Makefile snippet handles polluting testcases with -lnetbsd, specific
headers for ATF version differences, and does necessary rewriting for the
testcases to match the format discussed on the TestSuite wiki page
(t_<foo> -> <foo>_test)

One must define SRCTOP (inspired by projects/bmake), OBJTOP, and TESTSRC
(e.g. contrib/netbsd-tests/lib/libc/gen) to use the Makefile snippet

Test programs are specific either via NETBSD_ATF_TESTS_C or NETBSD_ATF_TESTS_SH

C++ analogs aren't currently implemented.

The imported testcases will be cleaned up to use this Makefile snippet pseudo
"API".
2014-11-04 00:19:10 +00:00
Julio Merino
30175d7650 Use the right depend file for each program.
bsd.progs.mk generates a separate depend file for every program being
built, but then it does not properly tell each submake to use those
individual files.  Properly propagate the depend file to use.

Discovered while preparing the update of atf to 0.21 and noticing that
the test programs were not being relinked to the new library.

This change is "make tinderbox" clean.
2014-10-30 22:07:29 +00:00
Enji Cooper
05f0ff5a30 Fix the logic inversion in the previous commit by ensuring that the matched
expression (:M) is empty, not the not matched (:N) is empty. The former case
means we have not found the TEST_SUBDIR value in SUBDIR

Reported by: rodrigc
X-MFC with: r273803
Pointyhat to: me (did not use a clean install root)
Sponsored by: EMC / Isilon Storage Division
2014-10-29 04:32:46 +00:00
Enji Cooper
9aa9738938 Filter out TESTS_SUBDIRS already added to SUBDIR instead of blindly
appending the TESTS_SUBDIRS variable to SUBDIR

Duplicate directory entries can cause unexpected side effects, like
installing the same files multiple times. This can be easily
reproduced via the following testcase prior to this commit:

  SUBDIR= dir
  TESTS_SUBDIRS+= dir

  .include <bsd.test.mk>

Sponsored by: EMC / Isilon Storage Division
2014-10-28 23:01:09 +00:00
Enji Cooper
eb1fef6574 Fix linking static test binaries with atf.test.mk
Check for -static in LDFLAGS or LDFLAGS.<test>, then pass in the appropriate
dependency (LIBATF or LDATF)

This unbreaks the build with some of the NetBSD tests that need to be compiled
statically

Reviewed by: imp, jmmv
Phabric: D991
Sponsored by: EMC / Isilon Storage Division
2014-10-22 18:11:10 +00:00
John-Mark Gurney
14cac2a6f1 fix spelling of DEFAULT in comments... 2014-10-22 06:53:55 +00:00
Warner Losh
b55e8e6e0d My previous commit exposed an issue as it fixed a different
issue. lib/atf isn't a prereq_lib, since it isn't required for other
libraries to build. Remove it. The old kludge of always building it
had effectively been retired. Since we don't want to build the
libraries with the tests when we're bootstrapping, invent
MK_TESTS_SUPPORT which normally defaults to the current MK_TESTS
value, except when explicitly defined. Make lib/atf depend on it being
yes. When building the libraries set MK_TESTS to no, and
MK_TESTS_SUPPORT to the current value of MK_TESTS so that later stages
of the build work correctly. This should fix (and does for me)
people's issues with parallel builds racing between lib/atf and
libexec/atf. Since lib/atf is built during the libraries phase, the
race disappears.
2014-10-22 03:39:11 +00:00
Baptiste Daroussin
e82241aa78 Revert r273426 r273409
A solution that work with both new and old binutils should be investigated
2014-10-21 21:17:44 +00:00
Baptiste Daroussin
412013d7a8 older binutils does not know about --no-fatal-warnings 2014-10-21 21:09:54 +00:00
Warner Losh
289ee3b601 For the kernel, we have USB_GADGET_EXAMPLES as defaults to yes. For
userland defaults to no. This caused issues for the automated option
documenation script. Turns out, this isn't used in userland at all, so
just remove it from here.
2014-10-21 20:29:53 +00:00
Baptiste Daroussin
9904471bf3 Do not make ld(1) warnings fatal anymore, binutils behaviour has changed over the
time and gnu.warnings.symbol are now being fatal preventing building world.

in the futur we want to investigate only making the gnu.warning.symbol non fatal

Reviewed by:	imp
2014-10-21 20:11:05 +00:00
Baptiste Daroussin
ff2cf3685b Always use libc++ as the default c++ stack when building with an external gcc 4.8+
While here disable building gcc from base when using gcc 4.8+

Reviewed by:	imp
2014-10-21 20:00:49 +00:00
Baptiste Daroussin
d8d1a9ad6c When using an external toolchain note that gcc 4.8+ supports C++11
Submitted by:	imp
2014-10-21 19:58:23 +00:00
Baptiste Daroussin
8447c44fe7 The dependencies are computed with CC even if sources are C++, when building
when building with an external gcc, we want to be able to pass the path to
the libc++ headers so dependencies are correctly computed for C++ source files.
Add a DEPFLAGS for that purpose

Reviewed by:	imp
2014-10-21 19:56:45 +00:00
Mark Johnston
e9083b2dc5 Fix a few small bugs in the DTrace USDT rules:
* anchor search strings appropriately,
* use .ALLSRC to pass the full path to the D script to dtrace(1),
* don't insert the auto-generated header into SRCS - it doesn't
  accomplish anything, and we end up having to remove it from OBJS anyway.

Reviewed by:		rpaulo
Differential Revision:	https://reviews.freebsd.org/D978
MFC after:		3 weeks
Sponsored by:		EMC / Isilon Storage Division
2014-10-21 04:30:00 +00:00
Mark Johnston
cfcdd438f4 Don't define rules based on PROGS if PROGS is empty.
Reviewed by:	sjg, ngie
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2014-10-16 21:13:46 +00:00
Warner Losh
f8080a9986 HYPERV isn't available on all architectures, but just on by default
for i386/amd64. Rather, it only works on i386/amd64 and should only be
built there. Rather than change the default based on which
architecutre, do things more directly by only building it on
i386/amd64 and having it always on. This is how we handle other
options that are relevant only for a few architectures.
2014-10-16 00:33:06 +00:00
Xin LI
f972197651 Promote libevent to lib/ level and fold ftp-proxy into its parent Makefile.
This allows us to use libevent for other application in the future.

For now libevent is still INTERNALLIB and no shared library is installed.

MFC after:	1 month
2014-10-13 22:15:26 +00:00
Enji Cooper
c57b274d49 Add LDFLAGS to PROG_VARS so it can be overridden on a per-PROG basis
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2014-10-10 22:18:09 +00:00
Baptiste Daroussin
78abccfc94 Make sure SIZE is defined early 2014-10-10 06:09:47 +00:00
Will Andrews
6cc777bf8b Revise r272363 by collapsing the tests into a for loop.
This has the side effect of ensuring that realpath is also run for the
nominal case of PORTSDIR=/usr/ports (assuming .CURDIR is a ports directory
that relies on /usr/ports but is not rooted in it).  This ensures that any
generated PORTSDIR used is always the actual location.

Submitted by:	jkim (different implementation)
2014-10-01 20:52:08 +00:00
Andrew Turner
66c5f84baf Clean up detection of big-endian ARM. In all cases we follow the pattern
arm*eb*. Check we are building for arm and if MACHINE_ARCH follows this
pattern.
2014-10-01 16:00:21 +00:00
Will Andrews
ff48e37159 Always resolve PORTSDIR to absolute paths using realpath(1).
Reported by:	madpilot
Reviewed by:	bapt
X-MFC-With:	272282
2014-10-01 15:02:37 +00:00
Andrew Turner
6d4766c1b8 Remove MK_ARM_EABI, the armeb issues have been fixed. The code to support
the oabi is still in the tree, but it is expected this will be removed
as developers work on surrounding code.

With this commit the ARM EABI is the only supported supported ABI by
FreeBSD on ARMa 32-bit processors.

X-MFC after:	never
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D876
2014-10-01 08:26:51 +00:00
Mark Johnston
721dae3a52 Correct the way that libelf is linked when USDT is used. 2014-10-01 04:28:39 +00:00
Will Andrews
a0dec793d0 Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR.
This will only take effect if PORTSDIR is not set, as previously supported.

Use .if exists(), for four specific possibilities relative to .CURDIR:
., .., ../.., and ../../..  The fourth possibility is primarily in case
ports ever grows a third level.  If none of these paths exist, fall back to
the old default of /usr/ports.

This removes the need to set PORTSDIR explicitly (or via wrapper script) if
one is running out of a ports tree that is not in /usr/ports, but in a
home directory.

Reviewed by:	bapt, bdrewery (older version)
CR:		D799
MFC after:	1 week
Sponsored by:	Spectra Logic
2014-09-29 15:05:23 +00:00
Enji Cooper
68e69f7343 Improve bsd.progs.mk compatibility with bsd.prog.mk
1. Do not install FILES/SCRIPTS multiple times if PROGS is specified; this is
   already handled via bsd.prog.mk when it's called recursively (PR: 191055,
   191955).
2. Some variables, like BINDIR and PROGNAME, default to a value if unset
   whereas others get appended to, like CFLAGS. Add support for the former case
   (PR: 191056)
3. Make "checkdpadd" and "clean" available targets for recursive execution.

Reviewed by: marcel, sjg
Phabric: D822
PR: 191055, 191056, 191955
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2014-09-24 04:45:35 +00:00
Xin LI
e72055b7fe Import HyperV Key-Value Pair (KVP) driver and daemon code by Microsoft,
many thanks for their continued support of FreeBSD.

While I'm there, also implement a new build knob, WITHOUT_HYPERV to
disable building and installing of the HyperV utilities when necessary.

The HyperV utilities are only built for i386 and amd64 targets.

This is a stable/10 candidate for inclusion with 10.1-RELEASE.

Submitted by:	Wei Hu <weh microsoft com>
MFC after:	1 week
2014-09-13 02:15:31 +00:00
Enji Cooper
41ae64f374 Remove many false positives with make checkdpadd
- Reduce DPADD and LDADD in checkdpadd to -l<foo>
- Skip over -Wl,[es]*-group because -Wl,--end-group and
  -Wl,--start-group might be required to properly link objects (see
  usr.bin/clang/lldb as an example)

This caveat has been present for a while with some components of
the build. However, these false positives were made more more apparent
after r269648.

Phabric: D635
Reviewed by: jmmv (an earlier version)
PR: 192730
MFC after: 2 weeks
2014-09-10 07:55:51 +00:00
Mark Johnston
5439a71566 Define _DTRACE_VERSION in sdt.h rather than setting it manually. This is
similar to what illumos does, and makes it easier to enable USDT probes
in third-party software that doesn't make use of the system makefiles.
2014-09-02 23:43:06 +00:00
Ed Maste
6e52173261 Allow standalone debug for non-default ${PROG} targets
This allows WITH_DEBUG_FILES to produce standalone debug for the ELF
runtime linker.

We previously disabled standalone debug files for bsd.prog.mk consumers
that included a non-default ${PROG} target, but this is not required.

Consumers that do not support standalone debug are still handled by
disabling it for statically linked binaries, and for those that specify
a non-default binary format.

Sponsored by:	DARPA, AFRL
2014-09-02 19:05:34 +00:00
Ed Schouten
13b7412dad Add -Wthread-safety to WARNS=6.
While there, add a NO_WTHREAD_SAFETY flag that can be used to disable
this specific warning flag. Disable it for auditdistd. We can easily
patch up auditdistd to have the right annotations to build, but as
auditdistd is intended to be portable across other operating systems,
it's not worth the effort.

Approved by:	brueffer@
2014-09-01 20:18:09 +00:00
Enji Cooper
2dba8ab00d Introduce missing definition for LIBTERMCAPW
Some Makefiles expect this value to exist

Approved by: rpaulo (mentor)
MFC after: 5 days
Phabric: D675 (as part of a larger diff)
PR: 192762
2014-08-26 09:12:41 +00:00
Enji Cooper
3303bfc042 Fix "make checkdpadd" for lib/libc when MK_SSP != no
Add LIBSSP_NONSHARED to bsd.libnames.mk and append LIBSSP_NONSHARED to DPADD in
lib/libc when MK_SSP != no

Approved by: rpaulo (mentor)
MFC after: 3 days
Phabric: D675 (as part of a larger diff)
PR: 192728
2014-08-25 06:10:03 +00:00
Bryan Drewery
5608fd23c2 Revert r267233 for now. PIE support needs to be reworked.
1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
   build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
   where it never would work anyhow, such as csu or loader. This suggests
   there may be better ways of adding support to the tree. Many of these
   cases can be fixed such that -fPIE will work but there is really no
   reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
   really building libraries but have been using bsd.prog.mk because the code
   is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
   been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by:	kib
2014-08-19 15:04:32 +00:00
Adrian Chadd
51bfac0253 Make the libbsdstat useful again. 2014-08-13 19:43:22 +00:00
Rui Paulo
9c851217b6 Make sure the DTrace header files are built before depend and before
the build starts.

This adds a new variable DHDRS that contains a list of all DTrace
header files.  Then, we use the beforedepend hook to make sure the
heaeder files are built.

Introduce a beforebuild dependency (from projects/bmake) based on
feedback from Simon J. Gerraty.  This lets us generate the header
files without running make depend.

Reviewed by:	sjg, imp
MFC after:	3 days
2014-08-13 01:27:51 +00:00
Rui Paulo
17b227229c Revert r269839.
This doesn't work like I expected and the if clause is never matched.
It turns out that the problem with the older make is unrelated.

MFC after:	3 days
2014-08-11 22:43:44 +00:00
Rui Paulo
8a152f97e7 Add .d files to the reverse matching pattern in bsd.dep.mk to account
for source file dependencies.

This follows the .y and .l behaviour.

MFC after:	3 days
2014-08-11 21:42:06 +00:00
Rui Paulo
6b2edf61bd Fix another typoe in the definition of DTrace SOBJS.
MFC after:	3 days
2014-08-11 21:14:08 +00:00
Rui Paulo
04c241ea2d bsd.dep.mk: use the empty() function with the check for .d files.
Seems to work better with the old make.

MFC after:	3 days
2014-08-11 20:44:57 +00:00
Rui Paulo
23e9784542 Fix an error in the dependency of the DTrace object file.
MFC after:	3 days
2014-08-11 20:41:14 +00:00
Rui Paulo
9b646f2533 Fix a few problems with the USDT probes:
* Include OBJDIR to make sure the generated file is found;
* Simplify the definition of OBJS;
* Add targets for shared objects and for profiled objects.

MFC after:	3 days
2014-08-10 06:43:40 +00:00
Baptiste Daroussin
e806d5088b Make libohash a proper internallib instead of hidding it in m4
mandoc development seems to be also using ohash so prepare to share the code when
needed
2014-08-06 22:46:15 +00:00
Baptiste Daroussin
d029c3aa25 Rework privatelib/internallib
Make sure everything linking to a privatelib and/or an internallib does it directly
from the OBJDIR rather than DESTDIR.
Add src.libnames.mk so bsd.libnames.mk is not polluted by libraries not existsing
in final installation
Introduce the LD* variable which is what ld(1) is expecting (via LDADD) to link to
internal/privatelib
Directly link to the .so in case of private library to avoid having to complexify
LDFLAGS.

Phabric:	https://phabric.freebsd.org/D553
Reviewed by:	imp, emaste
2014-08-06 22:17:26 +00:00
Simon J. Gerraty
faa8fa9077 We do not ever want _srcconf_included_ as MAIN target. 2014-07-28 23:36:21 +00:00
Simon J. Gerraty
5b6dc2efc9 Reviewed by: imp
LDFLAGS is supposed to be given to CC not LD.
Define _LDFLAGS as a filtered version of LDFLAGS safe to give to LD
2014-07-26 04:38:09 +00:00
Warner Losh
8ca0d5ad1d Document an important, but easy to overlook without grepping the
entire tree, detail about LDFLAGS.
2014-07-25 21:10:30 +00:00
Simon J. Gerraty
49217bc51e bsd.lib.mk does not add OBJS etc to CLEANFILES so does not automatically
get them flagged as .NOPATH.  This hurts people who don't use obj dirs.
Since its clean target seprate rm's for things, use NOPATH_FILES as list
to collect things that need .NOPATH.

bsd.obj.mk will add CLEANFILES to NOPATH_FILES and do the deed if needed.

Reviewed by: sbruno
2014-07-22 00:42:55 +00:00
Dag-Erling Smørgrav
48b0feca16 Older versions of flex (like the one used in FreeBSD <= 9) expect the
output file name to follow the -o flag immediately, with no intervening
whitespace.

Reported by:	ian@
MFC after:	1 week
2014-07-20 14:49:24 +00:00
Dag-Erling Smørgrav
8f812fec9f Use -o (output to file) instead of -t (print to stdout) and a redirect.
MFC after:	1 week
2014-07-19 14:26:04 +00:00
Julio Merino
b85bd43aae Enable MK_TESTS by default, take 2.
This is a redo of r267424, which was reverted in r267432 because it broke
"make buildworld" from FreeBSD 9.x.  This issue has been resolved and this
change is still "make tinderbox" clean.
2014-07-16 21:40:11 +00:00
Rui Paulo
72a442fa29 Remove bsd.dtrace.mk.
MFC after:	3 weeks
2014-07-12 07:46:18 +00:00
Rui Paulo
d8b631554e Optimisation: replace ${_D:R} with just ${_D}.
MFC after:	3 weeks
2014-07-12 01:06:29 +00:00
Rui Paulo
ff0f36e773 Automatically build and link DTrace USDT probes.
This completely replaces bsd.dtrace.mk which never worked reliably.

MFC after:	3 weeks
2014-07-12 00:54:34 +00:00
Warner Losh
9e88096ea1 Make MK_GNUCXX mean "build the libstdc++ and libsupc++ libraries" and
nothing more. Force it to be "no" when MK_CXX is "no" to simplify
usage.  It no longer also means "build g++" since we no longer have a
platform where that's interesting now that pc98 no longer needs clang
and gcc, but not g++. pc98 now just uses clang after boot2 changes.
2014-07-10 21:11:48 +00:00
Baptiste Daroussin
f471720995 The GNU texinfo and GNU info pages are not built and installed
anymore, WITH_INFO knob has been added to allow to built and install
them again.

Reviewed by:	imp
2014-07-10 15:05:41 +00:00
Warner Losh
23f02598b8 Now that pc98 no longer needs gcc to compile boot2, remove the special
case and treat it just like i386.
2014-07-10 00:15:55 +00:00
Baptiste Daroussin
8a833bda0a The GNU readline library is now an INTERNALLIB - that is, it is
statically linked into consumers (GDB and variants) in the base
system, and the shared library is no longer installed.

That also allows ports to be able to use a modern version of readline

PR:		162948
Reviewed by:	emaste
2014-07-09 15:52:30 +00:00
Julio Merino
64dc02450b Fix atf-sh's integration_test
With the move of atf-sh into /usr/libexec in r267181, some of the
tests in the integration_test program broke because they could not
execute atf-sh from the path any longer.

This slipped through because I do have a local atf installation in
my home directory that appears in my path, hence the tests could
still execute my own version.

Fix this by forcing /usr/libexec to appear at the beginning of the
path when attempting to execute atf-sh.

To make upgrading easy (and to avoid an unnecessary entry in UPDATING),
make integration_test depend on the Makefile so that a rebuild of the
shell script is triggered.  This requires a hack in the *.test.mk files
to ensure the Makefile is not treated as a source to the generated
program.  Ugly, I know, but I don't have a better way of doing this at
the moment.  Will think of one once I address the TODO in the *.test.mk
files that suggests generalizing the file generation functionality.

PR:		191052
Reviewed by:	Garrett Cooper
2014-07-09 00:55:50 +00:00
Ian Lepore
cc55c7c78f Support CXXFLAGS.${MACHINE_ARCH} as well as CFLAGS. This allows different
C++ options for toolchain versus target when cross-building.
2014-07-08 14:37:01 +00:00
Marcel Moolenaar
e7d939bda2 Remove ia64.
This includes:
o   All directories named *ia64*
o   All files named *ia64*
o   All ia64-specific code guarded by __ia64__
o   All ia64-specific makefile logic
o   Mention of ia64 in comments and documentation

This excludes:
o   Everything under contrib/
o   Everything under crypto/
o   sys/xen/interface
o   sys/sys/elf_common.h

Discussed at: BSDcan
2014-07-07 00:27:09 +00:00
Rui Paulo
9f65e34ff8 bsd.dep.mk: add support for generating DTrace header files from .d files.
MFC after:	3 weeks
2014-07-05 20:08:35 +00:00
Glen Barber
71b259d4f1 Merge r267837 from ^/projects/release-debugdist:
When building world when WITH_DEBUG_FILES is set,
  avoid building ar(1) archives with '-g'.

Tested on:	head@r267801
Reviewed by:	emaste, imp
Sponsored by:	The FreeBSD Foundation
2014-07-01 18:26:30 +00:00
Ed Maste
824a909300 Rename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT
The _SUPPORT knobs have a consistent meaning which differs from the
behaviour controlled by this knob.  As the knob is opt-out and has not
appeared in a release the impact should be low.

Suggested by:	imp, wblock
MFC after:	1 week
2014-06-30 00:20:12 +00:00
Ian Lepore
a1c70d6943 Create a mechanism for providing fine-grained build order dependencies
during SUBDIR_PARALLEL builds.  This augments the coarse .WAIT mechanism,
which is still useful if you've got a situation such as "almost everything
depends on A and B".

Because the parallel subdir mechanism uses non-obvious mangling of
target names, which should probably remain a private detail of the
implementation, it's not easy to do things like "libfoo: libbar", so
instead the new mechanism lets you set a variable that lists dependencies:

  SUBDIR_DEPEND_libfoo= libgroodah libpouet

Note that while I'm using libraries as an example here, it really has
nothing to do with the generated library files.  This is really saying
"build in directory libfoo after building in the libgroodah and libpouet
directories."

This updates lib/Makefile with dependency information based on the old
almost-accurate comment block and by combing through lib/* makefiles
looking for LDADD dependencies to other libraries within lib/*.

Reviewed by:	Jia-Shiun Li <jiashiun@gmail.com>
2014-06-15 13:45:37 +00:00
Hans Petter Selasky
36716419f3 Attach the CUSE library and kernel module to the default FreeBSD
builds. Bump the FreeBSD version number.
2014-06-13 08:53:49 +00:00
Glen Barber
402da360e1 Revert r267424 and r267425:
More exploration will be needed in order to silence the
  tinderbox mails caused by setting WITH_TESTS=1 by default.

Ref:	http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-amd64-amd64.full
With hat:	re
2014-06-13 00:05:06 +00:00
Julio Merino
a2b2ff60be Enable MK_TESTS by default.
This was never intended to be off by default but was done this way
because the initial patches broke the build.  Things seem stable now
(have been so for a while too) and "make tinderbox" is clean so let's
try again.

Announced in freebsd-current; all reported shortcomings have been
addressed.
2014-06-12 18:54:52 +00:00
Julio Merino
e8a34402f2 Put the test suite in its own tests.txz distribution file.
Force all the contents of /usr/tests to go into a separate distribution
file so that users of binary releases can easily choose to not install it.

To make this possible, we need two fixes:
- bsd.subdir.mk needs to properly honor NO_SUBDIR in all cases so that we
  do not recurse into 'tests' subdirectories when we needn't.  Otherwise,
  we end up with some Kyuafiles in base.txz.
- etc/Makefile needs to skip installing tests in its 'distribute' target
  so that a Kyuafile doesn't leak into base.txz.

Approved by:	gjb
2014-06-10 17:04:30 +00:00
Julio Merino
ada17d7bde Ensure files are created during the build when using bsd.subdir.mk.
When FILES is defined in a Makefile that _also_ includes bsd.subdir.mk, the
build of the files (if any) was not properly triggered during the build
stage.  This was because bsd.files.mk did not define the buildfiles target
if it was already defined... and bsd.subdir.mk defined this target on its
own, thus causing a conflict.

Fix this by unconditionally defining buildfiles from bsd.files.mk; this is
safe because nothing else in the tree needs to redefine this and because the
target itself contains no commands: all it does is define dependencies.
Also ensure that bsd.files.mk is always pulled in by bsd.test.mk regardless
of what bsd.prog.mk does.

These fixes allow "make installworld" to run cleanly on a system with
read-only src and obj trees.

This is "make tinderbox" clean.

Reviewed by:	imp
Obtained from:	jilles
2014-06-09 14:36:49 +00:00
Bryan Drewery
864c53ead8 In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.
This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by:		Shawn Webb <lattera@gmail.com>
Discussed between:	des@ and Shawn Webb [2]
2014-06-08 17:29:31 +00:00
Julio Merino
8c7ec47a40 Move atf-sh from /usr/bin/ to /usr/libexec/
In r266650, we made libatf-c and libatf-c++ private libraries so that no
components outside of the source tree could unintendedly depend on them.

This change does the same for the "atf-sh library" by moving the atf-sh
interpreter from its public location in /usr/bin/ to the private location
in /usr/libexec/.  Our build system will ensure that our own test programs
use the right binary, but users won't be able to depend on atf-sh by
"mistake".

Committing this now to ride the UPDATING notice added with r267172 today.
2014-06-06 18:58:06 +00:00
Julio Merino
a845d42777 Add the *_TESTS_SH_SED_* functionality to atf.test.mk.
This exists already in plain.test.mk and tap.test.mk and should have been
added to atf.test.mk too when the feature was first introduced.

(It is probably time to address the related TODOs but I will do that
separately.)
2014-06-06 17:53:05 +00:00
Ed Maste
8febff7073 Install VT support files
They can be disabled by setting WITHOUT_VT_SUPPORT=yes in src.conf.

Sponsored by:	The FreeBSD Foundation
2014-06-05 18:53:56 +00:00
Warner Losh
e23dd3b2d2 Better documentation for why KERBEROS and OPENSSH are here, and where
to look for all the other options that used to be here (well, in
bsd.own.mk)

Suggested by: des@
2014-05-27 16:30:54 +00:00
Julio Merino
17a286a994 Change libatf-c and libatf-c++ to be private libraries.
We should not be leaking these interfaces to the outside world given
that it's much easier for third-party components to use the devel/atf
package from ports.

As a side-effect, we can also drop the ATF pkgconfig and aclocal files
from the base system.  Nothing in the base system needs these, and it
was quite ugly to have to get them installed only so that a few ports
could build.  The offending ports have been fixed to depend on
devel/atf explicitly.

Reviewed by:	bapt
2014-05-25 12:01:13 +00:00
Warner Losh
79f387daa8 Allow CC to not actually exist. During the ports INDEX run, all the
Makefiles are evaluated without building things. In a normal build,
the prerequisites would be built, and CC would be an actual thing. In
an INDEX build, though, they don't exists. Redirect stderr to get rid
of annoying messages, and assume that the compiler version is 0 if the
actual compiler can't tell us. Do this in preference to guessing based
on numbers because gcc410 might be 4.10, or 4.1.0 and without
carefully crafted special knowledge we differentiate between them
easily (also ming-gcc has no clues at all). Elsewhere, don't trust
the compiler version if it is 0.
2014-05-23 14:34:22 +00:00
Simon J. Gerraty
d94068ba0d Use an intermediate target to associate with _SUBDIR which is marked .MAKE
this allows make -n to do tree walks as expected without
doing anything else (as intended).
Use prefix _sub. to help avoid conflict with any real target.

Reviewed by:	imp
2014-05-20 18:25:46 +00:00
Simon J. Gerraty
a14f4e2fc1 Revert previous change - doesn't cover all cases. 2014-05-19 21:55:47 +00:00
Simon J. Gerraty
2cf7eab64a _SUBDIR is marked .MAKE - since it runs a sub-make.
Targets thus marked are supposed to run even with -n.
As such they should not do anything except run the sub-make.

Use an intermediate target _* to associate with _SUBDIR and which
depends on installincludes etc so that we get the correct behavior with -n.

Reviewed by:	marcel
2014-05-19 19:08:46 +00:00
Warner Losh
34bbee4317 Move inclusion of /etc/make.conf and others to old location (this also
moves local.sys.mk). The new location broke adding things to CXXFLAGS
in /etc/src.conf with +=. Move it back until that's sorted out...
2014-05-17 20:31:40 +00:00
Warner Losh
1f4e0ed969 The time is not yet ripe to break the lack of dependencies between
src/sys and the rest of the tree for builds.
o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk
o No need to include src.opts.mk at all anymore. The reasons for it
  are now coverted in sys.mk and src.sys.mk.
2014-05-17 20:31:34 +00:00
Warner Losh
6b14aaa4d4 Read in SRCCONF early and consistently, if src.sys.mk exists, which is
should for all normal builds. Read /etc/make.conf earlier than before,
but consistently before SRCCONF and local.sys.mk.
2014-05-17 01:47:06 +00:00
Brooks Davis
525e2a83f6 Revert r261296. This removes the WITHOUT_NCURSESW option.
It was the wrong direction.  We will instead remove use of the
non-wide-character supporting libncurses.
2014-05-15 16:44:25 +00:00
Warner Losh
cb8b0584f4 Really, I don't want to install src.opts.mk at all. 2014-05-10 21:27:47 +00:00
Warner Losh
7ecf742eeb Move DOCCOMPRESS to MK variable. 2014-05-10 16:38:54 +00:00
Warner Losh
c115b8184e Remove last two NO_MAN= in the tree. In both of these cases, MAN= is
what is needed.
2014-05-10 16:38:37 +00:00
Warner Losh
be4646cf7f Remove some useless, commented out code. Remove name space polution in
the POSIX case by moving more things under !Posix part of an if.
2014-05-10 16:38:32 +00:00
Warner Losh
dfd11a4413 g/c unmaintained, uninstalled bsd.pkg.mk. It tied into the ports
system, as it existed 9 years ago, and has been obsolete for a long
time.
2014-05-10 16:38:27 +00:00
Warner Losh
7273339dc4 Eliminate EARLY_BUILD flag. It is redundant and means MK_CLANG_FULL=no
and MK_LLDB=no, so set those explicitly (now that we can do
that). Simplify tests for these variables as well, since we know they
will always be defined regardless of the phase of the build.
2014-05-10 16:38:03 +00:00
Warner Losh
ab72ce6b1b Migrate NO_WARN to MK_WARN. Support legacy NO_WARN usage. Remove a
check for EARLY_BUILD because it isn't necessary (MK_WARN=no will
always be defined for that).
2014-05-10 16:37:53 +00:00
Warner Losh
999298523e Support, to the extent we generate proper command lines, compiling
with clang 3.3. Useful for test building -current on a -stable system
in individual directories. Potentially useful if we ever want to
support, say, gcc 4.8 or 4.9's new warnings when building with an
external toolchain (but such support not yet committed). Document
the bsd.compiler.mk interface.
2014-05-10 16:37:44 +00:00
Warner Losh
f510ecf0ee Optionally allow building the historical FreeBSD make program and
install it as fmake. This defaults to no. This should be viewed as the
first step towards evental migration of this historic code to ports
and removal from the tree.
2014-05-10 16:37:39 +00:00
Warner Losh
22cac7546c Introduce kern.opts.mk to hold all the options for kernel module
builds. Include this in the right places. Make src.opts.mk optional so
that modules can be built outside of the tree in the ports system.

PR: 189520
2014-05-09 21:11:27 +00:00
Warner Losh
f9798cc7eb We have to include bsd.opts.mk (included in bsd.own.mk) after
/etc/src.conf so that options set there will affect the options
defined in bsd.opts.mk. Fix a few comments while I'm here.
2014-05-09 04:49:48 +00:00
Warner Losh
3ceb1e5386 Spell always the more traditional way. 2014-05-09 04:49:43 +00:00
Warner Losh
09df65e474 Put bsd.own.mk back in the list, and take src.opts.mk out.
Fix a silly typo.
2014-05-08 02:24:30 +00:00
Warner Losh
8a863ef3d5 Fix a typo make should have complained about.
Submitted by: Mark Johnston
2014-05-08 02:18:36 +00:00
Warner Losh
bd871f14b7 bsd.compiler.mk was implicitly included by bsd.own.mk in historical
versions. With its movement to src.opts.mk, bsd.prog.mk was testing
COMPILER_TYPE without including the bsd.compiler.mk anymore. In the
source tree, this caused no problems, for reasons that aren't clear,
but does cause problems outside of the source tree. Allow
bsd.compiler.mk to be included multiple times safely, and always
include bsd.compiler.mk at the top of bsd.prog.mk. Resist the urge to
put it in bsd.init.mk, since that would reintroduce the implicit
include.
2014-05-07 18:15:02 +00:00
Warner Losh
5d420b97e6 All the NO_foo options processed in src.opts.mk are really bsd.opts.mk
options, so move their processing there. This fixes issues with
Makefiles that define NO_MAN=t and only inlcude bsd.*.mk files. A few
ports fell into this category, and they should be fixed by this change.
Also, for now, disable the warning about NO_foo being deprecated. More
work is needed than anticipated before we can do that, so kill the
noise for now.
2014-05-07 18:14:56 +00:00
Warner Losh
d03127447d Remove support for WITHOUT_BMAKE. bmake is now the only make that can
build world, so it is the only make we build or install. fmake is
still in the tree, but disconnected, and upgrades from older systems
that still have bmake has not been removed, but its state has not been
tested (it should work given how minimal the work to upgrade to bmake
is).
2014-05-06 04:22:37 +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
Warner Losh
5e84b765f4 Move the /usr/src specific options to src.opts.mk. Move inclusion of
/etc/src.conf to this file as well. Now, it will only affect builds of
/usr/src and not others that use the bsd.*.mk files. Specifically
don't install src.opts.mk so we can catch when it 'leaks' into
bsd.*.mk again and have there be errors when this happens. Future
commits will move to including src.opts.mk instead of bsd.own.mk when
all that's needed is one of the MK_FOO options from src.opts.mk.
Future options should be placed here, unless they directly affect a
bsd.*.mk file, in which case they should be placed in bsd.opts.mk.
2014-05-06 04:21:48 +00:00
Warner Losh
41603b8357 Simplify use of the semi-bogus EARLY_BUILD variable. Also, simplify
use of semi-bogus NO_WARNS variable. Both of these, in this case,
should collapse to WITHOUT_WARNS in a future commit.
2014-05-05 22:03:08 +00:00
Warner Losh
a18673d42d Introduce CWARNFLAGS.${COMPILER_TYPE} and use that to simplify the
thicket of .if ${COMPILER_TYPE} == "clang" that controls
warnings. Also, use CFLAGS.clang in a couple places in preference to
having a similar construct that's related to the CWARNFLAGS changes.
2014-05-05 22:03:01 +00:00
Warner Losh
9b01449f96 [1] Make WITHOUT_FOO alway trump WITH_FOO, regardless of the system
default. This restores more of the historical expectations that
    were broken when we started disallowing both WITH_FOO and
    WITHOUT_FOO to be defined.
[2] Document this new behavior, and improve the documentation in
    general here.

Submitted by: sjg@ [1].
2014-05-05 22:02:48 +00:00
Warner Losh
6f9f01a2d8 NLS is used by the build system. 2014-04-29 14:52:39 +00:00
Warner Losh
2ded1ea292 Generalize FOO.clang to FOO.${COMPILER_TYPE}. There's no reason these
need to be clang specific. Also generalize things a bit.
2014-04-25 19:25:57 +00:00
Warner Losh
7061d0855c Split up the options into those used only by bsd.mk.* or sys.mk and
the rest. Add note of caution for the surprises that popped up. MK_SSP
is the only one used by sys.mk, and it likely needs even extra
attention.
2014-04-25 19:25:53 +00:00
Warner Losh
347c9de056 Eliminate NO_INCS. It is used one place, and MK_TOOLCHAIN=no will
handle the job just as well. Opt for simplicity rather than one more
option.
2014-04-25 19:25:45 +00:00
Warner Losh
c772d4925c Now that all the NO_foo expressed in this loop have been removed from
the tree, start warning that NO_foo is deprecated. It was supposed to
be gone from the tree as a user-setting a long time ago...
2014-04-25 19:25:37 +00:00
Warner Losh
14472d17d7 NO_DEBUG_FILES -> MK_DEBUG_FILES=no in last remaining place. 2014-04-25 19:25:18 +00:00
Warner Losh
d6d1ee211a Add option WITHOUT_VI to not build/install vi. vi was the largest
binary without a knob to turn it off.
2014-04-24 23:17:40 +00:00
Warner Losh
f6092768b1 Use MK_OPENLDAP in preference to WITH_OPENLDAP and make it a default
NO option to match the opt-in nature of the historical nature of this
option.
2014-04-24 23:17:31 +00:00
Warner Losh
fa3dfa6128 LIBUNBOUND can be unconditionally set. 2014-04-24 21:18:29 +00:00
Warner Losh
1e309af2ef Don't need to make these conditional on MK_LIBCPLUSPLUS. They can be
defined all the time without ill effect.
2014-04-24 21:18:22 +00:00
Warner Losh
54421a3433 LIBMILTER can be defined always. No need to restrict to only when
we're building sendmail.
2014-04-24 21:18:14 +00:00
Warner Losh
02504aec49 Always define LIBLDNS. We don't need to only define it when it is
enabled.
2014-04-24 21:18:06 +00:00
Warner Losh
8609cb7bfd Include bsd.opts.mk before Makefile.inc so Makefile.inc can do things
based on MK_xxx symbols. Continue to include bsd.own.mk after
Makefile.inc to preserve current behavior.
2014-04-24 02:02:51 +00:00
Ian Lepore
b4bb98ed6b Allow .WAIT to appear in SUBDIR= lists, to provide some control over
parallel build order.  All subdirs before a .WAIT will be built before
any subdirs after it.

Reviewed by:	imp@
2014-04-23 12:52:11 +00:00
Jung-uk Kim
709d846ced Install newly added bsd.mkopt.mk. 2014-04-19 04:59:56 +00:00
Warner Losh
04943ab399 Retire compatibility YES_HESIOD. If you haven't upgraded in the last
decade to WITH_HESIOD, your are in for a rude surprise...
2014-04-18 17:04:34 +00:00
Warner Losh
5144b2be23 Move the generic part of bsd.opts.mk into bsd.mkopts.mk to allow for
the WITH/WITHOUT_FOO -> MK_FOO={yes,no} stuff to be used elsewhere.
2014-04-18 17:04:26 +00:00
Warner Losh
4f9fa02d54 Allow setting of MK_FOO by anybody. There are too many edge cases that
we're preventing now with this policy. However, these edge cases
should be rare and all that set MK_FOO directly.
WITH_FOO and WITHOUT_FOO both being defined now result in the
non-default behavior happening silently. Users needing determinism
here fall into the edge case exception for MK_FOO setting.
2014-04-18 17:04:18 +00:00
Warner Losh
6a542ebed9 Copy bsd.own.mk to bsd.opts.mk and separate out the option setting
code from the rest. Include bsd.opts.mk in bsd.own.mk to preserve
current behavior. Future revisions will replace the inclusion of
bsd.own.mk elsewhere with bsd.opts.mk or a more appropriate new
file that's still being finalized.
2014-04-18 17:04:09 +00:00
Warner Losh
2bf36e7e08 Separate out enabling building clang and/or gcc for the system and
building clang and/or gcc as the bootstrap compiler. Normally, the
default compiler is used. WITH_CLANG_BOOTSTRAP and/or
WITH_GCC_BOOTSTRAP will enable building these compilers as part
bootstrap phase.  WITH/WITHOUT_CLANG_IS_CC controls which compiler is
used by default for the bootstrap phase, as well as which compiler is
installed as cc.  buildworld now successfully completes building the
cross compiler with WITHOUT_CLANG=t and WITHOUT_GCC=t and produces a
built system with neither of these included.

Similarlly, MK_BINUTILS_BOOTSTRAP controls whether binutils is built
during this phase.

WITHOUT_CROSS_COMPILER will now force MK_BINUTILS_BOOTSTRAP=no,
MK_CLANG_BOOTSTRAP=no and MK_GCC_BOOTSTRAP=no.

BOOTSTRAP_COMPILER was considered, but rejected, since pc98 needs both
clang and gcc to bootstrap still. It should be revisisted in the
future if this requirement goes away. Values should be gcc, clang or
none. It could also be a list.

The odd interaction with Xfoo cross/external tools needs work, but
is beyond the scope of this change as well.
2014-04-18 17:03:58 +00:00
Warner Losh
0abe2561f6 Convert NO_MANCOMPRESSED to MK_MANCOMPRESSED. 2014-04-18 17:03:49 +00:00
Warner Losh
77667fecbe Don't build EISA by default anymore. Remove from i386 GENERIC and
create an option that defaults to "no" on all platforms to not build
the EISA bits.

Discussed on: arch@
2014-04-18 16:53:06 +00:00
Warner Losh
a0f4cb1e7b r264402 builds fine, but turns out there are problems with
install. Back it out until they can be tracked down.
2014-04-13 21:52:27 +00:00
Warner Losh
5bce97114a Convert NO_MANCOMPRESS to normal convention. 2014-04-13 05:22:26 +00:00
Warner Losh
3bdf775801 NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
and finish the job. ncurses is now the only Makefile in the tree that
uses it since it wasn't a simple mechanical change, and will be
addressed in a future commit.
2014-04-13 05:21:56 +00:00
Warner Losh
e0919954d5 Don't apply ctf conversions in POSIX mode. These can't happen there
because they pollute the POSIX environment, which doens't allow
for these extentions. ctf conversions are really only relevant when
used in coordination with the rest of the bsd*.mk system anyway.
Leave them in place for the normal, non-posix enviornment since
they are quite useful there.
2014-04-13 05:21:48 +00:00
Dag-Erling Smørgrav
f1c8f60b88 Introduce RANLIBFLAGS to mirror ARFLAGS and add -D to both. This sets
all timestamps in static libraries to 0 so that consecutive builds
from the same source, even on different machines, produce identical
libraries.

MFC after:	3 weeks
2014-04-12 12:44:09 +00:00
Warner Losh
35074a0a2b Need to test .MAKE.LEVEL everywhere before using it for bootstrapping
issues between fmake and bmake.
2014-04-07 21:16:51 +00:00
Warner Losh
cf57243a46 Convert sort to using newer MK_ convention. 2014-04-05 18:01:49 +00:00
Warner Losh
a5fc5b6223 Convert from WITHOUT_SYSCALL_COMPAT to MK_SYSCALL_COMPAT. 2014-04-05 17:54:43 +00:00
Warner Losh
40b86d77c7 The proper way to request no man pages currently is NO_MAN=xxx. Use it
in preference to the user WITHOUT_MAN knob, which should never be set
in normal src Makefiles.
2014-04-05 17:54:36 +00:00
Warner Losh
14a7e8f167 Move setting of the MK_xxx variables based on NO_xxx to avoid
triggering the "you aren't allowed to set this" warning when building
stand alone in directories whose Makefile sets NO_MAN, for example.
2014-04-02 16:33:10 +00:00
Warner Losh
bcca5958db FreeBSD make (aka fmake) doesn't grok .MAKE.LEVEL. Failsafe and assume
that it is OK to set MK_xxx flags.
2014-04-02 16:33:02 +00:00
Warner Losh
74b229cb2b Don't test WITHOUT_FOO in program makefiles, test MK_FOO instead. 2014-04-01 14:24:32 +00:00
Warner Losh
fffba3dbc2 There's no need to set the default for GNUCXX based on WITHOUT_CXX
being defined. The system works fine without it (because GNUCXX isn't
built when WITHOUT_CXX is defined), and it is one of the few places we
test WITHOUT_FOO instead of MK_FOO in the base system. Simply
eliminate it to solve both problems. Also, minor tweak to make it
clearer that the default is always NO for GNUGCC on i386.
2014-04-01 14:24:15 +00:00
Warner Losh
e5c1052e48 Eliminate FDT being treated specially. When the BSDL DTC was
introduced, the meaning of WITH_FDT changed from 'do FDT in boot
loader and build dtc compiler' to be simply 'do FDT things in the boot
loader'. Now that we test for FDT in the architecture specific files,
this test here is now redunant and encourages bad behavior, so just
eliminate it and make it always yes. Those architectures whose boot
loaders don't support FDT already omit it when it is set to yes
anyway.
2014-04-01 14:24:08 +00:00
Warner Losh
63e4d6f712 There's no need to guess at the COMPILER_TYPE to pass it down. We
guess wrong for buildkernel when CC=gcc49, say. Eliminate all the
guessing. COMPILER_TYPE propigates properly on its own, if specified,
and we guess it correctly otherwise lower in the build. Also, fix
conditionals for armv6hf when using an external compiler chain. They
were broken before, but unused. Also, prefer checking the compiler
type over CLANG_IS_CC since the latter is only supposed to be used to
determine what symlinks to install (more fixes to follow).
2014-03-30 23:43:30 +00:00
Warner Losh
15eee89508 Kill NO_TESTS and use MK_TESTS=no when we want to skip them. 2014-03-30 22:24:53 +00:00
Warner Losh
e091d98517 Allow the build system to safely set MK_FOO to avoid the ambiguity
when both WITH_FOO and WITHOUT_FOO are set. Use this where
possible. Only disallow setting of MK_FOO on the command line. This
was preferable to inventing a new mechanism or fixing the undef bug
(bin/183762) which precludes users from turning off anything we turn
off for parts of the build with WITHOUT_FOO prior to this.
2014-03-30 22:24:45 +00:00
Dimitry Andric
54ff5d7323 Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process
all the SUBDIR entries in parallel, instead of serially.  Apply this
option to a selected number of Makefiles, which can greatly speed up the
build on multi-core machines, when using make -j.

This can be extended to more Makefiles later on, whenever they are
verified to work correctly with parallel building.

I tested this on a 24-core machine, with make -j48 buildworld (N = 6):

                before    stddev       after    stddev
                =======   ======       =======  ======
real time        1741.1     16.5         959.8     2.7
user time       12468.7     16.4       14393.0    16.8
sys  time        1825.0     54.8        2110.6    22.8

(user+sys)/real     8.2                   17.1

E.g. the build was approximately 45% faster in real time.  On machines
with less cores, or with lower -j settings, the speedup will not be as
impressive.  But at least you can now almost max out a machine with
buildworld!

Submitted by:	jilles
MFC after:	2 weeks
2014-03-26 22:30:38 +00:00
Andrew Turner
73279d4113 Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental.
This targets the existing ARMv6 and ARMv7 SoCs that contain a VFP unit.
This is an optional coprocessors may not be present in all devices, however
it appears to be in all current SoCs we support.

armv6hf targets the VFP variant of the ARM EABI and our copy of gcc is too
old to support this. Because of this there are a number of WITH/WITHOUT
options that are unsupported and must be left as the default value. The
options and their required value are:
 * WITH_ARM_EABI
 * WITHOUT_GCC
 * WITHOUT_GNUCXX

In addition, without an external toolchain, the following need to be left
as their default:
 * WITH_CLANG
 * WITH_CLANG_IS_CC

As there is a different method of passing float and double values to
functions the ABI is incompatible with existing armv6 binaries. To use
this a full rebuild of world is required. Because no floating point values
are passed into the kernel an armv6 kernel with VFP enabled will work with
an armv6hf userland and vice versa.
2014-03-23 12:49:25 +00:00
Jung-uk Kim
6619822598 Add new CPUTYPEs supported by Clang 3.4, i.e., AMD Steamroller (bdver3) and
Intel Silvermont (slm) processors.
2014-03-20 19:17:46 +00:00
Ian Lepore
44653522f6 Add a way to apply CFLAGS only when building the given architecture. This
is useful primarily on a system used for cross-building, when you have a
set of flags to apply to the TARGET_ARCH being cross-built but don't want
those settings applied to building the cross-tools or other components that
run on the build host machine.
2014-03-19 18:54:53 +00:00
Julio Merino
4692f5ba26 Document support for TAP-compliant Perl test programs. 2014-03-16 01:22:23 +00:00
Julio Merino
a5bf6b6d21 Add some documentation for bsd.test.mk. 2014-03-15 09:27:59 +00:00
Julio Merino
a784098c10 Move FreeBSD Test Suite-specific code to a suite.test.mk file.
The new suite.test.mk file contains all the logic needed to install test
programs under /usr/tests/ and to support Kyua as the run-time engine.
This file is included by default by bsd.test.mk so Makefiles do not need
to care about its existence.

Specific Makefiles can define NOT_FOR_TEST_SUITE to indicate that whatever
test programs they are building are not supposed to be installed under
/usr/tests/ nor run by Kyua.  (The effect of passing this setting is that
suite.test.mk is simply not included.)

NOT_FOR_TEST_SUITE should never be used by Makefiles in the base system.
This functionality is provided so that third-parties can hook in their
own test code, with different semantics, if they wish.  This was asked
for by sjg@.
2014-03-14 12:52:55 +00:00
Julio Merino
f5fd950e35 Make bsd.test.mk the only public mk fragment for the building of tests.
Change {atf,plain,tap}.test.mk to be internal implementation details of
bsd.test.mk.  Makefiles that build tests should now only include bsd.test.mk
and declaratively specify what they want to build, without worrying about
the internal implementation of the mk files.

The reason for this change is to permit building test programs of different
interfaces from a single directory, which is something I had a need for
while porting tests over from src/tools/regression/.

Additionally, this change makes it possible to perform some other requested
changes to bsd.test.mk in an easier manner.  Coming soon.
2014-03-14 08:56:19 +00:00
Gleb Smirnoff
2c284d9395 Remove IPX support.
IPX was a network transport protocol in Novell's NetWare network operating
system from late 80s and then 90s. The NetWare itself switched to TCP/IP
as default transport in 1998. Later, in this century the Novell Open
Enterprise Server became successor of Novell NetWare. The last release
that claimed to still support IPX was OES 2 in 2007. Routing equipment
vendors (e.g. Cisco) discontinued support for IPX in 2011.

Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.
2014-03-14 02:58:48 +00:00
Andrey A. Chernov
c34a97a05d Add fetch and patch to .PHONY and .NOTMAIN only if PORTNAME is defined.
Unconditional addition cause real fetch(1) and patch(1) programs are
builded every time.

MFC after:      1 week
2014-03-02 13:12:06 +00:00
Warner Losh
eeb913c99f Integrate device-tree upstream files into the build process:
(1) Invoke cpp to bring in files via #include (although the old
    /include/ stuff is supported still).
(2) bring in files from either vendor tree or freebsd-custom files
    when building.
(3) move all dts* files from sys/boot/fdt/dts to
    sys/boot/fdt/dts/${MACHINE} as appropriate.
(4) encode all the magic to do the build in sys/tools/fdt/make_dtb.sh
    so that the different places in the tree use the exact same logic.
(5) switch back to gpl dtc by default. the bsdl one in the tree has
    significant issues not easily addressed by those unfamiliar with
    the code.
2014-02-28 18:29:09 +00:00
Dimitry Andric
892620150f Merge from head up to r262415. 2014-02-23 23:33:11 +00:00
Baptiste Daroussin
d0bfcaf83e Remove libyaml, it has been replaced by libucl 2014-02-23 22:27:14 +00:00
Baptiste Daroussin
c99fb5f907 Import libucl into head
UCL is heavily infused by nginx configuration as the example of a convenient
configuration system. However, UCL is fully compatible with JSON format and is
able to parse json files.

UCL is used by pkg(8) for its configuration file as well for the manifest format
in packages, it will be used in base for the pkg boostrap (signature checking
and configuration file parsing.)

libucl has been developped and is maintained by vsevolod@
2014-02-23 21:49:21 +00:00
Baptiste Daroussin
6a54f620e5 Rename WITHOUT_DMA into WITHOUT_DMAGENT to avoid confusion
Requested by:	ian
2014-02-22 13:05:23 +00:00
Dimitry Andric
9bc21aae69 Merge from head up to r262311. 2014-02-21 22:54:35 +00:00
Dimitry Andric
2879baf24b Move the part in bsd.own.mk that sets -Wno-c++11-extensions for clang to
bsd.sys.mk, where it really belongs.  This also causes the flag to get
added when clang is *not* the default system compiler, but is still
used, e.g. by setting WITH_CLANG_IS_CC manually.

MFC after:	3 days
2014-02-21 22:38:25 +00:00
Dimitry Andric
7e4113e2e1 In case source files are compiled with -g, tell clang not to emit .cfi
directives, since on sparc64 we must still GNU as, which does not
support those directives.

Note there are several programs and libraries in our tree, which are
always compiled with -g, even if DEBUG_FLAGS is not set by the user!
2014-02-21 19:58:45 +00:00
Baptiste Daroussin
a9e8641da9 Import Dragonfly Mail Agent into base system
It is a small and lightweight Mail Transport Agent.
It accepts mails from locally installed Mail User Agents (MUA) and delivers the
mails either locally or to a remote destination. Remote delivery includes
several features like TLS/SSL support, SMTP authentication and NULLCLIENT.

Make dma conditional to new WITHOUT_DMA option and make it respect WITHOUT_MAIL

Reviewed by:	peter
Discussed with:	emaste, bz, peter
2014-02-21 07:26:49 +00:00
Dimitry Andric
f785676f2a Upgrade our copy of llvm/clang to 3.4 release. This version supports
all of the features in the current working draft of the upcoming C++
standard, provisionally named C++1y.

The code generator's performance is greatly increased, and the loop
auto-vectorizer is now enabled at -Os and -O2 in addition to -O3.  The
PowerPC backend has made several major improvements to code generation
quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ
backends have all seen major feature work.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.4/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html>

MFC after:	1 month
2014-02-16 19:44:07 +00:00
Brooks Davis
8f26887dfb Merge from CheriBSD:
commit 2d581e8caf
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Mon Jan 27 22:57:51 2014 +0000

    Add WITHOUT_FMTREE to disable building fmtree.

MFC after:	4 weeks
Sponsored by:	DARPA, AFRL
2014-01-30 21:37:43 +00:00
Brooks Davis
6adfbbbf16 Merge from CheriBSD:
commit 6b569451b9
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Mon Jan 27 22:50:46 2014 +0000

    Always install nmtree as mtree.
    For compability, link mtree to nmtree.

X-MFC after:	never
Sponsored by:	DARPA, AFRL
2014-01-30 21:25:01 +00:00
Brooks Davis
38e233371c Merge from CheriBSD:
commit c1acf022c5
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Fri Jan 17 21:46:44 2014 +0000

    Add an option WITHOUT_NCURSESW to suppress building and linking to
    libncursesw.  While wide character support it useful we'd like to
    only need one ncurses library on embedded systems.

MFC after:	4 weeks
Sponsored by:	DARPA, AFRL
2014-01-30 21:08:36 +00:00
Steven Kreuzer
c904339f2f Remove WITHOUT_ATF as it has been replaced by WITH_TESTS
PR:		conf/185326
Reported by:	Igor Mozolevsky <igor@hybrid-lab.co.uk>
Approved by:	hrs (mentor)
2014-01-23 03:14:48 +00:00
Ed Schouten
46fec22881 Correct value of LIBCOMPILER_RT.
Caught by:	Luca Bayer
2014-01-18 14:47:34 +00:00
Ed Schouten
37656b872b Replace LIBGCC by LIBCOMPILER_RT.
We now use libcompiler_rt on all platforms now. Instead of referring
directly to -lgcc and LIBGCC, use -lcompiler_rt and LIBCOMPILER_RT.
2014-01-18 14:22:56 +00:00
Julio Merino
e8de5c5235 Support perl-based TAP-compliant test programs.
Introduce a TAP_TESTS_PERL primitive to list test programs written in perl.
Only do this in tap.test.mk because I only expect perl-based test programs
with this interface.

This is very similar to TAP_TESTS_SH but the difference is that we record
in the Kyuafile that the test program requires a perl interpreter.  This
in turn makes Kyua mark the test as skipped if the perl package is not yet
installed, instead of mysteriously failing to run the program.

MFC after:	5 days
2014-01-14 18:35:56 +00:00
Julio Merino
8c465f5880 Support defining test program metadata from the Makefiles.
Introduce a new, per-test-program TEST_METADATA.<program> variable that
contains a list of key/value paris describing metadata properties for
that test program.  These properties are later written into the
auto-generated Kyuafile when using the KYUAFILE=auto functionality.

This is to avoid having to supply hand-crafted Kyuafiles when the needs
for metadata overrides are trivial.

While doing this, and because I am documenting TEST_METADATA, take the
chance to document the TEST_INTERFACE setting as well.

MFC after:	5 days
2014-01-14 18:32:47 +00:00
Julio Merino
d7efee230d Allow tests to provide a Kyuafile when they relied on auto-generation.
When generating a Kyuafile in the KYUAFILE=auto case, use a filename
that is unlikely to clash with the filename used by explicitly-provided
Kyuafiles.

This allows a Makefile to set KYUAFILE=yes and provide a Kyuafile in
the same directory when such Makefile was previously relying on
KYUAFILE=auto.

Fixes issues with new Kyuafiles not being picked up in NO_CLEAN builds
(although manual intervention is required once, unfortunately, as
described in UPDATING).

Reviewed by:	sjg
MFC after:	1 week
2014-01-10 10:36:14 +00:00
Dimitry Andric
f66aed321e Apply band-aid for 32-bit compat libs failures after r260334: put back
-Qunused-arguments for clang for now, until I can figure out a way to
make it unneeded in all scenarios.  Sorry about the breakage.
2014-01-06 14:39:10 +00:00
Dimitry Andric
4abd7edcbd Split the last gcc-specific flags off into CFLAGS.gcc. This also
removes the need to use -Qunused-arguments for clang throughout the
tree.

MFC after:	3 days
2014-01-05 21:03:49 +00:00
Dimitry Andric
20dcbdb6be In addition to r260102, also define GCC_MS_EXTENSIONS in bsd.sys.mk,
since kernel module builds do not use kern.pre.mk.

MFC after:	3 days
X-MFC-With:	r260102
2014-01-05 16:40:41 +00:00
Dimitry Andric
b294993d63 To avoid having to explicitly test COMPILER_TYPE for setting
clang-specific or gcc-specific flags, introduce the following new
variables for use in Makefiles:

CFLAGS.clang
CFLAGS.gcc
CXXFLAGS.clang
CXXFLAGS.gcc

In bsd.sys.mk, these get appended to the regular CFLAGS or CXXFLAGS for
the right compiler.

MFC after:	1 week
2013-12-22 17:51:33 +00:00
Ed Maste
7c27d02398 Require a C++11 compiler to build LLDB
In practice the old test (using MK_CLANG_IS_CC) is similar, but
COMPILER_FEATURES provides the information we actually want to test.

Sponsored by:	DARPA, AFRL
2013-12-17 18:30:37 +00:00
Julio Merino
f4a4cdd166 Make bsd.progs.mk work in directories with SCRIPTS but no PROGS.
This change fixes some cases where bsd.progs.mk would fail to handle
directories with SCRIPTS but no PROGS.  In particular, "install" did
not handle such scripts nor dependent files when bsd.subdir.mk was
added to the mix.

This is "make tinderbox" clean.

Reviewed by:	freebsd-testing
Approved by:	rpaulo (mentor)
2013-12-11 03:41:07 +00:00
Julio Merino
d8278f57f8 Add tap.test.mk.
This file provides support to build test programs that comply with the
Test Anything Protocol.  Its main goal is to support the painless
integration of existing tests from tools/regression/ into the Kyua-based
test suite.

Approved by:	rpaulo (mentor)
2013-12-11 03:39:50 +00:00
Dimitry Andric
e33625bfdc For WARNS <= 3, change the clang warning flag -Wno-conversion to
-Wno-enum-conversion.  In earlier clang versions (before 3.2), the
latter did not exist, and suppressing enum conversion warnings was
really the goal of this warning suppression flag.

This should enable the same kind of warning again as was fixed by
r259072 ("incompatible integer to pointer conversion passing 'Elf_Addr'
(aka 'unsigned int') to parameter of type 'void *'"), and which was only
emitted by gcc.

Noticed by:	kib
MFC after:	3 days
2013-12-07 22:30:07 +00:00
Pawel Jakub Dawidek
42a8595256 Please welcome casperd daemon. It (and its services) will be responsible for
giving access to functionality that is not available in capability mode
sandbox. The functionality can be precisely restricted.

Start with the following services:
- system.dns - provides API compatible to:
	- gethostbyname(3),
	- gethostbyname2(3),
	- gethostbyaddr(3),
	- getaddrinfo(3),
	- getnameinfo(3),
- system.grp - provides getgrent(3)-compatible API,
- system.pwd - provides getpwent(3)-compatible API,
- system.random - allows to obtain entropy from /dev/random,
- system.sysctl - provides sysctlbyname(3-compatible API.

Sponsored by:	The FreeBSD Foundation
2013-12-02 08:21:28 +00:00
Pawel Jakub Dawidek
2f02600abf Move my simple logging API to a separate library. It is now already used
by hastctl(8), hastd(8) and auditdistd(8) and will soon be also used
by casperd(8) and its services. There is no documentation and pjdlog.h
header file is not installed in /usr/include/ to keep it private.
Unfortunately we don't have /lib/private/ at this point, only
/usr/lib/private/, so the library is installed in /lib/.

Sponsored by:	The FreeBSD Foundation
2013-12-01 09:41:06 +00:00
Peter Wemm
17e27327de Revert r258672. We clearly don't compile libraries enough times. 2013-11-27 19:51:50 +00:00
Peter Wemm
ff678e6c81 At great personal risk, change the default for LIB32 from yes to no. As
mentioned in UPDATING, you can even do it as an as-needed operation after
doing a buildworld/installworld.  You can set WITH_LIB32=yes in make.conf
or src.conf.
2013-11-27 04:54:23 +00:00
Julio Merino
9e684a3a79 Generate plain sh test programs from a source file.
Instead of assuming that plain sh test programs exist in the source
tree in their final form and are marked as executable, generate them
from a list of sources.

By default, just assume that the source file for a program P is P.sh
but allow the caller to customize the inputs.  Similarly, also allow
the caller to apply sed(1) replacements on the output.  These will
both be useful in hooking existing test code from tools/regression/
into the test suite.

Approved by:	rpaulo (mentor)
2013-11-25 13:30:06 +00:00
Julio Merino
f67f6c4e3b Install plain.test.mk.
This was missed when this file was first imported.  Its atf.test.mk
counterpart is already being installed and these are necessary if we
want "make" within the source tree (not via "buildworld") to work.

Approved by:	rpaulo (mentor)
2013-11-25 13:28:40 +00:00
Simon J. Gerraty
3bd40bb188 Need to also test for defined(${v}_${PROG}) 2013-11-19 00:34:59 +00:00