summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-05-20 16:17:19 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-05-20 16:17:19 +0000
commit86c081db689b391bf1a5327aeb24f2cc8c3c1950 (patch)
tree0ea43a00de0026f7d3178164568b189b6abb11c5 /acinclude.m4
parentd6de24d172be7c072c23a81f36eaf77c3cc3df34 (diff)
downloadmpfr-86c081db689b391bf1a5327aeb24f2cc8c3c1950.tar.gz
[acinclude.m4,configure.ac] Check that a directory passed to
a --with-gmp* configure option exists and doesn't contain any space, and canonicalize the name if the realpath utility is available (patch by Patrick PĂ©lissier). (merged changeset r8840 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9421 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m430
1 files changed, 30 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 1e1a78906..0262727ca 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -549,6 +549,36 @@ You need to use another compiler (or lower the optimization level).])
esac
])
+dnl MPFR_PARSE_DIRECTORY
+dnl Input: $1 = a string to a relative or absolute directory
+dnl Output: $2 = the variable to set with the absolute directory
+AC_DEFUN([MPFR_PARSE_DIRECTORY],
+[
+ dnl Check if argument is a directory
+ if test -d $1 ; then
+ dnl Get the absolute path of the directory
+ dnl in case of relative directory.
+ dnl If realpath is not a valid command,
+ dnl an error is produced and we keep the given path.
+ local_tmp=`realpath $1 2>/dev/null`
+ if test "$local_tmp" != "" ; then
+ if test -d "$local_tmp" ; then
+ $2="$local_tmp"
+ else
+ $2=$1
+ fi
+ else
+ $2=$1
+ fi
+ dnl Check for space in the directory
+ if test `echo $1|cut -d' ' -f1` != $1 ; then
+ AC_MSG_ERROR($1 directory shall not contain any space.)
+ fi
+ else
+ AC_MSG_ERROR($1 shall be a valid directory)
+ fi
+])
+
dnl MPFR_C_LONG_DOUBLE_FORMAT
dnl -------------------------