ldconfig revision 103019
178344Sobrien#!/bin/sh 278344Sobrien# 398184Sgordon# $NetBSD: ldconfig,v 1.5 2002/03/22 04:33:58 thorpej Exp $ 498184Sgordon# $FreeBSD: head/etc/rc.d/ldconfig 103019 2002-09-06 16:18:05Z gordon $ 578344Sobrien# 678344Sobrien 778344Sobrien# PROVIDE: ldconfig 878344Sobrien# REQUIRE: mountall 998184Sgordon# BEFORE: DAEMON 1098184Sgordon# KEYWORD: FreeBSD NetBSD 1178344Sobrien 1278344Sobrien. /etc/rc.subr 1378344Sobrien 1478344Sobrienname="ldconfig" 1598184Sgordonldconfig_command="/sbin/ldconfig" 1678344Sobrienstart_cmd="ldconfig_start" 1778344Sobrienstop_cmd=":" 1878344Sobrien 1978344Sobrienldconfig_start() 2078344Sobrien{ 21103019Sgordon case ${OSTYPE} in 2298184Sgordon FreeBSD) 2398184Sgordon ldconfig=${ldconfig_command} 2498184Sgordon checkyesno ldconfig_insecure && ldconfig="${ldconfig} -i" 2598184Sgordon if [ -x "${ldconfig_command}" ]; then 2698184Sgordon case `/usr/bin/objformat` in 2798184Sgordon elf) 2898184Sgordon _LDC=/usr/lib 2998184Sgordon for i in ${ldconfig_paths}; do 3098184Sgordon if [ -d "${i}" ]; then 3198184Sgordon _LDC="${_LDC} ${i}" 3298184Sgordon fi 3398184Sgordon done 3498184Sgordon echo 'ELF ldconfig path:' ${_LDC} 3598184Sgordon ${ldconfig} -elf ${_LDC} 3698184Sgordon ;; 3798184Sgordon esac 3898184Sgordon 3998184Sgordon # Legacy aout support for i386 only 4098184Sgordon case `sysctl -n hw.machine_arch` in 4198184Sgordon i386) 4298184Sgordon # Default the a.out ldconfig path. 4398184Sgordon : ${ldconfig_paths_aout=${ldconfig_paths}} 4498184Sgordon _LDC=/usr/lib/aout 4598184Sgordon for i in ${ldconfig_paths_aout}; do 4698184Sgordon if [ -d "${i}" ]; then 4798184Sgordon _LDC="${_LDC} ${i}" 4898184Sgordon fi 4998184Sgordon done 5098184Sgordon echo 'a.out ldconfig path:' ${_LDC} 5198184Sgordon ${ldconfig} -aout ${_LDC} 5298184Sgordon ;; 5398184Sgordon esac 5498184Sgordon fi 5598184Sgordon ;; 5698184Sgordon NetBSD) 5798184Sgordon if [ -f ${ldconfig_command} ]; then 5898184Sgordon echo "Creating a.out runtime link editor directory cache." 5998184Sgordon ${ldconfig_command} 6098184Sgordon fi 6198184Sgordon ;; 6298184Sgordon *) 6398184Sgordon ;; 6498184Sgordon esac 6578344Sobrien} 6678344Sobrien 6778344Sobrienload_rc_config $name 6878344Sobrienrun_rc_command "$1" 69