source: roaraudio/plugins/audacious/configure @ 1694:d29a1e29f07a

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

test for output plugin dir

  • Property exe set to *
File size: 2.2 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
53fi
54
55echo -n 'testing for gtk... '
56
57if [ "$PKG_CONFIG" != '' ]
58then
59 GTK_LIBS=`pkg-config  gtk+-2.0 --libs 2> /dev/null`
60 GTK_CFLAFS=`pkg-config --cflags gtk+-2.0 2> /dev/null`
61else
62 GTK_LIBS=`gtk-config gtk+-2.0 --libs 2> /dev/null`
63 GTK_CFLAFS=`gtk-config gtk+-2.0 --cflags 2> /dev/null`
64fi
65
66if [ "$GTK_LIBS" = '' -a "$GTK_CFLAFS" = '' ]
67then
68 echo no.
69 on_error;
70else
71 echo yes
72fi
73
74echo -n 'testing for audacious... '
75XMMS_LIBS=`pkg-config audacious  --libs 2> /dev/null`
76XMMS_CFLAGS=`pkg-config audacious  --cflags 2> /dev/null`
77
78if [ "$XMMS_LIBS" = '' -a "$XMMS_CFLAGS" = '' ]
79then
80 echo no.
81 on_error;
82else
83 echo yes
84fi
85
86echo -n 'testing for audacious plugin dir... '
87if [ "$INSTALL_DIR" = '' ]
88then
89 INSTALL_DIR="`pkg-config --variable=output_plugin_dir audacious 2> /dev/null`"
90
91 if [ "$INSTALL_DIR" = '' ]
92 then
93  echo not found.
94  on_error;
95 else
96  echo "$INSTALL_DIR"
97 fi
98else
99  echo "$INSTALL_DIR"
100fi
101
102echo -n 'testing for libroar... '
103if $HAVE_ROAR
104then
105 echo 'yes (forced)'
106else
107 cat > tests.c << EOF
108#include <roaraudio.h>
109int main (void) { return 0; }
110EOF
111
112 $CC -o tests tests.c -lroar 2> /dev/null
113 ./tests 2> /dev/null
114
115 if [ "$?" = '0' ]
116 then
117  echo yes
118 else
119  echo no.
120  on_error
121 fi
122fi
123rm -f tests tests.c
124
125echo creating Makefile.conf...
126{
127 echo "CC=$CC"
128 echo
129 echo "GTK_LIBS=$GTK_LIBS"
130 echo "GTK_CFLAFS=$GTK_CFLAFS"
131 echo
132 echo "XMMS_LIBS=$XMMS_LIBS"
133 echo "XMMS_CFLAGS=$XMMS_CFLAGS"
134 echo
135 echo "INSTALL_DIR=$INSTALL_DIR"
136} > Makefile.conf
137
138#ll
Note: See TracBrowser for help on using the repository browser.