annotate acinclude.m4 @ 2713:182dd0f45cc7

Synchronize acinclude.m4.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 16 Jun 2008 14:16:06 +0300
parents e48338bffeef
children b52eee8523d5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
1
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
2 dnl ** ADD_PKG_REQUIRES([requirement])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
3 AC_DEFUN([ADD_PC_REQUIRES], [
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
4 if test "x$PC_REQUIRES" = "x"; then
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
5 PC_REQUIRES="$1"
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
6 else
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
7 PC_REQUIRES="$PC_REQUIRES, $1"
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
8 fi
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
9 AC_SUBST([PC_REQUIRES])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
10 ])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
11
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
12
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
13 dnl ** Like PKG_CHECK_MODULES, but provides an informative error message.
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
14 dnl ** AUD_CHECK_MODULE([define name], [module], [version required],
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
15 dnl ** [informational name], [additional error message])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
16 dnl **
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
17 dnl ** AUD_CHECK_MODULE([GLIB], [gtk+-2.0], [>= 2.10.0], [Gtk+2], [See http://www.gtk.org/])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
18 AC_DEFUN([AUD_CHECK_MODULE], [
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
19 PKG_CHECK_MODULES([$1], [$2 $3], [
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
20 ADD_PC_REQUIRES([$2 $3])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
21 ],[
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
22 PKG_CHECK_EXISTS([$2], [
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
23 cv_pkg_version=`$PKG_CONFIG --modversion "$2" 2>/dev/null`
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
24 AC_MSG_ERROR([[
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
25 $4 version $cv_pkg_version was found, but $2 $3 is required.
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
26 $5]])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
27 ],[
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
28 AC_MSG_ERROR([[
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
29 Cannot find $4! If you are using binary packages based system, check that you
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
30 have the corresponding -dev/devel packages installed.
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
31 $5]])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
32 ])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
33 ])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
34 ])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
35
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
36
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
37 dnl ** Simplifying wrapper
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
38 AC_DEFUN([AUD_CONDITIONAL],
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
39 [if test "x${$2}" = m4_ifval([$3], ["x$3"],["xyes"]) ; then
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
40 $1="yes"
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
41 else
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
42 $1="no"
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
43 fi
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
44 AC_SUBST([$1])dnl
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
45 ])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
46
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
47
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
48 dnl ** Simple wrapper for AC_ARG_ENABLE
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
49 dnl ** AUD_ARG_ENABLE([name], [default value], [help string], [if enabled], [if disabled])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
50 AC_DEFUN([AUD_ARG_ENABLE], [dnl
2713
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
51 # _A_ARG_ENABLE($1, $2, $3, $4, $5)
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
52 define([Name], [translit([$1], [./-], [___])])dnl
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
53 AC_ARG_ENABLE([$1], [AS_HELP_STRING([ifelse([$2],[yes],[--disable-$1],[--enable-$1])], [$3])],, [enable_[]Name=$2])
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
54 if test "x${enable_[]Name}" = "xyes"; then
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
55 m4_ifvaln([$4], [$4], [:])dnl
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
56 m4_ifvaln([$5], [else $5])dnl
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
57 fi
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
58 ])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
59
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
60
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
61 AC_DEFUN([AUD_ARG_SIMPLE], [dnl
2713
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
62 # _A_ARG_SIMPLE($1, $2, $3, $4, $5, $6)
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
63 define([Name], [translit([$1], [./-], [___])])dnl
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
64 AC_ARG_ENABLE([$1], [AS_HELP_STRING([ifelse([$2],[yes],[--disable-$1],[--enable-$1])], [$3])],, [enable_[]Name=$2])
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
65 if test "x${enable_[]Name}" = "xyes"; then
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
66 AC_DEFINE([$4], [$5], [$6])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
67 fi
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
68 AUD_CONDITIONAL([$4], [enable_$1])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
69 AC_SUBST([$4])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
70 ])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
71
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
72
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
73 dnl ** Wrapper for cached compilation check
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
74 dnl ** AUD_TRY_COMPILE([message], [result variable], [includes], [body], [if ok], [if not ok])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
75 AC_DEFUN([AUD_TRY_COMPILE], [dnl
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
76 AC_CACHE_CHECK([$1], [$2],
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
77 [AC_TRY_COMPILE([$3], [$4], [$2="yes"], [$2="no"])])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
78 if test "x${$2}" = "xyes"; then
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
79 m4_ifvaln([$5], [$5], [:])dnl
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
80 m4_ifvaln([$6], [else $6])dnl
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
81 fi
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
82 ])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
83
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
84
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
85 dnl ** Check for GNU make
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
86 AC_DEFUN([AUD_CHECK_GNU_MAKE],[
2683
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
87 AC_CACHE_CHECK([for GNU make],cv_gnu_make_command,[
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
88 cv_gnu_make_command=""
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
89 for a in "$MAKE" make gmake gnumake; do
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
90 test "x$a" = "x" && continue
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
91 if ( sh -c "$a --version" 2>/dev/null | grep "GNU Make" >/dev/null ) ; then
2683
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
92 cv_gnu_make_command="$a"
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
93 break
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
94 fi
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
95 done
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
96 ])
2683
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
97 if test "x$cv_gnu_make_command" != "x" ; then
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
98 MAKE="$cv_gnu_make_command"
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
99 else
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
100 AC_MSG_ERROR([** GNU make not found. If it is installed, try setting MAKE environment variable. **])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
101 fi
2713
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
102 AC_SUBST([MAKE])dnl
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
103 ])dnl
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
104
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
105
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
106 dnl *** Define plugin directories
2713
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
107 AC_DEFUN([AUD_DEFINE_PLUGIN_DIR],[dnl
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
108 define([Name], [translit([$1], [a-z], [A-Z])])dnl
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
109 if test "x$enable_one_plugin_dir" = "xyes"; then
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
110 ifdef([aud_plugin_dirs_defined],[],
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
111 [ pluginsubs="\\\"Plugins\\\""
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
112 ])dnl
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
113 Name[]_PLUGIN_DIR="Plugins"
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
114 else
2684
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
115 ifdef([aud_def_plugin_dirs_defined],
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
116 [pluginsubs="$pluginsubs,\\\"$1\\\""],
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
117 [pluginsubs="\\\"$1\\\""])
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
118 Name[]_PLUGIN_DIR="$1"
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
119 fi
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
120 AC_SUBST(Name[]_PLUGIN_DIR)dnl
2684
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
121 define([aud_def_plugin_dirs_defined],[1])dnl
2540
1fd4d8e5aad2 Various new helper macros added for simplifying and sanitizing configure.ac.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
122 ])dnl
2683
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
123
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
124
2684
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
125 dnl *** Get plugin directories
2713
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
126 AC_DEFUN([AUD_GET_PLUGIN_DIR],[dnl
2684
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
127 define([Name], [translit([$1_plugin_dir], [A-Z], [a-z])])dnl
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
128 define([BigName], [translit([$1], [a-z], [A-Z])])dnl
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
129 ifdef([aud_get_plugin_dirs_defined],
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
130 [pluginsubs="$pluginsubs,\\\"$1\\\""],
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
131 [pluginsubs="\\\"$1\\\""])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
132 BigName[]_PLUGIN_DIR=`pkg-config audacious --variable=[]Name[]`
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
133 AC_SUBST(BigName[]_PLUGIN_DIR)dnl
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
134 define([aud_get_plugin_dirs_defined],[1])dnl
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
135 ])dnl
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
136
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
137
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
138
2683
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
139 dnl ***
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
140 dnl *** Common checks
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
141 dnl ***
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
142 AC_DEFUN([AUD_COMMON_PROGS], [
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
143
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
144 dnl Check for C and C++ compilers
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
145 dnl =============================
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
146 AUD_CHECK_GNU_MAKE
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
147 AC_PROG_CC
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
148 AC_PROG_CXX
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
149 AM_PROG_AS
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
150 AC_ISC_POSIX
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
151 AC_C_BIGENDIAN
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
152
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
153 if test "x$GCC" = "xyes"; then
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
154 CFLAGS="$CFLAGS -Wall -pipe"
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
155 CXXFLAGS="$CXXFLAGS -pipe -Wall"
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
156 fi
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
157
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
158 dnl Checks for various programs
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
159 dnl ===========================
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
160 AC_PROG_LN_S
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
161 AC_PROG_MAKE_SET
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
162 AC_PATH_PROG([RM], [rm])
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
163 AC_PATH_PROG([MV], [mv])
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
164 AC_PATH_PROG([CP], [cp])
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
165 AC_PATH_PROG([AR], [ar])
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
166 AC_PATH_PROG([RANLIB], [ranlib])
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
167
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
168
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
169 dnl Check for Gtk+/GLib and pals
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
170 dnl ============================
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
171 AUD_CHECK_MODULE([GLIB], [glib-2.0], [>= 2.14.0], [Glib2])
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
172 AUD_CHECK_MODULE([GTHREAD], [gthread-2.0], [>= 2.14.0], [gthread-2.0])
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
173 AUD_CHECK_MODULE([GTK], [gtk+-2.0], [>= 2.10.0], [Gtk+2])
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
174 AUD_CHECK_MODULE([PANGO], [pango], [>= 1.8.0], [Pango])
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
175 AUD_CHECK_MODULE([CAIRO], [cairo], [>= 1.2.4], [Cairo])
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
176
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
177
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
178 dnl Check for libmowgli
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
179 dnl ===================
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
180 AUD_CHECK_MODULE([MOWGLI], [libmowgli], [>= 0.4.0], [libmowgli],
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
181 [http://www.atheme.org/projects/mowgli.shtml])
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
182
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
183
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
184 dnl Check for libmcs
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
185 dnl ================
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
186 AUD_CHECK_MODULE([LIBMCS], [libmcs], [>= 0.7], [libmcs],
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
187 [http://www.atheme.org/projects/mcs.shtml])
2684
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
188
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
189
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
190 dnl SSE2 support
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
191 dnl ============
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
192 AUD_ARG_ENABLE([sse2], [yes],
2713
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
193 [Disable SSE2 support (def: enabled)],
2684
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
194 [
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
195 AC_MSG_CHECKING([SSE2 support])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
196 aud_my_save_CFLAGS="$CFLAGS"
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
197 CFLAGS="-msse2"
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
198 AC_TRY_RUN([
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
199 #include <emmintrin.h>
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
200 int main()
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
201 {
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
202 _mm_setzero_pd();
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
203 return 0;
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
204 }
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
205 ],[
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
206 AC_MSG_RESULT([yes])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
207 AC_DEFINE([HAVE_SSE2], 1, [Define to 1 if your system has SSE2 support])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
208 SIMD_CFLAGS="-msse2"
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
209 ],[
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
210 AC_MSG_RESULT([no])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
211 enable_sse2="no"
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
212 ])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
213 AC_SUBST([SIMD_CFLAGS])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
214 CFLAGS="$aud_my_save_CFLAGS"
2683
dc12b0d4d33e Synchronized acinclude.m4 from core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2540
diff changeset
215 ])
2684
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
216
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
217 dnl AltiVec support
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
218 dnl ===============
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
219 AUD_ARG_ENABLE([altivec], [yes],
2713
182dd0f45cc7 Synchronize acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2684
diff changeset
220 [Disable AltiVec support (def: enabled)],
2684
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
221 [
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
222 AC_CHECK_HEADERS([altivec.h],
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
223 [
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
224 AC_DEFINE([HAVE_ALTIVEC], 1, [Define to 1 if your system has AltiVec.])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
225 AC_DEFINE([HAVE_ALTIVEC_H], 1, [Define to 1 if your system has an altivec.h file.])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
226 AC_DEFINE([ARCH_POWERPC], 1, [Define to 1 if your system is a PowerPC.])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
227 SIMD_CFLAGS="-maltivec"
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
228 AC_SUBST([SIMD_CFLAGS])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
229 ],[
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
230 enable_altivec="no"
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
231 ])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
232 ])
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
233
e48338bffeef Synchronized acinclude.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 2683
diff changeset
234 ])