comparison m4/arts.m4 @ 810:e9509e909193 trunk

[svn] ported xmms-arts 0.7.1 to audacious and integrated it in the build process
author giacomo
date Thu, 09 Mar 2006 09:55:56 -0800
parents
children 7483ff99b335
comparison
equal deleted inserted replaced
809:79da0e6ed790 810:e9509e909193
1 # CFLAGS and library paths for aRts
2 # written 15 December 1999 by Ben Gertzfield <che@debian.org>
3 # hacked for artsc by Haavard Kvaalen <havardk@xmms.org>
4
5 dnl Usage:
6 dnl AM_PATH_ARTSC([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
7 dnl
8 dnl Example:
9 dnl AM_PATH_ARTSC(0.9.5, , AC_MSG_ERROR([*** ARTSC >= 0.9.5 not installed - please install first ***]))
10 dnl
11 dnl Defines ARTSC_CFLAGS, ARTSC_LIBS and ARTSC_VERSION.
12 dnl
13
14 dnl ARTSC_TEST_VERSION(AVAILABLE-VERSION, NEEDED-VERSION [, ACTION-IF-OKAY [, ACTION-IF-NOT-OKAY]])
15 AC_DEFUN(ARTSC_TEST_VERSION, [
16
17 # Determine which version number is greater. Prints 2 to stdout if
18 # the second number is greater, 1 if the first number is greater,
19 # 0 if the numbers are equal.
20
21 # Written 15 December 1999 by Ben Gertzfield <che@debian.org>
22 # Revised 15 December 1999 by Jim Monty <monty@primenet.com>
23
24 AC_PROG_AWK
25 artsc_got_version=[` $AWK ' \
26 BEGIN { \
27 print vercmp(ARGV[1], ARGV[2]); \
28 } \
29 \
30 function vercmp(ver1, ver2, ver1arr, ver2arr, \
31 ver1len, ver2len, \
32 ver1int, ver2int, len, i, p) { \
33 \
34 ver1len = split(ver1, ver1arr, /\./); \
35 ver2len = split(ver2, ver2arr, /\./); \
36 \
37 len = ver1len > ver2len ? ver1len : ver2len; \
38 \
39 for (i = 1; i <= len; i++) { \
40 p = 1000 ^ (len - i); \
41 ver1int += ver1arr[i] * p; \
42 ver2int += ver2arr[i] * p; \
43 } \
44 \
45 if (ver1int < ver2int) \
46 return 2; \
47 else if (ver1int > ver2int) \
48 return 1; \
49 else \
50 return 0; \
51 }' $1 $2`]
52
53 if test $artsc_got_version -eq 2; then # failure
54 ifelse([$4], , :, $4)
55 else # success!
56 ifelse([$3], , :, $3)
57 fi
58 ])
59
60 AC_DEFUN(AM_PATH_ARTSC,
61 [
62 AC_ARG_WITH(artsc-prefix,[ --with-artsc-prefix=PFX Prefix where aRts is installed (optional)],
63 artsc_config_prefix="$withval", artsc_config_prefix="")
64 AC_ARG_WITH(artsc-exec-prefix,[ --with-artsc-exec-prefix=PFX Exec prefix where aRts is installed (optional)],
65 artsc_config_exec_prefix="$withval", artsc_config_exec_prefix="")
66
67 if test x$artsc_config_exec_prefix != x; then
68 artsc_config_args="$artsc_config_args --exec-prefix=$artsc_config_exec_prefix"
69 if test x${ARTSC_CONFIG+set} != xset; then
70 ARTSC_CONFIG=$artsc_config_exec_prefix/bin/artsc-config
71 fi
72 fi
73
74 if test x$artsc_config_prefix != x; then
75 artsc_config_args="$artsc_config_args --prefix=$artsc_config_prefix"
76 if test x${ARTSC_CONFIG+set} != xset; then
77 ARTSC_CONFIG=$artsc_config_prefix/bin/artsc-config
78 fi
79 fi
80
81 AC_PATH_PROG(ARTSC_CONFIG, artsc-config, no)
82 min_artsc_version=ifelse([$1], ,0.9.5.1, $1)
83
84 if test "$ARTSC_CONFIG" = "no"; then
85 no_artsc=yes
86 else
87 ARTSC_CFLAGS=`$ARTSC_CONFIG $artsc_config_args --cflags`
88 ARTSC_LIBS=`$ARTSC_CONFIG $artsc_config_args --libs`
89 ARTSC_VERSION=`$ARTSC_CONFIG $artsc_config_args --version`
90
91 ARTSC_TEST_VERSION($ARTSC_VERSION, $min_artsc_version, ,no_artsc=version)
92 fi
93
94 AC_MSG_CHECKING(for artsc - version >= $min_artsc_version)
95
96 if test "x$no_artsc" = x; then
97 AC_MSG_RESULT(yes)
98 AC_SUBST(ARTSC_CFLAGS)
99 AC_SUBST(ARTSC_LIBS)
100 AC_SUBST(ARTSC_VERSION)
101 ifelse([$2], , :, [$2])
102 else
103 AC_MSG_RESULT(no)
104
105 if test "$ARTSC_CONFIG" = "no" ; then
106 echo "*** The artsc-config script installed by aRts could not be found."
107 echo "*** If aRts was installed in PREFIX, make sure PREFIX/bin is in"
108 echo "*** your path, or set the ARTSC_CONFIG environment variable to the"
109 echo "*** full path to artsc-config."
110 else
111 if test "$no_artsc" = "version"; then
112 echo "*** An old version of aRts, $ARTSC_VERSION, was found."
113 echo "*** You need a version of aRts newer than $min_artsc_version."
114 echo "*** The latest version of aRts is available from"
115 echo "*** http://www.arts-project.org/"
116 echo "***"
117
118 echo "*** If you have already installed a sufficiently new version, this error"
119 echo "*** probably means that the wrong copy of the artsc-config shell script is"
120 echo "*** being found. The easiest way to fix this is to remove the old version"
121 echo "*** of aRts, but you can also set the ARTSC_CONFIG environment to point to the"
122 echo "*** correct copy of artsc-config. (In this case, you will have to"
123 echo "*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf"
124 echo "*** so that the correct libraries are found at run-time)"
125 fi
126 fi
127 ARTSC_CFLAGS=""
128 ARTSC_LIBS=""
129 ifelse([$3], , :, [$3])
130 fi
131 ])