source: roaraudio/plugins/ao/configure @ 1048:941ec9dc3e8c

Last change on this file since 1048:941ec9dc3e8c was 1048:941ec9dc3e8c, checked in by phi, 15 years ago

write a dummy Makefile in error case

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