source: roaraudio/plugins/xmms/configure @ 1702:0a8cda6b9314

Last change on this file since 1702:0a8cda6b9314 was 1702:0a8cda6b9314, checked in by phi, 15 years ago

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