"zero-latency" patch for netjack from torben
[jack.git] / configure.ac
blobc61a9ef20373a89ad0d2fad0035a7e0902040c83
1 dnl Process this file with autoconf to produce a configure script.
2 dnl $Id$
4 AC_INIT(jackd/jackd.c)
6 AC_CONFIG_AUX_DIR(config)
7 AC_CANONICAL_TARGET
9 dnl ---
10 dnl HOWTO: updating the JACK version number
11 dnl
12 dnl major version = ask on jackit-devel :)
13 dnl minor version = incremented when any of the public or internal
14 dnl                 interfaces are changed
15 dnl micro version = incremented when implementation-only
16 dnl                 changes are made
17 dnl ---
18 JACK_MAJOR_VERSION=0
19 JACK_MINOR_VERSION=115
20 JACK_MICRO_VERSION=6
22 dnl ---
23 dnl HOWTO: updating the jack protocol version
24 dnl
25 dnl increment the protocol version whenever a change is
26 dnl made to the way libjack communicates with jackd
27 dnl that would break applications linked with an older
28 dnl version of libjack.
29 dnl ---
30 JACK_PROTOCOL_VERSION=23
32 dnl ---
33 dnl HOWTO: updating the libjack interface version
34 dnl
35 dnl current = incremented whenever the public libjack API is changed 
36 dnl revision = incremented when the libjack implementation is changed
37 dnl age = current libjack is both source and binary compatible with
38 dnl       libjack interfaces current,current-1,...,current-age
39 dnl
40 dnl Note! see libtool documentation for detailed documentation
41 dnl
42 dnl Note Also! until we reach CURRENT>=1, the rules are somewhat
43 dnl slacker than this, and closer to those for the JACK version
44 dnl number.
45 dnl ---
46 JACK_API_CURRENT=0
47 JACK_API_REVISION=28
48 JACK_API_AGE=0
50 AC_SUBST(JACK_MAJOR_VERSION)
51 AC_SUBST(JACK_MINOR_VERSION)
52 AC_SUBST(JACK_MICRO_VERSION)
54 AC_SUBST(JACK_PROTOCOL_VERSION)
55 AC_DEFINE_UNQUOTED(PROTOCOL_VERSION, "$JACK_PROTOCOL_VERSION", [Protocol version])
57 AC_SUBST(JACK_API_MAJOR_VERSION)
58 AC_SUBST(JACK_API_MINOR_VERSION)
59 AC_SUBST(JACK_API_MICRO_VERSION)
61 JACK_SO_VERSION=${JACK_API_CURRENT}:${JACK_API_REVISION}:${JACK_API_AGE}
63 JACK_VERSION=$JACK_MAJOR_VERSION.$JACK_MINOR_VERSION.${JACK_MICRO_VERSION}${BETA}
64 JACK_RELEASE=$JACK_MAJOR_VERSION-$JACK_MINOR_VERSION-${JACK_MICRO_VERSION}${BETA}
66 AC_SUBST(JACK_SO_VERSION)
67 AC_SUBST(JACK_VERSION)
68 AC_SUBST(JACK_RELEASE)
70 AM_INIT_AUTOMAKE(jack-audio-connection-kit,${JACK_VERSION})
71 AM_MAINTAINER_MODE
73 AM_CONFIG_HEADER(config.h)
74 AC_ENABLE_STATIC(no)
75 AC_ENABLE_SHARED(yes)
76 AC_PROG_CC
77 AC_PROG_CXX
78 AC_PROG_LD
79 AM_PROG_LIBTOOL
80 AC_PROG_LN_S
81 AM_PROG_CC_C_O
82 AC_C_BIGENDIAN
84 AC_MSG_CHECKING([platform dependencies])
86 HOST_DEFAULT_TMP_DIR=/dev/shm
87 case "${host_os}" in
88   freebsd*)
89     # current FreeBSD header files conflict with the OSS driver's
90     # barrier code, this may be fixed in 5.3, stay tuned.
91     USE_BARRIER="no"
92     ;;
93   openbsd*)
94     # pthread_barrier* not implemented
95     USE_BARRIER="no"
96     # need small realtime stack
97     JACK_THREAD_STACK_TOUCH=10000
98     ;;
99   darwin*)
100     JACK_THREAD_STACK_TOUCH=10000       # need small realtime stack
101     JACK_CPP_VARARGS_BROKEN=1
102     JACK_DO_NOT_MLOCK=1
103     JACK_USE_MACH_THREADS=1
104     OS_LDFLAGS="-framework CoreAudio -framework CoreServices -framework AudioUnit"
105     TRY_POSIX_SHM=yes                   # POSIX shm works better
106     HOST_DEFAULT_TMP_DIR=/tmp
107     ;;
108 esac
110 AC_SUBST(OS_LDFLAGS)
113 # We need to establish suitable defaults for a 64-bit OS
114 libnn=lib
115 case "${host_os}" in
116     linux*)
117     case "${host_cpu}" in
118         x86_64|mips64|ppc64|sparc64|s390x)
119         libnn=lib64
120         ;;
121     esac
122     ;;
123     solaris*)
124     ## libnn=lib/sparcv9 ## on 64-bit only, but that's compiler-specific
125     ;;  
126 esac
128 ## take care not to  override the command-line setting
129 if test "${libdir}" = '${exec_prefix}/lib'; then
130   libdir='${exec_prefix}/'${libnn}
133 # system-dependent config.h values
134 test "x$JACK_THREAD_STACK_TOUCH" = "x" && JACK_THREAD_STACK_TOUCH=500000
135 AC_DEFINE_UNQUOTED(JACK_THREAD_STACK_TOUCH,
136         [$JACK_THREAD_STACK_TOUCH],
137         [Guaranteed size of realtime stack])
138 if test "x$JACK_CPP_VARARGS_BROKEN" != "x"; then
139     AC_DEFINE_UNQUOTED(JACK_CPP_VARARGS_BROKEN,
140         [$JACK_CPP_VARARGS_BROKEN],
141         [CPP has a broken varargs implementation])
143 if test "x$JACK_USE_MACH_THREADS" != "x"; then
144     AC_DEFINE_UNQUOTED(JACK_USE_MACH_THREADS,
145         [$JACK_USE_MACH_THREADS],
146         [Use MACH threads where possible])
149 # headers
150 AC_CHECK_HEADERS(string.h strings.h alloca.h)
151 AC_CHECK_HEADERS(getopt.h, [], [
152     for d in /Developer/SDKs/MacOSX10.3.0.sdk/usr/include/ ; do
153         AC_CHECK_HEADERS($d/getopt.h, [], [CFLAGS="$CFLAGS -I$d"])
154     done])
155 AC_CHECK_HEADER(/usr/include/nptl/pthread.h,
156         [CFLAGS="$CFLAGS -I/usr/include/nptl"])
158 # functions and libraries
159 AC_CHECK_FUNC(getopt_long, [],
160     AC_MSG_ERROR([*** JACK requires GNU getopt_long]))
161 AC_CHECK_FUNC(gethostent, [], AC_CHECK_LIB(nsl, gethostent))
162 AC_CHECK_FUNC(setsockopt, [], AC_CHECK_LIB(socket, setsockopt))
163 AC_CHECK_FUNC(connect, [], AC_CHECK_LIB(inet, connect))
164 AC_CHECK_FUNC(dlopen, [], 
165     AC_CHECK_LIB(dl, dlopen, [],
166         AC_MSG_ERROR([*** JACK requires dynamic load support])))
167 AC_CHECK_FUNC(pthread_create, [],
168     AC_CHECK_LIB(pthread, pthread_create, [],
169         AC_MSG_ERROR([*** JACK requires POSIX threads support])))
170 AC_CHECK_FUNCS(on_exit atexit)
171 AC_CHECK_FUNCS(posix_memalign)
172 AC_CHECK_LIB(m, sin)
174 echo -n "Checking for ppoll()... "
175 AC_EGREP_CPP( ppoll,
177 #define _GNU_SOURCE
178 #include <poll.h>
179 ], [
180         AC_DEFINE(HAVE_PPOLL,1,"Whether ppoll is available")
181         echo "yes"
182    ],[
183         AC_DEFINE(HAVE_PPOLL,0,"Whether ppoll is available")
184         echo "no"
185    ] )
187          
189 AC_CHECK_FUNC(clock_gettime, 
190        [
191            AC_DEFINE(HAVE_CLOCK_GETTIME,0,"Whether or not clock_gettime can be found in system libraries")
192        ], 
193        #
194        # if not found, check librt specifically
195        #
196        AC_CHECK_LIB(rt, clock_gettime, 
197            [
198               AC_DEFINE(HAVE_CLOCK_GETTIME,1,"Whether or not clock_gettime can be found in system libraries")
199               OS_LDFLAGS="$OS_LDFLAGS -lrt"
200            ])
201 )         
203 # should we use mlockall() on this platform?
204 if test "x$JACK_DO_NOT_MLOCK" = "x"; then
205     AC_CHECK_HEADER(sys/mman.h,
206         [AC_CHECK_FUNC(mlockall,
207             [AC_DEFINE(USE_MLOCK, 1, [Use POSIX memory locking])])])
210 # look for system support for POSIX shm API
211 AC_ARG_ENABLE(posix-shm,
212         AC_HELP_STRING([--enable-posix-shm], [use POSIX shm API (default=auto)]),
213         [TRY_POSIX_SHM=$enableval])
214 if test "x$TRY_POSIX_SHM" = "xyes"
215 then
216         AC_CHECK_FUNC(shm_open, [],
217                 AC_CHECK_LIB(rt, shm_open, [], [TRY_POSIX_SHM=no]))
219 AC_MSG_CHECKING([shared memory support])
220 if test "x$TRY_POSIX_SHM" = "xyes"
221 then
222         AC_MSG_RESULT([POSIX shm_open().])
223         AC_DEFINE(USE_POSIX_SHM,1,[Use POSIX shared memory interface])
224         JACK_SHM_TYPE='"POSIX"'
225         USE_POSIX_SHM="true"
226 else
227         AC_MSG_RESULT([System V shmget().])
228         JACK_SHM_TYPE='"System V"'
229         USE_POSIX_SHM="false"
231 AC_DEFINE_UNQUOTED(JACK_SHM_TYPE, [$JACK_SHM_TYPE],
232         [JACK shared memory type])
233 AM_CONDITIONAL(USE_POSIX_SHM, $USE_POSIX_SHM)
235 JACK_CORE_CFLAGS="-I\$(top_srcdir)/config -I\$(top_srcdir) \
236 -I\$(top_srcdir) -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall"
238 AC_ARG_WITH(cpu-target,
239             [  --with-cpu-target=cpu-type    explicit, overriding argument for gcc -march= flag])
243 dnl figure out how best to optimize
244 dnl JOQ: this should be done via config/configure.hosts
247 dnl ----------------------------------------------------------------------
249 if test "$target_cpu" = "powerpc64" ; then
251     AC_ARG_ENABLE(cell,
252         [  --enable-cell           enable Cell BE support (default=no)],,
253         [ enable_cell=no ])
255     if test "x$enable_cell" = xyes; then
256         AC_DEFINE(ENABLE_CELLBE, 1, [Define to 1 if you need support for the Cell BE.])
257     fi
261 if test "$target_cpu" = "powerpc" -o "$target_cpu" = "powerpc64" ; then
263     AC_DEFINE(POWERPC, 1, "Are we running a ppc CPU?")
264     
265 ############################
266 # Check for Altivec assembly
267 ############################
269     AC_ARG_ENABLE(altivec,
270         [  --enable-altivec        enable Altivec support (default=auto)],,
271         [ enable_altivec=yes ])
272     
273     if test "x$enable_altivec" = xyes; then
274         
275         AC_MSG_CHECKING(whether we can compile Altivec code)
276         
277         AC_COMPILE_IFELSE([asm ("vand %v0, %v0, %v0");],
278             AC_DEFINE(USE_ALTIVEC, 1, [Define to 1 if Altivec assembly is available.])
279             AC_DEFINE(HAVE_ALTIVEC_LINUX, 1, "Is there Altivec Support ?")
280             ALTIVEC_OPT_FLAGS="-maltivec -mabi=altivec"
281             AC_MSG_RESULT(yes)
282             ,
283             enable_altivec=no
284             AC_MSG_RESULT(no)
285             AC_MSG_WARN([The assembler does not support the Altivec command set.])
286         )
287         
288     fi
290     dnl -mcpu=7450 does not reliably work with gcc 3.*
291     
292     JACK_OPT_CFLAGS="-O2 -mcpu=7400 $ALTIVEC_OPT_FLAGS -mhard-float -mpowerpc-gfxopt"
294     if test "$target_cpu" = "powerpc64"; then
295         JACK_OPT_CFLAGS="-O2 -mcpu=powerpc64 $ALTIVEC_OPT_FLAGS -mhard-float" 
296     fi
298 elif echo $target_cpu | egrep '(i.86|x86_64)' >/dev/null; then
300     dnl Check for MMX/SSE assembly
301     
302     if test -r /proc/cpuinfo ; then
303         procflags=`grep '^flags' /proc/cpuinfo`
304         if echo $procflags | grep -s mmx ; then
305             cpu_supports_mmx=yes
306         fi
307         if echo $procflags | grep -s sse ; then
308             cpu_supports_sse=yes
309         fi
310     else
311         # this is not linux, but assume that if the processor
312         # is x86 then is supports SSE and not MMX
313         cpu_supports_sse=yes
314         AC_MSG_WARN([Assuming your x86/x86_64 system can support SSE. Use --disable-sse if this is not the case])
315         cpu_supports_mmx=no
316         AC_MSG_WARN([Assuming your x86/x86_64 system does not need to use MMX. Use --enable-mmx if this is not the case])
317     fi
318     
319     AC_ARG_ENABLE(optimization-by-compiler,
320         AC_HELP_STRING([--enable-optimization-by-compiler],[use compiler (NOT processor) capabilities to determine optimization flags (default=no)]),,
321         optimization_by_compiler=no
322     )
323     
324     AC_ARG_ENABLE(optimization-by-cpu,
325         AC_HELP_STRING([--enable-optimization-by-cpu],[use processor capabilities to determine optimization flags (default=yes)]),,
326         optimization_by_cpu=yes
327     )
328     
329     AC_ARG_ENABLE(mmx,
330         AC_HELP_STRING([--enable-mmx],[enable MMX support (default=auto)]),,
331         enable_mmx=yes)
332     
333     AC_ARG_ENABLE(sse,
334         AC_HELP_STRING([--enable-sse],[enable SSE support (default=auto)]),,
335         enable_sse=$enable_mmx)
336     
337     if test "x$enable_mmx" = xyes; then
338         
339         AC_MSG_CHECKING(whether we can compile MMX code)
340         
341         AC_COMPILE_IFELSE([asm ("movq 0, %mm0");],
342             
343             AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.])
344             AC_MSG_RESULT(yes)
345             
346             if test x$optimization_by_cpu = xyes ; then
347                 if test x$cpu_supports_mmx = xyes ; then
348                     MMX_FLAGS="-mmmx"
349                 fi
350             else 
351                 MMX_FLAGS="-mmmx"
352             fi
353             
354             AC_MSG_RESULT(yes)
355             ,
356             enable_mmx=no
357             AC_MSG_RESULT(no)
358             AC_MSG_WARN([The assembler does not support the MMX command set.])
359         )
360     fi
362     if test "x$enable_sse" = xyes; then
363         
364         AC_MSG_CHECKING(whether we can compile SSE code)
365         
366         AC_COMPILE_IFELSE([asm ("movntps %xmm0, 0");],
367             [
368                 if test x$optimization_by_cpu = xyes ; then
369                     if test x$cpu_supports_sse = xyes ; then
370                         SSE_FLAGS="-msse -mfpmath=sse"
371                     fi
372                 else 
373                     SSE_FLAGS="-msse -mfpmath=sse"
374                 fi
375                 
376                 AC_MSG_RESULT(yes)
377                 ],
378             [
379                 enable_sse=no
380                 AC_MSG_RESULT(no)
381                 AC_MSG_WARN([The assembler does not support the SSE command set.]) 
382                 ])
383     fi
384     
385     AC_DEFINE(x86, 1, "Nope it's intel")
386     COMMON_X86_OPT_FLAGS="-O3 -fomit-frame-pointer -ffast-math -funroll-loops"
387     
388     if test x$with_cpu_target != x ; then
389         JACK_OPT_CFLAGS="-march=$with_cpu_target"
390     else
391         if test "$target_cpu" = "i586"; then
392            JACK_OPT_CFLAGS="-march=i586 "
393         elif test "$target_cpu" = "i686"; then
394             JACK_OPT_CFLAGS="-march=i686"
395         elif test "$target_cpu" = "x86_64"; then
396             JACK_OPT_CFLAGS="-march=k8"
397         else
398             :
399         fi
400     fi
402     JACK_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $JACK_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS"
406 AC_ARG_ENABLE(dynsimd,
407         AC_HELP_STRING([--enable-dynsimd],[enable dynamic SIMD selection (default=no)]),,
408     enable_dynsimd=no)
410 if test "x$enable_dynsimd" = xyes; then
411         AC_DEFINE(USE_DYNSIMD, 1, [Define to 1 to use dynamic SIMD selection.])
412         dnl This needs update once there's more than x86/x86-64 supported
413         SIMD_CFLAGS="-msse -msse2 -m3dnow"
414         AC_SUBST(SIMD_CFLAGS)
417 AC_ARG_ENABLE(optimize,
418     AC_HELP_STRING([--enable-optimize],
419         [optimize code, based on CPU or compiler, as separately selected (default=no)]),
420     [ if test x$enable_optimize != xno ; then
421         AC_MSG_WARN([optimization in use.........................])
422       else
423         # no optimization, so lets get debugging symbols instead
424         JACK_OPT_CFLAGS="-g"
425         AC_MSG_WARN([no optimization.........................])
426       fi 
427     ],
428     [
429         # no optimization, so lets get debugging symbols instead
430         JACK_OPT_CFLAGS="-g"
431         AC_MSG_WARN([no optimization.........................])
432     ]
435 JACK_CFLAGS="$JACK_CORE_CFLAGS $JACK_OPT_CFLAGS"
437 AC_SUBST(JACK_CFLAGS)
440 dnl use JACK_CFLAGS for jackd compilation
441 dnl 
443 CFLAGS=$JACK_CFLAGS
445 # allow buffer resizing unless --disable-resize specified
446 buffer_resizing=yes
447 AC_ARG_ENABLE(resize,
448         AC_HELP_STRING([--enable-resize], [enable buffer resizing feature (default=yes)]),
449         [ 
450           if test x$enable_resize = xno ; then
451                 buffer_resizing=no
452           fi
453          ]
456 if test x$buffer_resizing != xno; then 
457    AC_DEFINE(DO_BUFFER_RESIZE,,[Enable buffer resizing])
461 AC_ARG_ENABLE(ensure-mlock,
462         AC_HELP_STRING([--enable-ensure-mlock], [server should fail if unable to lock memory (default=no)]),
463         [ 
464           if test x$enable_ensure_mlock != xno ; then
465                 AC_DEFINE(ENSURE_MLOCK,,[Ensure that memory locking succeeds])
466           fi
467         ]
470 AC_ARG_ENABLE(debug,
471         AC_HELP_STRING([--enable-debug],
472                 [enable debugging messages in jackd and libjack (default=no)]),
473         [ 
474           if test x$enable_debug != xno ; then
475              AC_DEFINE(DEBUG_ENABLED,,[Enable debugging messages])
476           fi
477         ]
480 AC_ARG_ENABLE(timestamps,
481         AC_HELP_STRING([--enable-timestamps],
482                 [allow clients to use the JACK timestamp API (JACK developers only) (default=no)]),
483         [ 
484           if test x$enable_timestamps != xno ; then
485                 AC_DEFINE(WITH_TIMESTAMPS,,[Enable JACK timestamp API])
486           fi
487         ]               
490 AC_ARG_ENABLE(preemption-check,
491         AC_HELP_STRING([--enable-preemption-check],
492                 [check for inappropriate realtime preemption (requires a specially built Linux kernel) (default=no)]),
493                 [
494                   if test x$enable_preemption_check != xno ; then
495                         echo checking for realtime preemption bugs
496                         AC_DEFINE(DO_PREEMPTION_CHECKING,,
497                                 [check realtime preemption])
498                   fi
499                 ])
501 USE_CAPABILITIES=false
503 AC_ARG_ENABLE(capabilities,
504         AC_HELP_STRING([--enable-capabilities],[!!! LINUX 2.4 KERNELS ONLY !!! use libcap to gain realtime scheduling priviledges]),
505               [ if test "x$enable_capabilities" != "xno" ; then
506                     AC_CHECK_LIB(cap, capgetp,
507                                  [AC_CHECK_HEADER(sys/capability.h,
508                                                   [HAVE_CAPABILITIES=true],
509                                                   [AC_MSG_WARN([*** no kernel support for capabilities])
510                                                    HAVE_CAPABILITIES=false]
511                                   )],
512                                  [AC_MSG_WARN([*** no libcap present])
513                                   HAVE_CAPABILITIES=false]
514                     )
515                     if test "x$HAVE_CAPABILITIES" = "xtrue"; then
516                         AC_CHECK_PROG(HAVE_CAPABILITIES, md5sum, true, false)
517                     fi
518                     if test "x$HAVE_CAPABILITIES" = "xfalse"; then
519                         AC_MSG_WARN([*** required program md5sum not found])
520                     fi
521                     if test "x$HAVE_CAPABILITIES" = "xfalse"; then
522                         AC_MSG_ERROR([*** Capabilities support not present. Run configure again without --enable-capabilities.])
523                     fi
524                     USE_CAPABILITIES=true
525                     AC_DEFINE(USE_CAPABILITIES,,[Enable POSIX 1.e capabilities support])
526                 fi
527               ]
530 with_oldtrans=yes
531 AC_ARG_ENABLE(oldtrans,
532         AC_HELP_STRING([--disable-oldtrans],[remove old transport interfaces (default=yes)]),
533               [ if test "x$enable_oldtrans" = "xno" ; then
534                     with_oldtrans=no
535                 fi 
536               ]
538 if test "x$with_oldtrans" != "xno" ; then
539         AC_DEFINE(OLD_TRANSPORT,,[Include old transport interfaces])
542 STRIPPED_JACKD=false
543 AC_ARG_ENABLE(stripped-jackd,
544         AC_HELP_STRING([--enable-stripped-jackd],[strip jack before computing its md5 sum (useful only with Linux 2.4 kernel)]),
545               [ if test "x$USE_CAPABILITIES" != "xtrue" ; then      
546                     AC_MSG_WARN([*** capabilities not enabled, stripped jackd has no effect])
547                 elif test "x$enable_stripped_jackd" != "xno"; then
548                     STRIPPED_JACKD=true             
549                 fi  
550               ] 
553 # plugins go in the addon dir.
555 ADDON_DIR='${libdir}/jack'
556 AC_SUBST(ADDON_DIR)
557 AS_AC_EXPAND(ADDON_DIR_EXPANDED,${libdir}/jack)
558 AC_DEFINE_UNQUOTED(ADDON_DIR,"$ADDON_DIR_EXPANDED",[Directory for plugins])
560 AC_ARG_WITH(html-dir,
561                 AC_HELP_STRING([--with-html-dir=PATH],[where to install the html documentation]))
563 if test "x$with_html_dir" = "x" ; then
564     HTML_DIR='${pkgdatadir}'
565 else
566     HTML_DIR=$with_html_dir
569 AC_SUBST(HTML_DIR)
572 # allow specifying default tmpdir
573 AC_ARG_WITH(default-tmpdir,
574             AC_HELP_STRING([--with-default-tmpdir],[where jackd and clients will put tmp files (default=/dev/shm)]))
576 if test "x$with_default_tmpdir" = "x" ; then
577         DEFAULT_TMP_DIR=$HOST_DEFAULT_TMP_DIR
578 else
579         DEFAULT_TMP_DIR=$with_default_tmpdir
582 AC_SUBST(DEFAULT_TMP_DIR)
583 AC_DEFINE_UNQUOTED(DEFAULT_TMP_DIR,"$DEFAULT_TMP_DIR",[Default tmp directory])
585 # Check for barrier functions in the pthreads library.  The default
586 # option setting may be OS-dependent, otherwise it's "yes".
587 test "x$USE_BARRIER" = "x" && USE_BARRIER="yes"
588 AC_ARG_WITH(barrier,
589         AC_HELP_STRING([--without-barrier],
590                        [avoid using pthread barrier functions (only used by OSS driver)]),
591         [ USE_BARRIER=$withval ])
592 if test "x$USE_BARRIER" = "xyes"; then
593         AC_CHECK_LIB([pthread], [pthread_barrier_init],
594                 AC_DEFINE(USE_BARRIER, 1, [Use pthread barrier functions]))
597 # some example-clients need libsndfile
598 HAVE_SNDFILE=false
599 PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0,[HAVE_SNDFILE=true], [true])
600 if test x$HAVE_SNDFILE = xfalse; then
601              AC_MSG_WARN([*** the jackrec example client will not be built])
604 # NetJack backend and internal client need libsamplerate
605 HAVE_SAMPLERATE=false
606 PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.1.2,[HAVE_SAMPLERATE=true], [true])
607 if test x$HAVE_SAMPLERATE = xfalse; then
608         AC_MSG_WARN([*** the NetJack backend and internal client will not be built])
609 else
610         CFLAGS="$CFLAGS $SAMPLERATE_CFLAGS"
611         LIBS="$LIBS $SAMPLERATE_LIBS"
614 # Celt low-latency audio codec. netjack transmission via internet.
615 HAVE_CELT=false
616 PKG_CHECK_MODULES(CELT, celt >= 0.5.0,[HAVE_CELT=true], [true])
617 if test x$HAVE_CELT = xfalse; then
618         AC_DEFINE(HAVE_CELT,0,"Whether CELT is available")
619         AC_MSG_RESULT(no)
620         AC_MSG_WARN([*** NetJack will not be built with celt support])
621 else
622         AC_DEFINE(HAVE_CELT,1,"Whether CELT is available")
623         AC_MSG_RESULT(yes)
624         LIBS="$LIBS $CELT_LIBS"
627 # Note: A bug in pkg-config causes problems if the first occurence of
628 # PKG_CHECK_MODULES can be disabled. So, if you're going to use
629 # PKG_CHECK_MODULES inside a --disable-whatever check, you need to
630 # do it somewhere *below* this comment.
632 # Check which backend drivers can be built.  The last one successfully
633 # configured becomes the default JACK driver; so the order of
634 # precedence is: alsa, sun, oss, coreaudio, portaudio, dummy.
636 JACK_DEFAULT_DRIVER=\"dummy\"
638 AC_ARG_ENABLE(portaudio,
639         AC_HELP_STRING([--enable-portaudio],[build PortAudio driver]),
640    TRY_PORTAUDIO=$enableval , TRY_PORTAUDIO=no)
642 HAVE_PA="false"
643 if test "x$TRY_PORTAUDIO" = "xyes"
644 then
645         # check for portaudio V18
646         AC_CHECK_LIB(portaudio, Pa_Initialize,
647                 [ AC_CHECK_HEADERS(portaudio.h,
648                         [ HAVE_PA="true"
649                           PA_LIBS=-lportaudio
650                           JACK_DEFAULT_DRIVER=\"portaudio\"
651                         ])
652                 ])
653         AC_SUBST(PA_LIBS)
655 AM_CONDITIONAL(HAVE_PA, $HAVE_PA)
657 AC_ARG_ENABLE(coreaudio, AC_HELP_STRING([--disable-coreaudio], [ignore CoreAudio driver]),
658                         TRY_COREAUDIO=$enableval , TRY_COREAUDIO=yes )
659 HAVE_COREAUDIO="false"
660 if test "x$TRY_COREAUDIO" = "xyes"
661 then
662         # check for coreaudio
663         AC_CHECK_HEADERS(CoreAudio/CoreAudio.h,
664                 [ HAVE_COREAUDIO="true"
665                   JACK_DEFAULT_DRIVER=\"coreaudio\"
666                 ])
668 AM_CONDITIONAL(HAVE_COREAUDIO, $HAVE_COREAUDIO)
670 AC_ARG_ENABLE(oss, AC_HELP_STRING([--disable-oss],[ignore OSS driver ]),
671                         TRY_OSS=$enableval , TRY_OSS=yes ) 
672 HAVE_OSS="false"
673 if test "x$TRY_OSS" = "xyes"
674 then
675         # check for Open Sound System
676         AC_CHECK_HEADER([sys/soundcard.h],
677              [HAVE_OSS="true"
678               JACK_DEFAULT_DRIVER=\"oss\"])
680 AM_CONDITIONAL(HAVE_OSS, $HAVE_OSS)
682 AC_ARG_ENABLE(sun, AC_HELP_STRING([--disable-sun],[ignore Sun driver ]),
683                         TRY_SUN=$enableval , TRY_SUN=yes ) 
684 HAVE_SUN="false"
685 if test "x$TRY_SUN" = "xyes"
686 then
687         # check for Sun audio API
688         AC_CHECK_HEADER([sys/audioio.h],
689              [HAVE_SUN="true"
690               JACK_DEFAULT_DRIVER=\"sun\"])
692 AM_CONDITIONAL(HAVE_SUN, $HAVE_SUN)
694 AC_ARG_ENABLE(freebob, AC_HELP_STRING([--disable-freebob],[ignore FreeBob driver ]),
695                         TRY_FREEBOB=$enableval , TRY_FREEBOB=yes ) 
696 HAVE_FREEBOB="false"
697 if test "x$TRY_FREEBOB" = "xyes"
698 then
699         # check for FreeBob libraries
700         PKG_CHECK_MODULES(LIBFREEBOB, libfreebob >= 1.0.0,
701              [HAVE_FREEBOB="true"
702               JACK_DEFAULT_DRIVER=\"freebob\"
703              ], AC_MSG_RESULT([no]))
705         AC_SUBST([LIBFREEBOB_CFLAGS])
706         AC_SUBST([LIBFREEBOB_LIBS])
709 AM_CONDITIONAL(HAVE_FREEBOB,$HAVE_FREEBOB)
711 AC_ARG_ENABLE(firewire, AC_HELP_STRING([--disable-firewire],[ignore FireWire driver (FFADO)]),
712                         TRY_FIREWIRE=$enableval , TRY_FIREWIRE=yes ) 
713 HAVE_FIREWIRE="false"
714 if test "x$TRY_FIREWIRE" = "xyes"
715 then
716         # check for FFADO libraries
717         PKG_CHECK_MODULES(LIBFFADO, libffado >= 1.999.17,
718              [HAVE_FIREWIRE="true"
719               JACK_DEFAULT_DRIVER=\"firewire\"
720              ], AC_MSG_RESULT([no]))
722         AC_SUBST([LIBFFADO_CFLAGS])
723         AC_SUBST([LIBFFADO_LIBS])
726 AM_CONDITIONAL(HAVE_FIREWIRE,$HAVE_FIREWIRE)
728 AC_ARG_ENABLE(alsa, AC_HELP_STRING([--disable-alsa],[ignore ALSA driver ]),
729                         TRY_ALSA=$enableval , TRY_ALSA=yes ) 
730 HAVE_ALSA="false"
731 if test "x$TRY_ALSA" = "xyes"
732 then
733         # check for ALSA >= 1.0.0
734         PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0,
735              [HAVE_ALSA="true"
736               ALSA_LIBS=-lasound
737               JACK_DEFAULT_DRIVER=\"alsa\"
738              ], AC_MSG_RESULT([no]), [-lm]
739         )
740         AC_SUBST(ALSA_LIBS)
742 AM_CONDITIONAL(HAVE_ALSA, $HAVE_ALSA)
744 HAVE_ALSA_MIDI=$HAVE_ALSA
745 AM_CONDITIONAL(HAVE_ALSA_MIDI, $HAVE_ALSA_MIDI)
747 if test "$JACK_DEFAULT_DRIVER" = \"dummy\"; then
748   AC_MSG_WARN([Only the dummy driver can be built])
750 AC_DEFINE_UNQUOTED(JACK_DEFAULT_DRIVER,
751         [$JACK_DEFAULT_DRIVER],
752         [Default JACK driver])
754 # On some systems, readline depends on termcap or ncurses.  But, the
755 # MacOSX linker complains bitterly if these libraries are explicitly
756 # referenced.  
758 # AC_CHECK_LIB() foolishly assumes that checking a library for an entry
759 # point always returns the same result regardless of any dependent
760 # libraries specified.  The `unset ac_cv_lib_readline_readline' erases
761 # the cached result to work around this problem.
762 READLINE_DEPS=""
763 HAVE_READLINE=true
764 AC_CHECK_LIB(readline, readline, [:],
765     [unset ac_cv_lib_readline_readline
766      AC_CHECK_LIB(readline, readline, [READLINE_DEPS="-ltermcap"],
767         [unset ac_cv_lib_readline_readline
768          AC_CHECK_LIB(readline, readline,
769             [READLINE_DEPS="-lncurses"], [HAVE_READLINE=false], "-lncurses")],
770         "-ltermcap")])
771 AC_CHECK_HEADER(readline/chardefs.h, [], [HAVE_READLINE=false])
772 if test x$HAVE_READLINE = xfalse; then
773         AC_MSG_WARN([*** the jack_transport example client will not be built])
775 AC_SUBST(READLINE_DEPS)
777 # you need doxygen to make dist.
778 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
779 if test $HAVE_DOXYGEN = "false"; then
780              AC_MSG_WARN([*** doxygen not found, docs will not be built])
783 AM_CONDITIONAL(HAVE_SNDFILE, $HAVE_SNDFILE)
784 AM_CONDITIONAL(HAVE_CELT, $HAVE_CELT)
785 AM_CONDITIONAL(HAVE_SAMPLERATE, $HAVE_SAMPLERATE)
786 AM_CONDITIONAL(HAVE_READLINE, $HAVE_READLINE)
787 AM_CONDITIONAL(HAVE_DOXYGEN, $HAVE_DOXYGEN)
788 AM_CONDITIONAL(USE_CAPABILITIES, $USE_CAPABILITIES)
789 AM_CONDITIONAL(STRIPPED_JACKD, $STRIPPED_JACKD)
790 AM_CONDITIONAL(HAVE_PPOLL, $HAVE_PPOLL)
792 AC_OUTPUT(
793 Makefile
794 config/Makefile
795 config/cpu/Makefile
796 config/cpu/alpha/Makefile
797 config/cpu/cris/Makefile
798 config/cpu/generic/Makefile
799 config/cpu/i386/Makefile
800 config/cpu/i486/Makefile
801 config/cpu/ia64/Makefile
802 config/cpu/m68k/Makefile
803 config/cpu/mips/Makefile
804 config/cpu/powerpc/Makefile
805 config/cpu/s390/Makefile
806 config/os/Makefile
807 config/os/generic/Makefile
808 config/os/gnu-linux/Makefile
809 config/os/macosx/Makefile
810 config/sysdeps/Makefile
811 doc/Makefile
812 doc/reference.doxygen
813 drivers/Makefile
814 drivers/alsa/Makefile
815 drivers/alsa-midi/Makefile
816 drivers/dummy/Makefile
817 drivers/oss/Makefile
818 drivers/sun/Makefile
819 drivers/portaudio/Makefile
820 drivers/coreaudio/Makefile
821 drivers/freebob/Makefile
822 drivers/firewire/Makefile
823 drivers/netjack/Makefile
824 example-clients/Makefile
825 tools/Makefile
826 jack.pc
827 jack.spec
828 jack/Makefile
829 jack/version.h
830 jackd/Makefile
831 jackd/jackd.1
832 libjack/Makefile
836 dnl Output summary message
839 echo
840 echo $PACKAGE $VERSION :
841 echo
842 echo \| Build with ALSA support............................... : $HAVE_ALSA
843 echo \| Build with old FireWire \(FreeBob\) support............. : $HAVE_FREEBOB
844 echo \| Build with new FireWire \(FFADO\) support............... : $HAVE_FIREWIRE
845 echo \| Build with OSS support................................ : $HAVE_OSS
846 echo \| Build with Sun audio support.......................... : $HAVE_SUN
847 echo \| Build with CoreAudio support.......................... : $HAVE_COREAUDIO
848 echo \| Build with PortAudio support.......................... : $HAVE_PA
849 echo \| Build with NetJack support............................ : $HAVE_SAMPLERATE
850 echo \| Build with Celt support............................... : $HAVE_CELT
851 echo \| Build with dynamic buffer size support................ : $buffer_resizing
852 echo \| Compiler optimization flags........................... : $JACK_OPT_CFLAGS
853 echo \| Compiler full flags................................... : $CFLAGS
854 echo \| Install dir for libjack + backends.................... : $libdir/jack
855 echo \|
856 echo \| Default driver backend................................ : $JACK_DEFAULT_DRIVER
857 echo \| Shared memory interface............................... : $JACK_SHM_TYPE
858 echo \| IPC Temporary directory............................... : $DEFAULT_TMP_DIR
859 echo \| Install prefix........................................ : $prefix
860 echo \| Default tmp dir....................................... : $DEFAULT_TMP_DIR
861 echo