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.

1007 lines
31KB

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