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.

794 lines
23KB

  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=111
  17. JACK_MICRO_VERSION=0
  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=23
  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=28
  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. AC_MSG_CHECKING([platform dependencies])
  70. HOST_DEFAULT_TMP_DIR=/dev/shm
  71. case "${host_os}" in
  72. freebsd*)
  73. # current FreeBSD header files conflict with the OSS driver's
  74. # barrier code, this may be fixed in 5.3, stay tuned.
  75. USE_BARRIER="no"
  76. ;;
  77. openbsd*)
  78. # pthread_barrier* not implemented
  79. USE_BARRIER="no"
  80. # need small realtime stack
  81. JACK_THREAD_STACK_TOUCH=10000
  82. ;;
  83. darwin*)
  84. JACK_THREAD_STACK_TOUCH=10000 # need small realtime stack
  85. JACK_CPP_VARARGS_BROKEN=1
  86. JACK_DO_NOT_MLOCK=1
  87. JACK_USE_MACH_THREADS=1
  88. OS_LDFLAGS="-framework CoreAudio -framework CoreServices -framework AudioUnit"
  89. TRY_POSIX_SHM=yes # POSIX shm works better
  90. HOST_DEFAULT_TMP_DIR=/tmp
  91. ;;
  92. esac
  93. AC_SUBST(OS_LDFLAGS)
  94. #
  95. # We need to establish suitable defaults for a 64-bit OS
  96. libnn=lib
  97. case "${host_os}" in
  98. linux*)
  99. case "${host_cpu}" in
  100. x86_64|mips64|ppc64|sparc64|s390x)
  101. libnn=lib64
  102. ;;
  103. esac
  104. ;;
  105. solaris*)
  106. ## libnn=lib/sparcv9 ## on 64-bit only, but that's compiler-specific
  107. ;;
  108. esac
  109. ## take care not to override the command-line setting
  110. if test "${libdir}" = '${exec_prefix}/lib'; then
  111. libdir='${exec_prefix}/'${libnn}
  112. fi
  113. # system-dependent config.h values
  114. test "x$JACK_THREAD_STACK_TOUCH" = "x" && JACK_THREAD_STACK_TOUCH=500000
  115. AC_DEFINE_UNQUOTED(JACK_THREAD_STACK_TOUCH,
  116. [$JACK_THREAD_STACK_TOUCH],
  117. [Guaranteed size of realtime stack])
  118. if test "x$JACK_CPP_VARARGS_BROKEN" != "x"; then
  119. AC_DEFINE_UNQUOTED(JACK_CPP_VARARGS_BROKEN,
  120. [$JACK_CPP_VARARGS_BROKEN],
  121. [CPP has a broken varargs implementation])
  122. fi
  123. if test "x$JACK_USE_MACH_THREADS" != "x"; then
  124. AC_DEFINE_UNQUOTED(JACK_USE_MACH_THREADS,
  125. [$JACK_USE_MACH_THREADS],
  126. [Use MACH threads where possible])
  127. fi
  128. # headers
  129. AC_CHECK_HEADERS(string.h strings.h)
  130. AC_CHECK_HEADERS(getopt.h, [], [
  131. for d in /Developer/SDKs/MacOSX10.3.0.sdk/usr/include/ ; do
  132. AC_CHECK_HEADERS($d/getopt.h, [], [CFLAGS="$CFLAGS -I$d"])
  133. done])
  134. AC_CHECK_HEADER(/usr/include/nptl/pthread.h,
  135. [CFLAGS="$CFLAGS -I/usr/include/nptl"])
  136. # functions and libraries
  137. AC_CHECK_FUNC(getopt_long, [],
  138. AC_MSG_ERROR([*** JACK requires GNU getopt_long]))
  139. AC_CHECK_FUNC(gethostent, [], AC_CHECK_LIB(nsl, gethostent))
  140. AC_CHECK_FUNC(setsockopt, [], AC_CHECK_LIB(socket, setsockopt))
  141. AC_CHECK_FUNC(connect, [], AC_CHECK_LIB(inet, connect))
  142. AC_CHECK_FUNC(dlopen, [],
  143. AC_CHECK_LIB(dl, dlopen, [],
  144. AC_MSG_ERROR([*** JACK requires dynamic load support])))
  145. AC_CHECK_FUNC(pthread_create, [],
  146. AC_CHECK_LIB(pthread, pthread_create, [],
  147. AC_MSG_ERROR([*** JACK requires POSIX threads support])))
  148. AC_CHECK_FUNCS(on_exit atexit)
  149. AC_CHECK_FUNCS(posix_memalign)
  150. AC_CHECK_LIB(m, sin)
  151. AC_CHECK_FUNC(clock_gettime,
  152. [
  153. AC_DEFINE(HAVE_CLOCK_GETTIME,0,"Whether or not clock_gettime can be found in system libraries")
  154. ],
  155. #
  156. # if not found, check librt specifically
  157. #
  158. AC_CHECK_LIB(rt, clock_gettime,
  159. [
  160. AC_DEFINE(HAVE_CLOCK_GETTIME,1,"Whether or not clock_gettime can be found in system libraries")
  161. OS_LDFLAGS="$OS_LDFLAGS -lrt"
  162. ])
  163. )
  164. # should we use mlockall() on this platform?
  165. if test "x$JACK_DO_NOT_MLOCK" = "x"; then
  166. AC_CHECK_HEADER(sys/mman.h,
  167. [AC_CHECK_FUNC(mlockall,
  168. [AC_DEFINE(USE_MLOCK, 1, [Use POSIX memory locking])])])
  169. fi
  170. # look for system support for POSIX shm API
  171. AC_ARG_ENABLE(posix-shm,
  172. AC_HELP_STRING([--enable-posix-shm], [use POSIX shm API]),
  173. [TRY_POSIX_SHM=$enableval])
  174. if test "x$TRY_POSIX_SHM" = "xyes"
  175. then
  176. AC_CHECK_FUNC(shm_open, [],
  177. AC_CHECK_LIB(rt, shm_open, [], [TRY_POSIX_SHM=no]))
  178. fi
  179. AC_MSG_CHECKING([shared memory support])
  180. if test "x$TRY_POSIX_SHM" = "xyes"
  181. then
  182. AC_MSG_RESULT([POSIX shm_open().])
  183. AC_DEFINE(USE_POSIX_SHM,1,[Use POSIX shared memory interface])
  184. JACK_SHM_TYPE='"POSIX"'
  185. USE_POSIX_SHM="true"
  186. else
  187. AC_MSG_RESULT([System V shmget().])
  188. JACK_SHM_TYPE='"System V"'
  189. USE_POSIX_SHM="false"
  190. fi
  191. AC_DEFINE_UNQUOTED(JACK_SHM_TYPE, [$JACK_SHM_TYPE],
  192. [JACK shared memory type])
  193. AM_CONDITIONAL(USE_POSIX_SHM, $USE_POSIX_SHM)
  194. JACK_CORE_CFLAGS="-I\$(top_srcdir)/config -I\$(top_srcdir) \
  195. -I\$(top_srcdir) -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -g"
  196. JACK_OPT_CFLAGS="$JACK_CORE_CFLAGS -march=pentium2 -mcpu=pentium4 -O3 \
  197. -ffast-math -funroll-loops -fprefetch-loop-arrays"
  198. JACK_CFLAGS="$JACK_CORE_CFLAGS $CFLAGS"
  199. dnl
  200. dnl figure out how best to optimize
  201. dnl JOQ: this should be done via config/configure.hosts
  202. dnl
  203. dnl ----------------------------------------------------------------------
  204. if test "$target_cpu" = "powerpc"; then
  205. AC_DEFINE(POWERPC, 1, "Are we running a ppc CPU?")
  206. ############################
  207. # Check for Altivec assembly
  208. ############################
  209. AC_ARG_ENABLE(altivec,
  210. [ --enable-altivec enable Altivec support (default=auto)],,
  211. [ enable_altivec=yes ])
  212. if test "x$enable_altivec" = xyes; then
  213. AC_MSG_CHECKING(whether we can compile Altivec code)
  214. AC_COMPILE_IFELSE([asm ("vand %v0, %v0, %v0");],
  215. AC_DEFINE(USE_ALTIVEC, 1, [Define to 1 if Altivec assembly is available.])
  216. AC_DEFINE(HAVE_ALTIVEC_LINUX, 1, "Is there Altivec Support ?")
  217. ALTIVEC_OPT_FLAGS="-maltivec -mabi=altivec"
  218. AC_MSG_RESULT(yes)
  219. ,
  220. enable_altivec=no
  221. AC_MSG_RESULT(no)
  222. AC_MSG_WARN([The assembler does not support the Altivec command set.])
  223. )
  224. fi
  225. dnl -mcpu=7450 does not reliably work with gcc 3.*
  226. JACK_OPT_CFLAGS="-D_REENTRANT -O2 -mcpu=7400 $ALTIVEC_OPT_FLAGS_FLAGS -mhard-float -mpowerpc-gfxopt"
  227. elif echo $target_cpu | egrep '(i.86|x86_64)' >/dev/null; then
  228. dnl Check for MMX/SSE assembly
  229. if test -r /proc/cpuinfo ; then
  230. procflags=`grep '^flags' /proc/cpuinfo`
  231. if echo $procflags | grep -s mmx ; then
  232. cpu_supports_mmx=yes
  233. fi
  234. if echo $procflags | grep -s sse ; then
  235. cpu_supports_sse=yes
  236. fi
  237. fi
  238. AC_ARG_ENABLE(optimization-by-compiler,
  239. [ --enable-optimization-by-compiler use compiler (NOT processor) capabilities to determine optimization flags],,
  240. optimization_by_compiler=no
  241. )
  242. AC_ARG_ENABLE(optimization-by-cpu,
  243. [ --enable-optimization-by-cpu use processor capabilities to determine optimization flags],,
  244. optimization_by_cpu=yes
  245. )
  246. AC_ARG_ENABLE(mmx,
  247. [ --enable-mmx enable MMX support (default=auto)],,
  248. enable_mmx=yes)
  249. AC_ARG_ENABLE(sse,
  250. [ --enable-sse enable SSE support (default=auto)],,
  251. enable_sse=$enable_mmx)
  252. if test "x$enable_mmx" = xyes; then
  253. AC_MSG_CHECKING(whether we can compile MMX code)
  254. AC_COMPILE_IFELSE([asm ("movq 0, %mm0");],
  255. AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.])
  256. AC_MSG_RESULT(yes)
  257. if test x$optimization_by_cpu = xyes ; then
  258. if test x$cpu_supports_mmx = xyes ; then
  259. MMX_FLAGS="-mmmx"
  260. fi
  261. else
  262. MMX_FLAGS="-mmmx"
  263. fi
  264. AC_MSG_RESULT(yes)
  265. ,
  266. enable_mmx=no
  267. AC_MSG_RESULT(no)
  268. AC_MSG_WARN([The assembler does not support the MMX command set.])
  269. )
  270. fi
  271. if test "x$enable_sse" = xyes; then
  272. AC_MSG_CHECKING(whether we can compile SSE code)
  273. AC_COMPILE_IFELSE([asm ("movntps %xmm0, 0");],
  274. AC_DEFINE(USE_SSE, 1,
  275. [Define to 1 if SSE assembly is available.])
  276. if test x$optimization_by_cpu = xyes ; then
  277. if test x$cpu_supports_sse = xyes ; then
  278. SSE_FLAGS="-msse -mfpmath=sse"
  279. fi
  280. else
  281. SSE_FLAGS="-msse -mfpmath=sse"
  282. fi
  283. AC_MSG_RESULT(yes)
  284. ,
  285. enable_sse=no
  286. AC_MSG_RESULT(no)
  287. AC_MSG_WARN(
  288. [The assembler does not support the SSE command set.]
  289. )
  290. )
  291. fi
  292. AC_DEFINE(x86, 1, "Nope it's intel")
  293. COMMON_X86_OPT_FLAGS="-DREENTRANT -O3 -fomit-frame-pointer -ffast-math -funroll-loops"
  294. if test "$target_cpu" = "i586"; then
  295. JACK_OPT_CFLAGS="-march=i586 "
  296. elif test "$target_cpu" = "i686"; then
  297. JACK_OPT_CFLAGS="-march=i686"
  298. elif test "$target_cpu" = "x86_64"; then
  299. JACK_OPT_CFLAGS="-march=k8"
  300. else
  301. :
  302. fi
  303. JACK_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $JACK_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS"
  304. fi
  305. AC_ARG_ENABLE(dynsimd,
  306. [ --enable-dynsimd enable dynamic SIMD selection (default=no)],,
  307. enable_dynsimd=no)
  308. if test "x$enable_dynsimd" = xyes; then
  309. AC_DEFINE(USE_DYNSIMD, 1, [Define to 1 to use dynamic SIMD selection.])
  310. dnl This needs update once there's more than x86/x86-64 supported
  311. SIMD_CFLAGS="-msse -msse2 -m3dnow"
  312. AC_SUBST(SIMD_CFLAGS)
  313. fi
  314. AC_ARG_ENABLE(optimize,
  315. AC_HELP_STRING([--enable-optimize],
  316. [ask the compiler for its best optimizations]),
  317. [ if test x$enable_optimize != xno ; then
  318. JACK_CFLAGS="$JACK_CORE_CFLAGS $JACK_OPT_CFLAGS"
  319. AC_MSG_WARN([optimization in use.........................])
  320. else
  321. JACK_OPT_CFLAGS=""
  322. AC_MSG_WARN([no optimization.........................])
  323. fi
  324. ]
  325. )
  326. AC_SUBST(JACK_CFLAGS)
  327. dnl
  328. dnl use JACK_CFLAGS for jackd compilation
  329. dnl
  330. CFLAGS=$JACK_CFLAGS
  331. # allow buffer resizing unless --disable-resize specified
  332. buffer_resizing=yes
  333. AC_ARG_ENABLE(resize,
  334. AC_HELP_STRING([--enable-resize], [enable buffer resizing feature]),
  335. [
  336. if test x$enable_resize = xno ; then
  337. buffer_resizing=no
  338. fi
  339. if test x$buffer_resizing != xno; then
  340. AC_DEFINE(DO_BUFFER_RESIZE,,[Enable buffer resizing])
  341. fi
  342. ]
  343. )
  344. AC_ARG_ENABLE(ensure-mlock,
  345. AC_HELP_STRING([--enable-ensure-mlock],
  346. [fail if unable to lock memory]),
  347. [
  348. if test x$enable_ensure_mlock != xno ; then
  349. AC_DEFINE(ENSURE_MLOCK,,[Ensure that memory locking succeeds])
  350. fi
  351. ]
  352. )
  353. AC_ARG_ENABLE(debug,
  354. AC_HELP_STRING([--enable-debug],
  355. [enable debugging messages in jackd and libjack]),
  356. [
  357. if test x$enable_debug != xno ; then
  358. AC_DEFINE(DEBUG_ENABLED,,[Enable debugging messages])
  359. fi
  360. ]
  361. )
  362. AC_ARG_ENABLE(timestamps,
  363. AC_HELP_STRING([--enable-timestamps],
  364. [allow clients to use the JACK timestamp API]),
  365. [
  366. if test x$enable_timestamps != xno ; then
  367. AC_DEFINE(WITH_TIMESTAMPS,,[Enable JACK timestamp API])
  368. fi
  369. ]
  370. )
  371. AC_ARG_ENABLE(preemption-check,
  372. AC_HELP_STRING([--enable-preemption-check],
  373. [check for inappropriate realtime preemption]),
  374. [
  375. if test x$enable_preemption_check != xno ; then
  376. echo checking for realtime preemption bugs
  377. AC_DEFINE(DO_PREEMPTION_CHECKING,,
  378. [check realtime preemption])
  379. fi
  380. ])
  381. USE_CAPABILITIES=false
  382. AC_ARG_ENABLE(capabilities,
  383. [ --enable-capabilities !!! LINUX 2.4 KERNELS ONLY !!! use libcap to gain realtime scheduling priviledges],
  384. [ if test "x$enable_capabilities" != "xno" ; then
  385. AC_CHECK_LIB(cap, capgetp,
  386. [AC_CHECK_HEADER(sys/capability.h,
  387. [HAVE_CAPABILITIES=true],
  388. [AC_MSG_WARN([*** no kernel support for capabilities])
  389. HAVE_CAPABILITIES=false]
  390. )],
  391. [AC_MSG_WARN([*** no libcap present])
  392. HAVE_CAPABILITIES=false]
  393. )
  394. if test "x$HAVE_CAPABILITIES" = "xtrue"; then
  395. AC_CHECK_PROG(HAVE_CAPABILITIES, md5sum, true, false)
  396. fi
  397. if test "x$HAVE_CAPABILITIES" = "xfalse"; then
  398. AC_MSG_WARN([*** required program md5sum not found])
  399. fi
  400. if test "x$HAVE_CAPABILITIES" = "xfalse"; then
  401. AC_MSG_ERROR([*** Capabilities support not present. Run configure again without --enable-capabilities.])
  402. fi
  403. USE_CAPABILITIES=true
  404. AC_DEFINE(USE_CAPABILITIES,,[Enable POSIX 1.e capabilities support])
  405. fi
  406. ]
  407. )
  408. with_oldtrans=yes
  409. AC_ARG_ENABLE(oldtrans,
  410. [ --disable-oldtrans remove old transport interfaces],
  411. [ if test "x$enable_oldtrans" = "xno" ; then
  412. with_oldtrans=no
  413. fi
  414. ]
  415. )
  416. if test "x$with_oldtrans" != "xno" ; then
  417. AC_DEFINE(OLD_TRANSPORT,,[Include old transport interfaces])
  418. fi
  419. STRIPPED_JACKD=false
  420. AC_ARG_ENABLE(stripped-jackd,
  421. [ --enable-stripped-jackd strip jack before computing its md5 sum ],
  422. [ if test "x$USE_CAPABILITIES" != "xtrue" ; then
  423. AC_MSG_WARN([*** capabilities not enabled, stripped jackd has no effect])
  424. elif test "x$enable_stripped_jackd" != "xno"; then
  425. STRIPPED_JACKD=true
  426. fi
  427. ]
  428. )
  429. # plugins go in the addon dir.
  430. ADDON_DIR='${libdir}/jack'
  431. AC_SUBST(ADDON_DIR)
  432. AS_AC_EXPAND(ADDON_DIR_EXPANDED,${libdir}/jack)
  433. AC_DEFINE_UNQUOTED(ADDON_DIR,"$ADDON_DIR_EXPANDED",[Directory for plugins])
  434. AC_ARG_WITH(html-dir,
  435. [ --with-html-dir=PATH where to install the html documentation])
  436. if test "x$with_html_dir" = "x" ; then
  437. HTML_DIR='${pkgdatadir}'
  438. else
  439. HTML_DIR=$with_html_dir
  440. fi
  441. AC_SUBST(HTML_DIR)
  442. # allow specifying default tmpdir
  443. AC_ARG_WITH(default-tmpdir,
  444. [ --with-default-tmpdir=PATH where jackd and clients will put tmp files (/dev/shm)])
  445. if test "x$with_default_tmpdir" = "x" ; then
  446. DEFAULT_TMP_DIR=$HOST_DEFAULT_TMP_DIR
  447. else
  448. DEFAULT_TMP_DIR=$with_default_tmpdir
  449. fi
  450. AC_SUBST(DEFAULT_TMP_DIR)
  451. AC_DEFINE_UNQUOTED(DEFAULT_TMP_DIR,"$DEFAULT_TMP_DIR",[Default tmp directory])
  452. # Check for barrier functions in the pthreads library. The default
  453. # option setting may be OS-dependent, otherwise it's "yes".
  454. test "x$USE_BARRIER" = "x" && USE_BARRIER="yes"
  455. AC_ARG_WITH(barrier,
  456. AC_HELP_STRING([--without-barrier],
  457. [avoid using pthread barrier functions]),
  458. [ USE_BARRIER=$withval ])
  459. if test "x$USE_BARRIER" = "xyes"; then
  460. AC_CHECK_LIB([pthread], [pthread_barrier_init],
  461. AC_DEFINE(USE_BARRIER, 1, [Use pthread barrier functions]))
  462. fi
  463. # some example-clients need libsndfile
  464. HAVE_SNDFILE=false
  465. PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0,[HAVE_SNDFILE=true], [true])
  466. if test x$HAVE_SNDFILE = xfalse; then
  467. AC_MSG_WARN([*** the jackrec example client will not be built])
  468. fi
  469. # NetJack backend and internal client need libsamplerate
  470. HAVE_SAMPLERATE=false
  471. PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.1.2,[HAVE_SAMPLERATE=true], [true])
  472. if test x$HAVE_SAMPLERATE = xfalse; then
  473. AC_MSG_WARN([*** the NetJack backend and internal client will not be built])
  474. fi
  475. # Note: A bug in pkg-config causes problems if the first occurence of
  476. # PKG_CHECK_MODULES can be disabled. So, if you're going to use
  477. # PKG_CHECK_MODULES inside a --disable-whatever check, you need to
  478. # do it somewhere *below* this comment.
  479. # Check which backend drivers can be built. The last one successfully
  480. # configured becomes the default JACK driver; so the order of
  481. # precedence is: alsa, sun, oss, coreaudio, portaudio, dummy.
  482. JACK_DEFAULT_DRIVER=\"dummy\"
  483. AC_ARG_ENABLE(portaudio, [ --disable-portaudio ignore PortAudio driver ],
  484. TRY_PORTAUDIO=$enableval , TRY_PORTAUDIO=no )
  485. HAVE_PA="false"
  486. if test "x$TRY_PORTAUDIO" = "xyes"
  487. then
  488. # check for portaudio V18
  489. AC_CHECK_LIB(portaudio, Pa_Initialize,
  490. [ AC_CHECK_HEADERS(portaudio.h,
  491. [ HAVE_PA="true"
  492. PA_LIBS=-lportaudio
  493. JACK_DEFAULT_DRIVER=\"portaudio\"
  494. ])
  495. ])
  496. AC_SUBST(PA_LIBS)
  497. fi
  498. AM_CONDITIONAL(HAVE_PA, $HAVE_PA)
  499. AC_ARG_ENABLE(coreaudio, [ --disable-coreaudio ignore CoreAudio driver ],
  500. TRY_COREAUDIO=$enableval , TRY_COREAUDIO=yes )
  501. HAVE_COREAUDIO="false"
  502. if test "x$TRY_COREAUDIO" = "xyes"
  503. then
  504. # check for coreaudio
  505. AC_CHECK_HEADERS(CoreAudio/CoreAudio.h,
  506. [ HAVE_COREAUDIO="true"
  507. JACK_DEFAULT_DRIVER=\"coreaudio\"
  508. ])
  509. fi
  510. AM_CONDITIONAL(HAVE_COREAUDIO, $HAVE_COREAUDIO)
  511. AC_ARG_ENABLE(oss, [ --disable-oss ignore OSS driver ],
  512. TRY_OSS=$enableval , TRY_OSS=yes )
  513. HAVE_OSS="false"
  514. if test "x$TRY_OSS" = "xyes"
  515. then
  516. # check for Open Sound System
  517. AC_CHECK_HEADER([sys/soundcard.h],
  518. [HAVE_OSS="true"
  519. JACK_DEFAULT_DRIVER=\"oss\"])
  520. fi
  521. AM_CONDITIONAL(HAVE_OSS, $HAVE_OSS)
  522. AC_ARG_ENABLE(sun, [ --disable-sun ignore Sun driver ],
  523. TRY_SUN=$enableval , TRY_SUN=yes )
  524. HAVE_SUN="false"
  525. if test "x$TRY_SUN" = "xyes"
  526. then
  527. # check for Sun audio API
  528. AC_CHECK_HEADER([sys/audioio.h],
  529. [HAVE_SUN="true"
  530. JACK_DEFAULT_DRIVER=\"sun\"])
  531. fi
  532. AM_CONDITIONAL(HAVE_SUN, $HAVE_SUN)
  533. AC_ARG_ENABLE(freebob, [ --disable-freebob ignore FreeBob driver ],
  534. TRY_FREEBOB=$enableval , TRY_FREEBOB=yes )
  535. HAVE_FREEBOB="false"
  536. if test "x$TRY_FREEBOB" = "xyes"
  537. then
  538. # check for FreeBob libraries
  539. PKG_CHECK_MODULES(LIBFREEBOB, libfreebob >= 1.0.0,
  540. [HAVE_FREEBOB="true"
  541. JACK_DEFAULT_DRIVER=\"freebob\"
  542. ], AC_MSG_RESULT([no]))
  543. AC_SUBST([LIBFREEBOB_CFLAGS])
  544. AC_SUBST([LIBFREEBOB_LIBS])
  545. fi
  546. AM_CONDITIONAL(HAVE_FREEBOB,$HAVE_FREEBOB)
  547. AC_ARG_ENABLE(firewire, [ --disable-firewire ignore FireWire driver (FFADO) ],
  548. TRY_FIREWIRE=$enableval , TRY_FIREWIRE=yes )
  549. HAVE_FIREWIRE="false"
  550. if test "x$TRY_FIREWIRE" = "xyes"
  551. then
  552. # check for FFADO libraries
  553. PKG_CHECK_MODULES(LIBFFADO, libffado >= 1.999.17,
  554. [HAVE_FIREWIRE="true"
  555. JACK_DEFAULT_DRIVER=\"firewire\"
  556. ], AC_MSG_RESULT([no]))
  557. AC_SUBST([LIBFFADO_CFLAGS])
  558. AC_SUBST([LIBFFADO_LIBS])
  559. fi
  560. AM_CONDITIONAL(HAVE_FIREWIRE,$HAVE_FIREWIRE)
  561. AC_ARG_ENABLE(alsa, [ --disable-alsa ignore ALSA driver ],
  562. TRY_ALSA=$enableval , TRY_ALSA=yes )
  563. HAVE_ALSA="false"
  564. if test "x$TRY_ALSA" = "xyes"
  565. then
  566. # check for ALSA >= 1.0.0
  567. PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0,
  568. [HAVE_ALSA="true"
  569. ALSA_LIBS=-lasound
  570. JACK_DEFAULT_DRIVER=\"alsa\"
  571. ], AC_MSG_RESULT([no]), [-lm]
  572. )
  573. AC_SUBST(ALSA_LIBS)
  574. fi
  575. AM_CONDITIONAL(HAVE_ALSA, $HAVE_ALSA)
  576. HAVE_ALSA_MIDI=$HAVE_ALSA
  577. AM_CONDITIONAL(HAVE_ALSA_MIDI, $HAVE_ALSA_MIDI)
  578. if test "$JACK_DEFAULT_DRIVER" = \"dummy\"; then
  579. AC_MSG_WARN([Only the dummy driver can be built])
  580. fi
  581. AC_DEFINE_UNQUOTED(JACK_DEFAULT_DRIVER,
  582. [$JACK_DEFAULT_DRIVER],
  583. [Default JACK driver])
  584. # On some systems, readline depends on termcap or ncurses. But, the
  585. # MacOSX linker complains bitterly if these libraries are explicitly
  586. # referenced.
  587. #
  588. # AC_CHECK_LIB() foolishly assumes that checking a library for an entry
  589. # point always returns the same result regardless of any dependent
  590. # libraries specified. The `unset ac_cv_lib_readline_readline' erases
  591. # the cached result to work around this problem.
  592. READLINE_DEPS=""
  593. HAVE_READLINE=true
  594. AC_CHECK_LIB(readline, readline, [:],
  595. [unset ac_cv_lib_readline_readline
  596. AC_CHECK_LIB(readline, readline, [READLINE_DEPS="-ltermcap"],
  597. [unset ac_cv_lib_readline_readline
  598. AC_CHECK_LIB(readline, readline,
  599. [READLINE_DEPS="-lncurses"], [HAVE_READLINE=false], "-lncurses")],
  600. "-ltermcap")])
  601. AC_CHECK_HEADER(readline/chardefs.h, [], [HAVE_READLINE=false])
  602. if test x$HAVE_READLINE = xfalse; then
  603. AC_MSG_WARN([*** the jack_transport example client will not be built])
  604. fi
  605. AC_SUBST(READLINE_DEPS)
  606. # you need doxygen to make dist.
  607. AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
  608. if test $HAVE_DOXYGEN = "false"; then
  609. AC_MSG_WARN([*** doxygen not found, docs will not be built])
  610. fi
  611. AM_CONDITIONAL(HAVE_SNDFILE, $HAVE_SNDFILE)
  612. AM_CONDITIONAL(HAVE_SAMPLERATE, $HAVE_SAMPLERATE)
  613. AM_CONDITIONAL(HAVE_READLINE, $HAVE_READLINE)
  614. AM_CONDITIONAL(HAVE_DOXYGEN, $HAVE_DOXYGEN)
  615. AM_CONDITIONAL(USE_CAPABILITIES, $USE_CAPABILITIES)
  616. AM_CONDITIONAL(STRIPPED_JACKD, $STRIPPED_JACKD)
  617. AC_OUTPUT(
  618. Makefile
  619. config/Makefile
  620. config/cpu/Makefile
  621. config/cpu/alpha/Makefile
  622. config/cpu/cris/Makefile
  623. config/cpu/generic/Makefile
  624. config/cpu/i386/Makefile
  625. config/cpu/i486/Makefile
  626. config/cpu/ia64/Makefile
  627. config/cpu/m68k/Makefile
  628. config/cpu/mips/Makefile
  629. config/cpu/powerpc/Makefile
  630. config/cpu/s390/Makefile
  631. config/os/Makefile
  632. config/os/generic/Makefile
  633. config/os/gnu-linux/Makefile
  634. config/os/macosx/Makefile
  635. config/sysdeps/Makefile
  636. doc/Makefile
  637. doc/reference.doxygen
  638. drivers/Makefile
  639. drivers/alsa/Makefile
  640. drivers/alsa-midi/Makefile
  641. drivers/dummy/Makefile
  642. drivers/oss/Makefile
  643. drivers/sun/Makefile
  644. drivers/portaudio/Makefile
  645. drivers/coreaudio/Makefile
  646. drivers/freebob/Makefile
  647. drivers/firewire/Makefile
  648. drivers/netjack/Makefile
  649. example-clients/Makefile
  650. tools/Makefile
  651. jack.pc
  652. jack.spec
  653. jack/Makefile
  654. jack/version.h
  655. jackd/Makefile
  656. jackd/jackd.1
  657. libjack/Makefile
  658. )
  659. dnl
  660. dnl Output summary message
  661. dnl
  662. echo
  663. echo $PACKAGE $VERSION :
  664. echo
  665. echo \| Build with ALSA support............................... : $HAVE_ALSA
  666. echo \| Build with old FireWire \(FreeBob\) support............. : $HAVE_FREEBOB
  667. echo \| Build with new FireWire \(FFADO\) support............... : $HAVE_FIREWIRE
  668. echo \| Build with OSS support................................ : $HAVE_OSS
  669. echo \| Build with Sun audio support.......................... : $HAVE_SUN
  670. echo \| Build with CoreAudio support.......................... : $HAVE_COREAUDIO
  671. echo \| Build with PortAudio support.......................... : $HAVE_PA
  672. echo \| Build with NetJack support............................ : $HAVE_SAMPLERATE
  673. echo \| Compiler optimization flags........................... : $JACK_OPT_CFLAGS
  674. echo \| Compiler full flags................................... : $CFLAGS
  675. echo \| Install dir for libjack + backends.................... : $libdir/jack
  676. echo \|
  677. echo \| Default driver backend................................ : $JACK_DEFAULT_DRIVER
  678. echo \| Shared memory interface............................... : $JACK_SHM_TYPE
  679. echo \| IPC Temporary directory............................... : $DEFAULT_TMP_DIR
  680. echo \| Install prefix........................................ : $prefix
  681. echo