[Libreoffice-commits] core.git: configure.ac

Kevin Hunter hunteke at earlham.edu
Thu Feb 20 14:58:00 PST 2014


 configure.ac |   24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

New commits:
commit faaaddeea42996bf0aa9089fc851eb594165f7d5
Author: Kevin Hunter <hunteke at earlham.edu>
Date:   Thu Feb 20 10:43:58 2014 -0500

    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 at gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/configure.ac b/configure.ac
index 9c317cc..cf9a3a7 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)
 


More information about the Libreoffice-commits mailing list