Commit Graph

286 Commits

Author SHA1 Message Date
joerg 5af38558ac Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.
2008-09-09 11:54:19 +00:00
christos 4b67625a5e fix debugging library build. 2008-08-13 16:36:15 +00:00
lukem 01ca4a276a Fix installed symlinks for LIBISMODULE=yes.
Further fixes to support for SHLIB_MAJOR set without SHLIB_MINOR.
2008-08-10 11:06:43 +00:00
lukem e24bdb26eb When building a .so, don't require the library to have a minor version.
Prevents a "stat: Too many levels of symlinks" build error.
2008-08-10 10:42:01 +00:00
lukem b88ccbbf16 Implement LIBISMODULE:
If not "no", install as ${LIB}.so (without the "lib" prefix),
	and act as "MKDEBUGLIB=no MKLINT=no MKPICINSTALL=no
	MKPROFILE=no MKSTATICLIB=no".
	Default: no
2008-08-10 09:25:04 +00:00
lukem 66176dfdff Rename MKPRIVATELIB to LIBISPRIVATE, to make it clearer that this is
a variable that is used by in-tree Makefiles to control behaviour.
(MKsomevar variables are generally intended to be controlled by the end-user)
2008-05-03 14:48:30 +00:00
lukem b552ef70c2 Provide a "lint" target that will lint all the sources, even if MKLINT=no.
(MKLINT=no still prevents installation of the lint libraries).
Explictly disable some library variations if MKPRIVATELIB=yes.
2008-05-03 14:36:06 +00:00
lukem d77bf7654f Explicitly set MKLINT=no if MKLINKLIB==no, rather than just acting that way. 2008-05-02 11:45:19 +00:00
simonb 71a4269193 Use -nodefaultlibs instead of -nostdlib when linking libc and libgcc*
so that we still link in the crt* start/end files.
Explicitly link libc against gcc_pic, since -nodefaultlibs undoes this.

Fixes problems where shared libraries don't get init/fini sections,
most easily noticable with pthreads programs not working.

Approved by: skrll
Thanks: bjs, mrg, icb peanut gallery.
2008-04-29 07:48:31 +00:00
christos a9587bb896 now that gcc adds -lc, reverse the logic and explain. 2008-04-27 23:48:10 +00:00
christos f369b6c6cb Exempt gcc libraries from linking against libc. 2008-04-26 22:28:13 +00:00
christos fe6aa33a8e deal with modules that don't define lib. 2008-04-26 21:26:03 +00:00
christos 9d8a22cf84 make all shared libraries depend on libc. 2008-04-26 20:03:44 +00:00
simonb d8de5b102b Remove support for NetBSD/pc532. 2008-01-09 11:25:58 +00:00
christos 9ba5d03c10 Enable text relocation warnings. 2007-09-15 14:36:14 +00:00
tsutsui ca549fcb8e CPPICFLAGS -> CPPPICFLAGS (in comments) 2007-03-18 09:08:45 +00:00
martin 6a3c1d7aeb When checking wether we are debugging, look for -g in ${CFLAGS} instead
of ${COPTS}. The latter explicitly includes the former and ${DBG}, where
the -g most likely is hidden.
2006-11-23 12:05:26 +00:00
dbj 758985809b pay attention to MKUPDATE instead of UPDATE when installing libs 2006-09-18 05:15:35 +00:00
lukem 8b3ce8625c Rename MKDEBUG to MKDEBUGLIB. 2006-07-22 05:29:03 +00:00
mrg 1ed40e7c8b add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>. 2006-05-11 23:47:34 +00:00
christos 1c364e3284 Add MKDEBUG and the ability to build debugging versions of the libraries. 2006-04-09 01:52:06 +00:00
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