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