source: roaraudio/plugins/audacious/configure @ 1698:87da86251aaf

Last change on this file since 1698:87da86251aaf was 1695:8edface8b1cf, checked in by phi, 15 years ago

check for version, use $PKG_CONFIG

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