1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-17 15:27:36 +00:00

Add a mechanism to include files added by ports which contain

the names of directories to include in the base ldconfig script.
This will eliminate the need for each port to install its own
boot script which does nothing but ldocnfig a given directory.

This code was developed by flz (ports committer), discussed on
freebsd-rc@, and modified slightly by me.

Submitted by:	flz
Reviewed by:	brooks
This commit is contained in:
Doug Barton 2006-01-08 10:15:31 +00:00
parent 1775714935
commit dfdae5534f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154114
6 changed files with 48 additions and 1 deletions

View File

@ -498,6 +498,11 @@ ldconfig_paths="/usr/lib/compat /usr/X11R6/lib /usr/local/lib /usr/local/lib/com
# shared library search paths
ldconfig_paths_aout="/usr/lib/compat/aout /usr/X11R6/lib/aout /usr/local/lib/aout"
# a.out shared library search paths
ldconfig_local_dirs="/usr/local/libdata/ldconfig /usr/X11R6/libdata/ldconfig"
# Local directories with ldconfig configuration files.
ldconfig_local32_dirs="/usr/local/libdata/ldconfig32 /usr/X11R6/libdata/ldconfig32"
# Local directories with 32-bit compatibility ldconfig
# configuration files.
kern_securelevel_enable="NO" # kernel security level (see init(8)),
kern_securelevel="-1" # range: -1..3 ; `-1' is the most insecure
# Note that setting securelevel to 0 will result

View File

@ -20,6 +20,10 @@
lib
..
libdata
ldconfig
..
ldconfig32
..
pkgconfig
..
..

View File

@ -192,6 +192,10 @@
..
..
libdata
ldconfig
..
ldconfig32
..
..
libexec
..

View File

@ -22,6 +22,11 @@ ldconfig_start()
checkyesno ldconfig_insecure && _ins="-i"
if [ -x "${ldconfig_command}" ]; then
_LDC="/lib /usr/lib"
for i in ${ldconfig_local_dirs}; do
if [ -d "${i}" ]; then
ldconfig_paths="${ldconfig_paths} `find ${i} -type f`"
fi
done
for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
if [ -r "${i}" ]; then
_LDC="${_LDC} ${i}"
@ -30,6 +35,18 @@ ldconfig_start()
echo 'ELF ldconfig path:' ${_LDC}
${ldconfig} -elf ${_ins} ${_LDC}
case `sysctl -n hw.machine_arch` in
amd64)
for i in ${ldconfig_local32_dirs}; do
if [ -d "${i}" ]; then
ldconfig32_paths="${ldconfig32_paths} `find ${i} -type f`"
fi
done
echo '32-bit compatibility ldconfig path:' ${ldconfig32_paths}
${ldconfig} -32 -m ${_ins} ${ldconfig32_paths}
;;
esac
# Legacy aout support for i386 only
case `sysctl -n hw.machine_arch` in
i386)

View File

@ -2830,6 +2830,23 @@ which are writable by anyone except root.
Set this variable to
.Dq Li YES
to disable that security check during system startup.
.It Va ldconfig_local_dirs
.Pq Vt str
Set to the list of local
.Xr ldconfig 8
directories.
The names of all files in the directories listed will be
passed as arguments to
.Xr ldconfig 8 .
.It Va ldconfig_local32_dirs
.Pq Vt str
Set to the list of local 32-bit compatibility
.Xr ldconfig 8
directories.
The names of all files in the directories listed will be
passed as arguments to
.Xr ldconfig 8
.Fl 32 .
.It Va kern_securelevel_enable
.Pq Vt bool
Set to

View File

@ -57,7 +57,7 @@
* is created, otherwise 1.
*/
#undef __FreeBSD_version
#define __FreeBSD_version 700011 /* Master, propagated to newvers */
#define __FreeBSD_version 700012 /* Master, propagated to newvers */
#ifndef LOCORE
#include <sys/types.h>