source: roaraudio/plugins/xmms/configure @ 1121:476f1bd5f496

Last change on this file since 1121:476f1bd5f496 was 1121:476f1bd5f496, checked in by phi, 15 years ago

added a small usleep() of 100ms in error case, this improves the stability

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