annotate m4/arts.m4 @ 1737:73f4c2c89c23 trunk

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