source: roaraudio/plugins/ao/configure @ 1706:4400f3a0e375

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

exit after --help

  • Property exe set to *
File size: 1.4 KB
RevLine 
[0]1#!/bin/sh
2
3INSTALL_DIR=/usr/lib/ao/plugins-2/
4
[1050]5HAVE_ROAR=false
6
[0]7while [ "$1" != '' ]
8do
9 case "$1" in
[1598]10  --install-dir|--inst-dir)
[0]11   INSTALL_DIR="$2"
12   shift;
13  ;;
[1050]14  --force-have-roar)
15   HAVE_ROAR=true
16  ;;
[0]17  --help|-h)
18    cat << EOF
19Usage: ./configure [OPTIONS]...
20
21Options:
22  --help         - Show this help
23  --inst-dir DIR - Install dir
24EOF
[1703]25    exit 0
[0]26   ;;
27  *)
28    echo 'Unknown option. Try ./configure --help'
29    exit 2
30 esac
31 shift;
32done
33
[1048]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
[0]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.
[1048]54 on_error;
[0]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.
[1048]72 on_error
[0]73fi
74
75echo -n 'testing for libroar... '
[1050]76if $HAVE_ROAR
77then
78 echo 'yes (forced)'
79else
80 cat > tests.c << EOF
[0]81#include <roaraudio.h>
82int main (void) { return 0; }
83EOF
84
[1693]85 $CC -o tests tests.c -lroar 2> /dev/null
[1050]86 ./tests 2> /dev/null
[0]87
[1050]88 if [ "$?" = '0' ]
89 then
90  echo yes
91 else
92  echo no.
93  on_error
94 fi
[0]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.