~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.1.0/third_party/portaudio/configure.in

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2015-01-07 14:51:16 UTC
  • mfrom: (4.3.5 sid)
  • Revision ID: package-import@ubuntu.com-20150107145116-yxnafinf4lrdvrmx
Tags: 1.4.1-0.1ubuntu1
* Merge with Debian, remaining changes:
 - Drop soprano, nepomuk build-dep
* Drop ubuntu patches, now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl
2
 
dnl portaudio V19 configure.in script
3
 
dnl
4
 
dnl Dominic Mazzoni, Arve Knudsen, Stelios Bounanos
5
 
dnl
6
 
 
7
 
dnl Require autoconf >= 2.13
8
 
AC_PREREQ(2.13)
9
 
 
10
 
dnl Init autoconf and make sure configure is being called
11
 
dnl from the right directory
12
 
AC_INIT([include/portaudio.h])
13
 
 
14
 
dnl Define build, build_cpu, build_vendor, build_os
15
 
AC_CANONICAL_BUILD
16
 
dnl Define host, host_cpu, host_vendor, host_os
17
 
AC_CANONICAL_HOST
18
 
dnl Define target, target_cpu, target_vendor, target_os
19
 
AC_CANONICAL_TARGET
20
 
 
21
 
dnl Specify options
22
 
 
23
 
AC_ARG_WITH(alsa,
24
 
            AS_HELP_STRING([--with-alsa], [Enable support for ALSA @<:@autodetect@:>@]),
25
 
            [with_alsa=$withval])
26
 
 
27
 
AC_ARG_WITH(jack,
28
 
            AS_HELP_STRING([--with-jack], [Enable support for JACK @<:@autodetect@:>@]),
29
 
            [with_jack=$withval])
30
 
 
31
 
AC_ARG_WITH(oss,
32
 
            AS_HELP_STRING([--with-oss], [Enable support for OSS @<:@autodetect@:>@]),
33
 
            [with_oss=$withval])
34
 
 
35
 
AC_ARG_WITH(asihpi,
36
 
            AS_HELP_STRING([--with-asihpi], [Enable support for ASIHPI @<:@autodetect@:>@]),
37
 
            [with_asihpi=$withval])
38
 
 
39
 
AC_ARG_WITH(winapi,
40
 
            AS_HELP_STRING([--with-winapi],
41
 
                           [Select Windows API support (@<:@wmme|directx|asio|wdmks@:>@@<:@,...@:>@) @<:@wmme@:>@]),
42
 
            [with_winapi=$withval], [with_winapi="wmme"])
43
 
case "$target_os" in *mingw* | *cygwin*)
44
 
     with_wmme=no
45
 
     with_directx=no
46
 
     with_asio=no
47
 
     with_wdmks=no
48
 
     for api in $(echo $with_winapi | sed 's/,/ /g'); do
49
 
         case "$api" in
50
 
             wmme|directx|asio|wdmks)
51
 
                 eval with_$api=yes
52
 
                 ;;
53
 
             *)
54
 
                 AC_MSG_ERROR([unknown Windows API \"$api\" (do you need --help?)])
55
 
                 ;;
56
 
         esac
57
 
     done
58
 
     ;;
59
 
esac
60
 
 
61
 
AC_ARG_WITH(asiodir,
62
 
            AS_HELP_STRING([--with-asiodir], [ASIO directory @<:@/usr/local/asiosdk2@:>@]),
63
 
            with_asiodir=$withval, with_asiodir="/usr/local/asiosdk2")
64
 
 
65
 
AC_ARG_WITH(dxdir,
66
 
            AS_HELP_STRING([--with-dxdir], [DirectX directory @<:@/usr/local/dx7sdk@:>@]),
67
 
            with_dxdir=$withval, with_dxdir="/usr/local/dx7sdk")
68
 
 
69
 
debug_output=no
70
 
AC_ARG_ENABLE(debug-output,
71
 
              AS_HELP_STRING([--enable-debug-output], [Enable debug output @<:@no@:>@]),
72
 
              [if test "x$enableval" != "xno" ; then
73
 
                  AC_DEFINE(PA_ENABLE_DEBUG_OUTPUT,,[Enable debugging messages])
74
 
                  debug_output=yes
75
 
               fi
76
 
              ])
77
 
 
78
 
AC_ARG_ENABLE(cxx,
79
 
              AS_HELP_STRING([--enable-cxx], [Enable C++ bindings @<:@no@:>@]),
80
 
              enable_cxx=$enableval, enable_cxx="no")
81
 
 
82
 
AC_ARG_ENABLE(mac-debug,
83
 
              AS_HELP_STRING([--enable-mac-debug], [Enable Mac debug @<:@no@:>@]),
84
 
              enable_mac_debug=$enableval, enable_mac_debug="no")
85
 
 
86
 
AC_ARG_ENABLE(mac-universal,
87
 
              AS_HELP_STRING([--enable-mac-universal], [Build Mac universal binaries @<:@yes@:>@]),
88
 
              enable_mac_universal=$enableval, enable_mac_universal="yes")
89
 
 
90
 
dnl Continue to accept --host_os for compatibility but do not document
91
 
dnl it (the correct way to change host_os is with --host=...).  Moved
92
 
dnl here because the empty help string generates a blank line which we
93
 
dnl can use to separate PA options from libtool options.
94
 
AC_ARG_WITH(host_os, [], host_os=$withval)
95
 
 
96
 
dnl Checks for programs.
97
 
 
98
 
AC_PROG_CC
99
 
AC_LIBTOOL_WIN32_DLL
100
 
AC_PROG_LIBTOOL
101
 
AC_PROG_INSTALL
102
 
AC_PROG_LN_S
103
 
AC_PATH_PROG(AR, ar, no)
104
 
if [[ $AR = "no" ]] ; then
105
 
    AC_MSG_ERROR("Could not find ar - needed to create a library")
106
 
fi
107
 
 
108
 
dnl This must be one of the first tests we do or it will fail...
109
 
AC_C_BIGENDIAN
110
 
 
111
 
dnl checks for various host APIs and arguments to configure that
112
 
dnl turn them on or off
113
 
 
114
 
have_alsa=no
115
 
if test "x$with_alsa" != "xno"; then
116
 
    AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
117
 
fi
118
 
have_asihpi=no
119
 
if test "x$with_asihpi" != "xno"; then
120
 
    AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm)
121
 
fi
122
 
have_libossaudio=no
123
 
have_oss=no
124
 
if test "x$with_oss" != "xno"; then
125
 
    AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h], [have_oss=yes])
126
 
    if test "x$have_oss" = "xyes"; then
127
 
        AC_CHECK_LIB(ossaudio, _oss_ioctl, have_libossaudio=yes, have_libossaudio=no)
128
 
    fi
129
 
fi
130
 
have_jack=no
131
 
if test "x$with_jack" != "xno"; then
132
 
    PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no)
133
 
fi
134
 
 
135
 
 
136
 
dnl sizeof checks: we will need a 16-bit and a 32-bit type
137
 
 
138
 
AC_CHECK_SIZEOF(short)
139
 
AC_CHECK_SIZEOF(int)
140
 
AC_CHECK_SIZEOF(long)
141
 
 
142
 
save_LIBS="${LIBS}"
143
 
AC_CHECK_LIB(rt, clock_gettime, [rt_libs=" -lrt"])
144
 
LIBS="${LIBS}${rt_libs}"
145
 
DLL_LIBS="${DLL_LIBS}${rt_libs}"
146
 
AC_CHECK_FUNCS([clock_gettime nanosleep])
147
 
LIBS="${save_LIBS}"
148
 
 
149
 
dnl LT_RELEASE=19
150
 
LT_CURRENT=2
151
 
LT_REVISION=0
152
 
LT_AGE=0
153
 
 
154
 
AC_SUBST(LT_CURRENT)
155
 
AC_SUBST(LT_REVISION)
156
 
AC_SUBST(LT_AGE)
157
 
 
158
 
dnl extra variables
159
 
AC_SUBST(OTHER_OBJS)
160
 
AC_SUBST(PADLL)
161
 
AC_SUBST(SHARED_FLAGS)
162
 
AC_SUBST(THREAD_CFLAGS)
163
 
AC_SUBST(DLL_LIBS)
164
 
AC_SUBST(CXXFLAGS)
165
 
AC_SUBST(NASM)
166
 
AC_SUBST(NASMOPT)
167
 
 
168
 
dnl -g is optional on darwin
169
 
if ( echo "${host_os}" | grep ^darwin >> /dev/null ) &&
170
 
      [[ "$enable_mac_universal" = "yes" ] &&
171
 
       [ "$enable_mac_debug" != "yes" ]] ; then
172
 
   CFLAGS="-O2 -Wall -pedantic -pipe -fPIC -DNDEBUG"
173
 
else
174
 
   CFLAGS=${CFLAGS:-"-g -O2 -Wall -pedantic -pipe -fPIC"}
175
 
fi
176
 
 
177
 
if [[ $ac_cv_c_bigendian = "yes" ]] ; then
178
 
   CFLAGS="$CFLAGS -DPA_BIG_ENDIAN"
179
 
else
180
 
   CFLAGS="$CFLAGS -DPA_LITTLE_ENDIAN"
181
 
fi
182
 
 
183
 
add_objects()
184
 
{
185
 
    for o in $@; do
186
 
        test "${OTHER_OBJS#*${o}*}" = "${OTHER_OBJS}" && OTHER_OBJS="$OTHER_OBJS $o"
187
 
    done
188
 
}
189
 
 
190
 
case "${host_os}" in
191
 
  darwin* )
192
 
        dnl Mac OS X configuration
193
 
 
194
 
        AC_DEFINE(PA_USE_COREAUDIO)
195
 
 
196
 
        CFLAGS="$CFLAGS -Werror"
197
 
        LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon"
198
 
 
199
 
        if test "x$enable_mac_universal" = "xyes" ; then
200
 
           mac_version_min="-mmacosx-version-min=10.3"
201
 
           if [[ -d /Developer/SDKs/MacOSX10.5.sdk ]] ; then
202
 
              mac_arches="-arch i386 -arch ppc -arch x86_64 -arch ppc64"
203
 
              mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
204
 
           else
205
 
              mac_arches="-arch i386 -arch ppc"
206
 
              mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
207
 
           fi
208
 
        else
209
 
           mac_arches=""
210
 
           mac_sysroot=""
211
 
           mac_version=""
212
 
        fi
213
 
        SHARED_FLAGS="$LIBS -dynamiclib $mac_arches $mac_sysroot $mac_version_min"
214
 
        CFLAGS="-std=c99 $CFLAGS $mac_arches $mac_sysroot $mac_version_min"
215
 
        OTHER_OBJS="src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o src/common/pa_ringbuffer.o"
216
 
        PADLL="libportaudio.dylib"
217
 
        ;;
218
 
 
219
 
  mingw* )
220
 
        dnl MingW configuration
221
 
 
222
 
        PADLL="portaudio.dll"
223
 
        THREAD_CFLAGS="-mthreads"
224
 
        SHARED_FLAGS="-shared"
225
 
        CFLAGS="$CFLAGS -I\$(top_srcdir)/include -DPA_NO_WMME -DPA_NO_ASIO -DPA_NO_WDMKS -DPA_NO_DS"
226
 
 
227
 
        if [[ "x$with_directx" = "xyes" ]]; then
228
 
            DXDIR="$with_dxdir"
229
 
            add_objects src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/pa_win_ds_dynlink.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o
230
 
            LIBS="-lwinmm -lm -ldsound -lole32"
231
 
            DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -ldsound -lole32"
232
 
            #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""
233
 
            #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"
234
 
            CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/win -I$DXDIR/include -UPA_NO_DS"
235
 
        fi
236
 
 
237
 
        if [[ "x$with_asio" = "xyes" ]]; then
238
 
            ASIODIR="$with_asiodir"
239
 
            add_objects src/hostapi/asio/pa_asio.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/hostapi/asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o
240
 
            LIBS="-lwinmm -lm -lole32 -luuid"
241
 
            DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lole32 -luuid"
242
 
            CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -I\$(top_srcdir)/src/common -I\$(top_srcdir)/src/hostapi/asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -UPA_NO_ASIO -DWINDOWS"
243
 
            CXXFLAGS="$CFLAGS"
244
 
        fi
245
 
 
246
 
        if [[ "x$with_wdmks" = "xyes" ]]; then
247
 
            DXDIR="$with_dxdir"
248
 
            add_objects src/hostapi/wdmks/pa_win_wdmks.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o
249
 
            LIBS="-lwinmm -lm -luuid -lsetupapi -lole32"
250
 
            DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -luuid -lsetupapi -lole32"
251
 
            #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""
252
 
            #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"
253
 
            CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -I$DXDIR/include -UPA_NO_WDMKS"
254
 
        fi
255
 
 
256
 
        if [[ "x$with_wmme" = "xyes" ]]; then
257
 
            add_objects src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o
258
 
            LIBS="-lwinmm -lm -lole32 -luuid"
259
 
            DLL_LIBS="${DLL_LIBS} -lwinmm"
260
 
            CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -UPA_NO_WMME"
261
 
        fi
262
 
        ;;
263
 
 
264
 
  cygwin* )
265
 
        dnl Cygwin configuration
266
 
 
267
 
        OTHER_OBJS="src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o"
268
 
        CFLAGS="$CFLAGS -DPA_NO_DS -DPA_NO_WDMKS -DPA_NO_ASIO -DPA_NO_WASAPI"
269
 
        LIBS="-lwinmm -lm"
270
 
        PADLL="portaudio.dll"
271
 
        THREAD_CFLAGS="-mthreads"
272
 
        SHARED_FLAGS="-shared"
273
 
        DLL_LIBS="${DLL_LIBS} -lwinmm"
274
 
        ;;
275
 
 
276
 
  irix* )
277
 
        dnl SGI IRIX audio library (AL) configuration (Pieter, oct 2-13, 2003).
278
 
        dnl The 'dmedia' library is needed to read the Unadjusted System Time (UST).
279
 
        dnl
280
 
        AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR([IRIX posix thread library not found!]))
281
 
        AC_CHECK_LIB(audio,   alOpenPort,     , AC_MSG_ERROR([IRIX audio library not found!]))
282
 
        AC_CHECK_LIB(dmedia,  dmGetUST,       , AC_MSG_ERROR([IRIX digital media library not found!]))
283
 
 
284
 
        dnl See the '#ifdef PA_USE_SGI' in file pa_unix/pa_unix_hostapis.c
285
 
        dnl which selects the appropriate PaXXX_Initialize() function.
286
 
        dnl
287
 
        AC_DEFINE(PA_USE_SGI)
288
 
 
289
 
        dnl The _REENTRANT option for pthread safety. Perhaps not necessary but it 'll do no harm.
290
 
        dnl
291
 
        THREAD_CFLAGS="-D_REENTRANT"
292
 
    
293
 
        OTHER_OBJS="pa_sgi/pa_sgi.o src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o"
294
 
 
295
 
        dnl SGI books say -lpthread should be the last of the libs mentioned.
296
 
        dnl
297
 
        LIBS="-lm -ldmedia -laudio -lpthread"
298
 
        PADLL="libportaudio.so"
299
 
        SHARED_FLAGS=""
300
 
        ;;
301
 
 
302
 
  *)
303
 
        dnl Unix configuration
304
 
 
305
 
        AC_CHECK_LIB(pthread, pthread_create,[have_pthread="yes"],
306
 
                AC_MSG_ERROR([libpthread not found!]))
307
 
 
308
 
        if [[ "$have_alsa" = "yes" ] && [ "$with_alsa" != "no" ]] ; then
309
 
           DLL_LIBS="$DLL_LIBS -lasound"
310
 
           LIBS="$LIBS -lasound"
311
 
           OTHER_OBJS="$OTHER_OBJS src/hostapi/alsa/pa_linux_alsa.o"
312
 
           AC_DEFINE(PA_USE_ALSA)
313
 
        fi
314
 
 
315
 
        if [[ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ]] ; then
316
 
           DLL_LIBS="$DLL_LIBS $JACK_LIBS"
317
 
           CFLAGS="$CFLAGS $JACK_CFLAGS"
318
 
           OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o src/common/pa_ringbuffer.o"
319
 
           AC_DEFINE(PA_USE_JACK)
320
 
        fi
321
 
 
322
 
        if [[ "$with_oss" != "no" ]] ; then
323
 
           OTHER_OBJS="$OTHER_OBJS src/hostapi/oss/pa_unix_oss.o"
324
 
           if [[ "$have_libossaudio" = "yes" ]] ; then
325
 
                   DLL_LIBS="$DLL_LIBS -lossaudio"
326
 
                   LIBS="$LIBS -lossaudio"
327
 
           fi      
328
 
           AC_DEFINE(PA_USE_OSS)
329
 
        fi
330
 
 
331
 
        if [[ "$have_asihpi" = "yes" ] && [ "$with_asihpi" != "no" ]] ; then
332
 
           LIBS="$LIBS -lhpi"
333
 
           DLL_LIBS="$DLL_LIBS -lhpi"
334
 
           OTHER_OBJS="$OTHER_OBJS src/hostapi/asihpi/pa_linux_asihpi.o"
335
 
           AC_DEFINE(PA_USE_ASIHPI)
336
 
        fi
337
 
 
338
 
        DLL_LIBS="$DLL_LIBS -lm -lpthread"
339
 
        LIBS="$LIBS -lm -lpthread"
340
 
        PADLL="libportaudio.so"
341
 
 
342
 
        ## support sun cc compiler flags
343
 
        case "${host_os}" in
344
 
           solaris*)
345
 
              SHARED_FLAGS="-G"
346
 
              THREAD_CFLAGS="-mt"
347
 
              ;;
348
 
           *)
349
 
              SHARED_FLAGS="-shared -fPIC"
350
 
              THREAD_CFLAGS="-pthread"
351
 
              ;;
352
 
        esac
353
 
 
354
 
        OTHER_OBJS="$OTHER_OBJS src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o"
355
 
esac
356
 
CFLAGS="$CFLAGS $THREAD_CFLAGS"
357
 
 
358
 
if test "$enable_cxx" = "yes"; then
359
 
   AC_CONFIG_SUBDIRS([bindings/cpp])
360
 
   ENABLE_CXX_TRUE=""
361
 
   ENABLE_CXX_FALSE="#"
362
 
else
363
 
   ENABLE_CXX_TRUE="#"
364
 
   ENABLE_CXX_FALSE=""
365
 
fi
366
 
AC_SUBST(ENABLE_CXX_TRUE)
367
 
AC_SUBST(ENABLE_CXX_FALSE)
368
 
 
369
 
if test "x$with_asio" = "xyes"; then
370
 
   WITH_ASIO_TRUE=""
371
 
   WITH_ASIO_FALSE="@ #"
372
 
else
373
 
   WITH_ASIO_TRUE="@ #"
374
 
   WITH_ASIO_FALSE=""
375
 
fi
376
 
AC_SUBST(WITH_ASIO_TRUE)
377
 
AC_SUBST(WITH_ASIO_FALSE)
378
 
 
379
 
AC_OUTPUT([Makefile portaudio-2.0.pc])
380
 
 
381
 
AC_MSG_RESULT([
382
 
Configuration summary:
383
 
 
384
 
  Target ...................... $target
385
 
  C++ bindings ................ $enable_cxx
386
 
  Debug output ................ $debug_output])
387
 
 
388
 
case "$target_os" in *linux*)
389
 
    AC_MSG_RESULT([
390
 
  ALSA ........................ $have_alsa
391
 
  ASIHPI ...................... $have_asihpi])
392
 
    ;;
393
 
esac
394
 
case "$target_os" in
395
 
    *mingw* | *cygwin*)
396
 
        test "x$with_directx" = "xyes" && with_directx="$with_directx (${with_dxdir})"
397
 
        test "x$with_wdmks" = "xyes" && with_wdmks="$with_wdmks (${with_dxdir})"
398
 
        test "x$with_asio" = "xyes" && with_asio="$with_asio (${with_asiodir})"
399
 
        AC_MSG_RESULT([
400
 
  WMME ........................ $with_wmme
401
 
  DSound ...................... $with_directx
402
 
  WDMKS ....................... $with_wdmks
403
 
  ASIO ........................ $with_asio
404
 
])
405
 
        ;;
406
 
    *darwin*)
407
 
        AC_MSG_RESULT([
408
 
  Mac debug flags ............. $enable_mac_debug
409
 
])
410
 
        ;;
411
 
     *)
412
 
        AC_MSG_RESULT([
413
 
  OSS ......................... $have_oss
414
 
  JACK ........................ $have_jack
415
 
])
416
 
        ;;
417
 
esac