source: roaraudio/plugins/audacious/configure @ 1740:511ac10ad77b

Last change on this file since 1740:511ac10ad77b was 1740:511ac10ad77b, checked in by phi, 15 years ago

addec configure.inc: global configure things

  • Property exe set to *
File size: 2.6 KB
Line 
1#!/bin/sh
2
3. ../configure.inc
4
5HAVE_ROAR=false
6
7while [ "$1" != '' ]
8do
9 case "$1" in
10  --inst-dir)
11   INSTALL_DIR="$2"
12   shift;
13  ;;
14  --pkg-config)
15   PKG_CONFIG="$2"
16   shift;
17  ;;
18  --force-have-roar)
19   HAVE_ROAR=true
20  ;;
21  --help|-h)
22    cat << EOF
23Usage: ./configure [OPTIONS]...
24
25Options:
26  --help               - Show this help
27  --inst-dir DIR       - Install dir
28  --force-have-roar    - Force to assume libroar is ok
29  --pkg-config PKGCONF - Set filename for pkg-config
30EOF
31    exit 0
32   ;;
33  *)
34    echo 'Unknown option. Try ./configure --help'
35    exit 2
36 esac
37 shift;
38done
39
40on_error () {
41 exit 1;
42}
43
44echo -n 'testing for C compiler... '
45CC=$(which gcc cc 2> /dev/null | head -n 1)
46if [ -x "$CC" ]
47then
48 echo $CC
49else
50 echo no.
51 on_error;
52fi
53
54echo -n "checking for pkg-config... "
55if [ "$PKG_CONFIG" = '' ]
56then
57 PKG_CONFIG=$(which pkg-config false 2> /dev/null | grep ^/ | head -n 1)
58 if $PKG_CONFIG --help > /dev/null 2> /dev/null
59 then
60  echo $PKG_CONFIG
61 else
62  PKG_CONFIG=''
63  echo no
64  on_error;
65 fi
66else
67  echo $PKG_CONFIG '(forced)'
68fi
69
70echo -n 'testing for gtk... '
71
72if [ "$PKG_CONFIG" != '' ]
73then
74 GTK_LIBS=`$PKG_CONFIG  gtk+-2.0 --libs 2> /dev/null`
75 GTK_CFLAFS=`$PKG_CONFIG --cflags gtk+-2.0 2> /dev/null`
76else
77 GTK_LIBS=`gtk-config gtk+-2.0 --libs 2> /dev/null`
78 GTK_CFLAFS=`gtk-config gtk+-2.0 --cflags 2> /dev/null`
79fi
80
81if [ "$GTK_LIBS" = '' -a "$GTK_CFLAFS" = '' ]
82then
83 echo no.
84 on_error;
85else
86 echo yes
87fi
88
89echo -n 'testing for audacious version... '
90if $PKG_CONFIG --atleast-version=1.5.1 audacious 2> /dev/null
91then
92 echo '>= 1.5.1'
93else
94 echo 'too old'
95 on_error;
96fi
97
98echo -n 'testing for audacious... '
99XMMS_LIBS=`$PKG_CONFIG audacious  --libs 2> /dev/null`
100XMMS_CFLAGS=`$PKG_CONFIG audacious  --cflags 2> /dev/null`
101
102if [ "$XMMS_LIBS" = '' -a "$XMMS_CFLAGS" = '' ]
103then
104 echo no.
105 on_error;
106else
107 echo yes
108fi
109
110echo -n 'testing for audacious plugin dir... '
111if [ "$INSTALL_DIR" = '' ]
112then
113 INSTALL_DIR="`$PKG_CONFIG --variable=output_plugin_dir audacious 2> /dev/null`"
114
115 if [ "$INSTALL_DIR" = '' ]
116 then
117  echo not found.
118  on_error;
119 else
120  echo "$INSTALL_DIR"
121 fi
122else
123  echo "$INSTALL_DIR"
124fi
125
126echo -n 'testing for libroar... '
127if $HAVE_ROAR
128then
129 echo 'yes (forced)'
130else
131 cat > tests.c << EOF
132#include <roaraudio.h>
133int main (void) { return 0; }
134EOF
135
136 $CC -o tests tests.c -lroar 2> /dev/null
137 ./tests 2> /dev/null
138
139 if [ "$?" = '0' ]
140 then
141  echo yes
142 else
143  echo no.
144  on_error
145 fi
146fi
147rm -f tests tests.c
148
149echo creating Makefile.conf...
150{
151 echo "CC=$CC"
152 echo
153 echo "GTK_LIBS=$GTK_LIBS"
154 echo "GTK_CFLAFS=$GTK_CFLAFS"
155 echo
156 echo "XMMS_LIBS=$XMMS_LIBS"
157 echo "XMMS_CFLAGS=$XMMS_CFLAGS"
158 echo
159 echo "INSTALL_DIR=$INSTALL_DIR"
160} > Makefile.conf
161
162#ll
Note: See TracBrowser for help on using the repository browser.