source: roaraudio/plugins/ao/configure @ 1703:823e984bc2fc

Last change on this file since 1703:823e984bc2fc was 1703:823e984bc2fc, checked in by phi, 15 years ago

exit after --help

  • 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  --install-dir|--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    exit 0
26   ;;
27  *)
28    echo 'Unknown option. Try ./configure --help'
29    exit 2
30 esac
31 shift;
32done
33
34on_error () {
35 cat <<'EOF' > Makefile
36all: error
37clean: error
38new: error
39install: error
40error:
41        echo Error while configuring this plugin
42        echo rerun configure script to fix
43EOF
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 'testing for libao... '
58cat > tests.c << EOF
59#include <ao/ao.h>
60#include <ao/plugin.h>
61int main (void) { return 0; }
62EOF
63
64$CC -lao -o tests tests.c 2> /dev/null
65./tests 2> /dev/null
66
67if [ "$?" = '0' ]
68then
69 echo yes
70else
71 echo no.
72 on_error
73fi
74
75echo -n 'testing for libroar... '
76if $HAVE_ROAR
77then
78 echo 'yes (forced)'
79else
80 cat > tests.c << EOF
81#include <roaraudio.h>
82int main (void) { return 0; }
83EOF
84
85 $CC -o tests tests.c -lroar 2> /dev/null
86 ./tests 2> /dev/null
87
88 if [ "$?" = '0' ]
89 then
90  echo yes
91 else
92  echo no.
93  on_error
94 fi
95fi
96rm -f tests tests.c
97
98echo creating Makefile...
99echo "CC=$CC" > Makefile
100echo "INSTALL_DIR=$INSTALL_DIR" >> Makefile
101cat Makefile.pre >> Makefile
102
103#ll
Note: See TracBrowser for help on using the repository browser.