?? makeshlib
字號:
#!/bin/sh## makeshlib - installs a shareable libresolv_pic.a into SunOS 4.x libc.so## by Chris Davis <ckd@kei.com> # based on code by Piete Brooks <pb@cl.cam.ac.uk># and Dave Morrison <drmorris@mit.edu># with additions by Greg Woods <woods@planix.com>## $Id: makeshlib,v 8.5 1995/12/24 06:44:27 vixie Exp $## set these by hand, or as an environment var, or let script figure them out#bindtree=/usr/obj/local/bind#SHLIBDIR=/usr/lib/shlib.etcthisdir=`pwd`# patch should be in this path, or root's pathPATH=/usr/bin:/usr/etc:/sbin:/usr/ucb:${PATH} ; export PATH# NOTE: not all shells have the 'type' builtin, else we could do this##if expr "`type printf`" : '.* is .*/printf$' >/dev/null 2>&1 ; then# HAVEPRINTF=true# echo=printf# nl='\n'# n=''# c='\c'#elseecho=echo(echo "hi there\c" ; echo " ") >./.echotmp# metaconfig checks to make sure grep returns a status....if grep c ./.echotmp >/dev/null 2>&1 ; then nl='' n='-n' c=''else nl='\n' n='' c='\c'firm -f ./.echotmp# these should not need changingjunkobjs=gethostent.o# try to find the BIND tree if it's not setcase "x${bindtree}" in'x') echo 'Trying to find BIND tree...' if [ -d "${thisdir}/shres/sunos" ]; then bindtree=$thisdir elif [ -d "${thisdir}/../../shres" ]; then bindtree="$thisdir/../../" fi ;;esaccase "x${bindtree}" in'x') echo "I can't find the bind tree, and you didn't set \$bindtree." echo "Please do so, and try again." exit 1esac# make sure patch is availableif patch < /dev/null > /dev/null 2>&1then echo "Good, you have patch."else echo "Sorry, you need Larry Wall's 'patch' program for this." echo "Get it by anonymous ftp from prep.ai.mit.edu in /pub/gnu." exit 1fi# cd into the Sun shared library build directorycd ${SHLIBDIR-/usr/lib/shlib.etc} || exit 1# Extract and setup the ucb libcecho 'Setting up the UCB universe libc.so build directory'if [ ! -d tmp.ucb ]; then rm -f tmp.ucb mkdir tmp.ucbficd tmp.ucb || exit 1rm -rf *ar x ../libc_pic.a || exit 1test -f __.SYMDEF && rm __.SYMDEFfor f in *.; do mv $f ${f}odonerm -f $junkobjs# Sun's inet_addr.o and possible getnetent.o are clobbered in thisar x $bindtree/shres/sunos/libresolv_pic.atest -f __.SYMDEF && rm __.SYMDEFcd ..# Extract and setup the sysv libcecho 'Setting up the SysV universe libc.so build directory'if [ ! -d tmp.s5 ]; then rm -f tmp.s5 mkdir tmp.s5ficd tmp.s5 || exit 1rm -rf *ar x ../libcs5_pic.a || exit 1test -f __.SYMDEF && rm __.SYMDEFfor f in *.; do mv $f ${f}odonerm -f $junkobjs# Sun's inet_addr.o and possible getnetent.o are clobbered in thisar x $bindtree/shres/sunos/libresolv_pic.atest -f __.SYMDEF && rm __.SYMDEF# Back to the make directorycd ..# Fix the broken SunOS awk scriptgrep FCS awkfile >/dev/null 2>&1 || patch < $bindtree/shres/sunos/sun-awkfile.patches && echo 'patched awkfile'# Add the resolver objects to the lorder sparc listing (uncool hack)grep gethnamaddr.o lorder-sparc >/dev/null 2>&1 || patch < $bindtree/shres/sunos/sun-lorder-sparc.patches && echo 'patched lorder-sparc'# Fix the broken SunOS Makefile# only first half needed for 4.1.3 with patch 100890-08+ and/or 100891-10+# Makefile still assumes version numbers for the sys5 & ucb libc's won't clashgrep '\./objsort' Makefile >/dev/null 2>&1 || patch < $bindtree/shres/sunos/sun-Makefile.patch1 && echo 'patched shlib Makefile with first patch'grep ' -ldl' Makefile >/dev/null 2>&1 || patch < $bindtree/shres/sunos/sun-Makefile.patch2 && echo 'patched shlib Makefile with second patch'### WARNING: the SunOS shlib.etc Makefile doesn't expect any clash between### SysV and UCB library names, assuming the version numbers will be different.# Make the sys5 shared libcrm -rf tmpln -s tmp.s5 tmptime make libcs5.so# Make the ucb shared libcrm -rf tmpln -s tmp.ucb tmptime make libc.soecho 'Now we will test these libraries and copy them as appropriate:'ls -l libc.so*LD_LIBRARY_PATH=`pwd` date$echo $n "Does the output of date shown above look normal? [n] $c"read answer junkcase "$answer" in[yY]*) echo "OK, we'll copy them into place!" ;;*) echo "Something went wrong. Try fixing it and re-running this script." exit 1 ;;esacVUCB=`/bin/ls /usr/lib/libc.so.* | awk -f awkfile`VS5=`/bin/ls /usr/5lib/libc.so.* | awk -f awkfile`VUCB_OLD=`echo $VUCB | awk -F. '{printf("%d.%d.%d", $1, $2, $3 - 1) }'`VS5_OLD=`echo $VS5 | awk -F. '{printf("%d.%d.%d", $1, $2, $3 - 1) }'`# so we get "1.9" instead of "1.9.0"VUCB_OLD=`basename $VUCB_OLD .0`VS5_OLD=`basename $VS5_OLD .0`set -xcp libc.so.$VUCB /usr/libcp libc.so.$VS5 /usr/5libcp /usr/lib/libc.sa.$VUCB_OLD /usr/lib/libc.sa.$VUCBcp /usr/5lib/libc.sa.$VS5_OLD /usr/5lib/libc.sa.$VS5set +xecho 'OK, they are in place now... running ranlib and ldconfig'ranlib -t /usr/lib/libc.sa.*ranlib -t /usr/5lib/libc.sa.*/usr/etc/ldconfigecho 'If you are really paranoid, run "trace /usr/bin/date" and check which'echo 'shared library is used, then run "trace /usr/5bin/cat < /dev/null" too.'echo 'Finally you should test a number of SunOS tools that do name resolution,'echo 'such as telnet, rlogin, ftp, etc.'echo 'If something breaks, remove the new shared libraries copied above and'echo 'run "ldconfig".'exit 0
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -