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.

919 lines
27KB

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