freebsd-nq/etc/rc.d/ldconfig
Peter Wemm 66422f5b7a Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00

65 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
# 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)
ldconfig=${ldconfig_command}
checkyesno ldconfig_insecure && ldconfig="${ldconfig} -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 ${_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 ${_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"