source: roaraudio/plugins/ao/configure @ 3233:4a4b67ead57d

Last change on this file since 3233:4a4b67ead57d was 3233:4a4b67ead57d, checked in by phi, 14 years ago

test for .output_matrix

  • Property exe set to *
File size: 1.7 KB
Line 
1#!/bin/sh
2
3. ../configure.inc
4
5INSTALL_DIR=/usr/lib/ao/plugins-2/
6
7HAVE_ROAR=false
8
9while [ "$1" != '' ]
10do
11 case "$1" in
12  --install-dir|--inst-dir)
13   INSTALL_DIR="$2"
14   shift;
15  ;;
16  --pkg-config)
17   PKG_CONFIG="$2"
18   shift;
19  ;;
20  --force-have-roar)
21   HAVE_ROAR=true
22  ;;
23  --help|-h)
24    cat << EOF
25Usage: ./configure [OPTIONS]...
26
27Options:
28  --help               - Show this help
29  --inst-dir DIR       - Install dir
30  --force-have-roar    - Force to assume libroar is ok
31  --pkg-config PKGCONF - Set filename for pkg-config
32EOF
33    exit 0
34   ;;
35  *)
36    echo 'Unknown option. Try ./configure --help'
37    exit 2
38 esac
39 shift;
40done
41
42on_error () {
43 rm -f Makefile.conf
44 exit 1;
45}
46
47check_cc;
48check_pkg_config;
49
50echo -n 'testing for libao... '
51cat > tests.c << EOF
52#include <ao/ao.h>
53#include <ao/plugin.h>
54int main (void) { return 0; }
55EOF
56
57if [ "$PKG_CONFIG" = '' ]
58then
59 AO_LIBS=''
60 AO_CFLAGS=''
61else
62 AO_LIBS=`pkg-config --libs ao`
63 AO_CFLAGS=`pkg-config --cflags ao`
64fi
65if [ "$AO_LIBS" = '' -a "$AO_CFLAGS" = '' ]
66then
67 AO_LIBS='-lao'
68 AO_CFLAGS=''
69fi
70
71$CC $AO_LIBS $AO_CFLAGS -o tests tests.c 2> /dev/null
72./tests 2> /dev/null
73
74if [ "$?" = '0' ]
75then
76 echo yes
77else
78 echo no.
79 on_error
80fi
81
82echo -n 'testing for libao to support mapping matrix... '
83cat > tests.c << EOF
84#include <ao/ao.h>
85#include <ao/plugin.h>
86int main (void) { ao_device dev = {.output_matrix = ""}; return 0; }
87EOF
88
89$CC $AO_LIBS $AO_CFLAGS -o tests tests.c 2> /dev/null
90R="$?"
91./tests 2> /dev/null
92
93HAVE_MATRIX=false
94
95if [ "$R" = '0' -a "$?" = '0' ]
96then
97 echo yes
98 HAVE_MATRIX=true
99else
100 echo no.
101fi
102
103check_libroar;
104
105rm -f tests tests.c
106
107echo creating Makefile.conf...
108{
109 echo "CC=$CC"
110 echo "INSTALL_DIR=$INSTALL_DIR"
111 echo
112 echo "AO_CFLAGS=$AO_CFLAGS"
113 echo "AO_LIBS=$AO_LIBS"
114} > Makefile.conf
115
116#ll
Note: See TracBrowser for help on using the repository browser.