diff options
author | Kevin Hunter <hunteke@earlham.edu> | 2014-02-20 10:43:58 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-02-20 22:57:37 +0000 |
commit | faaaddeea42996bf0aa9089fc851eb594165f7d5 (patch) | |
tree | f60b278a000e24118e0b9815727f94d2d8065d7e /configure.ac | |
parent | ae838de0a3840e0fd490db5447bd6d481616e9d7 (diff) |
Enable relative paths.
The documentation for the --with-external-tar was previously not
specific that it required an absolute path. So rather than fix the
help text, convert the path to an absolute one.
Change-Id: I794cd77235e68a2270acd09895bf994527e847c4
Reviewed-on: https://gerrit.libreoffice.org/8146
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 9c317cc0a7b2..cf9a3a7a6ce6 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,23 @@ PathFormat() fi } +AbsolutePath() +{ + # There appears to be no simple and portable method to get an absolute and + # canonical path, so we try creating the directory if does not exist and + # utilizing the shell and pwd. + rel="$1" + absolute_path="" + test ! -e "$rel" && mkdir -p "$rel" + if test -d "$rel" ; then + cd "$rel" || AC_MSG_ERROR([absolute path resolution failed for "$rel".]) + absolute_path="$(pwd)" + cd - &> /dev/null + else + AC_MSG_ERROR([Failed to resolve absolute path. "$rel" does not exist or is not a directory.]) + fi +} + rm -f warn have_WARNINGS="no" add_warning() @@ -1333,8 +1350,8 @@ AC_ARG_WITH(gnu-cp, ,) AC_ARG_WITH(external-tar, - AS_HELP_STRING([--with-external-tar=<TARFILE PATH>], - [Specify path to tarfiles manually.]), + AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>], + [Specify an absolute path of where to find (and store) tarfiles.]), TARFILE_LOCATION=$withval , ) @@ -4729,6 +4746,9 @@ if test -z "$TARFILE_LOCATION"; then ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src" fi TARFILE_LOCATION="$SRC_ROOT/external/tarballs" +else + AbsolutePath "$TARFILE_LOCATION" + TARFILE_LOCATION="${absolute_path}" fi AC_SUBST(TARFILE_LOCATION) |