source: roaraudio/plugins/xmms/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.4 KB
Line 
1#!/bin/sh
2
3. ../configure.inc
4
5HAVE_ROAR=false
6
7while [ "$1" != '' ]
8do
9 case "$1" in
10  --install-dir|--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 fi
65else
66  echo $PKG_CONFIG '(forced)'
67fi
68
69echo -n 'testing for gtk... '
70#pkg-config
71
72#if [ "$PKG_CONFIG" != '' ]
73#then
74# GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0 2> /dev/null`
75# GTK_CFLAFS=`$PKG_CONFIG --cflags gtk+-2.0 2> /dev/null`
76#else
77 GTK_LIBS=`gtk-config --libs 2> /dev/null`
78 GTK_CFLAFS=`gtk-config --cflags 2> /dev/null`
79#fi
80
81if [ "$GTK_LIBS" = '' -a "$GTK_CFLAFS" = '' ]
82then
83 echo no.
84 on_error;
85else
86 echo yes
87fi
88
89echo -n 'testing for xmms... '
90XMMS_LIBS=`xmms-config --libs 2> /dev/null`
91XMMS_CFLAGS=`xmms-config --cflags 2> /dev/null`
92
93if [ "$XMMS_LIBS" = '' -a "$XMMS_CFLAGS" = '' ]
94then
95 echo no.
96 on_error;
97else
98 echo yes
99fi
100
101echo -n 'testing for xmms plugin dir... '
102if [ "$INSTALL_DIR" = '' ]
103then
104 INSTALL_DIR=`xmms-config --output-plugin-dir`
105
106 if [ "$INSTALL_DIR" = '' ]
107 then
108  echo not found.
109  on_error;
110 else
111  echo "$INSTALL_DIR"
112 fi
113else
114  echo "$INSTALL_DIR"
115fi
116
117echo -n 'testing for libroar... '
118if $HAVE_ROAR
119then
120 echo 'yes (forced)'
121else
122 cat > tests.c << EOF
123#include <roaraudio.h>
124int main (void) { return 0; }
125EOF
126
127 $CC -o tests tests.c -lroar 2> /dev/null
128 ./tests 2> /dev/null
129
130 if [ "$?" = '0' ]
131 then
132  echo yes
133 else
134  echo no.
135  on_error
136 fi
137fi
138rm -f tests tests.c
139
140echo creating Makefile.conf...
141{
142 echo "CC=$CC"
143 echo
144 echo "GTK_LIBS=$GTK_LIBS"
145 echo "GTK_CFLAFS=$GTK_CFLAFS"
146 echo
147 echo "XMMS_LIBS=$XMMS_LIBS"
148 echo "XMMS_CFLAGS=$XMMS_CFLAGS"
149 echo
150 echo "INSTALL_DIR=$INSTALL_DIR"
151} > Makefile.conf
152
153#ll
Note: See TracBrowser for help on using the repository browser.