source: roaraudio/plugins/ao/configure @ 1054:048ae1a48654

Last change on this file since 1054:048ae1a48654 was 1050:f822683268ac, checked in by phi, 15 years ago

added --force-have-roar, include roaraudio/lib to gcc lib search path

  • Property exe set to *
File size: 1.4 KB
Line 
1#!/bin/sh
2
3INSTALL_DIR=/usr/lib/ao/plugins-2/
4
5HAVE_ROAR=false
6
7while [ "$1" != '' ]
8do
9 case "$1" in
10  --inst-dir)
11   INSTALL_DIR="$2"
12   shift;
13  ;;
14  --force-have-roar)
15   HAVE_ROAR=true
16  ;;
17  --help|-h)
18    cat << EOF
19Usage: ./configure [OPTIONS]...
20
21Options:
22  --help         - Show this help
23  --inst-dir DIR - Install dir
24EOF
25   ;;
26  *)
27    echo 'Unknown option. Try ./configure --help'
28    exit 2
29 esac
30 shift;
31done
32
33on_error () {
34 cat <<'EOF' > Makefile
35all: error
36clean: error
37new: error
38install: error
39error:
40        echo Error while configuring this plugin
41        echo rerun configure script to fix
42EOF
43 exit 1;
44}
45
46echo -n 'testing for C compiler... '
47CC=$(which gcc cc 2> /dev/null | head -n 1)
48if [ -x "$CC" ]
49then
50 echo $CC
51else
52 echo no.
53 on_error;
54fi
55
56echo -n 'testing for libao... '
57cat > tests.c << EOF
58#include <ao/ao.h>
59#include <ao/plugin.h>
60int main (void) { return 0; }
61EOF
62
63$CC -lao -o tests tests.c 2> /dev/null
64./tests 2> /dev/null
65
66if [ "$?" = '0' ]
67then
68 echo yes
69else
70 echo no.
71 on_error
72fi
73
74echo -n 'testing for libroar... '
75if $HAVE_ROAR
76then
77 echo 'yes (forced)'
78else
79 cat > tests.c << EOF
80#include <roaraudio.h>
81int main (void) { return 0; }
82EOF
83
84 $CC -lroar -o tests tests.c 2> /dev/null
85 ./tests 2> /dev/null
86
87 if [ "$?" = '0' ]
88 then
89  echo yes
90 else
91  echo no.
92  on_error
93 fi
94fi
95rm -f tests tests.c
96
97echo creating Makefile...
98echo "CC=$CC" > Makefile
99echo "INSTALL_DIR=$INSTALL_DIR" >> Makefile
100cat Makefile.pre >> Makefile
101
102#ll
Note: See TracBrowser for help on using the repository browser.