6aeefcde4b
with the rest of the options following it. This caused problems for people using ldconfig_insecure=yes because the '-i' switch was being positioned before the format argument. Approved by: markm/mentor (implicit), re/rwatson PR: 47430
66 lines
1.2 KiB
Bash
Executable File
66 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $NetBSD: ldconfig,v 1.5 2002/03/22 04:33:58 thorpej Exp $
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: ldconfig
|
|
# REQUIRE: mountall mountcritremote
|
|
# BEFORE: DAEMON
|
|
# KEYWORD: FreeBSD NetBSD
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="ldconfig"
|
|
ldconfig_command="/sbin/ldconfig"
|
|
start_cmd="ldconfig_start"
|
|
stop_cmd=":"
|
|
|
|
ldconfig_start()
|
|
{
|
|
case ${OSTYPE} in
|
|
FreeBSD)
|
|
_ins=
|
|
ldconfig=${ldconfig_command}
|
|
checkyesno ldconfig_insecure && _ins="-i"
|
|
if [ -x "${ldconfig_command}" ]; then
|
|
_LDC=/usr/lib
|
|
for i in ${ldconfig_paths}; do
|
|
if [ -d "${i}" ]; then
|
|
_LDC="${_LDC} ${i}"
|
|
fi
|
|
done
|
|
echo 'ELF ldconfig path:' ${_LDC}
|
|
${ldconfig} -elf ${_ins} ${_LDC}
|
|
|
|
# Legacy aout support for i386 only
|
|
case `sysctl -n hw.machine_arch` in
|
|
i386)
|
|
# Default the a.out ldconfig path.
|
|
: ${ldconfig_paths_aout=${ldconfig_paths}}
|
|
_LDC=/usr/lib/aout
|
|
for i in ${ldconfig_paths_aout}; do
|
|
if [ -d "${i}" ]; then
|
|
_LDC="${_LDC} ${i}"
|
|
fi
|
|
done
|
|
echo 'a.out ldconfig path:' ${_LDC}
|
|
${ldconfig} -aout ${_ins} ${_LDC}
|
|
;;
|
|
esac
|
|
fi
|
|
;;
|
|
NetBSD)
|
|
if [ -f ${ldconfig_command} ]; then
|
|
echo "Creating a.out runtime link editor directory cache."
|
|
${ldconfig_command}
|
|
fi
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|