forked from openslide/openslide-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacinclude.m4
43 lines (41 loc) · 1.21 KB
/
acinclude.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# FIND_FILE([OUTPUT], [FILE_NAME], [SEARCH_PATHS])
# The colon-delimited paths in SEARCH_PATHS are searched to determine
# whether they contain the file FILE_NAME. If so, OUTPUT is set to the
# directory containing the file. Otherwise, an error is produced.
# ---------------------------------------------------------------------
AC_DEFUN([FIND_FILE], [
AC_MSG_CHECKING([for $2])
$1=
ac__save_ifs="$IFS"
IFS=:
for ac__path in $3
do
# IFS doesn't consolidate consecutive delimiters
ac__path=$(echo "$ac__path" | sed 's/:*$//')
if test -r "$ac__path/$2" ; then
IFS="$ac__save_ifs"
AC_MSG_RESULT([$ac__path])
$1=$ac__path
break
fi
done
IFS="$ac__save_ifs"
if test "z$$1" = z ; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([cannot find $2 in $3])
fi
])
# JOIN_EACH([OUTPUT], [PATHS], [SUBDIR])
# Append SUBDIR to each of the colon-delimited PATHS and put the result
# in OUTPUT.
# ---------------------------------------------------------------------
AC_DEFUN([JOIN_EACH], [
$1=
ac__save_ifs="$IFS"
IFS=:
for dir in $2
do
$1="$$1:$dir/$3"
done
IFS="$ac__save_ifs"
])