13 desc="Configure the shared library cache"
14 ldconfig_command="/sbin/ldconfig"
15 start_cmd="ldconfig_start"
23 ldconfig=${ldconfig_command}
24 checkyesno ldconfig_insecure && _ins="-i"
25 if [ -x "${ldconfig_command}" ]; then
27 for i in ${ldconfig_local_dirs}; do
28 if [ -d "${i}" ]; then
29 _files=`find ${i} -type f`
30 if [ -n "${_files}" ]; then
31 ldconfig_paths="${ldconfig_paths} `cat ${_files} | sort -u`"
35 for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
36 if [ -r "${i}" ]; then
40 check_startmsgs && echo 'ELF ldconfig path:' ${_LDC}
41 ${ldconfig} -elf ${_ins} ${_LDC}
43 machine_arch=$(sysctl -n hw.machine_arch)
45 case ${machine_arch} in
46 amd64|mips64|powerpc64)
47 for i in ${ldconfig_local32_dirs}; do
48 if [ -d "${i}" ]; then
49 _files=`find ${i} -type f`
50 if [ -n "${_files}" ]; then
51 ldconfig32_paths="${ldconfig32_paths} `cat ${_files} | sort -u`"
56 for i in ${ldconfig32_paths}; do
57 if [ -r "${i}" ]; then
62 echo '32-bit compatibility ldconfig path:' ${_LDC}
63 ${ldconfig} -32 ${_ins} ${_LDC}
67 case ${machine_arch} in
69 for i in ${ldconfig_localsoft_dirs}; do
70 if [ -d "${i}" ]; then
71 _files=`find ${i} -type f`
72 if [ -n "${_files}" ]; then
73 ldconfigsoft_paths="${ldconfigsoft_paths} `cat ${_files} | sort -u`"
78 for i in ${ldconfigsoft_paths}; do
79 if [ -r "${i}" ]; then
84 echo 'Soft Float compatibility ldconfig path:' ${_LDC}
85 ${ldconfig} -soft ${_ins} ${_LDC}
89 # Legacy aout support for i386 only
90 case ${machine_arch} in
92 # Default the a.out ldconfig path.
93 : ${ldconfig_paths_aout=${ldconfig_paths}}
95 for i in /usr/lib/aout ${ldconfig_paths_aout} /etc/ld.so.conf; do
96 if [ -r "${i}" ]; then
100 check_startmsgs && echo 'a.out ldconfig path:' ${_LDC}
101 ${ldconfig} -aout ${_ins} ${_LDC}