Commit Graph

265 Commits

Author SHA1 Message Date
christos 45cfed2d83 make symlink types consistent. 2006-03-30 19:49:02 +00:00
jwise 8bc0f5da0f Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).
2006-03-16 18:43:34 +00:00
dsl 286b8b3f54 Use ${OBJCOPY} -[xX] ${.TARGET} instead of getting the file written to
${.TARGET}.tmp and running ${LD} -[xX] ...
I don't believe there are any architectures where objcopy can't delete local
symbols.
2006-01-28 11:10:18 +00:00
christos 7f5f767e82 Compile all profiling sources with -DPROF -DGPROF, not just assembly sources. 2006-01-08 01:23:51 +00:00
lukem 156714223a Also use relative symlinks for the /usr/lib/lib${LIB}.so.${SHLIB_FULLVERSION}
symlink to ../../lib/... because runtime lookups on the former aren't
speed critical either.
2005-05-10 14:54:02 +00:00
lukem b2536b11a5 Restore rev 1.247:
Use relative symlinks for /usr/lib/libfoo.so -> /lib/libfoo.so.M.N
This should work now that "install -l r -d destdir" works if destdir
contains a symlink.
2005-05-10 02:01:06 +00:00
lukem 1227550528 Revert previous (1.258): we don't want to link .so libraries against
(non-PIC) .a libraries, and the problem which triggered the addition
of the previous has been fixed by providing librpcsvc as a .so.
2005-01-10 02:42:34 +00:00
lukem e0f9049e4d When setting DPADD based on LIBDPLIBS, only add the .so if it exists
and fallback to the .a instead.  This allows the use of libraries
which are .so only, have both .so & .a, and are .a only.
2004-12-29 14:41:05 +00:00
simonb 0f9fca4682 Add COPTS to AFLAGS so assembly files pick up flags like -msoft-float. 2004-12-02 00:00:41 +00:00
lukem 600b0d8d67 Implement LIBDPLIBS, which is a list of the tuples:
libname  path-to-srcdir-of-libname

For each tuple;
     *	LIBDO.libname contains the .OBJDIR of the library `libname', and
	if it is not set it is determined from the srcdir and added to
	MAKEOVERRIDES (the latter is to allow for build time optimization).
     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
     *	DPADD gets  ${LIBDO.libname}/liblibname.so  added.
2004-08-04 08:00:27 +00:00
thorpej 52aef894d6 Assign STOBJS the value of OBJS, and use that when referring to static
library objects, rather than using OBJS to refer to them.  This gives us
a separate variable to refer to static library objects that does not affect
profile library objects (which has POBJS) or shared library objects (which
has SOBJS).
2004-07-29 03:14:04 +00:00
lukem 4fbb0461b9 Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253 2004-06-10 00:29:58 +00:00
christos d3b5333e6b PR/25887: Peter Bex: Missing yacc dependency in bsd Make system 2004-06-09 22:45:24 +00:00
lukem 2308454342 * Add MKPRIVATELIB; if not "no", act as "MKPROFILE=no MKPIC=no MKLINT=no"
and don't install the (.a) library.
  This is useful for "build only" helper libraries.
* Add some  #{  [...]  #}  comments around large conditional statements.
2004-05-23 01:45:21 +00:00
lukem 180444c2a0 Rework .s.{o,po,so} and .S.{o,po,so} to be more like the <bsd.sys.mk> rules:
- support ${COPTS.<fn>} ${CPUFLAGS.<fn>} ${CPPFLAGS.<fn>}
  (deficiency noted by Tyler Retzlaff <rtr@NetBSD.org>)
- use ${COMPILE.s} for .s.o .s.po .s.so (instead of ${COMPILE.S})
- don't support AINC anymore; append to AFLAGS instead

Remove .c.ln - it was a duplicate of the rule in <bsd.sys.mk>
2004-04-18 13:11:31 +00:00
skrll e6fbf37618 hppa can uses the standard flags so remove the unnecessary special case. 2004-02-23 21:12:13 +00:00
skrll b263dbdd73 Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

        - creates libgcc, libgcc_eh and libgcc_s

        - updates LIBGCC_SPEC to use them appropriately.

          There's a hack in here at the moment with respect to libgcc_so in that it
          is preferable to link against libgcc_so will only when -shared-libgcc is
          specified (the c++ frontend does this automatically.) Configurations where
          LINK_EH_SPEC is defined already do this. The gcc configuration for
          NetBSD/alpha and another NetBSD platform (I forget which) actually define
          LINK_EH_SPEC probably by accident rather than design.

        - updates share/mk to use the compiler's knowledge of what needs linking into
          libraries and executables. This removes an hppa hack.

        - updates the sets for the newly created libgcc* files.

	- support for linking against the _pg version of libgcc has been removed.
2004-02-15 19:52:27 +00:00
lukem 68edea2915 Revert previous; install -l r doesn't appear to work correctly when
DESTDIR is a symlink.
(Yet another reason why "-l r" looks good on paper but sucks in practice).
2004-02-09 06:35:18 +00:00
lukem eee88ffea0 Convert the /usr/lib/libfoo.so -> /lib/libfoo.so.M.N link into a relative link.
This simplifies using ld with ${DESTDIR}/usr/lib whilst retaining the
(slightly faster) absolute links for the run-time libraries.
Per discussion on tech-toolchain.

(Side note;  install(1) -l r  needs the source to be prefixed with ${DESTDIR}
to operate correctly, which makes it non trivial to enable '-l r' by default
for all ${INSTALL_SYMLINK}s)
2004-02-06 12:34:11 +00:00
lukem 84a4748659 Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.
2004-01-29 01:48:45 +00:00
lukem af85ccad70 Replace
:M-[IDU]*
with
	:C/-([IDU])[  ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)
2004-01-27 03:31:48 +00:00
skrll 6d86e95627 Correct a comment 2004-01-07 15:27:08 +00:00
rtr 57bab08096 Need to provide alternate definitions of __archive{build,install} for x11.
approved by lukem
2003-12-23 10:30:02 +00:00
simonb 0921f67df2 No shared libraries on ns32k at the moment - set *PICFLAGS to nothing. 2003-12-07 12:56:45 +00:00
matt 9e7bfda285 Use ${HOST_LN}
Fix how hppa gets to -lgcc_pic
2003-11-13 05:56:30 +00:00
dsl 433a97cc58 Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend.  I don't think .afterdepend is used anywhere any more.
2003-11-11 11:43:45 +00:00
lukem 7f41288379 use ${HOST_SH} instead of sh 2003-10-26 03:29:44 +00:00
lukem 130ab7336b Rework how MAKEVERBOSE operates:
*	Don't bother prefixing commands with a line of  ${_MKCMD}\
	and instead rely upon "make -s".  This is less intrusive on
	all the Makefiles than the former.  Idea from David Laight.

    *	Rename the variables use to print messages.  The scheme now is:
	    _MKMSG_FOO		Run  _MKMSG 'foo'
	    _MKTARGET_FOO	Run  _MKMSG_FOO ${.TARGET}
	From discussion with Alistair Crooks.
2003-10-21 10:01:19 +00:00
lukem 4ccb31e74a Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} "  ...  {$.TARGET}"  and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO
2003-10-19 03:00:55 +00:00
lukem 03b6213598 Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
    0	Minimal output ("quiet")
    1	Describe what is occurring
    2	Describe what is occurring and echo the actual command ("verbose")
	This is the default, and is equivalent to the previous behaviour.
2003-10-18 15:33:59 +00:00
lukem 58d2d9a196 Set _LIBLDOPTS to set -Wl,-rpath-link -R -L appropriately based
on the setting of ${SHLIBDIR} and ${SHLIBINSTALLDIR} (_not_ ${_LIBSODIR}).

Fixes cruel and unusual ^W^W^W obscure native-build and not-so-obscure
cross-builds problems I was having with shared libraries with a
non-base LIBDIR (e.g, /usr/X11R6/lib) that use LDADD to pull in other
libraries from /usr/lib (such as libm) which are really in /lib and the
symlink from ${DESTDIR}/usr/lib/libm.so to /lib/libm.so.N.M was confusing
the linker.  Stuffing -rpath-link ${DESTDIR}/lib in solves the problem.

This should mean that shared libraries that depend upon other shared
libraries in other directories should DTRT in a DESTDIR (cross-)build...

Inspired by _PROGLDOPTS in <bsd.prog.mk>
2003-09-30 07:24:23 +00:00
lukem 403d124c72 implement MKSTATICLIB, which defaults to "yes". if "no" (which NOSTATICLIB
also sets, a la the other variables), prevents build and installation
of the "normal" static *.a libraries.
2003-09-13 19:08:26 +00:00
erh 552531a249 Also support per-program LDFLAGS and LDSTATIC. 2003-09-13 03:44:20 +00:00
erh 056a75c41e Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.
2003-09-13 02:52:05 +00:00
lukem 40a8a5734e Support ${LDFLAGS} when linking libraries 2003-08-24 09:35:49 +00:00
lukem a93ea220fc Rework how dependency generation is performed:
* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
  This is a change of behaviour.  If a Makefile wants the clean semantics
  it must specifically append to CLEANFILES.
  Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
  that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d  depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
2003-08-01 17:03:41 +00:00
lukem 5aab21f43a be consistent when adding *.y and *.l to DPSRCS 2003-07-28 23:54:24 +00:00
lukem e71812aa94 Overhaul how the .{c,cc,cpp,cxx,C,f,m.S}.{o,po,so} rules are implemented:
only list the (often complicated) ${COMPILE.*} rules once always building
to ${.TARGET}.tmp.  Then, depending on whether *OPTS has -g, either
"mv ${.TARGET}.tmp ${.TARGET}" or "${LD} -[xX] -r ${TARGET}.tmp -o ${.TARGET}"
as appropriate.
This can prevent inconsistency that could occur between "echo ${COMPILE.*:Q}"
and "${COMPILE.*}", such as the problem in rev 1.226.  (There were still
examples of this in .cc.so and .m.so !!!)

Remove `@' from most non-echo rules, so that we can actually see what's
happening.  This helps debugging problems, such as that fixed by rev 1.226.

Always remove all possible temp files that might occur because of the above.

Be consistent about ${CC} instead of $(CC)
2003-07-28 04:08:47 +00:00
lukem 719829bd45 Pull in <bsd.sys.mk> before supplying our own .c.o (et al) rules.
Otherwise, <bsd.sys.mk>'s implementations will be used instead.  (oops!)
2003-07-28 02:29:35 +00:00
lukem 7a4d405e11 fix typo (insert botch? :) in previous, which broke .cxx.po 2003-07-28 00:51:47 +00:00
mrg 96d9a01177 introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes.  for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)
2003-07-27 14:49:22 +00:00
lukem 29c0479a2a Add source-file-specific variables in <bsd.lib.mk> and <bsd.prog.mk>:
COPTS.<fn>	Additional flags to the compiler when creating the C objects
		for <fn>.

CPUFLAGS.<fn>	Additional flags to the compiler/assembler for <fn>.

CPPFLAGS.<fn>	Additional flags to the C pre-processor for <fn>.


(For <fn>.[ly], "<fn>.c" must be used.)
2003-07-22 06:53:21 +00:00
lukem b6bdfc6774 Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246
2003-07-20 17:01:58 +00:00
lukem 87610a53a9 whitespace cleanup 2003-07-18 04:04:03 +00:00
drochner a915fb6b1e Use ${CC} instead of ${LD} to build shared objects.
(g)cc has all the knowledge which startfiles/libgcc to
use, so we don't need to duplicate all that here.

Externally visible change:
Shared objects are linked against libgcc_pic.a now
(if the in-tree gcc2 is used). This fixes problems with
dlopen()'ed objects referencing libgcc functions not used
(thus not linked in) by the main program.
2003-06-27 17:27:11 +00:00
msaitoh 535480c5be catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX 2003-06-11 04:56:58 +00:00
thorpej 000836e000 If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a.  Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.
2003-05-31 20:33:15 +00:00
wiz 43075c01c6 Use && instead of ; to only overwrite a file if the corresponding sed worked (from christos).
Add .cpp rules.
2003-05-27 19:32:18 +00:00
wiz 135b433e9c s/${ECHO}/@echo/, since we don't define ECHO in share/mk. 2003-05-26 12:38:59 +00:00
christos 2b009f6aa8 fix lossage caused by previous commit. 2003-04-22 12:55:26 +00:00