bump micro version
[jack.git] / configure.ac
blob7f1f0c3510221449491f17b56cb7db2f9c76e88a
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=116
20 JACK_MICRO_VERSION=1
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 statically linked with an older
28 dnl version of libjack. NOTE: statically linking to libjack
29 dnl is a huge mistake.
30 dnl ---
31 JACK_PROTOCOL_VERSION=24
33 dnl ---
34 dnl HOWTO: updating the libjack interface version
35 dnl
36 dnl current = incremented whenever the public libjack API is changed 
37 dnl revision = incremented when the libjack implementation is changed
38 dnl age = current libjack is both source and binary compatible with
39 dnl       libjack interfaces current,current-1,...,current-age
40 dnl
41 dnl Note! see libtool documentation for detailed documentation
42 dnl
43 dnl Note Also! until we reach CURRENT>=1, the rules are somewhat
44 dnl slacker than this, and closer to those for the JACK version
45 dnl number.
46 dnl ---
47 JACK_API_CURRENT=0
48 JACK_API_REVISION=28
49 JACK_API_AGE=0
51 AC_SUBST(JACK_MAJOR_VERSION)
52 AC_SUBST(JACK_MINOR_VERSION)
53 AC_SUBST(JACK_MICRO_VERSION)
55 AC_SUBST(JACK_PROTOCOL_VERSION)
56 AC_DEFINE_UNQUOTED(PROTOCOL_VERSION, "$JACK_PROTOCOL_VERSION", [Protocol version])
58 AC_SUBST(JACK_API_MAJOR_VERSION)
59 AC_SUBST(JACK_API_MINOR_VERSION)
60 AC_SUBST(JACK_API_MICRO_VERSION)
62 JACK_SO_VERSION=${JACK_API_CURRENT}:${JACK_API_REVISION}:${JACK_API_AGE}
64 JACK_VERSION=$JACK_MAJOR_VERSION.$JACK_MINOR_VERSION.${JACK_MICRO_VERSION}${BETA}
65 JACK_RELEASE=$JACK_MAJOR_VERSION-$JACK_MINOR_VERSION-${JACK_MICRO_VERSION}${BETA}
67 AC_SUBST(JACK_SO_VERSION)
68 AC_SUBST(JACK_VERSION)
69 AC_SUBST(JACK_RELEASE)
71 AM_INIT_AUTOMAKE(jack-audio-connection-kit,${JACK_VERSION})
72 AM_MAINTAINER_MODE
74 dnl
75 dnl save any user-provided CFLAGS so we can forget
76 dnl about any nonsense that configure generates
77 dnl 
79 ORIGINAL_CFLAGS="$CFLAGS"
81 AM_CONFIG_HEADER(config.h)
82 AC_ENABLE_STATIC(no)
83 AC_ENABLE_SHARED(yes)
84 AC_PROG_CC
85 AC_PROG_CXX
86 AC_PROG_LD
87 AM_PROG_LIBTOOL
88 AC_PROG_LN_S
89 AM_PROG_CC_C_O
90 AC_C_BIGENDIAN
92 dnl
93 dnl now use those user-provided CFLAGS
94 dnl and dump whatever nonsense configure generated
95 dnl while looking for a compiler
96 dnl
98 CFLAGS="$ORIGINAL_CFLAGS"
100 AC_MSG_CHECKING([platform dependencies])
102 HOST_DEFAULT_TMP_DIR=/dev/shm
103 case "${host_os}" in
104   freebsd*)
105     # current FreeBSD header files conflict with the OSS driver's
106     # barrier code, this may be fixed in 5.3, stay tuned.
107     USE_BARRIER="no"
108     ;;
109   openbsd*)
110     # pthread_barrier* not implemented
111     USE_BARRIER="no"
112     # need small realtime stack
113     JACK_THREAD_STACK_TOUCH=10000
114     ;;
115   darwin*)
116     JACK_THREAD_STACK_TOUCH=10000       # need small realtime stack
117     JACK_CPP_VARARGS_BROKEN=1
118     JACK_DO_NOT_MLOCK=1
119     JACK_USE_MACH_THREADS=1
120     OS_LDFLAGS="-framework CoreAudio -framework CoreServices -framework AudioUnit"
121     TRY_POSIX_SHM=yes                   # POSIX shm works better
122     HOST_DEFAULT_TMP_DIR=/tmp
123     ;;
124 esac
126 AC_SUBST(OS_LDFLAGS)
129 # We need to establish suitable defaults for a 64-bit OS
130 libnn=lib
131 case "${host_os}" in
132     linux*)
133     case "${host_cpu}" in
134         x86_64|mips64|ppc64|sparc64|s390x)
135         libnn=lib64
136         ;;
137     esac
138     ;;
139     solaris*)
140     ## libnn=lib/sparcv9 ## on 64-bit only, but that's compiler-specific
141     ;;  
142 esac
144 ## take care not to  override the command-line setting
145 if test "${libdir}" = '${exec_prefix}/lib'; then
146   libdir='${exec_prefix}/'${libnn}
149 # system-dependent config.h values
150 test "x$JACK_THREAD_STACK_TOUCH" = "x" && JACK_THREAD_STACK_TOUCH=500000
151 AC_DEFINE_UNQUOTED(JACK_THREAD_STACK_TOUCH,
152         [$JACK_THREAD_STACK_TOUCH],
153         [Guaranteed size of realtime stack])
154 if test "x$JACK_CPP_VARARGS_BROKEN" != "x"; then
155     AC_DEFINE_UNQUOTED(JACK_CPP_VARARGS_BROKEN,
156         [$JACK_CPP_VARARGS_BROKEN],
157         [CPP has a broken varargs implementation])
159 if test "x$JACK_USE_MACH_THREADS" != "x"; then
160     AC_DEFINE_UNQUOTED(JACK_USE_MACH_THREADS,
161         [$JACK_USE_MACH_THREADS],
162         [Use MACH threads where possible])
165 # headers
166 AC_CHECK_HEADERS(string.h strings.h alloca.h)
167 AC_CHECK_HEADERS(getopt.h, [], [
168     for d in /Developer/SDKs/MacOSX10.3.0.sdk/usr/include/ ; do
169         AC_CHECK_HEADERS($d/getopt.h, [], [CFLAGS="$CFLAGS -I$d"])
170     done])
171 AC_CHECK_HEADER(/usr/include/nptl/pthread.h,
172         [CFLAGS="$CFLAGS -I/usr/include/nptl"])
174 # functions and libraries
175 AC_CHECK_FUNC(getopt_long, [],
176     AC_MSG_ERROR([*** JACK requires GNU getopt_long]))
177 AC_CHECK_FUNC(gethostent, [], AC_CHECK_LIB(nsl, gethostent))
178 AC_CHECK_FUNC(setsockopt, [], AC_CHECK_LIB(socket, setsockopt))
179 AC_CHECK_FUNC(connect, [], AC_CHECK_LIB(inet, connect))
180 AC_CHECK_FUNC(dlopen, [], 
181     AC_CHECK_LIB(dl, dlopen, [],
182         AC_MSG_ERROR([*** JACK requires dynamic load support])))
183 AC_CHECK_FUNC(pthread_create, [],
184     AC_CHECK_LIB(pthread, pthread_create, [],
185         AC_MSG_ERROR([*** JACK requires POSIX threads support])))
186 AC_CHECK_FUNCS(on_exit atexit)
187 AC_CHECK_FUNCS(posix_memalign)
188 AC_CHECK_LIB(m, sin)
190 echo -n "Checking for ppoll()... "
191 AC_EGREP_CPP( ppoll,
193 #define _GNU_SOURCE
194 #include <poll.h>
195 ], [
196         AC_DEFINE(HAVE_PPOLL,1,"Whether ppoll is available")
197         echo "yes"
198    ],[
199         AC_DEFINE(HAVE_PPOLL,0,"Whether ppoll is available")
200         echo "no"
201    ] )
203          
205 AC_CHECK_FUNC(clock_gettime, 
206        [
207            AC_DEFINE(HAVE_CLOCK_GETTIME,0,"Whether or not clock_gettime can be found in system libraries")
208        ], 
209        #
210        # if not found, check librt specifically
211        #
212        AC_CHECK_LIB(rt, clock_gettime, 
213            [
214               AC_DEFINE(HAVE_CLOCK_GETTIME,1,"Whether or not clock_gettime can be found in system libraries")
215               OS_LDFLAGS="$OS_LDFLAGS -lrt"
216            ])
217 )         
219 # should we use mlockall() on this platform?
220 if test "x$JACK_DO_NOT_MLOCK" = "x"; then
221     AC_CHECK_HEADER(sys/mman.h,
222         [AC_CHECK_FUNC(mlockall,
223             [AC_DEFINE(USE_MLOCK, 1, [Use POSIX memory locking])])])
226 # look for system support for POSIX shm API
227 AC_ARG_ENABLE(posix-shm,
228         AC_HELP_STRING([--enable-posix-shm], [use POSIX shm API (default=auto)]),
229         [TRY_POSIX_SHM=$enableval])
230 if test "x$TRY_POSIX_SHM" = "xyes"
231 then
232         AC_CHECK_FUNC(shm_open, [],
233                 AC_CHECK_LIB(rt, shm_open, [], [TRY_POSIX_SHM=no]))
235 AC_MSG_CHECKING([shared memory support])
236 if test "x$TRY_POSIX_SHM" = "xyes"
237 then
238         AC_MSG_RESULT([POSIX shm_open().])
239         AC_DEFINE(USE_POSIX_SHM,1,[Use POSIX shared memory interface])
240         JACK_SHM_TYPE='"POSIX"'
241         USE_POSIX_SHM="true"
242 else
243         AC_MSG_RESULT([System V shmget().])
244         JACK_SHM_TYPE='"System V"'
245         USE_POSIX_SHM="false"
247 AC_DEFINE_UNQUOTED(JACK_SHM_TYPE, [$JACK_SHM_TYPE],
248         [JACK shared memory type])
249 AM_CONDITIONAL(USE_POSIX_SHM, $USE_POSIX_SHM)
251 JACK_CORE_CFLAGS="-I\$(top_srcdir)/config -I\$(top_srcdir) \
252 -I\$(top_srcdir) -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall"
254 JACK_LIBC_HELPER_FLAGS=
255 AC_ARG_ENABLE(ancient_libc,
256         AC_HELP_STRING([--enable-ancient-libc],[Add required CFLAGS for libc versions too old to expose PThread R/W Lock and other modern code]),
257         JACK_LIBC_HELPER_FLAGS="-D_XOPEN_SOURCE=600 -D_BSD_SOURCE",
258         JACK_LIBC_HELPER_FLAGS=""
259         )
260          
261 JACK_CORE_CFLAGS="$JACK_CORE_CFLAGS $JACK_LIBC_HELPER_FLAGS"   
263 AC_ARG_WITH(cpu-target,
264             [  --with-cpu-target=cpu-type    explicit, overriding argument for gcc -march= flag])
268 dnl figure out how best to optimize
269 dnl JOQ: this should be done via config/configure.hosts
272 dnl ----------------------------------------------------------------------
274 if test "$target_cpu" = "powerpc64" ; then
276     AC_ARG_ENABLE(cell,
277         AC_HELP_STRING([--enable-cell],[enable Cell BE support (default=no)]),,
278         [ enable_cell=no ])
280     if test "x$enable_cell" = xyes; then
281         AC_DEFINE(ENABLE_CELLBE, 1, [Define to 1 if you need support for the Cell BE.])
282     fi
286 if test "$target_cpu" = "powerpc" -o "$target_cpu" = "powerpc64" ; then
288     AC_DEFINE(POWERPC, 1, "Are we running a ppc CPU?")
289     
290 ############################
291 # Check for Altivec assembly
292 ############################
294     AC_ARG_ENABLE(altivec,
295         AC_HELP_STRING([--enable-altivec],[enable Altivec support (default=auto)]),,
296         [ enable_altivec=yes ])
297     
298     if test "x$enable_altivec" = xyes; then
299         
300         AC_MSG_CHECKING(whether we can compile Altivec code)
301         
302         AC_COMPILE_IFELSE([asm ("vand %v0, %v0, %v0");],
303             AC_DEFINE(USE_ALTIVEC, 1, [Define to 1 if Altivec assembly is available.])
304             AC_DEFINE(HAVE_ALTIVEC_LINUX, 1, "Is there Altivec Support ?")
305             ALTIVEC_OPT_FLAGS="-maltivec -mabi=altivec"
306             AC_MSG_RESULT(yes)
307             ,
308             enable_altivec=no
309             AC_MSG_RESULT(no)
310             AC_MSG_WARN([The assembler does not support the Altivec command set.])
311         )
312         
313     fi
315     dnl -mcpu=7450 does not reliably work with gcc 3.*
316     
317     JACK_OPT_CFLAGS="-O2 -mcpu=7400 $ALTIVEC_OPT_FLAGS -mhard-float -mpowerpc-gfxopt"
319     if test "$target_cpu" = "powerpc64"; then
320         JACK_OPT_CFLAGS="-O2 -mcpu=powerpc64 $ALTIVEC_OPT_FLAGS -mhard-float" 
321     fi
323 elif echo $target_cpu | egrep '(i.86|x86_64)' >/dev/null; then
325     dnl Check for MMX/SSE assembly
326     
327     if test -r /proc/cpuinfo ; then
328         procflags=`grep '^flags' /proc/cpuinfo`
329         if echo $procflags | grep -s mmx ; then
330             cpu_supports_mmx=yes
331         fi
332         if echo $procflags | grep -s sse ; then
333             cpu_supports_sse=yes
334         fi
335     else
336         # this is not linux, but assume that if the processor
337         # is x86 then is supports SSE and not MMX
338         cpu_supports_sse=yes
339         AC_MSG_WARN([Assuming your x86/x86_64 system can support SSE. Use --disable-sse if this is not the case])
340         cpu_supports_mmx=no
341         AC_MSG_WARN([Assuming your x86/x86_64 system does not need to use MMX. Use --enable-mmx if this is not the case])
342     fi
343     
344     AC_ARG_ENABLE(optimization-by-compiler,
345         AC_HELP_STRING([--enable-optimization-by-compiler],[use compiler (NOT processor) capabilities to determine optimization flags (default=no)]),
346         optimization_by_compiler=yes,
347         optimization_by_compiler=no
348     )
349     
350     AC_ARG_ENABLE(optimization-by-cpu,
351         AC_HELP_STRING([--enable-optimization-by-cpu],[use processor capabilities to determine optimization flags (default=yes)]),,
352         optimization_by_cpu=yes
353     )
354     
355     AC_ARG_ENABLE(mmx,
356         AC_HELP_STRING([--enable-mmx],[enable MMX support (default=auto)]),,
357         enable_mmx=yes)
358     
359     AC_ARG_ENABLE(sse,
360         AC_HELP_STRING([--enable-sse],[enable SSE support (default=auto)]),,
361         enable_sse=$enable_mmx)
362     
363     if test "x$enable_mmx" = xyes; then
364         
365         AC_MSG_CHECKING(whether we can compile MMX code)
366         
367         AC_COMPILE_IFELSE([asm ("movq 0, %mm0");],
368             
369             AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.])
370             AC_MSG_RESULT(yes)
371             
372             if test x$optimization_by_cpu = xyes ; then
373                 if test x$cpu_supports_mmx = xyes ; then
374                     MMX_FLAGS="-mmmx"
375                 fi
376             else 
377                 MMX_FLAGS="-mmmx"
378             fi
379             
380             AC_MSG_RESULT(yes)
381             ,
382             enable_mmx=no
383             AC_MSG_RESULT(no)
384             AC_MSG_WARN([The assembler does not support the MMX command set.])
385         )
386     fi
388     if test "x$enable_sse" = xyes; then
389         
390         AC_MSG_CHECKING(whether we can compile SSE code)
391         
392         AC_COMPILE_IFELSE([asm ("movntps %xmm0, 0");],
393             [
394                 if test x$optimization_by_cpu = xyes ; then
395                     if test x$cpu_supports_sse = xyes ; then
396                         SSE_FLAGS="-msse -mfpmath=sse"
397                         MMX_FLAGS=""
398                     fi
399                 else 
400                     SSE_FLAGS="-msse -mfpmath=sse"
401                     MMX_FLAGS=""
402                 fi
403                 
404                 AC_MSG_RESULT(yes)
405                 ],
406             [
407                 enable_sse=no
408                 AC_MSG_RESULT(no)
409                 AC_MSG_WARN([The assembler does not support the SSE command set.]) 
410                 ])
411     fi
412     
413     AC_DEFINE(x86, 1, "Nope it's intel")
414     COMMON_X86_OPT_FLAGS="-O3 -fomit-frame-pointer -ffast-math -funroll-loops"
417 dnl its a little sad that OS X doesn't make it possible to identify 
418 dnl the target_cpu a little more precisely. on os x we always get "i386"
419 dnl as the CPU type. we miss out on some possible optimizations as 
420 dnl a result. oh well.
421 dnl     
422     
423     if test x$with_cpu_target != x ; then
424         JACK_OPT_CFLAGS="-march=$with_cpu_target"
425     else
426         if test "$target_cpu" = "i586"; then
427            JACK_OPT_CFLAGS="-march=i586 "
428         elif test "$target_cpu" = "i686"; then
429             JACK_OPT_CFLAGS="-march=i686"
430         elif test "$target_cpu" = "x86_64"; then
431             JACK_OPT_CFLAGS="-march=k8"
432         else
433             :
434         fi
435     fi
438 dnl do not add h/w specific flags if asked to let compiler
439 dnl to the optimization
440 dnl    
442     if test x$optimization_by_compiler != xyes ; then
443         JACK_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $JACK_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS"
444     else
445        JACK_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS"
446     fi
450 AC_ARG_ENABLE(dynsimd,
451         AC_HELP_STRING([--enable-dynsimd],[enable dynamic SIMD selection (default=no)]),,
452     enable_dynsimd=no)
454 if test "x$enable_dynsimd" = xyes; then
455         AC_DEFINE(USE_DYNSIMD, 1, [Define to 1 to use dynamic SIMD selection.])
456         dnl This needs update once there's more than x86/x86-64 supported
457         SIMD_CFLAGS="-O -msse -msse2 -m3dnow"
458         AC_SUBST(SIMD_CFLAGS)
461 AC_ARG_ENABLE(optimize,
462     AC_HELP_STRING([--enable-optimize],
463         [optimize code, based on CPU or compiler, as separately selected (default=no)]),
464     [ if test x$enable_optimize != xno ; then
465         AC_MSG_WARN([optimization in use.........................])
466       else
467         # no optimization, so lets get debugging symbols instead
468         JACK_OPT_CFLAGS="-g"
469         AC_MSG_WARN([no optimization.........................])
470       fi 
471     ],
472     [
473         # no optimization, so lets get debugging symbols instead
474         JACK_OPT_CFLAGS="-g"
475         AC_MSG_WARN([no optimization.........................])
476     ]
479 JACK_CFLAGS="$JACK_CORE_CFLAGS $JACK_OPT_CFLAGS"
482 dnl most makefiles use JACK_CFLAGS, but simd code needs JACK_CORE_CFLAGS
485 AC_SUBST(JACK_CFLAGS)
486 AC_SUBST(JACK_CORE_CFLAGS)
489 dnl use JACK_CFLAGS for jackd compilation
490 dnl 
492 CFLAGS="$CFLAGS $JACK_CFLAGS"
494 # allow buffer resizing unless --disable-resize specified
495 buffer_resizing=yes
496 AC_ARG_ENABLE(resize,
497         AC_HELP_STRING([--enable-resize], [enable buffer resizing feature (default=yes)]),
498         [ 
499           if test x$enable_resize = xno ; then
500                 buffer_resizing=no
501           fi
502          ]
505 if test x$buffer_resizing != xno; then 
506    AC_DEFINE(DO_BUFFER_RESIZE,,[Enable buffer resizing])
510 AC_ARG_ENABLE(ensure-mlock,
511         AC_HELP_STRING([--enable-ensure-mlock], [server should fail if unable to lock memory (default=no)]),
512         [ 
513           if test x$enable_ensure_mlock != xno ; then
514                 AC_DEFINE(ENSURE_MLOCK,,[Ensure that memory locking succeeds])
515           fi
516         ]
519 AC_ARG_ENABLE(debug,
520         AC_HELP_STRING([--enable-debug],
521                 [enable debugging messages in jackd and libjack (default=no)]),
522         [ 
523           if test x$enable_debug != xno ; then
524              AC_DEFINE(DEBUG_ENABLED,,[Enable debugging messages])
525           fi
526         ]
529 AC_ARG_ENABLE(timestamps,
530         AC_HELP_STRING([--enable-timestamps],
531                 [allow clients to use the JACK timestamp API (JACK developers only) (default=no)]),
532         [ 
533           if test x$enable_timestamps != xno ; then
534                 AC_DEFINE(WITH_TIMESTAMPS,,[Enable JACK timestamp API])
535           fi
536         ]               
539 AC_ARG_ENABLE(preemption-check,
540         AC_HELP_STRING([--enable-preemption-check],
541                 [check for inappropriate realtime preemption (requires a specially built Linux kernel) (default=no)]),
542                 [
543                   if test x$enable_preemption_check != xno ; then
544                         echo checking for realtime preemption bugs
545                         AC_DEFINE(DO_PREEMPTION_CHECKING,,
546                                 [check realtime preemption])
547                   fi
548                 ])
550 USE_CAPABILITIES=false
552 AC_ARG_ENABLE(capabilities,
553         AC_HELP_STRING([--enable-capabilities],[!!! LINUX 2.4 KERNELS ONLY !!! use libcap to gain realtime scheduling priviledges]),
554               [ if test "x$enable_capabilities" != "xno" ; then
555                     AC_CHECK_LIB(cap, capgetp,
556                                  [AC_CHECK_HEADER(sys/capability.h,
557                                                   [HAVE_CAPABILITIES=true],
558                                                   [AC_MSG_WARN([*** no kernel support for capabilities])
559                                                    HAVE_CAPABILITIES=false]
560                                   )],
561                                  [AC_MSG_WARN([*** no libcap present])
562                                   HAVE_CAPABILITIES=false]
563                     )
564                     if test "x$HAVE_CAPABILITIES" = "xtrue"; then
565                         AC_CHECK_PROG(HAVE_CAPABILITIES, md5sum, true, false)
566                     fi
567                     if test "x$HAVE_CAPABILITIES" = "xfalse"; then
568                         AC_MSG_WARN([*** required program md5sum not found])
569                     fi
570                     if test "x$HAVE_CAPABILITIES" = "xfalse"; then
571                         AC_MSG_ERROR([*** Capabilities support not present. Run configure again without --enable-capabilities.])
572                     fi
573                     USE_CAPABILITIES=true
574                     AC_DEFINE(USE_CAPABILITIES,,[Enable POSIX 1.e capabilities support])
575                 fi
576               ]
579 with_oldtrans=yes
580 AC_ARG_ENABLE(oldtrans,
581         AC_HELP_STRING([--disable-oldtrans],[remove old transport interfaces (default=yes)]),
582               [ if test "x$enable_oldtrans" = "xno" ; then
583                     with_oldtrans=no
584                 fi 
585               ]
587 if test "x$with_oldtrans" != "xno" ; then
588         AC_DEFINE(OLD_TRANSPORT,,[Include old transport interfaces])
591 STRIPPED_JACKD=false
592 AC_ARG_ENABLE(stripped-jackd,
593         AC_HELP_STRING([--enable-stripped-jackd],[strip jack before computing its md5 sum (useful only with Linux 2.4 kernel)]),
594               [ if test "x$USE_CAPABILITIES" != "xtrue" ; then      
595                     AC_MSG_WARN([*** capabilities not enabled, stripped jackd has no effect])
596                 elif test "x$enable_stripped_jackd" != "xno"; then
597                     STRIPPED_JACKD=true             
598                 fi  
599               ] 
602 # plugins go in the addon dir.
604 ADDON_DIR='${libdir}/jack'
605 AC_SUBST(ADDON_DIR)
606 AS_AC_EXPAND(ADDON_DIR_EXPANDED,${libdir}/jack)
607 AC_DEFINE_UNQUOTED(ADDON_DIR,"$ADDON_DIR_EXPANDED",[Directory for plugins])
609 AC_ARG_WITH(html-dir,
610                 AC_HELP_STRING([--with-html-dir=PATH],[where to install the html documentation]))
612 if test "x$with_html_dir" = "x" ; then
613     HTML_DIR='${pkgdatadir}'
614 else
615     HTML_DIR=$with_html_dir
618 AC_SUBST(HTML_DIR)
621 # allow specifying default tmpdir
622 AC_ARG_WITH(default-tmpdir,
623             AC_HELP_STRING([--with-default-tmpdir],[where jackd and clients will put tmp files (default=/dev/shm)]))
625 if test "x$with_default_tmpdir" = "x" ; then
626         DEFAULT_TMP_DIR=$HOST_DEFAULT_TMP_DIR
627 else
628         DEFAULT_TMP_DIR=$with_default_tmpdir
631 AC_SUBST(DEFAULT_TMP_DIR)
632 AC_DEFINE_UNQUOTED(DEFAULT_TMP_DIR,"$DEFAULT_TMP_DIR",[Default tmp directory])
634 # Check for barrier functions in the pthreads library.  The default
635 # option setting may be OS-dependent, otherwise it's "yes".
636 test "x$USE_BARRIER" = "x" && USE_BARRIER="yes"
637 AC_ARG_WITH(barrier,
638         AC_HELP_STRING([--without-barrier],
639                        [avoid using pthread barrier functions (only used by OSS driver)]),
640         [ USE_BARRIER=$withval ])
641 if test "x$USE_BARRIER" = "xyes"; then
642         AC_CHECK_LIB([pthread], [pthread_barrier_init],
643                 AC_DEFINE(USE_BARRIER, 1, [Use pthread barrier functions]))
646 # some example-clients need libsndfile
647 HAVE_SNDFILE=false
648 PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0,[HAVE_SNDFILE=true], [true])
649 if test x$HAVE_SNDFILE = xfalse; then
650              AC_MSG_WARN([*** the jackrec example client will not be built])
653 # NetJack backend and internal client need libsamplerate
654 HAVE_SAMPLERATE=false
655 PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.1.2,[HAVE_SAMPLERATE=true], [true])
656 if test x$HAVE_SAMPLERATE = xfalse; then
657         AC_MSG_WARN([*** the NetJack backend and internal client will not be built])
658 else
659         CFLAGS="$CFLAGS $SAMPLERATE_CFLAGS"
660         LIBS="$LIBS $SAMPLERATE_LIBS"
663 # Celt low-latency audio codec. netjack transmission via internet.
664 HAVE_CELT=false
665 PKG_CHECK_MODULES(CELT, celt >= 0.5.0,[HAVE_CELT=true], [true])
666 if test x$HAVE_CELT = xfalse; then
667         AC_DEFINE(HAVE_CELT,0,"Whether CELT is available")
668         AC_MSG_RESULT(no)
669         AC_MSG_WARN([*** NetJack will not be built with celt support])
670 else
671         AC_DEFINE(HAVE_CELT,1,"Whether CELT is available")
672         AC_MSG_RESULT(yes)
673         LIBS="$LIBS $CELT_LIBS"
676 # Note: A bug in pkg-config causes problems if the first occurence of
677 # PKG_CHECK_MODULES can be disabled. So, if you're going to use
678 # PKG_CHECK_MODULES inside a --disable-whatever check, you need to
679 # do it somewhere *below* this comment.
681 # Check which backend drivers can be built.  The last one successfully
682 # configured becomes the default JACK driver; so the order of
683 # precedence is: alsa, sun, oss, coreaudio, portaudio, dummy.
685 JACK_DEFAULT_DRIVER=\"dummy\"
687 AC_ARG_ENABLE(portaudio,
688         AC_HELP_STRING([--enable-portaudio],[build PortAudio driver]),
689    TRY_PORTAUDIO=$enableval , TRY_PORTAUDIO=no)
691 HAVE_PA="false"
692 if test "x$TRY_PORTAUDIO" = "xyes"
693 then
694         # check for portaudio V18
695         AC_CHECK_LIB(portaudio, Pa_Initialize,
696                 [ AC_CHECK_HEADERS(portaudio.h,
697                         [ HAVE_PA="true"
698                           PA_LIBS=-lportaudio
699                           JACK_DEFAULT_DRIVER=\"portaudio\"
700                         ])
701                 ])
702         AC_SUBST(PA_LIBS)
704 AM_CONDITIONAL(HAVE_PA, $HAVE_PA)
706 AC_ARG_ENABLE(coreaudio, AC_HELP_STRING([--disable-coreaudio], [ignore CoreAudio driver]),
707                         TRY_COREAUDIO=$enableval , TRY_COREAUDIO=yes )
708 HAVE_COREAUDIO="false"
709 if test "x$TRY_COREAUDIO" = "xyes"
710 then
711         # check for coreaudio
712         AC_CHECK_HEADERS(CoreAudio/CoreAudio.h,
713                 [ HAVE_COREAUDIO="true"
714                   JACK_DEFAULT_DRIVER=\"coreaudio\"
715                 ])
717 AM_CONDITIONAL(HAVE_COREAUDIO, $HAVE_COREAUDIO)
719 AC_ARG_ENABLE(oss, AC_HELP_STRING([--disable-oss],[ignore OSS driver ]),
720                         TRY_OSS=$enableval , TRY_OSS=yes ) 
721 HAVE_OSS="false"
722 if test "x$TRY_OSS" = "xyes"
723 then
724         # check for Open Sound System
725         AC_CHECK_HEADER([sys/soundcard.h],
726              [HAVE_OSS="true"
727               JACK_DEFAULT_DRIVER=\"oss\"])
729 AM_CONDITIONAL(HAVE_OSS, $HAVE_OSS)
731 AC_ARG_ENABLE(sun, AC_HELP_STRING([--disable-sun],[ignore Sun driver ]),
732                         TRY_SUN=$enableval , TRY_SUN=yes ) 
733 HAVE_SUN="false"
734 if test "x$TRY_SUN" = "xyes"
735 then
736         # check for Sun audio API
737         AC_CHECK_HEADER([sys/audioio.h],
738              [HAVE_SUN="true"
739               JACK_DEFAULT_DRIVER=\"sun\"])
741 AM_CONDITIONAL(HAVE_SUN, $HAVE_SUN)
743 AC_ARG_ENABLE(freebob, AC_HELP_STRING([--disable-freebob],[ignore FreeBob driver ]),
744                         TRY_FREEBOB=$enableval , TRY_FREEBOB=yes ) 
745 HAVE_FREEBOB="false"
746 if test "x$TRY_FREEBOB" = "xyes"
747 then
748         # check for FreeBob libraries
749         PKG_CHECK_MODULES(LIBFREEBOB, libfreebob >= 1.0.0,
750              [HAVE_FREEBOB="true"
751               JACK_DEFAULT_DRIVER=\"freebob\"
752              ], AC_MSG_RESULT([no]))
754         AC_SUBST([LIBFREEBOB_CFLAGS])
755         AC_SUBST([LIBFREEBOB_LIBS])
758 AM_CONDITIONAL(HAVE_FREEBOB,$HAVE_FREEBOB)
760 AC_ARG_ENABLE(firewire, AC_HELP_STRING([--disable-firewire],[ignore FireWire driver (FFADO)]),
761                         TRY_FIREWIRE=$enableval , TRY_FIREWIRE=yes ) 
762 HAVE_FIREWIRE="false"
763 if test "x$TRY_FIREWIRE" = "xyes"
764 then
765         # check for FFADO libraries
766         PKG_CHECK_MODULES(LIBFFADO, libffado >= 1.999.17,
767              [HAVE_FIREWIRE="true"
768               JACK_DEFAULT_DRIVER=\"firewire\"
769              ], AC_MSG_RESULT([no]))
771         AC_SUBST([LIBFFADO_CFLAGS])
772         AC_SUBST([LIBFFADO_LIBS])
775 AM_CONDITIONAL(HAVE_FIREWIRE,$HAVE_FIREWIRE)
777 AC_ARG_ENABLE(alsa, AC_HELP_STRING([--disable-alsa],[ignore ALSA driver ]),
778                         TRY_ALSA=$enableval , TRY_ALSA=yes ) 
779 HAVE_ALSA="false"
780 if test "x$TRY_ALSA" = "xyes"
781 then
782         # check for ALSA >= 1.0.0
783         PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0,
784              [HAVE_ALSA="true"
785               ALSA_LIBS=-lasound
786               JACK_DEFAULT_DRIVER=\"alsa\"
787              ], AC_MSG_RESULT([no]), [-lm]
788         )
789         AC_SUBST(ALSA_LIBS)
791 AM_CONDITIONAL(HAVE_ALSA, $HAVE_ALSA)
793 HAVE_ALSA_MIDI=$HAVE_ALSA
794 AM_CONDITIONAL(HAVE_ALSA_MIDI, $HAVE_ALSA_MIDI)
796 if test "$JACK_DEFAULT_DRIVER" = \"dummy\"; then
797   AC_MSG_WARN([Only the dummy driver can be built])
799 AC_DEFINE_UNQUOTED(JACK_DEFAULT_DRIVER,
800         [$JACK_DEFAULT_DRIVER],
801         [Default JACK driver])
803 JACK_SEMAPHORE_KEY=0x282929
804 AC_DEFINE_UNQUOTED(JACK_SEMAPHORE_KEY,
805           [$JACK_SEMAPHORE_KEY],
806           [ an integer constant used as the semaphore and SysV SHM key. see libjack/shm.c for usage])
807 AC_SUBST(JACK_SEMAPHORE_KEY)
809 # On some systems, readline depends on termcap or ncurses.  But, the
810 # MacOSX linker complains bitterly if these libraries are explicitly
811 # referenced.  
813 # AC_CHECK_LIB() foolishly assumes that checking a library for an entry
814 # point always returns the same result regardless of any dependent
815 # libraries specified.  The `unset ac_cv_lib_readline_readline' erases
816 # the cached result to work around this problem.
817 READLINE_DEPS=""
818 HAVE_READLINE=true
819 AC_CHECK_LIB(readline, readline, [:],
820     [unset ac_cv_lib_readline_readline
821      AC_CHECK_LIB(readline, readline, [READLINE_DEPS="-ltermcap"],
822         [unset ac_cv_lib_readline_readline
823          AC_CHECK_LIB(readline, readline,
824             [READLINE_DEPS="-lncurses"], [HAVE_READLINE=false], "-lncurses")],
825         "-ltermcap")])
826 AC_CHECK_HEADER(readline/chardefs.h, [], [HAVE_READLINE=false])
827 if test x$HAVE_READLINE = xfalse; then
828         AC_MSG_WARN([*** the jack_transport example client will not be built])
830 AC_SUBST(READLINE_DEPS)
832 # you need doxygen to make dist.
833 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
834 if test $HAVE_DOXYGEN = "false"; then
835              AC_MSG_WARN([*** doxygen not found, docs will not be built])
838 AM_CONDITIONAL(HAVE_SNDFILE, $HAVE_SNDFILE)
839 AM_CONDITIONAL(HAVE_CELT, $HAVE_CELT)
840 AM_CONDITIONAL(HAVE_SAMPLERATE, $HAVE_SAMPLERATE)
841 AM_CONDITIONAL(HAVE_READLINE, $HAVE_READLINE)
842 AM_CONDITIONAL(HAVE_DOXYGEN, $HAVE_DOXYGEN)
843 AM_CONDITIONAL(USE_CAPABILITIES, $USE_CAPABILITIES)
844 AM_CONDITIONAL(STRIPPED_JACKD, $STRIPPED_JACKD)
845 AM_CONDITIONAL(HAVE_PPOLL, $HAVE_PPOLL)
847 AC_OUTPUT(
848 Makefile
849 config/Makefile
850 config/cpu/Makefile
851 config/cpu/alpha/Makefile
852 config/cpu/cris/Makefile
853 config/cpu/generic/Makefile
854 config/cpu/i386/Makefile
855 config/cpu/i486/Makefile
856 config/cpu/ia64/Makefile
857 config/cpu/m68k/Makefile
858 config/cpu/mips/Makefile
859 config/cpu/powerpc/Makefile
860 config/cpu/s390/Makefile
861 config/os/Makefile
862 config/os/generic/Makefile
863 config/os/gnu-linux/Makefile
864 config/os/macosx/Makefile
865 config/sysdeps/Makefile
866 doc/Makefile
867 doc/reference.doxygen
868 drivers/Makefile
869 drivers/alsa/Makefile
870 drivers/alsa-midi/Makefile
871 drivers/dummy/Makefile
872 drivers/oss/Makefile
873 drivers/sun/Makefile
874 drivers/portaudio/Makefile
875 drivers/coreaudio/Makefile
876 drivers/freebob/Makefile
877 drivers/firewire/Makefile
878 drivers/netjack/Makefile
879 example-clients/Makefile
880 tools/Makefile
881 man/Makefile
882 jack.pc
883 jack.spec
884 jack/Makefile
885 jack/version.h
886 jackd/Makefile
887 jackd/jackd.1
888 libjack/Makefile
892 dnl Output summary message
895 echo
896 echo $PACKAGE $VERSION :
897 echo
898 echo \| Build with ALSA support............................... : $HAVE_ALSA
899 echo \| Build with old FireWire \(FreeBob\) support............. : $HAVE_FREEBOB
900 echo \| Build with new FireWire \(FFADO\) support............... : $HAVE_FIREWIRE
901 echo \| Build with OSS support................................ : $HAVE_OSS
902 echo \| Build with Sun audio support.......................... : $HAVE_SUN
903 echo \| Build with CoreAudio support.......................... : $HAVE_COREAUDIO
904 echo \| Build with PortAudio support.......................... : $HAVE_PA
905 echo \| Build with NetJack support............................ : $HAVE_SAMPLERATE
906 echo \| Build with Celt support............................... : $HAVE_CELT
907 echo \| Build with dynamic buffer size support................ : $buffer_resizing
908 echo \| Compiler optimization flags........................... : $JACK_OPT_CFLAGS
909 echo \| Compiler full flags................................... : $CFLAGS
910 echo \| Install dir for libjack + backends.................... : $libdir/jack
911 echo \|
912 echo \| Default driver backend................................ : $JACK_DEFAULT_DRIVER
913 echo \| Shared memory interface............................... : $JACK_SHM_TYPE
914 echo \| IPC Temporary directory............................... : $DEFAULT_TMP_DIR
915 echo \| Install prefix........................................ : $prefix
916 echo \| Default tmp dir....................................... : $DEFAULT_TMP_DIR
917 echo