source: roaraudio/plugins/xmms/configure @ 1693:7bdb996c57a6

Last change on this file since 1693:7bdb996c57a6 was 1693:7bdb996c57a6, checked in by phi, 15 years ago

use correct order of linker parameters

  • 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   ;;
30  *)
31    echo 'Unknown option. Try ./configure --help'
32    exit 2
33 esac
34 shift;
35done
36
37on_error () {
38 exit 1;
39}
40
41echo -n 'testing for C compiler... '
42CC=$(which gcc cc 2> /dev/null | head -n 1)
43if [ -x "$CC" ]
44then
45 echo $CC
46else
47 echo no.
48 on_error;
49fi
50
51echo -n "checking for pkg-config... "
52if [ "$PKG_CONFIG" = '' ]
53then
54 PKG_CONFIG=$(which pkg-config false 2> /dev/null | grep ^/ | head -n 1)
55 if $PKG_CONFIG --help > /dev/null 2> /dev/null
56 then
57  echo $PKG_CONFIG
58 else
59  PKG_CONFIG=''
60  echo no
61 fi
62else
63  echo $PKG_CONFIG '(forced)'
64fi
65
66echo -n 'testing for gtk... '
67#pkg-config
68
69#if [ "$PKG_CONFIG" != '' ]
70#then
71# GTK_LIBS=`pkg-config --libs gtk+-2.0 2> /dev/null`
72# GTK_CFLAFS=`pkg-config --cflags gtk+-2.0 2> /dev/null`
73#else
74 GTK_LIBS=`gtk-config --libs 2> /dev/null`
75 GTK_CFLAFS=`gtk-config --cflags 2> /dev/null`
76#fi
77
78if [ "$GTK_LIBS" = '' -a "$GTK_CFLAFS" = '' ]
79then
80 echo no.
81 on_error;
82else
83 echo yes
84fi
85
86echo -n 'testing for xmms... '
87XMMS_LIBS=`xmms-config --libs 2> /dev/null`
88XMMS_CFLAGS=`xmms-config --cflags 2> /dev/null`
89
90if [ "$XMMS_LIBS" = '' -a "$XMMS_CFLAGS" = '' ]
91then
92 echo no.
93 on_error;
94else
95 echo yes
96fi
97
98echo -n 'testing for xmms plugin dir... '
99if [ "$INSTALL_DIR" = '' ]
100then
101 INSTALL_DIR=`xmms-config --output-plugin-dir`
102
103 if [ "$INSTALL_DIR" = '' ]
104 then
105  echo not found.
106  on_error;
107 else
108  echo "$INSTALL_DIR"
109 fi
110else
111  echo "$INSTALL_DIR"
112fi
113
114echo -n 'testing for libroar... '
115if $HAVE_ROAR
116then
117 echo 'yes (forced)'
118else
119 cat > tests.c << EOF
120#include <roaraudio.h>
121int main (void) { return 0; }
122EOF
123
124 $CC -o tests tests.c -lroar 2> /dev/null
125 ./tests 2> /dev/null
126
127 if [ "$?" = '0' ]
128 then
129  echo yes
130 else
131  echo no.
132  on_error
133 fi
134fi
135rm -f tests tests.c
136
137echo creating Makefile.conf...
138{
139 echo "CC=$CC"
140 echo
141 echo "GTK_LIBS=$GTK_LIBS"
142 echo "GTK_CFLAFS=$GTK_CFLAFS"
143 echo
144 echo "XMMS_LIBS=$XMMS_LIBS"
145 echo "XMMS_CFLAGS=$XMMS_CFLAGS"
146 echo
147 echo "INSTALL_DIR=$INSTALL_DIR"
148} > Makefile.conf
149
150#ll
Note: See TracBrowser for help on using the repository browser.