Commit Graph

212 Commits

Author SHA1 Message Date
thorpej 6dba3a7439 Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors.  This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.
2002-11-22 06:44:56 +00:00
thorpej 0d842ff28e Oops, AINC actually is still used; put it back. 2002-11-10 21:26:44 +00:00
thorpej ca760b0a32 The MIPS toolchain now defines __ABICALLS__ when abicalls are in use,
and the sources now use that define, so there is no need for us to define
ABICALLS.  Since that was the only use for the AINC variable, garbage-collect
it.
2002-11-10 18:15:29 +00:00
thorpej 5d2465f251 Now that the compiler does the right thing with -KPIC, we no longer
need to add it (or -fpic, for that matter) explicitly when building
shared libraries on MIPS.
2002-11-09 08:22:04 +00:00
perry 8885724457 Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.
2002-10-22 18:48:27 +00:00
thorpej 09a0767aa9 Only use the MKDYNAMICROOT semantics (i.e. -rpath=/lib,/usr/lib and
-dynamic-linker=/libexec/ld.elf_so) if the BINDIR of the program being
built is /bin or /sbin.

The reason we do this is because now all programs *except* those in
/bin and /sbin (i.e. the "special cases") match the default the compiler
uses, which is what is used for things in e.g. xsrc, pkgsrc, and other
random 3rd party programs.

This is done by decoupling where a shlib is installed from how it
is located.  Two new variables, SHLIBINSTALLDIR and SHLINKINSTALLDIR,
contain the former information, and key off MKDYNAMICROOT only.  SHLIBDIR
and SHLINKDIR contain the latter, and key off MKDYNAMICROOT and BINDIR.

The SHLIBINSTALLDIR, SHLIBDIR, _LIBSODIR, SHLINKINSTALLDIR, and
SHLINKDIR parameters are moved to a new <bsd.shlib.mk>; see bsd.README
for usage details.
2002-09-27 21:37:50 +00:00
thorpej 4c81eb7f69 If DESTDIR is set, add ${DESTDIR}/usr/libdata to the lint library
search path.  This works around the problem of lint using the
wrong lint libraries until a "lint -d ..." equivalent is implemented
for libraries.
2002-09-14 16:56:10 +00:00
yamt 4f420b3122 - add CSHLIBFLAGS.
- fix typos in comment.
2002-07-20 08:50:10 +00:00
fredette 9c5d82c38e Added a temporary workaround when building libraries for hppa:
link in libgcc to get the millicode routines.
2002-07-01 19:29:31 +00:00
eeh 25dfe267a1 Don't add -DBIGPIC to APICFLAGS. 2002-05-07 02:06:32 +00:00
eeh 90c1726789 Turn on 32-bit relocations for sparc64 PIC code. 2002-05-07 01:45:45 +00:00
lukem 82172c42f6 Implement NETBSDSRCDIR, which is the top level of the NetBSD source tree.
Defaults to the directory determined by the _SRC_TOP_ logic (if != ""),
and the BSDSRCDIR.

NETBSDSRCDIR has been provided for use by the various NetBSD source
Makefiles to find the top of the NetBSD source tree, and isn't
affected by the inheritance properties of _SRC_TOP_, nor does it
have the magic BSDOBJDIR baggage that BSDSRCDIR is stuck with.
2002-04-26 15:02:02 +00:00
lukem 0476c683f0 replace BSDSRCDIR with _SRC_TOP_, since the latter is more likely to
be "accurate".  document _SRC_TOP_.
2002-04-10 15:05:41 +00:00
lukem 328fa6b19f use ${VAR:D:U...} if we only want a value in the undefined case 2002-03-19 22:17:23 +00:00
lukem 1995e199a3 Change library installation.
Instead of:
	install -m 600 [...]
	ranlib -t [...]
	chmod 444 [...]
use the newly added "-a" flag to install(1) to invoke ranlib ifndef UPDATE.
Should prevent unnecessary ranlib-ing of installed libraries with UPDATE
defined.

Per discussion with simonb.
2002-03-19 14:39:22 +00:00
mycroft 09819b05ef Don't use .PHONY for targets that are actually installed. Instead use force
dependencies.  (Among other things, `make -t install' does something vaguely
sensible now.)
2002-02-11 21:14:58 +00:00
lukem 56640963f5 cosmetic tweak on an older comment 2001-12-28 01:40:50 +00:00
lukem efcc9a4c9d * Add user-controlled mk.conf variables
- SHLIBDIR	Location to install shared libraries if ${USE_SHLIBDIR}
			is "yes".  Defaults to "/usr/lib".

	- USE_SHLIBDIR	If "yes", install shared libraries in ${SHLIBDIR}
			instead of ${LIBDIR}.  Defaults to "no".
			Sets ${_LIBSODIR} to the appropriate value.
			This may be set by individual Makefiles as well.

	- SHLINKDIR	Location of shared linker.  Defaults to "/usr/libexec".
			If != "/usr/libexec", change the dynamic-linker
			encoded in shared programs

* Set USE_SHLIBDIR for libraries used by /bin and /sbin:
	libc libcrypt libcrypto libedit libipsec libkvm libm libmi387
	libtermcap libutil libz

* If ${_LIBSODIR} != ${LIBDIR}, add symlinks from ${LIBDIR}/${LIB}.so*
  to ${_LIBSODIR}/${LIB}.so* for compatibility.

* Always install /sbin/init statically (for now)


The net effect of these changes depends on how the variables are set:

  1.)	If nothing is set or changed, there is no change from the
	current behaviour:
		- Static /bin, /sbin, and bits of /usr/*
		- Dynamic rest
		- Shared linker is /usr/libexec/ld*so

  2.)	If the following make variables are set:
		LDSTATIC=
		SHLINKDIR=/lib
		SHLIBDIR=/lib
	Then the behaviour becomes:
		- Dynamic tools
		- .so libraries used by /bin and /sbin are installed to /lib,
		  with symlinks from /usr/lib/lib*so to -> /lib/lib*so
		  where appropriate
		- Shared linker is /lib/ld*so

  3.)	As per 2.), but add the following variable:
		USE_SHLIBDIR=yes
	This forces all .so's to be instaleld in /lib (with compat
	symlinks), not just those tagged by their Makefiles to be.
	Again, compat symlinks are installed
2001-12-28 01:32:37 +00:00
tv 4a1ad2db60 If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.
2001-11-28 04:38:29 +00:00
perry 6385e197e2 Now that install has been fixed to deal with -r in the symlink case,
make bsd.lib.mk use INSTALL_SYMLINK instead of mv and ln -s.
Note: There is still one weird case I left alone, in which symlinks
get built in the objdir. I didn't want to log metadata for those links
so I left the old machinery in for them.
XXX do we even need that elaborate dance for the ln's in the objdir?
2001-11-24 21:23:38 +00:00
thorpej 8bfeb9a270 Use a little transitional hack to determine if we use -isystem
or -idirafter.  Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.
2001-11-19 02:46:50 +00:00
tv 6699960dbf C/..$/.c/ -> C/\..$/.c/ 2001-11-14 23:06:26 +00:00
tv c8c3cf578b Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).
2001-11-14 21:49:53 +00:00
simonb 7d1f940ec6 Set installed library mode correctly in UNPRIVILEGED case. 2001-11-02 07:25:58 +00:00
tv 1129ed4afe Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments.  The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ.  Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.
2001-11-02 05:21:47 +00:00
nathanw 41ee0930b0 Don't explicitly set SHLIB_LDSTARTFILE and SHLIB_LDENDFILE for the
generic architecture case; this permits the later ELF clause to set
them properly for ELF platforms.

This will cause crtbeginS.o and crtendS.o to be included in shared
libraries built on all ELF platforms, not just alpha, mips, vax, and
sparc.
2001-10-25 19:32:15 +00:00
tv ccfbe64e81 Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.
2001-10-19 15:55:52 +00:00
tv b868449232 Since SHLIB_MAJOR may be set even in a MKPIC=no situation, make sure that
print-shlib-* targets only print stuff if MKPIC=yes.
2001-09-21 15:25:49 +00:00
tv e949020a8e If SHLIB_MAJOR is explicitly set in a Makefile, don't even look for a
shlib_version file.  (Part of a larger change which will also update
checkver to deal with this, and migrate old makefiles to include
SHLIB_MAJOR/SHLIB_MINOR.  For now, just add the hooks so that the old
gnu/lib toolchain libraries can use this as a workaround.)
2001-09-21 15:16:09 +00:00
tv d0f9e45413 Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").
2001-08-14 07:02:13 +00:00
mrg ef022c7570 redo the previous; allow SHLIB_LDSTARTFILE and SHLIB_LDENDFILE to be overridden. 2001-06-08 11:41:59 +00:00
mrg 6c81e0af9d set SHLIB_LDSTARTFILE and SHLIB_LDENDFILE based on ${LIBDIR} not hard coded
/usr/lib.
2001-06-07 15:28:55 +00:00
tv dd70bf30ad Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).
2001-06-01 17:49:32 +00:00
dmcmahill d425d2297d add support for building shared libs from fortran sources. Works correctly
with the default of 'f77' as the fortran compiler or using the 'f2c-f77'
script from pkgsrc (selected by overriding the FC variable)
2001-04-27 17:04:39 +00:00
mycroft 60e1ee6e37 This is *purely* anal-retentive, but: remove extra spaces in the generated
commands in the previous.
2000-12-05 22:18:30 +00:00
mycroft 4a6da470ba When handling ELF library symlinks, rather than removing and recreating the
symlink, instead create a temporary one ending in `.tmp' and `mv -f' it.
This way there is no window where libc isn't loadable (and thus
`make -j 100 install' works for libc).
2000-12-05 22:12:37 +00:00
gmcgarry 68e607a368 Remove executable permission from src/lib/checkver. 2000-08-09 23:41:24 +00:00
mrg 01875cae18 simplify previous. 2000-07-19 14:16:22 +00:00
eeh 04de183b83 Tell gas how to make PIC objects on sparc64. 2000-07-17 16:49:30 +00:00
christos 4c668e29d9 PR/10556: Veego: Shared library support was broken if shlib_version file
was not present.
2000-07-14 19:53:04 +00:00
matt 3b3ee7da25 Add NetBSD/vax ELF hook. 2000-07-06 16:48:48 +00:00
christos 921df2e6f1 add support for teeny dewey numbers; cleanup duplicated variables. 2000-07-03 21:08:55 +00:00
erh c2256d0630 For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries. 2000-06-25 05:07:22 +00:00
thorpej 78d67d6053 Add print-shlib-major and print-shlib-minor targets. 2000-06-19 19:35:05 +00:00
mycroft befa5650d3 Minor rearrangement. 2000-06-06 09:22:00 +00:00
matt b5db9f5e6e Implement my MKLINKLIB=yes fix a bit differently. Don't include ${OBJS}
in ${ALLOBJS} if MKLINKLIB=yes.  This allows Makefiles to continue to
modify ${OBJS}.
2000-05-03 15:15:50 +00:00
matt 1fef86f176 rework slightly so that when MKLINKLIB=no only the shared objects are built.
(building normal objects when they are never used really sucks on slow build
machines).
2000-05-03 03:44:12 +00:00
dmcmahill 7d8f383dc6 Change -fpic to -fPIC. Change was approved by mycroft. 2000-04-29 17:41:11 +00:00
simonb 1177aeba7c White space bogons (double spaces, spaces instead of tabs). 2000-04-24 14:22:05 +00:00
erh 6092e1aa2a Add NOPATH for all output files to prevent their presence in the search path from causing problems. 2000-02-19 05:36:23 +00:00