libraries a little by not passing all of ${CFLAGS} to lint. Pass
only options matching -[DIU]*. The important -nostdinc option can't
be passed like I first thought because lint misinterprets as
"-n -o stdinc". The unimportant -B* option can't be passed because
lint doesn't support it. Otherwise, we pass the same options as
to mkdep, exept for a bug in the latter: -U* is not passed. All
this depends on option args not being separated from option flags
by a space.
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
to avoid polluting sys.mk. This directive controls the addition of
compiler warning flags to CFLAGS in a relatively compiler-neutral manner.
The idea is that WARNS can be set in Makefile.inc or in individual
Makefiles as they become clean, to prevent the introduction of new
warnings in the code. -Werror is added by default
${LIB} library". "standard" tends to imply the one that is normally
used... but by default it is not the case - the .so would be the
"standard" library. Therefore, change this to 'static'. Another option
might be "conventional ${LIB} library".
Specifically intended for removing -fschg ("INSTALLFLAGS_EDIT=:S/schg/uchg/")
this makes the NOFSCHG flag redundant. NOFSCHG will still be honoured by
bsd.lib.mk but is valid for buildworld only. NOFSCHG is still implemented in
the old way (ie. _not_ ".if NOFSCHG then { INSTALLFLAGS_EDIT+=:S/schg/,/ }"
to emphasize the fact that NOFSCHG is only supported in a limited
fashion and for buildworld.
The interface and implementation are such that future use of flags such
as sappnd can also be easily removed or altered (perhaps to uappnd).
This commit brought to you by the letters B, D, and E, and the numbers six,
one, thirteen, and three.
-DNOFSCHG disables installation of libs with flag schg
GAMEGRP change the group with which games are installed
also organize the binary section into alphebetical order some what..
/usr/sbin/sysctl -> ${DESTDIR}/sbin/sysctl in some versions of 2.2,
and this link was broken if DESTDIR was set.
Added a SYMLINKS macro. This works the same as LINKS, except it
creates symlinks and the linked-to pathname may be relative. This
is more flexible than LN_FLAGS, since it supports installing
symlinks independently of hard links.
Use `ln -f[s] ...' instead of `rm -f ...; ln [-s] ...' for LINKS and
SYMLINKS. This is equivalent if the target is neither a directory nor
a symlink to a directory.
PR: 8279
<bsd.libnames.mk> is included regardless of the object file format.
This is needed to fix the a.out PAM breakage that manifests itself
when trying to build login.
building dlopen-able modules, and add features needed to build a
static PAM library. I think I cleaned it up some, too, but beauty
is in the eye of the beholder.
You can now build a shared library without version numbers, by
defining SHLIB_NAME to something like "pam_unix.so". If SHLIB_MAJOR
and/or SHLIB_MINOR are set, SHLIB_NAME gets the usual default value,
but it can be overridden if desired. If none of these symbols are
set, no shared library is built.
SHLIB_LINK controls the name of the symbolic link that points to
the library. If it is unset, no link is made. In the usual case,
it gets the right default: e.g., "libc.so" for ELF, nothing for
a.out. This can be overridden.
STATICOBJS can be set to a list of extra object files that should
be added to the static library but not to the shared library.
These objects are added to the profiled library too.
These changes should make it easy to use <bsd.lib.mk> for building
things such as PAM modules and dynamic linkers, for which <bsd.prog.mk>
has been abused until now.
than ".so". The old extension conflicted with well-established
naming conventions for dynamically loadable modules.
The "clean" targets continue to remove ".so" files too, to deal with
old systems.
Alpha. This is a minor, but important distinction. Should be a no-op
to the install base. If OBJFORMAT is set elsewhere, things work
exactly as they did before.
when certain .mk files include other .mk files. This will remove the
need for multiple include protection in some other makefiles around the
tree (and helps some elf conditionals).
Notes:
- We no longer use -fgnu-runtime in bsd.lib.mk, since it is the default
and bsd.lib.mk is the wrong place to override it.
- Gnu C doesn't have a special compiler driver for Objective C like it
does for C++. The defaults are suitable for Gnu C. Use `OBJCLIBS='
in /etc/make.conf for POC.
- the two `_EXTRADEPEND::' targets potentially clobbered each other for
`make -jN'. In practice, the output for the second target sometimes
disappeared.
- bogus dependencies were generated for static libraries.
headers in ${SRCS}, as in bsd.lmod.mk and bsd.prog.mk. This helps
`make [-j]' work when .depend doesn't exist. Even plain `make'
sometimes only worked because of magic ordering in ${SRCS}.
(as in bsd.prog.mk). Include it if `checkdpadd' is being made, so that
it can be checked until it goes away.
Don't clean files that we don't create.
Fixed style of empty test.
.if in Makefiles. bsd.prog.mk and bsd.lib.mk do not depend on it however.
Allow overriding of the -soname arg when building the lib*crypt.so* libs
since libdescrypt.so and libscrupt.so both need a -soname of libcrypt.so
so that the symlink is obeyed at runtime rather than at compile time.
since 2.1.x make(1) apparently does not have the -m switch to set both
the the bsd.*.mk and sys.mk location, and this breaks 'make world' from a
2.1.x system.
note, using "-Wl,-f" to generate a library objects list doesn't work
anymore since the hack to ld hasn't been incorporated into binutils-2.8.
(and the -f switch is used for something else already)
This is disabled by default, don't panic! :-)
a couple *.mk files to enable -current world building on really old
machines (e.g., 2.1.5).
Reviewed by: too many many people to list here, special thanks to bde
(bsd.dep.mk) and compiling assembly language sources (bsd.lib.mk).
This doesn't change anything for our current source tree, but if you
want to use the -B switch in C*FLAGS to specify the location of
compiler subprograms, now you can do it.
Reviewed by: bde (implicitly)
libraries. Remove the now-unneeded CPLUSPLUSLIB hack. I will also
remove the CPLUSPLUSLIB definitions from the Makefiles that use it,
after the dust settles.
Use gcc's LIBRARY_PATH environment variable to handle DESTDIR,
instead of -L flags in LDDESTDIR. LIBRARY_PATH is documented in
the gcc info pages. It is better than using -L flags, because it
modifies the search for start-up files as well as for libraries.
A new variable LDDESTDIRENV is used to contain the normally-empty
LIBRARY_PATH environment setting.
LDDESTDIR is no longer set in <bsd.lib.mk>. It is still honored for
the time being, because a couple of userland Makefiles still (wrongly)
set it. These should be fixed, and LDDESTDIR should vanish.
Removed the commented-out "LDDESTDIR+=-nostdlib", because "gcc -shared"
doesn't link in any standard libraries anyway.
Removed the ".if defined(LDADD)" around the _EXTRADEPEND target for
shared libraries. This target is always necessary now, because
c++rt0.o is linked into every shared library.
Don't merge this into -2.2 without first merging the support for
"gcc -shared".
Fixed back to front -X and -x strip flags in .m.o and .m.po rules.
Fixed disordered .m.o and .m.po rules. What is .m?
Stripping probably should be removed. It makes problems in library
functions hard to debug...
almost perfect dependencies on crt0's and libraries. DPADD and
bsd.libnames.mk should go away soon. Use a new _EXTRADEPEND target
to implement this and to avoid editing of .depend when .depend isn;t
being rebuilt. The afterdepend target doesn't seem to be good for
anything and is now unused.
Fixed LDDESTDIR for the DESTDIR case when ${SHLIBDIR} != /usr/lib.
Added commented-out -nostdlib to LDDESTDIR for the DESTDIR case.
The wrong libraries may be used without this; however it breaks
linkage to crt0 and libc.