jack1 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

711 lines
21KB

  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl $Id$
  3. AC_INIT(jackd/jackd.c)
  4. AC_CONFIG_AUX_DIR(config)
  5. AC_CANONICAL_TARGET
  6. dnl ---
  7. dnl HOWTO: updating the JACK version number
  8. dnl
  9. dnl major version = ask on jackit-devel :)
  10. dnl minor version = incremented when any of the public or internal
  11. dnl interfaces are changed
  12. dnl micro version = incremented when implementation-only
  13. dnl changes are made
  14. dnl ---
  15. JACK_MAJOR_VERSION=0
  16. JACK_MINOR_VERSION=102
  17. JACK_MICRO_VERSION=19
  18. dnl ---
  19. dnl HOWTO: updating the jack protocol version
  20. dnl
  21. dnl increment the protocol version whenever a change is
  22. dnl made to the way libjack communicates with jackd
  23. dnl that would break applications linked with an older
  24. dnl version of libjack.
  25. dnl ---
  26. JACK_PROTOCOL_VERSION=16
  27. dnl ---
  28. dnl HOWTO: updating the libjack interface version
  29. dnl
  30. dnl current = incremented whenever the public libjack API is changed
  31. dnl revision = incremented when the libjack implementation is changed
  32. dnl age = current libjack is both source and binary compatible with
  33. dnl libjack interfaces current,current-1,...,current-age
  34. dnl
  35. dnl Note! see libtool documentation for detailed documentation
  36. dnl
  37. dnl Note Also! until we reach CURRENT>=1, the rules are somewhat
  38. dnl slacker than this, and closer to those for the JACK version
  39. dnl number.
  40. dnl ---
  41. JACK_API_CURRENT=0
  42. JACK_API_REVISION=23
  43. JACK_API_AGE=0
  44. AC_SUBST(JACK_MAJOR_VERSION)
  45. AC_SUBST(JACK_MINOR_VERSION)
  46. AC_SUBST(JACK_MICRO_VERSION)
  47. AC_SUBST(JACK_PROTOCOL_VERSION)
  48. AC_DEFINE_UNQUOTED(PROTOCOL_VERSION, "$JACK_PROTOCOL_VERSION", [Protocol version])
  49. AC_SUBST(JACK_API_MAJOR_VERSION)
  50. AC_SUBST(JACK_API_MINOR_VERSION)
  51. AC_SUBST(JACK_API_MICRO_VERSION)
  52. JACK_SO_VERSION=${JACK_API_CURRENT}:${JACK_API_REVISION}:${JACK_API_AGE}
  53. JACK_VERSION=$JACK_MAJOR_VERSION.$JACK_MINOR_VERSION.${JACK_MICRO_VERSION}${BETA}
  54. JACK_RELEASE=$JACK_MAJOR_VERSION-$JACK_MINOR_VERSION-${JACK_MICRO_VERSION}${BETA}
  55. AC_SUBST(JACK_SO_VERSION)
  56. AC_SUBST(JACK_VERSION)
  57. AC_SUBST(JACK_RELEASE)
  58. AM_INIT_AUTOMAKE(jack-audio-connection-kit,${JACK_VERSION})
  59. AM_MAINTAINER_MODE
  60. AM_CONFIG_HEADER(config.h)
  61. AC_ENABLE_STATIC(no)
  62. AC_ENABLE_SHARED(yes)
  63. AC_PROG_CC
  64. AC_PROG_CXX
  65. AC_PROG_LD
  66. AM_PROG_LIBTOOL
  67. AC_PROG_LN_S
  68. AC_C_BIGENDIAN
  69. # Required due to initialization bug in PKG_CHECK_MODULES()
  70. PKG_PROG_PKG_CONFIG([0.0.1])
  71. AC_MSG_CHECKING([platform dependencies])
  72. case "${host_os}" in
  73. freebsd*)
  74. # current FreeBSD header files conflict with the OSS driver's
  75. # barrier code, this may be fixed in 5.3, stay tuned.
  76. USE_BARRIER="no"
  77. ;;
  78. darwin*)
  79. JACK_THREAD_STACK_TOUCH=10000 # need small realtime stack
  80. JACK_CPP_VARARGS_BROKEN=1
  81. JACK_DO_NOT_MLOCK=1
  82. JACK_USE_MACH_THREADS=1
  83. OS_LDFLAGS="-framework CoreAudio -framework CoreServices -framework AudioUnit"
  84. TRY_POSIX_SHM=yes # POSIX shm works better
  85. ;;
  86. esac
  87. AC_SUBST(OS_LDFLAGS)
  88. #
  89. # We need to establish suitable defaults for a 64-bit OS
  90. libnn=lib
  91. case "${host_os}" in
  92. linux*)
  93. case "${host_cpu}" in
  94. x86_64|mips64|ppc64|sparc64|s390x)
  95. libnn=lib64
  96. ;;
  97. esac
  98. ;;
  99. solaris*)
  100. ## libnn=lib/sparcv9 ## on 64-bit only, but that's compiler-specific
  101. ;;
  102. esac
  103. ## take care not to override the command-line setting
  104. if test "${libdir}" = '${exec_prefix}/lib'; then
  105. libdir='${exec_prefix}/'${libnn}
  106. fi
  107. # system-dependent config.h values
  108. test "x$JACK_THREAD_STACK_TOUCH" = "x" && JACK_THREAD_STACK_TOUCH=500000
  109. AC_DEFINE_UNQUOTED(JACK_THREAD_STACK_TOUCH,
  110. [$JACK_THREAD_STACK_TOUCH],
  111. [Guaranteed size of realtime stack])
  112. if test "x$JACK_CPP_VARARGS_BROKEN" != "x"; then
  113. AC_DEFINE_UNQUOTED(JACK_CPP_VARARGS_BROKEN,
  114. [$JACK_CPP_VARARGS_BROKEN],
  115. [CPP has a broken varargs implementation])
  116. fi
  117. if test "x$JACK_USE_MACH_THREADS" != "x"; then
  118. AC_DEFINE_UNQUOTED(JACK_USE_MACH_THREADS,
  119. [$JACK_USE_MACH_THREADS],
  120. [Use MACH threads where possible])
  121. fi
  122. # headers
  123. AC_CHECK_HEADERS(string.h strings.h)
  124. AC_CHECK_HEADERS(getopt.h, [], [
  125. for d in /Developer/SDKs/MacOSX10.3.0.sdk/usr/include/ ; do
  126. AC_CHECK_HEADERS($d/getopt.h, [], [CFLAGS="$CFLAGS -I$d"])
  127. done])
  128. AC_CHECK_HEADER(/usr/include/nptl/pthread.h,
  129. [CFLAGS="$CFLAGS -I/usr/include/nptl"])
  130. # functions and libraries
  131. AC_CHECK_FUNC(getopt_long, [],
  132. AC_MSG_ERROR([*** JACK requires GNU getopt_long]))
  133. AC_CHECK_FUNC(gethostent, [], AC_CHECK_LIB(nsl, gethostent))
  134. AC_CHECK_FUNC(setsockopt, [], AC_CHECK_LIB(socket, setsockopt))
  135. AC_CHECK_FUNC(connect, [], AC_CHECK_LIB(inet, connect))
  136. AC_CHECK_FUNC(dlopen, [],
  137. AC_CHECK_LIB(dl, dlopen, [],
  138. AC_MSG_ERROR([*** JACK requires dynamic load support])))
  139. AC_CHECK_FUNC(pthread_create, [],
  140. AC_CHECK_LIB(pthread, pthread_create, [],
  141. AC_MSG_ERROR([*** JACK requires POSIX threads support])))
  142. AC_CHECK_FUNCS(on_exit atexit)
  143. AC_CHECK_FUNCS(posix_memalign)
  144. AC_CHECK_LIB(m, sin)
  145. AC_CHECK_FUNC(clock_gettime,
  146. [
  147. AC_DEFINE(HAVE_CLOCK_GETTIME,1,"Whether or not clock_gettime can be found in system libraries")
  148. ],
  149. AC_CHECK_LIB(rt, clock_getttime,
  150. [
  151. AC_DEFINE(HAVE_CLOCK_GETTIME,1,"Whether or not clock_gettime can be found in system libraries")
  152. ])
  153. )
  154. # should we use mlockall() on this platform?
  155. if test "x$JACK_DO_NOT_MLOCK" = "x"; then
  156. AC_CHECK_HEADER(sys/mman.h,
  157. [AC_CHECK_FUNC(mlockall,
  158. [AC_DEFINE(USE_MLOCK, 1, [Use POSIX memory locking])])])
  159. fi
  160. # look for system support for POSIX shm API
  161. AC_ARG_ENABLE(posix-shm,
  162. AC_HELP_STRING([--enable-posix-shm], [use POSIX shm API]),
  163. [TRY_POSIX_SHM=$enableval])
  164. if test "x$TRY_POSIX_SHM" = "xyes"
  165. then
  166. AC_CHECK_FUNC(shm_open, [],
  167. AC_CHECK_LIB(rt, shm_open, [], [TRY_POSIX_SHM=no]))
  168. fi
  169. AC_MSG_CHECKING([shared memory support])
  170. if test "x$TRY_POSIX_SHM" = "xyes"
  171. then
  172. AC_MSG_RESULT([POSIX shm_open().])
  173. AC_DEFINE(USE_POSIX_SHM,1,[Use POSIX shared memory interface])
  174. JACK_SHM_TYPE='"POSIX"'
  175. USE_POSIX_SHM="true"
  176. else
  177. AC_MSG_RESULT([System V shmget().])
  178. JACK_SHM_TYPE='"System V"'
  179. USE_POSIX_SHM="false"
  180. fi
  181. AC_DEFINE_UNQUOTED(JACK_SHM_TYPE, [$JACK_SHM_TYPE],
  182. [JACK shared memory type])
  183. AM_CONDITIONAL(USE_POSIX_SHM, $USE_POSIX_SHM)
  184. JACK_CORE_CFLAGS="-I\$(top_srcdir)/config -I\$(top_srcdir) \
  185. -I\$(top_srcdir) -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -g"
  186. JACK_OPT_CFLAGS="$JACK_CORE_CFLAGS -march=pentium2 -mcpu=pentium4 -O3 \
  187. -ffast-math -funroll-loops -fprefetch-loop-arrays"
  188. JACK_CFLAGS="$JACK_CORE_CFLAGS $CFLAGS"
  189. dnl
  190. dnl figure out how best to optimize
  191. dnl JOQ: this should be done via config/configure.hosts
  192. dnl
  193. dnl ----------------------------------------------------------------------
  194. if test "$target_cpu" = "powerpc"; then
  195. AC_DEFINE(POWERPC, 1, "Are we running a ppc CPU?")
  196. ############################
  197. # Check for Altivec assembly
  198. ############################
  199. AC_ARG_ENABLE(altivec,
  200. [ --enable-altivec enable Altivec support (default=auto)],,
  201. [ enable_altivec=yes ])
  202. if test "x$enable_altivec" = xyes; then
  203. AC_MSG_CHECKING(whether we can compile Altivec code)
  204. AC_COMPILE_IFELSE([asm ("vand %v0, %v0, %v0");],
  205. AC_DEFINE(USE_ALTIVEC, 1, [Define to 1 if Altivec assembly is available.])
  206. AC_DEFINE(HAVE_ALTIVEC_LINUX, 1, "Is there Altivec Support ?")
  207. ALTIVEC_OPT_FLAGS="-maltivec -mabi=altivec"
  208. AC_MSG_RESULT(yes)
  209. ,
  210. enable_altivec=no
  211. AC_MSG_RESULT(no)
  212. AC_MSG_WARN([The assembler does not support the Altivec command set.])
  213. )
  214. fi
  215. dnl -mcpu=7450 does not reliably work with gcc 3.*
  216. JACK_OPT_CFLAGS="-D_REENTRANT -O2 -mcpu=7400 $ALTIVEC_OPT_FLAGS_FLAGS -mhard-float -mpowerpc-gfxopt"
  217. elif echo $target_cpu | egrep '(i.86|x86_64)' >/dev/null; then
  218. dnl Check for MMX/SSE assembly
  219. if test -r /proc/cpuinfo ; then
  220. procflags=`grep '^flags' /proc/cpuinfo`
  221. if echo $procflags | grep -s mmx ; then
  222. cpu_supports_mmx=yes
  223. fi
  224. if echo $procflags | grep -s sse ; then
  225. cpu_supports_sse=yes
  226. fi
  227. fi
  228. AC_ARG_ENABLE(optimization-by-compiler,
  229. [ --enable-optimization-by-compiler use compiler (NOT processor) capabilities to determine optimization flags],,
  230. optimization_by_compiler=no
  231. )
  232. AC_ARG_ENABLE(optimization-by-cpu,
  233. [ --enable-optimization-by-cpu use processor capabilities to determine optimization flags],,
  234. optimization_by_cpu=yes
  235. )
  236. AC_ARG_ENABLE(mmx,
  237. [ --enable-mmx enable MMX support (default=auto)],,
  238. enable_mmx=yes)
  239. AC_ARG_ENABLE(sse,
  240. [ --enable-sse enable SSE support (default=auto)],,
  241. enable_sse=$enable_mmx)
  242. if test "x$enable_mmx" = xyes; then
  243. AC_MSG_CHECKING(whether we can compile MMX code)
  244. AC_COMPILE_IFELSE([asm ("movq 0, %mm0");],
  245. AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.])
  246. AC_MSG_RESULT(yes)
  247. if test x$optimization_by_cpu = xyes ; then
  248. if test x$cpu_supports_mmx = xyes ; then
  249. MMX_FLAGS="-mmmx"
  250. fi
  251. else
  252. MMX_FLAGS="-mmmx"
  253. fi
  254. AC_MSG_RESULT(yes)
  255. ,
  256. enable_mmx=no
  257. AC_MSG_RESULT(no)
  258. AC_MSG_WARN([The assembler does not support the MMX command set.])
  259. )
  260. fi
  261. if test "x$enable_sse" = xyes; then
  262. AC_MSG_CHECKING(whether we can compile SSE code)
  263. AC_COMPILE_IFELSE([asm ("movntps %xmm0, 0");],
  264. AC_DEFINE(USE_SSE, 1,
  265. [Define to 1 if SSE assembly is available.])
  266. if test x$optimization_by_cpu = xyes ; then
  267. if test x$cpu_supports_sse = xyes ; then
  268. SSE_FLAGS="-msse -mfpmath=sse"
  269. fi
  270. else
  271. SSE_FLAGS="-msse -mfpmath=sse"
  272. fi
  273. AC_MSG_RESULT(yes)
  274. ,
  275. enable_sse=no
  276. AC_MSG_RESULT(no)
  277. AC_MSG_WARN(
  278. [The assembler does not support the SSE command set.]
  279. )
  280. )
  281. fi
  282. AC_DEFINE(x86, 1, "Nope it's intel")
  283. COMMON_X86_OPT_FLAGS="-DREENTRANT -O3 -fomit-frame-pointer -ffast-math -funroll-loops"
  284. if test "$target_cpu" = "i586"; then
  285. JACK_OPT_CFLAGS="-march=i586 "
  286. elif test "$target_cpu" = "i686"; then
  287. JACK_OPT_CFLAGS="-march=i686"
  288. elif test "$target_cpu" = "x86_64"; then
  289. JACK_OPT_CFLAGS="-march=k8"
  290. else
  291. :
  292. fi
  293. JACK_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $JACK_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS"
  294. fi
  295. AC_ARG_ENABLE(dynsimd,
  296. [ --enable-dynsimd enable dynamic SIMD selection (default=no)],,
  297. enable_dynsimd=no)
  298. if test "x$enable_dynsimd" = xyes; then
  299. AC_DEFINE(USE_DYNSIMD, 1, [Define to 1 to use dynamic SIMD selection.])
  300. fi
  301. AC_ARG_ENABLE(optimize,
  302. AC_HELP_STRING([--enable-optimize],
  303. [ask the compiler for its best optimizations]),
  304. [ if test x$enable_optimize != xno ; then
  305. JACK_CFLAGS="$JACK_CORE_CFLAGS $JACK_OPT_CFLAGS"
  306. AC_MSG_WARN([optimization in use.........................])
  307. else
  308. JACK_OPT_CFLAGS=""
  309. AC_MSG_WARN([no optimization.........................])
  310. fi
  311. ]
  312. )
  313. AC_SUBST(JACK_CFLAGS)
  314. dnl
  315. dnl use JACK_CFLAGS for jackd compilation
  316. dnl
  317. CFLAGS=$JACK_CFLAGS
  318. # allow buffer resizing unless --disable-resize specified
  319. buffer_resizing=yes
  320. AC_ARG_ENABLE(resize,
  321. AC_HELP_STRING([--enable-resize], [enable buffer resizing feature]),
  322. [
  323. if test x$enable_resize = xno ; then
  324. buffer_resizing=no
  325. fi
  326. if test x$buffer_resizing != xno; then
  327. AC_DEFINE(DO_BUFFER_RESIZE,,[Enable buffer resizing])
  328. fi
  329. ]
  330. )
  331. AC_ARG_ENABLE(ensure-mlock,
  332. AC_HELP_STRING([--enable-ensure-mlock],
  333. [fail if unable to lock memory]),
  334. [
  335. if test x$enable_ensure_mlock != xno ; then
  336. AC_DEFINE(ENSURE_MLOCK,,[Ensure that memory locking succeeds])
  337. fi
  338. ]
  339. )
  340. AC_ARG_ENABLE(debug,
  341. AC_HELP_STRING([--enable-debug],
  342. [enable debugging messages in jackd and libjack]),
  343. [
  344. if test x$enable_debug != xno ; then
  345. AC_DEFINE(DEBUG_ENABLED,,[Enable debugging messages])
  346. fi
  347. ]
  348. )
  349. AC_ARG_ENABLE(timestamps,
  350. AC_HELP_STRING([--enable-timestamps],
  351. [allow clients to use the JACK timestamp API]),
  352. [
  353. if test x$enable_timestamps != xno ; then
  354. AC_DEFINE(WITH_TIMESTAMPS,,[Enable JACK timestamp API])
  355. fi
  356. ]
  357. )
  358. AC_ARG_ENABLE(preemption-check,
  359. AC_HELP_STRING([--enable-preemption-check],
  360. [check for inappropriate realtime preemption]),
  361. [
  362. if test x$enable_preemption_check != xno ; then
  363. echo checking for realtime preemption bugs
  364. AC_DEFINE(DO_PREEMPTION_CHECKING,,
  365. [check realtime preemption])
  366. fi
  367. ])
  368. USE_CAPABILITIES=false
  369. AC_ARG_ENABLE(capabilities,
  370. [ --enable-capabilities use libcap to gain realtime scheduling priviledges],
  371. [ if test "x$enable_capabilities" != "xno" ; then
  372. AC_CHECK_LIB(cap, capgetp,
  373. [AC_CHECK_HEADER(sys/capability.h,
  374. [HAVE_CAPABILITIES=true],
  375. [AC_MSG_WARN([*** no kernel support for capabilities])
  376. HAVE_CAPABILITIES=false]
  377. )],
  378. [AC_MSG_WARN([*** no libcap present])
  379. HAVE_CAPABILITIES=false]
  380. )
  381. if test "x$HAVE_CAPABILITIES" = "xtrue"; then
  382. AC_CHECK_PROG(HAVE_CAPABILITIES, md5sum, true, false)
  383. fi
  384. if test "x$HAVE_CAPABILITIES" = "xfalse"; then
  385. AC_MSG_WARN([*** required program md5sum not found])
  386. fi
  387. if test "x$HAVE_CAPABILITIES" = "xfalse"; then
  388. AC_MSG_ERROR([*** Capabilities support not present. Run configure again without --enable-capabilities.])
  389. fi
  390. USE_CAPABILITIES=true
  391. AC_DEFINE(USE_CAPABILITIES,,[Enable POSIX 1.e capabilities support])
  392. fi
  393. ]
  394. )
  395. with_oldtrans=yes
  396. AC_ARG_ENABLE(oldtrans,
  397. [ --disable-oldtrans remove old transport interfaces],
  398. [ if test "x$enable_oldtrans" = "xno" ; then
  399. with_oldtrans=no
  400. fi
  401. ]
  402. )
  403. if test "x$with_oldtrans" != "xno" ; then
  404. AC_DEFINE(OLD_TRANSPORT,,[Include old transport interfaces])
  405. fi
  406. STRIPPED_JACKD=false
  407. AC_ARG_ENABLE(stripped-jackd,
  408. [ --enable-stripped-jackd strip jack before computing its md5 sum ],
  409. [ if test "x$USE_CAPABILITIES" != "xtrue" ; then
  410. AC_MSG_WARN([*** capabilities not enabled, stripped jackd has no effect])
  411. elif test "x$enable_stripped_jackd" != "xno"; then
  412. STRIPPED_JACKD=true
  413. fi
  414. ]
  415. )
  416. # plugins go in the addon dir.
  417. ADDON_DIR='${libdir}/jack'
  418. AC_SUBST(ADDON_DIR)
  419. AS_AC_EXPAND(ADDON_DIR_EXPANDED,${libdir}/jack)
  420. AC_DEFINE_UNQUOTED(ADDON_DIR,"$ADDON_DIR_EXPANDED",[Directory for plugins])
  421. AC_ARG_WITH(html-dir,
  422. [ --with-html-dir=PATH where to install the html documentation])
  423. if test "x$with_html_dir" = "x" ; then
  424. HTML_DIR='${pkgdatadir}'
  425. else
  426. HTML_DIR=$with_html_dir
  427. fi
  428. AC_SUBST(HTML_DIR)
  429. # allow specifying default tmpdir
  430. AC_ARG_WITH(default-tmpdir,
  431. [ --with-default-tmpdir=PATH where jackd and clients will put tmp files (/tmp)])
  432. if test "x$with_default_tmpdir" = "x" ; then
  433. DEFAULT_TMP_DIR=/tmp
  434. else
  435. DEFAULT_TMP_DIR=$with_default_tmpdir
  436. fi
  437. AC_SUBST(DEFAULT_TMP_DIR)
  438. AC_DEFINE_UNQUOTED(DEFAULT_TMP_DIR,"$DEFAULT_TMP_DIR",[Default tmp directory])
  439. # Check for barrier functions in the pthreads library. The default
  440. # option setting may be OS-dependent, otherwise it's "yes".
  441. test "x$USE_BARRIER" = "x" && USE_BARRIER="yes"
  442. AC_ARG_WITH(barrier,
  443. AC_HELP_STRING([--without-barrier],
  444. [avoid using pthread barrier functions]),
  445. [ USE_BARRIER=$withval ])
  446. if test "x$USE_BARRIER" = "xyes"; then
  447. AC_CHECK_LIB([pthread], [pthread_barrier_init],
  448. AC_DEFINE(USE_BARRIER, 1, [Use pthread barrier functions]))
  449. fi
  450. # Check which backend drivers can be built. The last one successfully
  451. # configured becomes the default JACK driver; so the order of
  452. # precedence is: alsa, oss, coreaudio, portaudio, dummy.
  453. JACK_DEFAULT_DRIVER=\"dummy\"
  454. AC_ARG_ENABLE(portaudio, [ --disable-portaudio ignore PortAudio driver ],
  455. TRY_PORTAUDIO=$enableval , TRY_PORTAUDIO=yes )
  456. HAVE_PA="false"
  457. if test "x$TRY_PORTAUDIO" = "xyes"
  458. then
  459. # check for portaudio V18
  460. AC_CHECK_LIB(portaudio, Pa_Initialize,
  461. [ AC_CHECK_HEADERS(portaudio.h,
  462. [ HAVE_PA="true"
  463. PA_LIBS=-lportaudio
  464. JACK_DEFAULT_DRIVER=\"portaudio\"
  465. ])
  466. ])
  467. AC_SUBST(PA_LIBS)
  468. fi
  469. AM_CONDITIONAL(HAVE_PA, $HAVE_PA)
  470. AC_ARG_ENABLE(coreaudio, [ --disable-coreaudio ignore CoreAudio driver ],
  471. TRY_COREAUDIO=$enableval , TRY_COREAUDIO=yes )
  472. HAVE_COREAUDIO="false"
  473. if test "x$TRY_COREAUDIO" = "xyes"
  474. then
  475. # check for coreaudio
  476. AC_CHECK_HEADERS(CoreAudio/CoreAudio.h,
  477. [ HAVE_COREAUDIO="true"
  478. JACK_DEFAULT_DRIVER=\"coreaudio\"
  479. ])
  480. fi
  481. AM_CONDITIONAL(HAVE_COREAUDIO, $HAVE_COREAUDIO)
  482. AC_ARG_ENABLE(oss, [ --disable-oss ignore OSS driver ],
  483. TRY_OSS=$enableval , TRY_OSS=yes )
  484. HAVE_OSS="false"
  485. if test "x$TRY_OSS" = "xyes"
  486. then
  487. # check for Open Sound System
  488. AC_CHECK_HEADER([sys/soundcard.h],
  489. [HAVE_OSS="true"
  490. JACK_DEFAULT_DRIVER=\"oss\"])
  491. fi
  492. AM_CONDITIONAL(HAVE_OSS, $HAVE_OSS)
  493. AC_ARG_ENABLE(freebob, [ --disable-freebob ignore FreeBob driver ],
  494. TRY_FREEBOB=$enableval , TRY_FREEBOB=yes )
  495. HAVE_FREEBOB="false"
  496. if test "x$TRY_FREEBOB" = "xyes"
  497. then
  498. # check for FreeBob libraries
  499. PKG_CHECK_MODULES(LIBFREEBOB, libfreebob >= 1.0.0,
  500. [HAVE_FREEBOB="true"
  501. JACK_DEFAULT_DRIVER=\"freebob\"
  502. ], AC_MSG_RESULT([no]))
  503. AC_SUBST([LIBFREEBOB_CFLAGS])
  504. AC_SUBST([LIBFREEBOB_LIBS])
  505. fi
  506. AM_CONDITIONAL(HAVE_FREEBOB,$HAVE_FREEBOB)
  507. AC_ARG_ENABLE(alsa, [ --disable-alsa ignore ALSA driver ],
  508. TRY_ALSA=$enableval , TRY_ALSA=yes )
  509. HAVE_ALSA="false"
  510. if test "x$TRY_ALSA" = "xyes"
  511. then
  512. # check for ALSA >= 1.0.0
  513. PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0,
  514. [HAVE_ALSA="true"
  515. ALSA_LIBS=-lasound
  516. JACK_DEFAULT_DRIVER=\"alsa\"
  517. ], AC_MSG_RESULT([no]), [-lm]
  518. )
  519. AC_SUBST(ALSA_LIBS)
  520. fi
  521. AM_CONDITIONAL(HAVE_ALSA, $HAVE_ALSA)
  522. if test "$JACK_DEFAULT_DRIVER" = \"dummy\"; then
  523. AC_MSG_WARN([Only the dummy driver can be built])
  524. fi
  525. AC_DEFINE_UNQUOTED(JACK_DEFAULT_DRIVER,
  526. [$JACK_DEFAULT_DRIVER],
  527. [Default JACK driver])
  528. # some example-clients need libsndfile
  529. HAVE_SNDFILE=false
  530. PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0,[HAVE_SNDFILE=true], [true])
  531. if test x$HAVE_SNDFILE = xfalse; then
  532. AC_MSG_WARN([*** the jackrec example client will not be built])
  533. fi
  534. # On some systems, readline depends on termcap or ncurses. But, the
  535. # MacOSX linker complains bitterly if these libraries are explicitly
  536. # referenced.
  537. #
  538. # AC_CHECK_LIB() foolishly assumes that checking a library for an entry
  539. # point always returns the same result regardless of any dependent
  540. # libraries specified. The `unset ac_cv_lib_readline_readline' erases
  541. # the cached result to work around this problem.
  542. READLINE_DEPS=""
  543. HAVE_READLINE=true
  544. AC_CHECK_LIB(readline, readline, [:],
  545. [unset ac_cv_lib_readline_readline
  546. AC_CHECK_LIB(readline, readline, [READLINE_DEPS="-ltermcap"],
  547. [unset ac_cv_lib_readline_readline
  548. AC_CHECK_LIB(readline, readline,
  549. [READLINE_DEPS="-lncurses"], [HAVE_READLINE=false], "-lncurses")],
  550. "-ltermcap")])
  551. AC_CHECK_HEADER(readline/chardefs.h, [], [HAVE_READLINE=false])
  552. if test x$HAVE_READLINE = xfalse; then
  553. AC_MSG_WARN([*** the jack_transport example client will not be built])
  554. fi
  555. AC_SUBST(READLINE_DEPS)
  556. # you need doxygen to make dist.
  557. AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
  558. if test $HAVE_DOXYGEN = "false"; then
  559. AC_MSG_WARN([*** doxygen not found, docs will not be built])
  560. fi
  561. AM_CONDITIONAL(HAVE_SNDFILE, $HAVE_SNDFILE)
  562. AM_CONDITIONAL(HAVE_READLINE, $HAVE_READLINE)
  563. AM_CONDITIONAL(HAVE_DOXYGEN, $HAVE_DOXYGEN)
  564. AM_CONDITIONAL(USE_CAPABILITIES, $USE_CAPABILITIES)
  565. AM_CONDITIONAL(STRIPPED_JACKD, $STRIPPED_JACKD)
  566. AC_OUTPUT(
  567. Makefile
  568. config/Makefile
  569. doc/Makefile
  570. doc/reference.doxygen
  571. drivers/Makefile
  572. drivers/alsa/Makefile
  573. drivers/dummy/Makefile
  574. drivers/oss/Makefile
  575. drivers/portaudio/Makefile
  576. drivers/coreaudio/Makefile
  577. drivers/freebob/Makefile
  578. example-clients/Makefile
  579. jack.pc
  580. jack.spec
  581. jack/Makefile
  582. jack/version.h
  583. jackd/Makefile
  584. jackd/jackd.1
  585. libjack/Makefile
  586. )
  587. dnl
  588. dnl Output summary message
  589. dnl
  590. echo
  591. echo $PACKAGE $VERSION :
  592. echo
  593. echo \| Build with ALSA support............................... : $HAVE_ALSA
  594. echo \| Build with FreeBob support............................ : $HAVE_FREEBOB
  595. echo \| Build with OSS support................................ : $HAVE_OSS
  596. echo \| Build with CoreAudio support.......................... : $HAVE_COREAUDIO
  597. echo \| Build with PortAudio support.......................... : $HAVE_PA
  598. echo \| Install prefix........................................ : $prefix
  599. echo \| Compiler optimization flags........................... : $JACK_OPT_CFLAGS
  600. echo \| Compiler full flags................................... : $CFLAGS
  601. echo \| Install dir for libjack + backends.................... : $libdir/jack
  602. echo \|
  603. echo \| Default driver backend................................ : $JACK_DEFAULT_DRIVER
  604. echo \| Shared memory interface............................... : $JACK_SHM_TYPE
  605. echo