ldconfig revision 115124
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 115124 2003-05-18 03:39:39Z mtm $ 578344Sobrien# 678344Sobrien 778344Sobrien# PROVIDE: ldconfig 8114278Smtm# REQUIRE: mountall mountcritremote 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) 23115124Smtm _ins= 2498184Sgordon ldconfig=${ldconfig_command} 25115124Smtm checkyesno ldconfig_insecure && _ins="-i" 2698184Sgordon if [ -x "${ldconfig_command}" ]; then 27103436Speter _LDC=/usr/lib 28103436Speter for i in ${ldconfig_paths}; do 29103436Speter if [ -d "${i}" ]; then 30103436Speter _LDC="${_LDC} ${i}" 31103436Speter fi 32103436Speter done 33103436Speter echo 'ELF ldconfig path:' ${_LDC} 34115124Smtm ${ldconfig} -elf ${_ins} ${_LDC} 3598184Sgordon 3698184Sgordon # Legacy aout support for i386 only 3798184Sgordon case `sysctl -n hw.machine_arch` in 3898184Sgordon i386) 3998184Sgordon # Default the a.out ldconfig path. 4098184Sgordon : ${ldconfig_paths_aout=${ldconfig_paths}} 4198184Sgordon _LDC=/usr/lib/aout 4298184Sgordon for i in ${ldconfig_paths_aout}; do 4398184Sgordon if [ -d "${i}" ]; then 4498184Sgordon _LDC="${_LDC} ${i}" 4598184Sgordon fi 4698184Sgordon done 4798184Sgordon echo 'a.out ldconfig path:' ${_LDC} 48115124Smtm ${ldconfig} -aout ${_ins} ${_LDC} 4998184Sgordon ;; 5098184Sgordon esac 5198184Sgordon fi 5298184Sgordon ;; 5398184Sgordon NetBSD) 5498184Sgordon if [ -f ${ldconfig_command} ]; then 5598184Sgordon echo "Creating a.out runtime link editor directory cache." 5698184Sgordon ${ldconfig_command} 5798184Sgordon fi 5898184Sgordon ;; 5998184Sgordon *) 6098184Sgordon ;; 6198184Sgordon esac 6278344Sobrien} 6378344Sobrien 6478344Sobrienload_rc_config $name 6578344Sobrienrun_rc_command "$1" 66