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.

705 lines
21KB

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