source:
roaraudio/plugins/ao/configure
@
1721:ec2fcd4e20c2
Last change on this file since 1721:ec2fcd4e20c2 was 1720:b5bacf3d00cc, checked in by phi, 15 years ago | |
---|---|
|
|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[0] | 1 | #!/bin/sh |
2 | ||
3 | INSTALL_DIR=/usr/lib/ao/plugins-2/ | |
4 | ||
[1050] | 5 | HAVE_ROAR=false |
6 | ||
[0] | 7 | while [ "$1" != '' ] |
8 | do | |
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 | |
19 | Usage: ./configure [OPTIONS]... | |
20 | ||
21 | Options: | |
22 | --help - Show this help | |
23 | --inst-dir DIR - Install dir | |
24 | EOF | |
[1703] | 25 | exit 0 |
[0] | 26 | ;; |
27 | *) | |
28 | echo 'Unknown option. Try ./configure --help' | |
29 | exit 2 | |
30 | esac | |
31 | shift; | |
32 | done | |
33 | ||
[1048] | 34 | on_error () { |
[1719] | 35 | rm -f Makefile.conf |
[1048] | 36 | exit 1; |
37 | } | |
38 | ||
[0] | 39 | echo -n 'testing for C compiler... ' |
40 | CC=$(which gcc cc 2> /dev/null | head -n 1) | |
41 | if [ -x "$CC" ] | |
42 | then | |
43 | echo $CC | |
44 | else | |
45 | echo no. | |
[1048] | 46 | on_error; |
[0] | 47 | fi |
48 | ||
49 | echo -n 'testing for libao... ' | |
50 | cat > tests.c << EOF | |
51 | #include <ao/ao.h> | |
52 | #include <ao/plugin.h> | |
53 | int main (void) { return 0; } | |
54 | EOF | |
55 | ||
56 | $CC -lao -o tests tests.c 2> /dev/null | |
57 | ./tests 2> /dev/null | |
58 | ||
59 | if [ "$?" = '0' ] | |
60 | then | |
61 | echo yes | |
62 | else | |
63 | echo no. | |
[1048] | 64 | on_error |
[0] | 65 | fi |
66 | ||
67 | echo -n 'testing for libroar... ' | |
[1050] | 68 | if $HAVE_ROAR |
69 | then | |
70 | echo 'yes (forced)' | |
71 | else | |
72 | cat > tests.c << EOF | |
[0] | 73 | #include <roaraudio.h> |
74 | int main (void) { return 0; } | |
75 | EOF | |
76 | ||
[1693] | 77 | $CC -o tests tests.c -lroar 2> /dev/null |
[1050] | 78 | ./tests 2> /dev/null |
[0] | 79 | |
[1050] | 80 | if [ "$?" = '0' ] |
81 | then | |
82 | echo yes | |
83 | else | |
84 | echo no. | |
85 | on_error | |
86 | fi | |
[0] | 87 | fi |
88 | rm -f tests tests.c | |
89 | ||
[1719] | 90 | echo creating Makefile.conf... |
91 | { | |
92 | echo "CC=$CC" | |
93 | echo "INSTALL_DIR=$INSTALL_DIR" | |
[1720] | 94 | } > Makefile.conf |
[0] | 95 | |
96 | #ll |
Note: See TracBrowser
for help on using the repository browser.