Kaydet (Commit) cb70868b authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

add utility script and build_env to avoid sourcing Env.Host.sh

The goal is to able to do partial build without having
to source Env.Host.sh into one's environment

There is 2 way to use this:

1/
copy the scripts lo_find_src_root and lo_proxy_start
somewhere in your PATH, and
then you can add
alias build='lo_proxy_start build'
alias deliver='lo_proxy_start deliver'
in your .bashrc

at that point you can use build and deliver anywhere in the source tree
without the need to source anything.
This allow you to switch from one source tree to another.
the proper SRC_ROOT will be determined automatically based
on the current working directory

2/
source build_env

build_env only source the bare minimum to allow build and make to work
for the associated source tree.
If you want to work in a diffrent tree, you need to resource
üst 1d5aaeac
......@@ -45,6 +45,7 @@
/aclocal.m4
/autom4te.cache
/autogen.lastrun
/build_env
/ChangeLog
/config.guess
/config.log
......
......@@ -86,9 +86,9 @@ ifeq (@BUILD_DMAKE@,YES)
-test -f dmake/Makefile && $(MAKE) -C dmake distclean
endif
rm -rf Env.Host.sh Makefile aclocal.m4 autogen.lastrun autom4te.cache \
bin/repo-list config.log config.status configure \
bin/repo-list build_env config.log config.status configure \
desktop/scripts/soffice.sh ooo.lst post_download post_download.log \
set_soenv set_soenv.last set_soenv.stamp src.downloaded warn
set_soenv set_soenv.last set_soenv.stamp src.downloaded warn
clean: clean-host clean-build
......
if hash lo_proxy_start 2>&- ; then
base_alias="lo_proxy_start"
else
base_alias="@SRC_ROOT@/solenv/bin/lo_proxy_start"
fi
alias build="$base_alias build"
alias deliver="$base_alias deliver"
unset base_alias
......@@ -40,9 +40,14 @@ AC_SUBST(CROSS_COMPILING)
if test "$build_os" = "cygwin"; then
EXEEXT_FOR_BUILD=.exe
SRC_ROOT=`pwd`
SRC_ROOT=`cygpath -d "$SRC_ROOT"`
SRC_ROOT=`cygpath -u "$SRC_ROOT"`
else
EXEEXT_FOR_BUILD=
SRC_ROOT=`pwd`
fi
AC_SUBST(SRC_ROOT)
AC_SUBST(EXEEXT_FOR_BUILD)
cat /dev/null > warn
......@@ -9548,7 +9553,7 @@ else
echo > set_soenv.last
fi
AC_CONFIG_FILES([ooo.lst set_soenv Makefile bin/repo-list desktop/scripts/soffice.sh])
AC_CONFIG_FILES([ooo.lst set_soenv Makefile bin/repo-list desktop/scripts/soffice.sh build_env])
AC_OUTPUT
# make sure this is executable
......
#!/usr/bin/env bash
#
# (c) 2011 Norbert Thiebaud. License : GPLv3
#
# try to locate the SRC_ROOT based on the working directory
# we search for first Repository.mk
# in the current directoyr or its parent, all teh way to /
# Ths is a heuristic. it works 'most of the times
# but it could give false positive if you try hard enough
#
current=$(pwd)
while [ "${current}" != "/" ] ; do
if [ -f ${current}/.src_root ] ; then
echo "${current}"
exit 0;
fi
current=$(dirname "${current}")
done
echo "Error cannot determine SRC_ROOT" 1>&2
exit 1;
#!/usr/bin/env bash
bin_dir=$(dirname $0)
action=$(basename $0)
if [ "$action" = "lo_proxy_start" ] ; then
action=$1
shift
fi
if [ -z "$SRC_ROOT" ] ; then
SRC_ROOT=$($bin_dir/lo_find_src_root) || exit 1
fi
if [ -z "$SOLARINC" ] ; then
if [ -e "$SRC_ROOT/config.mk" ] ; then
. "$SRC_ROOT/config.mk"
fi
if [ -e "$SRC_ROOT/Env.Host.sh" ] ; then
. "$SRC_ROOT/Env.Host.sh"
fi
fi
if [ -e $SRC_ROOT/solenv/bin/$action.pl ] ; then
$SRC_ROOT/solenv/bin/$action.pl "$@"
elif [ -e $SRC_ROOT/solenv/bin/$action.sh ] ; then
$SRC_ROOT/solenv/bin/$action.sh "$@"
else
echo "$action.[pl|sh] not found" 2>&1
exit 1
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment