Deleted Added
full compact
shlib-install (136644) shlib-install (157184)
1#! /bin/sh
2#
3# shlib-install - install a shared library and do any necessary host-specific
4# post-installation configuration (like ldconfig)
5#
1#! /bin/sh
2#
3# shlib-install - install a shared library and do any necessary host-specific
4# post-installation configuration (like ldconfig)
5#
6# usage: shlib-install [-D] -O host_os -d installation-dir -i install-prog [-U] library
6# usage: shlib-install [-D] -O host_os -d installation-dir [-b bin-dir] -i install-prog [-U] library
7#
8# Chet Ramey
9# chet@po.cwru.edu
10
11#
12# defaults
13#
14INSTALLDIR=/usr/local/lib
15LDCONFIG=ldconfig
16
17PROGNAME=`basename $0`
7#
8# Chet Ramey
9# chet@po.cwru.edu
10
11#
12# defaults
13#
14INSTALLDIR=/usr/local/lib
15LDCONFIG=ldconfig
16
17PROGNAME=`basename $0`
18USAGE="$PROGNAME [-D] -O host_os -d installation-dir -i install-prog [-U] library"
18USAGE="$PROGNAME [-D] -O host_os -d installation-dir [-b bin-dir] -i install-prog [-U] library"
19
20# process options
21
22while [ $# -gt 0 ]; do
23 case "$1" in
24 -O) shift; host_os="$1"; shift ;;
25 -d) shift; INSTALLDIR="$1"; shift ;;
19
20# process options
21
22while [ $# -gt 0 ]; do
23 case "$1" in
24 -O) shift; host_os="$1"; shift ;;
25 -d) shift; INSTALLDIR="$1"; shift ;;
26 -b) shift; BINDIR="$1" ; shift ;;
26 -i) shift; INSTALLPROG="$1" ; shift ;;
27 -D) echo=echo ; shift ;;
28 -U) uninstall=true ; shift ;;
29 -*) echo "$USAGE" >&2 ; exit 2;;
30 *) break ;;
31 esac
32done
33

--- 25 unchanged lines hidden (view full) ---

59 ${echo} eval ${INSTALLPROG} $LIBNAME ${INSTALLDIR}/${LIBNAME}
60else
61 ${echo} ${RM} ${INSTALLDIR}/${LIBNAME}
62fi
63
64# post-install/uninstall
65
66# HP-UX and Darwin/MacOS X require that a shared library have execute permission
27 -i) shift; INSTALLPROG="$1" ; shift ;;
28 -D) echo=echo ; shift ;;
29 -U) uninstall=true ; shift ;;
30 -*) echo "$USAGE" >&2 ; exit 2;;
31 *) break ;;
32 esac
33done
34

--- 25 unchanged lines hidden (view full) ---

60 ${echo} eval ${INSTALLPROG} $LIBNAME ${INSTALLDIR}/${LIBNAME}
61else
62 ${echo} ${RM} ${INSTALLDIR}/${LIBNAME}
63fi
64
65# post-install/uninstall
66
67# HP-UX and Darwin/MacOS X require that a shared library have execute permission
68# Cygwin installs both a dll (which must go in $BINDIR) and an implicit
69# link library (in $libdir)
67case "$host_os" in
68hpux*|darwin*|macosx*)
69 if [ -z "$uninstall" ]; then
70 chmod 555 ${INSTALLDIR}/${LIBNAME}
71 fi ;;
70case "$host_os" in
71hpux*|darwin*|macosx*)
72 if [ -z "$uninstall" ]; then
73 chmod 555 ${INSTALLDIR}/${LIBNAME}
74 fi ;;
75cygwin*)
76 IMPLIBNAME=`echo ${LIBNAME} \
77 | sed -e 's,^cyg,lib,' -e 's,[0-9]*.dll$,.dll.a,'`
78 if [ -z "$uninstall" ]; then
79 ${echo} $RM ${BINDIR}/${LIBNAME}.${OLDSUFF}
80 if [ -f "$BINDIR/$LIBNAME" ]; then
81 ${echo} $MV $BINDIR/$LIBNAME $BINDIR/$LIBNAME.$OLDSUFF
82 fi
83 ${echo} $MV ${INSTALLDIR}/${LIBNAME} ${BINDIR}/${LIBNAME}
84 ${echo} chmod a+x ${BINDIR}/${LIBNAME}
85 ${echo} eval ${INSTALLPROG} ${LIBNAME}.a \
86 ${INSTALLDIR}/${IMPLIBNAME}
87 else
88 ${echo} ${RM} ${BINDIR}/${LIBNAME}
89 ${echo} ${RM} ${INSTALLDIR}/${IMPLIBNAME}
90 fi ;;
91
72*) ;;
73esac
74
75case "$LIBNAME" in
76*.*.[0-9].[0-9]) # libname.so.M.N
77 LINK2=`echo $LIBNAME | sed 's:\(.*\..*\.[0-9]\)\.[0-9]:\1:'` # libname.so.M
78 LINK1=`echo $LIBNAME | sed 's:\(.*\..*\)\.[0-9]\.[0-9]:\1:'` # libname.so
79 ;;

--- 78 unchanged lines hidden (view full) ---

158hpux1*)
159 # libname.sl -> libname.M
160 ${echo} ${RM} ${INSTALLDIR}/$LINK1.sl
161 if [ -z "$uninstall" ]; then
162 eval $INSTALL_LINK1
163 fi
164 ;;
165
92*) ;;
93esac
94
95case "$LIBNAME" in
96*.*.[0-9].[0-9]) # libname.so.M.N
97 LINK2=`echo $LIBNAME | sed 's:\(.*\..*\.[0-9]\)\.[0-9]:\1:'` # libname.so.M
98 LINK1=`echo $LIBNAME | sed 's:\(.*\..*\)\.[0-9]\.[0-9]:\1:'` # libname.so
99 ;;

--- 78 unchanged lines hidden (view full) ---

178hpux1*)
179 # libname.sl -> libname.M
180 ${echo} ${RM} ${INSTALLDIR}/$LINK1.sl
181 if [ -z "$uninstall" ]; then
182 eval $INSTALL_LINK1
183 fi
184 ;;
185
186cygwin*)
187 # Links to .dlls don't work. Hence shobj-conf used DLLVERSION.dll
188 # instead of so.SHLIB_MAJOR.SHLIB_MINOR. The postinstall above
189 # took care of everything else.
190 ;;
191
166*) ;;
167esac
168
169exit 0
192*) ;;
193esac
194
195exit 0