1 | dnl |
---|
2 | dnl ctypesgen.m4: Locates ctypesgen for building/installing ctypes-python. |
---|
3 | dnl |
---|
4 | |
---|
5 | AC_DEFUN(SVN_CHECK_CTYPESGEN, |
---|
6 | [ |
---|
7 | AC_ARG_WITH(ctypesgen, |
---|
8 | AS_HELP_STRING([--with-ctypesgen=PATH], |
---|
9 | [Specify the path to ctypesgen. This can either |
---|
10 | be the full path to a ctypesgen installation, |
---|
11 | the full path to a ctypesgen source tree or the |
---|
12 | full path to ctypesgen.py.]), |
---|
13 | [ |
---|
14 | case "$withval" in |
---|
15 | "no") |
---|
16 | SVN_FIND_CTYPESGEN(no) |
---|
17 | ;; |
---|
18 | "yes") |
---|
19 | SVN_FIND_CTYPESGEN(check) |
---|
20 | ;; |
---|
21 | *) |
---|
22 | SVN_FIND_CTYPESGEN($withval) |
---|
23 | ;; |
---|
24 | esac |
---|
25 | ], |
---|
26 | [ |
---|
27 | SVN_FIND_CTYPESGEN(check) |
---|
28 | ]) |
---|
29 | ]) |
---|
30 | |
---|
31 | AC_DEFUN(SVN_FIND_CTYPESGEN, |
---|
32 | [ |
---|
33 | where=$1 |
---|
34 | |
---|
35 | CTYPESGEN=none |
---|
36 | |
---|
37 | if test $where = check; then |
---|
38 | AC_PATH_PROG(CTYPESGEN, "ctypesgen.py", none) |
---|
39 | elif test $where != no; then |
---|
40 | AC_MSG_CHECKING([for ctypesgen.py]) |
---|
41 | |
---|
42 | if test -f "$where"; then |
---|
43 | CTYPESGEN="$where" |
---|
44 | elif test -f "$where/bin/ctypesgen.py"; then |
---|
45 | CTYPESGEN="$where/bin/ctypesgen.py" |
---|
46 | else |
---|
47 | CTYPESGEN="$where/ctypesgen.py" |
---|
48 | fi |
---|
49 | |
---|
50 | if test ! -f "$CTYPESGEN" || test ! -x "$CTYPESGEN"; then |
---|
51 | AC_MSG_ERROR([Could not find ctypesgen at $where/ctypesgen.py or at |
---|
52 | $where/bin/ctypesgen.py]) |
---|
53 | else |
---|
54 | AC_MSG_RESULT([$CTYPESGEN]) |
---|
55 | fi |
---|
56 | fi |
---|
57 | |
---|
58 | dnl We use CTYPESGEN in the Makefile |
---|
59 | AC_SUBST(CTYPESGEN) |
---|
60 | ]) |
---|