2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $NetBSD: ldconfig,v 1.5 2002/03/22 04:33:58 thorpej Exp $
|
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: ldconfig
|
|
|
|
# REQUIRE: mountall
|
2002-06-13 22:14:37 +00:00
|
|
|
# BEFORE: DAEMON
|
|
|
|
# KEYWORD: FreeBSD NetBSD
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="ldconfig"
|
2002-06-13 22:14:37 +00:00
|
|
|
ldconfig_command="/sbin/ldconfig"
|
2001-06-16 07:16:14 +00:00
|
|
|
start_cmd="ldconfig_start"
|
|
|
|
stop_cmd=":"
|
|
|
|
|
|
|
|
ldconfig_start()
|
|
|
|
{
|
2002-06-13 22:14:37 +00:00
|
|
|
case `${CMD_OSTYPE}` in
|
|
|
|
FreeBSD)
|
|
|
|
ldconfig=${ldconfig_command}
|
|
|
|
checkyesno ldconfig_insecure && ldconfig="${ldconfig} -i"
|
|
|
|
if [ -x "${ldconfig_command}" ]; then
|
|
|
|
case `/usr/bin/objformat` in
|
|
|
|
elf)
|
|
|
|
_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 ${_LDC}
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# 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 ${_LDC}
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
NetBSD)
|
|
|
|
if [ -f ${ldconfig_command} ]; then
|
|
|
|
echo "Creating a.out runtime link editor directory cache."
|
|
|
|
${ldconfig_command}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
2001-06-16 07:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|