source: roaraudio/plugins/ao/configure @ 1719:0667f33c9f99

Last change on this file since 1719:0667f33c9f99 was 1719:0667f33c9f99, checked in by phi, 15 years ago

moved Makefile.pre to Makefile

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