@script_shell@ # $Id$ # Author: Denis Vakatov, NCBI # ########################################################################### # # Install the built libs, apps, and configured headers and makefiles from # this tree to another directory -- in a way that would allow "external" # users to use them. # # Note: non-configurable headers, sources, makefiles, scripts and docs # (which can be shared by several builds) must be installed # separately, using script "scripts/common/impl/install.sh". # ########################################################################### echo "[`date`]" svn_location=`echo '$HeadURL$' | sed "s%\\$[H]eadURL: *\\([^$][^$]*\\) \\$.*%\\1%"` svn_revision=`echo '$Revision$' | sed "s%\\$[R]evision: *\\([^$][^$]*\\) \\$.*%\\1%"` script_name=`basename $0` script_dir=`dirname $0` script_dir=`(cd "${script_dir}" ; pwd)` run_dir=`pwd` run_cmd="$0 $*" old_srcdir='@top_srcdir@' build_dir=`(cd "${script_dir}/.." ; pwd)` install_dir="$1" relocate_flags="--copy-times" ##### USAGE Usage() { cat <&2 Usage: $script_name [--without-bin] [--with-object-files] [--srcdir=DIR] [--drop-suffix] Synopsis: Install NCBI C++ build tree -- built libs, apps, and configured headers and makefiles. (Hint: to install the source tree, use "c++/scripts/common/impl/install.sh".) Arguments: -- where to install (this can be either a name of pre-installed top source dir, or a name of build dir) --move -- remove the original build dir on success --without-bin -- do not install executables (from "bin/" dir) --with-object-files -- install object files (*@obj_ext@) -- necessary for proper debugging when using WorkShop --srcdir=DIR -- required if is an absolute path to a directory which (or whose parent) is not a NCBI C++ top source directory --drop-suffix -- when adjusting paths embedded in makefiles, replace directory names of the form "c++*" (e.g. "c++.new") with "c++" to allow for more graceful switch-overs. Script's: Subversion location/revision, run directory, and run command: $svn_location | r$svn_revision $run_dir $run_cmd ERROR: $1 EOF # This comment supplies another ' to work around an emacs highlighting bug. kill $$ exit 1 } ##### ARGS test -n "$install_dir" || Usage " argument missing" shift for x_arg in "$@" ; do case "$x_arg" in --without-bin ) with_bin="no" ;; --with-object-files) with_object_files="yes" ;; --move ) with_move="yes" ;; --srcdir=* ) new_srcdir=`echo "$x_arg" | sed 's%--srcdir=%%'` ;; --drop-suffix ) relocate_flags="$relocate_flags $x_arg" ;; * ) Usage "Unknown argument \"$x_arg\"" esac done ##### DIRS test -z "$new_srcdir" -o -d "$new_srcdir" || \ echo "[WARNING] Top source dir does not exist: $new_srcdir" if test -f "$install_dir/include/corelib/ncbistd.hpp" ; then # is an existing top source dir if test -z "$new_srcdir" ; then new_srcdir="$install_dir" else echo "[WARNING] Top source dir discrepancy; using $new_srcdir" fi install_dir="$install_dir/`basename $build_dir`" else # is is just under an existing top source dir? x_srcdir=`echo "$install_dir" | sed 's%/\. *$%%' | sed 's%/$%%'` if test -d "$x_srcdir" ; then x_srcdir="$x_srcdir/.." else x_srcdir=`dirname "$x_srcdir"` fi if test -f "$x_srcdir/include/corelib/ncbistd.hpp" ; then if test -z "$new_srcdir" ; then new_srcdir="$x_srcdir" else echo "[WARNING] Top source dir discrepancy; using $new_srcdir" fi fi fi test -d "$new_srcdir" && new_srcdir=`(cd "${new_srcdir}" ; pwd)` test -d "$install_dir" && install_dir=`(cd "${install_dir}" ; pwd)` ##### INFO cat <