source: roaraudio/plugins/ao/configure @ 1742:4fbe8cb28680

Last change on this file since 1742:4fbe8cb28680 was 1742:4fbe8cb28680, checked in by phi, 15 years ago

moved a lot things to the common configure file

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