summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-07 06:48:41 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-11-07 06:48:41 -0800
commit148a14bef1d3eed1238930e00eb96ed620ab05c9 (patch)
tree07ed2863000b972cce27e8b5f81ca3ae6bd06a33
parenta351b12d01a19b466f987bf629dd3804b033b1cf (diff)
downloadreadline-148a14bef1d3eed1238930e00eb96ed620ab05c9.tar.gz
readline-148a14bef1d3eed1238930e00eb96ed620ab05c9.tar.bz2
readline-148a14bef1d3eed1238930e00eb96ed620ab05c9.zip
destdir
-rw-r--r--shlib/Makefile.in9
-rwxr-xr-xsupport/shlib-install47
2 files changed, 32 insertions, 24 deletions
diff --git a/shlib/Makefile.in b/shlib/Makefile.in
index c2225d6..325eb58 100644
--- a/shlib/Makefile.in
+++ b/shlib/Makefile.in
@@ -57,6 +57,7 @@ bindir = @bindir@
libdir = @libdir@
datadir = @datadir@
localedir = $(datadir)/locale
+linkagedir = $(libdir)
# Support an alternate destination root directory for package building
DESTDIR =
@@ -181,13 +182,13 @@ installdirs: $(topdir)/support/mkdirs
-$(SHELL) $(topdir)/support/mkdirs $(DESTDIR)$(libdir)
install: installdirs $(SHLIB_STATUS)
- $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY)
- $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_READLINE)
+ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY)
+ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -i "$(INSTALL_DATA)" $(SHARED_READLINE)
@echo install: you may need to run ldconfig
uninstall:
- $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_HISTORY)
- $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_READLINE)
+ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -U $(SHARED_HISTORY)
+ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -U $(SHARED_READLINE)
@echo uninstall: you may need to run ldconfig
clean mostlyclean: force
diff --git a/support/shlib-install b/support/shlib-install
index 790f53e..271c0be 100755
--- a/support/shlib-install
+++ b/support/shlib-install
@@ -3,7 +3,7 @@
# 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 [-b bin-dir] -i install-prog [-U] library
+# usage: shlib-install [-D] -O host_os -d installation-dir [-l linkage-dir] [-b bin-dir] -i install-prog [-U] library
#
# Chet Ramey
# chet@po.cwru.edu
@@ -12,10 +12,12 @@
# defaults
#
INSTALLDIR=/usr/local/lib
+LINKAGEDIR=
LDCONFIG=ldconfig
+DESTDIR=
PROGNAME=`basename $0`
-USAGE="$PROGNAME [-D] -O host_os -d installation-dir [-b bin-dir] -i install-prog [-U] library"
+USAGE="$PROGNAME [-D] -O host_os -d installation-dir [-l linkage-dir] [-b bin-dir] -i install-prog [-U] library"
# process options
@@ -23,14 +25,19 @@ while [ $# -gt 0 ]; do
case "$1" in
-O) shift; host_os="$1"; shift ;;
-d) shift; INSTALLDIR="$1"; shift ;;
+ -dd) shift; DESTDIR=$1; shift ;;
-b) shift; BINDIR="$1" ; shift ;;
-i) shift; INSTALLPROG="$1" ; shift ;;
+ -l) shift; LINKAGEDIR="$1" ; shift ;;
-D) echo=echo ; shift ;;
-U) uninstall=true ; shift ;;
-*) echo "$USAGE" >&2 ; exit 2;;
*) break ;;
esac
done
+if [ -z "$LINKAGEDIR" ]; then
+ LINKAGEDIR="$INSTALLDIR"
+fi
# set install target name
LIBNAME="$1"
@@ -48,18 +55,18 @@ LN="ln -s"
# pre-install
if [ -z "$uninstall" ]; then
- ${echo} $RM ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
- if [ -f "$INSTALLDIR/$LIBNAME" ]; then
- ${echo} $MV $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
+ ${echo} $RM ${DESTDIR}${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
+ if [ -f "${DESTDIR}$INSTALLDIR/$LIBNAME" ]; then
+ ${echo} $MV ${DESTDIR}$INSTALLDIR/$LIBNAME ${DESTDIR}${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
fi
fi
# install/uninstall
if [ -z "$uninstall" ] ; then
- ${echo} eval ${INSTALLPROG} $LIBNAME ${INSTALLDIR}/${LIBNAME}
+ ${echo} eval ${INSTALLPROG} $LIBNAME ${DESTDIR}${INSTALLDIR}/${LIBNAME}
else
- ${echo} ${RM} ${INSTALLDIR}/${LIBNAME}
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/${LIBNAME}
fi
# post-install/uninstall
@@ -71,7 +78,7 @@ fi
case "$host_os" in
hpux*|darwin*|macosx*|linux*)
if [ -z "$uninstall" ]; then
- chmod 555 ${INSTALLDIR}/${LIBNAME}
+ chmod 555 ${DESTDIR}${INSTALLDIR}/${LIBNAME}
fi ;;
cygwin*)
IMPLIBNAME=`echo ${LIBNAME} \
@@ -109,8 +116,8 @@ case "$LIBNAME" in
LINK1=`echo $LIBNAME | sed 's:\(.*\)\.[0-9]\.[0-9]:\1:'` # libname.dylib
esac
-INSTALL_LINK1='${echo} cd $INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK1'
-INSTALL_LINK2='${echo} cd $INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK2'
+INSTALL_LINK1='${echo} cd ${DESTDIR}$INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK1'
+INSTALL_LINK2='${echo} cd ${DESTDIR}$INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK2'
#
# Create symlinks to the installed library. This section is incomplete.
@@ -118,27 +125,27 @@ INSTALL_LINK2='${echo} cd $INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK2'
case "$host_os" in
*linux*)
# libname.so.M -> libname.so.M.N
- ${echo} ${RM} ${INSTALLDIR}/$LINK2
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2
if [ -z "$uninstall" ]; then
eval $INSTALL_LINK2
fi
# libname.so -> libname.so.M
- ${echo} ${RM} ${INSTALLDIR}/$LINK1
+ ${echo} ${RM} ${DESTDIR}${LINKAGEDIR}/$LINK1
if [ -z "$uninstall" ]; then
- ${echo} cd $INSTALLDIR && ${echo} ${LN} $LINK2 $LINK1
+ ${echo} ln -s ${INSTALLDIR}/$LIBNAME ${DESTDIR}${LINKAGEDIR}/$LINK1
fi
;;
bsdi4*|*gnu*|darwin*|macosx*|k*bsd*-gnu)
# libname.so.M -> libname.so.M.N
- ${echo} ${RM} ${INSTALLDIR}/$LINK2
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2
if [ -z "$uninstall" ]; then
eval $INSTALL_LINK2
fi
# libname.so -> libname.so.M.N
- ${echo} ${RM} ${INSTALLDIR}/$LINK1
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
if [ -z "$uninstall" ]; then
eval $INSTALL_LINK1
fi
@@ -146,7 +153,7 @@ bsdi4*|*gnu*|darwin*|macosx*|k*bsd*-gnu)
solaris2*|aix4.[2-9]*|osf*|irix[56]*|sysv[45]*|dgux*)
# libname.so -> libname.so.M
- ${echo} ${RM} ${INSTALLDIR}/$LINK1
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
if [ -z "$uninstall" ]; then
eval $INSTALL_LINK1
fi
@@ -157,19 +164,19 @@ solaris2*|aix4.[2-9]*|osf*|irix[56]*|sysv[45]*|dgux*)
freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*)
if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then
# libname.so -> libname.so.M
- ${echo} ${RM} ${INSTALLDIR}/$LINK1
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
if [ -z "$uninstall" ]; then
eval $INSTALL_LINK1
fi
else
# libname.so.M -> libname.so.M.N
- ${echo} ${RM} ${INSTALLDIR}/$LINK2
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2
if [ -z "$uninstall" ]; then
eval $INSTALL_LINK2
fi
# libname.so -> libname.so.M.N
- ${echo} ${RM} ${INSTALLDIR}/$LINK1
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
if [ -z "$uninstall" ]; then
eval $INSTALL_LINK1
fi
@@ -178,7 +185,7 @@ freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*)
hpux1*)
# libname.sl -> libname.M
- ${echo} ${RM} ${INSTALLDIR}/$LINK1.sl
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1.sl
if [ -z "$uninstall" ]; then
eval $INSTALL_LINK1
fi