summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
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 -------------------------