2001-12-28 05:44:22 +00:00
|
|
|
# $NetBSD: Makefile,v 1.43 2001/12/28 05:44:22 lukem Exp $
|
1996-12-16 20:37:55 +00:00
|
|
|
|
1998-02-23 10:09:31 +00:00
|
|
|
.include <bsd.own.mk> # for OBJECT_FMT definition
|
|
|
|
|
1999-03-05 11:57:54 +00:00
|
|
|
ARCHSUBDIR= ${MACHINE_ARCH:C/mipse[bl]/mips/}
|
|
|
|
M= ${.CURDIR}/arch/${ARCHSUBDIR}
|
1999-03-03 12:00:18 +00:00
|
|
|
|
1999-05-07 22:04:27 +00:00
|
|
|
.if ((${MACHINE_ARCH} == "alpha") || \
|
2001-07-15 03:09:22 +00:00
|
|
|
(${MACHINE_ARCH} == "arm") || \
|
1999-05-07 22:04:27 +00:00
|
|
|
(${MACHINE_ARCH} == "i386") || \
|
|
|
|
(${MACHINE_ARCH} == "m68k") || \
|
|
|
|
(${MACHINE_ARCH} == "mipsel") || (${MACHINE_ARCH} == "mipseb") || \
|
|
|
|
(${MACHINE_ARCH} == "powerpc") || \
|
|
|
|
(${MACHINE_ARCH} == "sparc") || \
|
2000-07-03 03:30:52 +00:00
|
|
|
(${MACHINE_ARCH} == "sparc64") || \
|
2001-06-19 01:11:03 +00:00
|
|
|
(${MACHINE_ARCH} == "x86_64") || \
|
2000-07-03 03:30:52 +00:00
|
|
|
(${MACHINE_ARCH} == "vax")) && \
|
1999-05-07 22:04:27 +00:00
|
|
|
${OBJECT_FMT} == "ELF" && ${MKPIC} != "no"
|
|
|
|
|
|
|
|
PROG= ld.elf_so
|
|
|
|
|
1997-10-22 05:45:08 +00:00
|
|
|
# Adds SRCS, CPPFLAGS, LDFLAGS, etc. Must go first so MD startup source
|
1996-12-16 20:37:55 +00:00
|
|
|
# is first.
|
1999-03-03 12:00:18 +00:00
|
|
|
.if exists($M/Makefile.inc)
|
|
|
|
.include "$M/Makefile.inc"
|
1997-04-10 17:39:20 +00:00
|
|
|
.endif
|
1996-12-16 20:37:55 +00:00
|
|
|
|
|
|
|
SRCS+= rtld.c reloc.c symbol.c malloc.c xmalloc.c xprintf.c debug.c \
|
|
|
|
map_object.c load.c search.c headers.c paths.c
|
2001-12-14 22:21:45 +00:00
|
|
|
|
* 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
|
|
|
BINDIR=${SHLINKDIR}
|
|
|
|
|
2001-12-14 22:21:45 +00:00
|
|
|
CPPFLAGS+= -DLIBDIR=\"${LIBDIR}\" -D_PATH_RTLD=\"${BINDIR}/${PROG}\"
|
1999-02-24 18:31:00 +00:00
|
|
|
CPPFLAGS+= -I${.CURDIR}
|
1997-10-22 05:45:08 +00:00
|
|
|
CPPFLAGS+= -DDEBUG -DRTLD_LOADER
|
1999-07-05 17:55:34 +00:00
|
|
|
CPPFLAGS+= -D_RTLD_SOURCE
|
2000-07-14 22:01:09 +00:00
|
|
|
#CPPFLAGS+= -DRTLD_DEBUG
|
|
|
|
#CPPFLAGS+= -DRTLD_DEBUG_RELOC
|
2000-11-10 21:31:30 +00:00
|
|
|
#DBG= -g
|
1996-12-16 20:37:55 +00:00
|
|
|
|
2001-12-28 05:44:22 +00:00
|
|
|
.if ${SHLIBDIR} != ${LIBDIR}
|
|
|
|
CPPFLAGS+= -DRTLD_DEFAULT_LIBRARY_PATH=\"${SHLIBDIR}:${LIBDIR}\"
|
|
|
|
.endif
|
|
|
|
|
* 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
|
|
|
LDADD+= -non_shared -L${DESTDIR}${LIBDIR} -lc_pic
|
1997-03-24 22:15:37 +00:00
|
|
|
DPADD+= ${LIBC_PIC}
|
1996-12-16 20:37:55 +00:00
|
|
|
|
1997-04-17 22:17:27 +00:00
|
|
|
STRIPFLAG=
|
1996-12-16 20:37:55 +00:00
|
|
|
|
1999-03-03 12:00:18 +00:00
|
|
|
.PATH: $M
|
1996-12-16 20:37:55 +00:00
|
|
|
|
2001-01-14 09:39:26 +00:00
|
|
|
${PROG}: ${OBJS} ${DPADD}
|
1996-12-16 20:37:55 +00:00
|
|
|
${LD} ${LDFLAGS} -o ${PROG} ${OBJS} ${LDADD}
|
2001-01-14 09:16:47 +00:00
|
|
|
|
1997-06-23 04:51:16 +00:00
|
|
|
.endif
|
|
|
|
|
2001-12-28 05:30:24 +00:00
|
|
|
.if ${SHLINKDIR} != "/usr/libexec"
|
|
|
|
SYMLINKS+= ${SHLINKDIR}/${PROG} /usr/libexec/${PROG}
|
|
|
|
.endif
|
|
|
|
|
1996-12-16 20:37:55 +00:00
|
|
|
.include <bsd.prog.mk>
|