URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [insight/] [readline/] [support/] [shlib-install] - Rev 578
Go to most recent revision | Compare with Previous | Blame | View Log
#! /bin/sh## shlib-install - install a shared library and do any necessary host-specific# post-installation configuration (like ldconfig)## usage: shlib-install [-D] -O host_os -d installation-dir -i install-prog [-U] library## Chet Ramey# chet@po.cwru.edu## defaults#INSTALLDIR=/usr/local/libLDCONFIG=ldconfigPROGNAME=`basename $0`USAGE="$PROGNAME [-D] -O host_os -d installation-dir -i install-prog [-U] library"# process optionswhile [ $# -gt 0 ]; docase "$1" in-O) shift; host_os="$1"; shift ;;-d) shift; INSTALLDIR="$1"; shift ;;-i) shift; INSTALLPROG="$1" ; shift ;;-D) echo=echo ; shift ;;-U) uninstall=true ; shift ;;-*) echo "$USAGE" >&2 ; exit 2;;*) break ;;esacdone# set install target nameLIBNAME="$1"if [ -z "$LIBNAME" ]; thenecho "$USAGE" >&2exit 2fiOLDSUFF=oldMV=mvRM="rm -f"LN="ln -s"# pre-installif [ -z "$uninstall" ]; then${echo} $RM ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}if [ -f "$INSTALLDIR/$LIBNAME" ]; then${echo} $MV $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}fifi# install/uninstallif [ -z "$uninstall" ] ; then${echo} eval ${INSTALLPROG} $LIBNAME ${INSTALLDIR}/${LIBNAME}else${echo} ${RM} ${INSTALLDIR}/${LIBNAME}fi# post-install/uninstall# HP-UX requires that a shared library have execute permissioncase "$host_os" inhpux*) if [ -z "$uninstall" ]; thenchmod 755 ${INSTALLDIR}/${LIBNAME}fi ;;*) ;;esaccase "$LIBNAME" in*.*.[0-9].[0-9]) # libname.so.M.NLINK2=`echo $LIBNAME | sed 's:\(.*\..*\.[0-9]\)\.[0-9]:\1:'` # libname.so.MLINK1=`echo $LIBNAME | sed 's:\(.*\..*\)\.[0-9]\.[0-9]:\1:'` # libname.so;;*.*.[0-9]) # libname.so.MLINK1=`echo $LIBNAME | sed 's:\(.*\..*\)\.[0-9]:\1:'` # libname.so;;*.[0-9]) # libname.MLINK1=`echo $LIBNAME | sed 's:\(.*\)\.[0-9]:\1:'` # libname;;esac## Create symlinks to the installed library. This section is incomplete.#case "$host_os" in*linux*|bsdi4*)# libname.so.M -> libname.so.M.N${echo} ${RM} ${INSTALLDIR}/$LINK2if [ -z "$uninstall" ]; then${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK2fi# libname.so -> libname.so.M.N${echo} ${RM} ${INSTALLDIR}/$LINK1if [ -z "$uninstall" ]; then${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1fi;;solaris2*|aix4.[2-9]*|osf*|irix[56]*)# libname.so -> libname.so.M${echo} ${RM} ${INSTALLDIR}/$LINK1if [ -z "$uninstall" ]; then${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1fi;;# FreeBSD 3.x can have either a.out or ELF shared librariesfreebsd3*)if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then# libname.so -> libname.so.M${echo} ${RM} ${INSTALLDIR}/$LINK1if [ -z "$uninstall" ]; then${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1fielse# libname.so.M -> libname.so.M.N${echo} ${RM} ${INSTALLDIR}/$LINK2if [ -z "$uninstall" ]; then${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK2fi# libname.so -> libname.so.M.N${echo} ${RM} ${INSTALLDIR}/$LINK1if [ -z "$uninstall" ]; then${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1fifi;;hpux1*)# libname.sl -> libname.M${echo} ${RM} ${INSTALLDIR}/$LINK1.slif [ -z "$uninstall" ]; then${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LINK1}.slfi;;*) ;;esacexit 0
Go to most recent revision | Compare with Previous | Blame | View Log
