diff options
author | gordon <gordon@FreeBSD.org> | 2002-06-13 22:14:37 +0000 |
---|---|---|
committer | gordon <gordon@FreeBSD.org> | 2002-06-13 22:14:37 +0000 |
commit | 9c5433cb225f7a4e56e87623ea2e4011179553a5 (patch) | |
tree | 3168589e209abd888b033397e3c46dee6131a116 /etc/rc.d/ldconfig | |
parent | 50d99cdfecd92f5323a18aa791a5b1cb9d8b7191 (diff) | |
download | FreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.zip FreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.tar.gz |
Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next.
Submitted by: Mike Makonnen <makonnen@pacbell.net>
Reviewed by: silence on -current and -hackers
Prodded by: rwatson
Diffstat (limited to 'etc/rc.d/ldconfig')
-rwxr-xr-x | etc/rc.d/ldconfig | 54 |
1 files changed, 49 insertions, 5 deletions
diff --git a/etc/rc.d/ldconfig b/etc/rc.d/ldconfig index 73cbba5..97cd38b 100755 --- a/etc/rc.d/ldconfig +++ b/etc/rc.d/ldconfig @@ -1,23 +1,67 @@ #!/bin/sh # -# $NetBSD: ldconfig,v 1.2 2000/05/13 08:45:07 lukem Exp $ +# $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() { - if [ -f /sbin/ldconfig ]; then - echo "Creating a.out runtime link editor directory cache." - ldconfig - fi + 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 } load_rc_config $name |