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 () { |
---|
| 35 | cat <<'EOF' > Makefile |
---|
| 36 | all: error |
---|
| 37 | clean: error |
---|
| 38 | new: error |
---|
| 39 | install: error |
---|
| 40 | error: |
---|
| 41 | echo Error while configuring this plugin |
---|
| 42 | echo rerun configure script to fix |
---|
| 43 | EOF |
---|
| 44 | exit 1; |
---|
| 45 | } |
---|
| 46 | |
---|
[0] | 47 | echo -n 'testing for C compiler... ' |
---|
| 48 | CC=$(which gcc cc 2> /dev/null | head -n 1) |
---|
| 49 | if [ -x "$CC" ] |
---|
| 50 | then |
---|
| 51 | echo $CC |
---|
| 52 | else |
---|
| 53 | echo no. |
---|
[1048] | 54 | on_error; |
---|
[0] | 55 | fi |
---|
| 56 | |
---|
| 57 | echo -n 'testing for libao... ' |
---|
| 58 | cat > tests.c << EOF |
---|
| 59 | #include <ao/ao.h> |
---|
| 60 | #include <ao/plugin.h> |
---|
| 61 | int main (void) { return 0; } |
---|
| 62 | EOF |
---|
| 63 | |
---|
| 64 | $CC -lao -o tests tests.c 2> /dev/null |
---|
| 65 | ./tests 2> /dev/null |
---|
| 66 | |
---|
| 67 | if [ "$?" = '0' ] |
---|
| 68 | then |
---|
| 69 | echo yes |
---|
| 70 | else |
---|
| 71 | echo no. |
---|
[1048] | 72 | on_error |
---|
[0] | 73 | fi |
---|
| 74 | |
---|
| 75 | echo -n 'testing for libroar... ' |
---|
[1050] | 76 | if $HAVE_ROAR |
---|
| 77 | then |
---|
| 78 | echo 'yes (forced)' |
---|
| 79 | else |
---|
| 80 | cat > tests.c << EOF |
---|
[0] | 81 | #include <roaraudio.h> |
---|
| 82 | int main (void) { return 0; } |
---|
| 83 | EOF |
---|
| 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] | 95 | fi |
---|
| 96 | rm -f tests tests.c |
---|
| 97 | |
---|
| 98 | echo creating Makefile... |
---|
| 99 | echo "CC=$CC" > Makefile |
---|
| 100 | echo "INSTALL_DIR=$INSTALL_DIR" >> Makefile |
---|
| 101 | cat Makefile.pre >> Makefile |
---|
| 102 | |
---|
| 103 | #ll |
---|
Note: See
TracBrowser
for help on using the repository browser.