1 | AC_DEFUN(AM_PATH_LINC, |
---|
2 | [dnl |
---|
3 | dnl Get the cflags and libs from the linc-config script |
---|
4 | dnl |
---|
5 | AC_ARG_WITH(linc-prefix,[ --with-linc-prefix=PFX Prefix where linc is installed (optional)], |
---|
6 | linc_config_prefix="$withval", linc_config_prefix="") |
---|
7 | AC_ARG_WITH(linc-exec-prefix,[ --with-linc-exec-prefix=PFX Exec prefix where linc is installed (optional)], |
---|
8 | linc_config_exec_prefix="$withval", linc_config_exec_prefix="") |
---|
9 | if test x$linc_config_exec_prefix != x ; then |
---|
10 | linc_config_args="$linc_config_args --exec-prefix=$linc_config_exec_prefix" |
---|
11 | if test x${LINC_CONFIG+set} != xset ; then |
---|
12 | LINC_CONFIG=$linc_config_exec_prefix/bin/linc-config |
---|
13 | fi |
---|
14 | fi |
---|
15 | if test x$linc_config_prefix != x ; then |
---|
16 | linc_config_args="$linc_config_args --prefix=$linc_config_prefix" |
---|
17 | if test x${LINC_CONFIG+set} != xset ; then |
---|
18 | LINC_CONFIG=$linc_config_prefix/bin/linc-config |
---|
19 | fi |
---|
20 | fi |
---|
21 | |
---|
22 | AC_PATH_PROG(LINC_CONFIG, linc-config, no) |
---|
23 | min_linc_version=ifelse([$1], , 0.1.0, $1) |
---|
24 | |
---|
25 | AC_MSG_CHECKING(for linc >= $min_linc_version) |
---|
26 | no_linc="" |
---|
27 | if test "$LINC_CONFIG" = "no" ; then |
---|
28 | no_linc=yes |
---|
29 | else |
---|
30 | LINC_CFLAGS="`$LINC_CONFIG $linc_config_args --cflags`" |
---|
31 | LINC_LIBS="`$LINC_CONFIG $linc_config_args --libs`" |
---|
32 | |
---|
33 | linc_config_major_version=`$LINC_CONFIG $linc_config_args --version | \ |
---|
34 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` |
---|
35 | linc_config_minor_version=`$LINC_CONFIG $linc_config_args --version | \ |
---|
36 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` |
---|
37 | linc_config_micro_version=`$LINC_CONFIG $linc_config_args --version | \ |
---|
38 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` |
---|
39 | needed_major_version=`echo $min_linc_version | \ |
---|
40 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` |
---|
41 | needed_minor_version=`echo $min_linc_version | \ |
---|
42 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` |
---|
43 | needed_micro_version=`echo $min_linc_version | \ |
---|
44 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` |
---|
45 | |
---|
46 | if test $linc_config_major_version -lt $needed_major_version; then |
---|
47 | ifelse([$3], , :, [$3]) |
---|
48 | no_linc=yes |
---|
49 | elif test $linc_config_major_version = $needed_major_version; then |
---|
50 | if test -n "$needed_minor_version" -a $linc_config_minor_version -lt $needed_minor_version; then |
---|
51 | ifelse([$3], , :, [$3]) |
---|
52 | no_linc=yes |
---|
53 | elif test -n "$needed_minor_version" -a $linc_config_minor_version = $needed_minor_version; then |
---|
54 | if test -n "$needed_micro_version" -a $linc_config_micro_version -lt $needed_micro_version; then |
---|
55 | ifelse([$3], , :, [$3]) |
---|
56 | no_linc=yes |
---|
57 | fi |
---|
58 | fi |
---|
59 | fi |
---|
60 | fi |
---|
61 | |
---|
62 | AC_SUBST(LINC_CFLAGS) |
---|
63 | AC_SUBST(LINC_LIBS) |
---|
64 | |
---|
65 | if test "x$no_linc" = x ; then |
---|
66 | AC_MSG_RESULT(yes) |
---|
67 | ifelse([$2], , :, [$2]) |
---|
68 | else |
---|
69 | AC_MSG_RESULT(no) |
---|
70 | if test "$LINC_CONFIG" = "no" ; then |
---|
71 | echo "*** The linc-config script could not be found. You" |
---|
72 | echo "*** must install the linc package, located in" |
---|
73 | echo "*** GNOME's cvs under the module 'linc'." |
---|
74 | else |
---|
75 | : |
---|
76 | fi |
---|
77 | LINC_CFLAGS="" |
---|
78 | LINC_LIBS="" |
---|
79 | ifelse([$3], , :, [$3]) |
---|
80 | fi |
---|
81 | ]) |
---|