source: roaraudio/plugins/audacious/configure @ 1701:a247fb068a77

Last change on this file since 1701:a247fb068a77 was 1701:a247fb068a77, checked in by phi, 15 years ago

updated and fixed help, option to force pkg config :)

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