~ubuntu-branches/ubuntu/oneiric/oss4/oneiric-proposed

« back to all changes in this revision

Viewing changes to configure

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Rivera
  • Date: 2011-06-16 20:37:48 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110616203748-jbrxik6ql33z54co
Tags: 4.2-build2004-1ubuntu1
* Merge from Debian unstable.
  - Supports our current kernel (LP: #746048)
  Remaining changes:
  - debian/oss4-dkms.dkms.in: s/source/build/ in Kernel headers paths.
* ld-as-needed.patch: Re-order CC arguments to enable building with ld
  --as-needed (LP: #770972)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
CONFIGURE=YES
 
4
COPY_OPTIONS=
 
5
OSSLIBDIR="/usr/lib/oss"
 
6
TARGETOS=
 
7
 
 
8
unset USE_PHPMAKE
 
9
 
 
10
OSS_CONFIG_OPTIONS="$*"
 
11
export OSS_CONFIG_OPTIONS
 
12
 
 
13
#
 
14
# Set GRC3 min/max conversion quality setting to 3 to conserve space.
 
15
# TODO: Add support for configurable quality settings.
 
16
GRC_MIN_QUALITY=3
 
17
GRC_MAX_QUALITY=3
 
18
export GRC_MIN_QUALITY GRC_MAX_QUALITY
 
19
 
 
20
# MIDI support is enabled by default. Use --config-midi=NO to disable
 
21
CONFIG_MIDI=ENABLED
 
22
 
 
23
export CONFIGURE CONFIG_MIDI
 
24
 
 
25
unset CDPATH >/dev/null 2>&1
 
26
 
 
27
if test -f /usr/include/vorbis/vorbisfile.h || test -f /usr/local/include/vorbisfile.h
 
28
then
 
29
        OGG_SUPPORT=YES
 
30
        export OGG_SUPPORT
 
31
fi
 
32
 
 
33
DIR=`pwd`
 
34
SRCDIR=`dirname $0`
 
35
SRCDIR=`cd $SRCDIR && pwd`
 
36
 
 
37
if test "$DIR " = " " || test "$DIR " = ". "
 
38
then
 
39
        echo
 
40
        echo
 
41
        echo
 
42
        echo
 
43
        echo
 
44
        echo
 
45
        echo
 
46
        echo
 
47
        echo "**** USAGE ERROR ****"
 
48
        echo
 
49
        echo You need to create an empty build directory and
 
50
        echo then execute sh `pwd`/configure inside it.
 
51
        echo
 
52
        echo Configure script aborted
 
53
        exit 2
 
54
fi
 
55
 
 
56
while test  "$# " != "0 "
 
57
do
 
58
        case "$1" in
 
59
 
 
60
        "--regparm")
 
61
                if test "`uname -s` " != "Linux "
 
62
                then
 
63
                        echo $0: --regparm is only valid under Linux
 
64
                        exit 1
 
65
                fi
 
66
                echo Will prepare for REGPARM kernels
 
67
                export USE_REGPARM=1
 
68
                ;;
 
69
 
 
70
        "--no-regparm")
 
71
                if test "`uname -s` " != "Linux "
 
72
                then
 
73
                        echo $0: --no-regparm is only valid under Linux
 
74
                        exit 1
 
75
                fi
 
76
                echo Will prepare for non-REGPARM kernels
 
77
                export NO_REGPARM=1
 
78
                ;;
 
79
 
 
80
        "--target=uclinux-blackfin")
 
81
                CROSSCOMPILE=uclinux-blackfin
 
82
                uOSS=1
 
83
                export CROSSCOMPILE uOSS
 
84
                ;;
 
85
 
 
86
        "--target=vxworks-x86")
 
87
                CROSSCOMPILE=vxworks-x86
 
88
                uOSS=1
 
89
                CONFIGSCRIPT=$SRCDIR/setup/setupdir.sh
 
90
                TARGETOS=VxWorks
 
91
                export CROSSCOMPILE uOSS
 
92
                ;;
 
93
 
 
94
        "--config-vmix=NO")
 
95
                VMIX_MODE=DISABLED
 
96
                export VMIX_MODE
 
97
                ;;
 
98
 
 
99
        "--config-vmix=FLOAT")
 
100
                VMIX_MODE=FLOAT
 
101
                export VMIX_MODE
 
102
                ;;
 
103
 
 
104
        "--config-vmix=FIXEDPOINT")
 
105
                VMIX_MODE=FIXEDPOINT
 
106
                export VMIX_MODE
 
107
                ;;
 
108
 
 
109
        "--config-midi=NO")
 
110
                CONFIG_MIDI=DISABLED
 
111
                export CONFIG_MIDI
 
112
                ;;
 
113
 
 
114
        "--config-midi=YES")
 
115
                CONFIG_MIDI=ENABLED
 
116
                export CONFIG_MIDI
 
117
                ;;
 
118
 
 
119
        "--copy-files")
 
120
                COPY_OPTIONS="-c"
 
121
                ;;
 
122
 
 
123
        "--include-closed-source")
 
124
                CLOSED_SOURCE=YES
 
125
                NO_WARNING_CHECKS=YES
 
126
                PORTABLE_BUILD=YES      # Produce binaries that work under generic CPU arch
 
127
                export CLOSED_SOURCE NO_WARNING_CHECKS PORTABLE_BUILD
 
128
                ;;
 
129
 
 
130
        "--portable-build")
 
131
                PORTABLE_BUILD=YES      # Produce binaries that work under generic CPU arch
 
132
                export PORTABLE_BUILD
 
133
                ;;
 
134
                
 
135
 
 
136
        "--enable-libsalsa=NO")
 
137
                NOALSA=1
 
138
                ;;
 
139
 
 
140
        "--enable-timings")
 
141
                # This is option is undocumented and unsupported. It is only
 
142
                # for internal testing by 4Front Technologies and not useful
 
143
                # to anybody else.
 
144
                DO_TIMINGS="1"
 
145
                export DO_TIMINGS
 
146
                ;;
 
147
 
 
148
        "--only-drv="*)
 
149
                ONLY_DRVS=`echo $1 | sed 's/--only-drv=/,/'`,osscore
 
150
                export ONLY_DRVS
 
151
                ;;
 
152
 
 
153
        "--use-phpmake")
 
154
                USE_PHPMAKE=YES
 
155
                export USE_PHPMAKE
 
156
                ;;
 
157
        *)
 
158
 
 
159
                echo $0: Unrecognized command line option $1
 
160
 
 
161
                echo
 
162
                echo Permitted command line arguments are:
 
163
                echo
 
164
                
 
165
                case `uname -s` in
 
166
 
 
167
                Linux)
 
168
                        echo "   --enable-libsalsa=YES|NO       - Enable/Disable libsalsa."
 
169
                        echo "   --target=uclinux-blackfin      - Configure for uClinux/Blackfin target (EXPERIMENTAL)"
 
170
                        echo "   --regparm                      - Configure for CONFIG_REGPARM kernels"
 
171
                        echo "   --no-regparm                   - Configure for kernels without CONFIG_REGPARM option."
 
172
                        echo "NOTE! --regparm/--no-regparm is normally detected"
 
173
                        echo "      automatically and these switches should NOT be used."
 
174
                        echo
 
175
                        ;;
 
176
 
 
177
                *)
 
178
                        echo
 
179
                esac
 
180
 
 
181
                echo "   --config-vmix=NO|FLOAT|FIXEDPOINT      - Configure vmix to use float/int arithmetic or disable it."
 
182
                echo "     (Check possible limitations caused by the OS or the CPU/arch)."
 
183
                echo "   --config-midi=NO|YES           - Enable/disable MIDI support."
 
184
                echo "   --only-drv=[list]              - Only compile the drivers named in the comma delimited list."
 
185
                echo "   --enable-timings               - Enable internal timings (for the readtimings utility)."
 
186
                echo "   --portable-build               - Produce portable binaries for generic CPU architecture."
 
187
                exit 1
 
188
        esac
 
189
 
 
190
        shift
 
191
done
 
192
 
 
193
export SRCDIR COPY_OPTIONS OSSLIBDIR TARGETOS
 
194
 
 
195
# Run the OS dependent setup script
 
196
 
 
197
if test "$CONFIGSCRIPT " != " "
 
198
then
 
199
        exec sh $CONFIGSCRIPT
 
200
fi
 
201
 
 
202
case `uname` in
 
203
 
 
204
"SunOS")
 
205
        case `uname -r` in
 
206
        "5.9")
 
207
                echo Setting up for Solaris 9
 
208
                SOL9=1
 
209
                GTK1=1
 
210
                export SOL9 GTK1
 
211
                ;;
 
212
 
 
213
        "5.8")
 
214
                echo Setting up for Solaris 8
 
215
                SOL9=1
 
216
                GTK1=1
 
217
                export SOL9 GTK1
 
218
                ;;
 
219
        *)
 
220
                echo Using Solaris10 specific script
 
221
                ;;
 
222
        esac
 
223
        exec sh $SRCDIR/setup/SunOS/solsetup.sh
 
224
        ;;
 
225
 
 
226
"Linux")
 
227
 
 
228
        if test "$NOALSA" != "1"
 
229
        then
 
230
                if test -d /usr/include/alsa || test -d /usr/local/include/alsa
 
231
                then
 
232
                        echo Compiling libsalsa library
 
233
                        export HAVE_ALSA=1
 
234
                fi
 
235
        fi
 
236
 
 
237
        if grep -q Ubuntu /etc/issue # Ubuntu?
 
238
        then
 
239
                MISSING=
 
240
                for n in build-essential libgtk2.0-dev gawk
 
241
                do
 
242
                  if ! apt-cache show $n > /dev/null 2>&1
 
243
                  then
 
244
                        MISSING="$MISSING $n"
 
245
                  fi
 
246
                done
 
247
 
 
248
                if test "$MISSING " != " "
 
249
                then
 
250
                        echo Missing one or more required install packages are missing
 
251
                        echo
 
252
                        echo You can install them by doing
 
253
                        echo
 
254
 
 
255
                        for n in $MISSING
 
256
                        do
 
257
                           echo apt-get install $n
 
258
                        done
 
259
 
 
260
                        exit 1
 
261
                fi
 
262
        fi
 
263
        
 
264
        if test "$USE_REGPARM " != "1 " && test "$NO_REGPARM " != "1 "
 
265
        then
 
266
          # REGPARM/NOTREGPARM not set so compile a version for both of them
 
267
                echo Using the Linux specific script
 
268
                exec sh $SRCDIR/setup/Linux/linsetup.sh
 
269
        else
 
270
                echo Using the default script
 
271
                exec sh $SRCDIR/setup/setupdir.sh
 
272
        fi
 
273
        ;;
 
274
 
 
275
*)
 
276
        echo Using the default script
 
277
        exec sh $SRCDIR/setup/setupdir.sh
 
278
 
 
279
esac
 
280
 
 
281
echo internal error in configure
 
282
 
 
283
exit 3