Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | HAVE_ROAR=false |
---|
4 | |
---|
5 | while [ "$1" != '' ] |
---|
6 | do |
---|
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 |
---|
17 | Usage: ./configure [OPTIONS]... |
---|
18 | |
---|
19 | Options: |
---|
20 | --help - Show this help |
---|
21 | --inst-dir DIR - Install dir |
---|
22 | EOF |
---|
23 | ;; |
---|
24 | *) |
---|
25 | echo 'Unknown option. Try ./configure --help' |
---|
26 | exit 2 |
---|
27 | esac |
---|
28 | shift; |
---|
29 | done |
---|
30 | |
---|
31 | on_error () { |
---|
32 | exit 1; |
---|
33 | } |
---|
34 | |
---|
35 | echo -n 'testing for C compiler... ' |
---|
36 | CC=$(which gcc cc 2> /dev/null | head -n 1) |
---|
37 | if [ -x "$CC" ] |
---|
38 | then |
---|
39 | echo $CC |
---|
40 | else |
---|
41 | echo no. |
---|
42 | on_error; |
---|
43 | fi |
---|
44 | |
---|
45 | echo -n 'testing for gtk... ' |
---|
46 | GTK_LIBS=`gtk-config --libs 2> /dev/null` |
---|
47 | GTK_CFLAFS=`gtk-config --cflags 2> /dev/null` |
---|
48 | |
---|
49 | if [ "$GTK_LIBS" = '' -a "$GTK_CFLAFS" = '' ] |
---|
50 | then |
---|
51 | echo no. |
---|
52 | on_error; |
---|
53 | else |
---|
54 | echo yes |
---|
55 | fi |
---|
56 | |
---|
57 | echo -n 'testing for xmms... ' |
---|
58 | XMMS_LIBS=`xmms-config --libs 2> /dev/null` |
---|
59 | XMMS_CFLAGS=`xmms-config --cflags 2> /dev/null` |
---|
60 | |
---|
61 | if [ "$XMMS_LIBS" = '' -a "$XMMS_CFLAGS" = '' ] |
---|
62 | then |
---|
63 | echo no. |
---|
64 | on_error; |
---|
65 | else |
---|
66 | echo yes |
---|
67 | fi |
---|
68 | |
---|
69 | echo -n 'testing for xmms plugin dir... ' |
---|
70 | if [ "$INSTALL_DIR" = '' ] |
---|
71 | then |
---|
72 | INSTALL_DIR=`xmms-config --output-plugin-dir` |
---|
73 | |
---|
74 | if [ "$INSTALL_DIR" = '' ] |
---|
75 | then |
---|
76 | echo not found. |
---|
77 | on_error; |
---|
78 | else |
---|
79 | echo "$INSTALL_DIR" |
---|
80 | fi |
---|
81 | else |
---|
82 | echo "$INSTALL_DIR" |
---|
83 | fi |
---|
84 | |
---|
85 | echo -n 'testing for libroar... ' |
---|
86 | if $HAVE_ROAR |
---|
87 | then |
---|
88 | echo 'yes (forced)' |
---|
89 | else |
---|
90 | cat > tests.c << EOF |
---|
91 | #include <roaraudio.h> |
---|
92 | int main (void) { return 0; } |
---|
93 | EOF |
---|
94 | |
---|
95 | $CC -lroar -o tests tests.c 2> /dev/null |
---|
96 | ./tests 2> /dev/null |
---|
97 | |
---|
98 | if [ "$?" = '0' ] |
---|
99 | then |
---|
100 | echo yes |
---|
101 | else |
---|
102 | echo no. |
---|
103 | on_error |
---|
104 | fi |
---|
105 | fi |
---|
106 | rm -f tests tests.c |
---|
107 | |
---|
108 | echo creating Makefile.conf... |
---|
109 | { |
---|
110 | echo "CC=$CC" |
---|
111 | echo |
---|
112 | echo "GTK_LIBS=$GTK_LIBS" |
---|
113 | echo "GTK_CFLAFS=$GTK_CFLAFS" |
---|
114 | echo |
---|
115 | echo "XMMS_LIBS=$XMMS_LIBS" |
---|
116 | echo "XMMS_CFLAGS=$XMMS_CFLAGS" |
---|
117 | echo |
---|
118 | echo "INSTALL_DIR=$INSTALL_DIR" |
---|
119 | } > Makefile.conf |
---|
120 | |
---|
121 | #ll |
---|
Note: See
TracBrowser
for help on using the repository browser.