source: roaraudio/plugins/ao/configure @ 1740:511ac10ad77b

Last change on this file since 1740:511ac10ad77b was 1740:511ac10ad77b, checked in by phi, 15 years ago

addec configure.inc: global configure things

  • Property exe set to *
File size: 2.0 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
47echo -n 'testing for C compiler... '
48CC=$(which gcc cc 2> /dev/null | head -n 1)
49if [ -x "$CC" ]
50then
51 echo $CC
52else
53 echo no.
54 on_error;
55fi
56
57echo -n "checking for pkg-config... "
58if [ "$PKG_CONFIG" = '' ]
59then
60 PKG_CONFIG=$(which pkg-config false 2> /dev/null | grep ^/ | head -n 1)
61 if $PKG_CONFIG --help > /dev/null 2> /dev/null
62 then
63  echo $PKG_CONFIG
64 else
65  PKG_CONFIG=''
66  echo no
67  on_error;
68 fi
69else
70  echo $PKG_CONFIG '(forced)'
71fi
72
73echo -n 'testing for libao... '
74cat > tests.c << EOF
75#include <ao/ao.h>
76#include <ao/plugin.h>
77int main (void) { return 0; }
78EOF
79
80if [ "$PKG_CONFIG" = '' ]
81then
82 AO_LIBS=''
83 AO_CFLAGS=''
84else
85 AO_LIBS=`pkg-config --libs ao`
86 AO_CFLAGS=`pkg-config --cflags ao`
87fi
88if [ "$AO_LIBS" = '' -a "$AO_CFLAGS" = '' ]
89then
90 AO_LIBS='-lao'
91 AO_CFLAGS=''
92fi
93
94$CC $AO_LIBS $AO_CFLAGS -o tests tests.c 2> /dev/null
95./tests 2> /dev/null
96
97if [ "$?" = '0' ]
98then
99 echo yes
100else
101 echo no.
102 on_error
103fi
104
105echo -n 'testing for libroar... '
106if $HAVE_ROAR
107then
108 echo 'yes (forced)'
109else
110 cat > tests.c << EOF
111#include <roaraudio.h>
112int main (void) { return 0; }
113EOF
114
115 $CC -o tests tests.c -lroar 2> /dev/null
116 ./tests 2> /dev/null
117
118 if [ "$?" = '0' ]
119 then
120  echo yes
121 else
122  echo no.
123  on_error
124 fi
125fi
126rm -f tests tests.c
127
128echo creating Makefile.conf...
129{
130 echo "CC=$CC"
131 echo "INSTALL_DIR=$INSTALL_DIR"
132 echo
133 echo "AO_CFLAGS=$AO_CFLAGS"
134 echo "AO_LIBS=$AO_LIBS"
135} > Makefile.conf
136
137#ll
Note: See TracBrowser for help on using the repository browser.