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.

956 lines
30KB

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