aRts audio server
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.
 
 
 
 
 
 

852 lines
22 KiB

  1. # Original Author was Kalle@kde.org
  2. # I lifted it in some mater. (Stephan Kulow)
  3. # I used much code from Janos Farkas
  4. dnl Process this file with autoconf to produce a configure script.
  5. AC_INIT(acinclude.m4) dnl a source file from your sub dir
  6. dnl This is so we can use kde-common
  7. AC_CONFIG_AUX_DIR(admin)
  8. dnl right now: install aRts in the same prefix as KDE3.x currently
  9. KDE_SET_PREFIX_CORE
  10. AC_CANONICAL_SYSTEM
  11. AC_ARG_PROGRAM
  12. dnl Version (we /might/ want to use libtool versioning, too)
  13. ARTS_MAJOR_VERSION=1
  14. ARTS_MINOR_VERSION=5
  15. ARTS_MICRO_VERSION=10
  16. ARTS_VERSION=$ARTS_MAJOR_VERSION.$ARTS_MINOR_VERSION.$ARTS_MICRO_VERSION
  17. dnl Automake doc recommends to do this only here. (Janos)
  18. AM_INIT_AUTOMAKE(arts, $ARTS_VERSION) dnl searches for some needed programs
  19. AC_PROG_INSTALL
  20. dnl generate the config header
  21. AM_CONFIG_HEADER(config.h) dnl at the distribution this done
  22. dnl Checks for programs.
  23. AC_CHECK_COMPILERS
  24. AC_LIBLTDL_CONVENIENCE
  25. AC_ENABLE_SHARED(yes)
  26. AC_ENABLE_STATIC(no)
  27. KDE_PROG_LIBTOOL
  28. AC_LANG_SAVE
  29. AC_LANG_C
  30. KDE_LIB_LTDL
  31. AC_LANG_RESTORE
  32. # this checks for --with-extra-libs
  33. KDE_CHECK_EXTRA_LIBS
  34. KDE_MISC_TESTS
  35. dnl KDE_CHECK_LIBDL
  36. dnl AC_PROG_LIBTOOL
  37. KDE_CHECK_QT_DIRECT
  38. KDE_ENABLE_HIDDEN_VISIBILITY
  39. dnl for NLS support. Call them in this order!
  40. dnl WITH_NLS is for the po files, GNU_GETTEXT for the sources
  41. dnl AM_KDE_WITH_NLS
  42. dnl AM_KDE_GNU_GETTEXT
  43. dnl Checks for header files.
  44. KDE_CHECK_STL
  45. AC_HEADER_DIRENT
  46. AC_HEADER_STDC
  47. AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/cdefs.h fnmatch.h sysent.h strings.h sys/stat.h sys/select.h sys/socket.h linux/socket.h socketbits.h sigaction.h paths.h malloc.h monetary.h sys/param.h limits.h sys/mnttab.h mntent.h fstab.h)
  48. KDE_CHECK_HEADERS(sys/soundcard.h)
  49. dnl Checks for libraries.
  50. AC_BASE_PATH_KDE([don't test]) dnl arts is a special case
  51. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
  52. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for FreeBSD
  53. AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(rt, sem_init, [LIBSEM="-lrt"]))
  54. AM_CONDITIONAL(HAVE_LIBJPEG, test -n "$LIBJPEG" )
  55. AM_CONDITIONAL(HAVE_LIBPNG, test -n "$LIBPNG" )
  56. AM_CONDITIONAL(HAVE_LIBTIFF, test -n "$LIBTIFF")
  57. # configure would do this very late. Too late for us!
  58. test "x$prefix" = xNONE && prefix=$ac_default_prefix
  59. AC_DEFINE_UNQUOTED(KDEDIR, "$prefix", [The prefix to use as fallback])
  60. ac_cpp_safe=$ac_cpp
  61. ac_cpp='$CXXCPP $CPPFLAGS $X_INCLUDES'
  62. KDE_CHECK_HEADERS(X11/ICE/ICElib.h)
  63. ac_cpp=$ac_cpp_safe
  64. dnl Checks for typedefs, structures, and compiler characteristics.
  65. AC_HEADER_TIME
  66. AC_C_BIGENDIAN
  67. dnl check if the compiler has bool
  68. AC_CHECK_BOOL
  69. dnl AC_CHECK_GNU_EXTENSIONS
  70. dnl Checks for library functions.
  71. AC_CHECK_FUNCS(socket snprintf vsnprintf seteuid setegid random strfmon stpcpy mkstemp setmntent gettimeofday vasprintf)
  72. AC_FUNC_VFORK
  73. AC_CHECK_USLEEP
  74. AC_CHECK_SETENV
  75. AC_CHECK_GETHOSTNAME
  76. AC_CHECK_RANDOM
  77. AC_CHECK_S_ISSOCK
  78. AC_CHECK_SOCKLEN_T
  79. dnl output files
  80. AC_SUBST(x_includes)
  81. AC_SUBST(x_libraries)
  82. AC_SUBST(LIBSOCKET)
  83. AC_SUBST(LIBCOMPAT)
  84. AC_SUBST(LIBUTIL)
  85. AC_SUBST(LIBSEM)
  86. AC_SUBST(LIBICE)
  87. all_includes="$all_includes $INCLTDL"
  88. AC_SUBST(all_includes)
  89. AC_SUBST(EXTRA_SUBDIRS)
  90. topdir=`cd $srcdir && pwd`
  91. ac_configure_args="$ac_configure_args --with-auxdir=$topdir/admin"
  92. CXXFLAGS="$CXXFLAGS $USE_RTTI"
  93. dnl----------------------------------------------------------------------------
  94. dnl aRts specific configure tests
  95. dnl
  96. dnl Check for libaudioio (which can be used to get solaris audio support)
  97. AC_DEFUN([AC_CHECK_LIBAUDIOIO],
  98. [
  99. ac_ldflags_save="$LDFLAGS"
  100. ac_CPPFLAGS_save="$CPPFLAGS"
  101. LDFLAGS="$all_libraries $LDFLAGS"
  102. CPPFLAGS="$CPPFLAGS $all_includes"
  103. arts_libaudioio_found=no
  104. AC_LANG_SAVE
  105. AC_LANG_C
  106. kde_have_libaudioio=no
  107. AC_CHECK_HEADER(libaudioio.h,
  108. [
  109. kde_have_libaudioio=yes
  110. ])
  111. if test "x$kde_have_libaudioio" = "xyes"; then
  112. AC_CHECK_LIB(audioio,AudioIOGetVersion,[
  113. dnl LDFLAGS in case it's in KDEDIR/lib
  114. LIBAUDIOIO="$LDFLAGS -laudioio"
  115. AC_DEFINE(HAVE_LIBAUDIOIO, 1,
  116. [Define if you have libaudioIO (required if you want to have libaudioio support)])
  117. arts_libaudioio_found=yes
  118. ])
  119. fi
  120. AC_SUBST(LIBAUDIOIO)
  121. AC_LANG_RESTORE
  122. CPPFLAGS="$ac_CPPFLAGS_save"
  123. LDFLAGS="$ac_ldflags_save"
  124. ])
  125. dnl aRts specific configure tests
  126. dnl
  127. dnl Check for libaudio (which can be used to get network audio support)
  128. AC_DEFUN([AC_CHECK_LIBAUDIONAS],
  129. [
  130. ac_ldflags_save="$LDFLAGS"
  131. ac_CPPFLAGS_save="$CPPFLAGS"
  132. LDFLAGS="$all_libraries $LDFLAGS"
  133. CPPFLAGS="$CPPFLAGS $all_includes"
  134. AC_LANG_SAVE
  135. AC_LANG_C
  136. arts_libaudionas_include=no
  137. AC_CHECK_HEADER(audio/audiolib.h,
  138. [
  139. arts_libaudionas_include=yes
  140. ])
  141. if test "x$arts_libaudionas_include" = "xyes"; then
  142. AC_CHECK_LIB(audio,AuOpenServer,[
  143. dnl LDFLAGS in case it's in KDEDIR/lib
  144. LIBAUDIONAS="-laudio -lXt"
  145. LIBAUDIONAS_LDFLAGS="$LDFLAGS"
  146. AC_DEFINE(HAVE_LIBAUDIONAS, 1,
  147. [Define if you have libaudio (required if you want to have NAS support)])
  148. ])
  149. fi
  150. AC_SUBST(LIBAUDIONAS)
  151. AC_SUBST(LIBAUDIONAS_LDFLAGS)
  152. AC_LANG_RESTORE
  153. CPPFLAGS="$ac_CPPFLAGS_save"
  154. LDFLAGS="$ac_ldflags_save"
  155. ])
  156. dnl Check for libesd (for EsounD support)
  157. AC_DEFUN([AC_CHECK_LIBESD],
  158. [
  159. ac_ldflags_save="$LDFLAGS"
  160. ac_CPPFLAGS_save="$CPPFLAGS"
  161. LDFLAGS="$all_libraries $LDFLAGS"
  162. CPPFLAGS="$CPPFLAGS $all_includes"
  163. AC_LANG_SAVE
  164. AC_LANG_C
  165. arts_libaudionas_include=no
  166. AC_CHECK_HEADER(esd.h,
  167. [
  168. arts_libesd_include=yes
  169. ])
  170. if test "x$arts_libesd_include" = "xyes"; then
  171. AC_CHECK_LIB(esd,esd_open_sound,[
  172. dnl LDFLAGS in case it's in KDEDIR/lib
  173. LIBESD="-lesd"
  174. LIBESD_LDFLAGS="$LDFLAGS"
  175. AC_DEFINE(HAVE_LIBESD, 1,
  176. [Define if you have libesd (required if you want EsounD support)])
  177. ])
  178. fi
  179. AC_SUBST(LIBESD)
  180. AC_SUBST(LIBESD_LDFLAGS)
  181. AC_LANG_RESTORE
  182. CPPFLAGS="$ac_CPPFLAGS_save"
  183. LDFLAGS="$ac_ldflags_save"
  184. ])
  185. dnl libaudiofile is used for loading wave files
  186. AC_DEFUN([AC_CHECK_LIBAUDIOFILE],
  187. [
  188. ac_ldflags_save="$LDFLAGS"
  189. ac_CPPFLAGS_save="$CPPFLAGS"
  190. LDFLAGS="$all_libraries $LDFLAGS"
  191. CPPFLAGS="$CPPFLAGS $all_includes"
  192. arts_audiolib_found=no
  193. dnl WAV reading
  194. AC_LANG_SAVE
  195. AC_LANG_C
  196. kde_has_audio_lib=no
  197. AC_CHECK_HEADER(audiofile.h,
  198. [
  199. kde_has_audio_lib=yes
  200. ])
  201. if test "x$kde_has_audio_lib" = "xyes"; then
  202. KDE_CHECK_LIB(audiofile,afOpenFile,[
  203. dnl LDFLAGS in case it's in KDEDIR/lib
  204. LIBAUDIOFILE="-laudiofile"
  205. LIBAUDIOFILE_LDFLAGS="$LDFLAGS"
  206. AC_DEFINE(HAVE_LIBAUDIOFILE, 1,
  207. [Define if you have libaudiofile (required for playing wavs with aRts)])
  208. arts_audiolib_found=yes
  209. ])
  210. fi
  211. AC_SUBST(LIBAUDIOFILE)
  212. AC_SUBST(LIBAUDIOFILE_LDFLAGS)
  213. AC_LANG_RESTORE
  214. CPPFLAGS="$ac_CPPFLAGS_save"
  215. LDFLAGS="$ac_ldflags_save"
  216. ])
  217. dnl check if sgi libaudio is present
  218. AC_DEFUN([AC_CHECK_SGILIBAUDIO],
  219. [
  220. ac_ldflags_save="$LDFLAGS"
  221. ac_CPPFLAGS_save="$CPPFLAGS"
  222. LDFLAGS="$all_libraries $LDFLAGS"
  223. CPPFLAGS="$CPPFLAGS $all_includes"
  224. dnl SGI libaudio (required on IRIX)
  225. AC_LANG_SAVE
  226. AC_LANG_C
  227. arts_dmedia_include=no
  228. AC_CHECK_HEADER(dmedia/audio.h,
  229. [
  230. arts_dmedia_include=yes
  231. ])
  232. if test "x$arts_dmedia_include" = "xyes"; then
  233. KDE_CHECK_LIB(audio,alOpenPort,[
  234. SGILIBAUDIO="-laudio"
  235. AC_DEFINE(HAVE_SGILIBAUDIO, 1,
  236. [Define if you have libaudio (required for sound i/o on IRIX)])
  237. ])
  238. fi
  239. AC_SUBST(SGILIBAUDIO)
  240. AC_LANG_RESTORE
  241. CPPFLAGS="$ac_CPPFLAGS_save"
  242. LDFLAGS="$ac_ldflags_save"
  243. ])
  244. dnl check if we want to build MAS support
  245. AC_DEFUN([AC_CHECK_LIBMAS],
  246. [
  247. AC_PATH_PROG(MAS_CONFIG, mas-config, no)
  248. if test "$MAS_CONFIG" != "no"; then
  249. AC_DEFINE(HAVE_LIBMAS, 1,
  250. [Define if you have libmas (required if you want MAS support)])
  251. MAS_CFLAGS="`$MAS_CONFIG --cflags`"
  252. tmp_mas_libs="`$MAS_CONFIG --libs` -lmas_jrtp"
  253. MAS_LDFLAGS="`for i in $tmp_mas_libs; do echo $i; done |grep ^-L`"
  254. MAS_LDFLAGS="$MAS_LDFLAGS `for i in $tmp_mas_libs; do echo $i; done |grep ^-L |sed s/^-L/-R/g`"
  255. LIBMAS="$MAS_LDFLAGS"
  256. for i in $tmp_mas_libs; do LIBMAS="$LIBMAS `echo $i |grep ^-l`"; done
  257. fi
  258. AC_SUBST(MAS_CFLAGS)
  259. AC_SUBST(MAS_LDFLAGS)
  260. AC_SUBST(LIBMAS)
  261. ])
  262. dnl Posix realtime scheduling - this is helpful if you want arts to run with
  263. dnl higher priority than everthing else
  264. AC_DEFUN([ARTS_TRY_LINK_POSIX_REALTIME],
  265. [
  266. AC_TRY_LINK([
  267. #include <sched.h>
  268. ],
  269. [
  270. sched_getscheduler(0);
  271. ],
  272. arts_realtime_sched=yes,
  273. arts_realtime_sched=no)
  274. ])
  275. AC_DEFUN([AC_CHECK_REALTIME_SCHED],
  276. [
  277. AC_MSG_CHECKING([for posix realtime scheduling support])
  278. save_LIBS="$LIBS"
  279. LIBPOSIX4=""
  280. ARTS_TRY_LINK_POSIX_REALTIME
  281. if test "x$arts_realtime_sched" = "xno"; then
  282. LIBS="$LIBS -lposix4"
  283. ARTS_TRY_LINK_POSIX_REALTIME
  284. if test "x$arts_realtime_sched" = "xyes"; then
  285. LIBPOSIX4="-lposix4"
  286. fi
  287. fi
  288. LIBS="$save_LIBS"
  289. AC_SUBST(LIBPOSIX4)
  290. AC_MSG_RESULT($arts_realtime_sched)
  291. if test "x$arts_realtime_sched" = "xyes"; then
  292. AC_DEFINE(HAVE_REALTIME_SCHED,1,
  293. [Define if your system supports realtime scheduling])
  294. fi
  295. ])
  296. dnl Type of the ioctl function test - after some tries, it seems that this
  297. dnl not required for Linux vs. FreeBSD (for which this test was written), and
  298. dnl that only the Linux documentation claims that it has an "int" as second
  299. dnl argument. But maybe there will pop up systems for which the signature
  300. dnl differs, later.
  301. AC_DEFUN([AC_CHECK_IOCTL_TYPE],
  302. [
  303. AC_MSG_CHECKING([ioctl type])
  304. AC_CACHE_VAL(ac_cv_ioctl_type,
  305. [
  306. AC_LANG_SAVE
  307. AC_LANG_C
  308. AC_TRY_COMPILE(
  309. [
  310. #include <unistd.h>
  311. #include <sys/ioctl.h>
  312. int ioctl(int d, int request,...);
  313. ],
  314. [
  315. ],
  316. ac_cv_ioctl_type=1)
  317. AC_TRY_COMPILE(
  318. [
  319. #include <unistd.h>
  320. #include <sys/ioctl.h>
  321. int ioctl(int d, unsigned long request,...);
  322. ],
  323. [
  324. ],
  325. ac_cv_ioctl_type=2)
  326. AC_TRY_COMPILE(
  327. [
  328. #include <unistd.h>
  329. #include <sys/ioctl.h>
  330. int ioctl(int d, unsigned long int request,...);
  331. ],
  332. [
  333. ],
  334. ac_cv_ioctl_type=3)
  335. AC_LANG_RESTORE
  336. ])
  337. AC_MSG_RESULT($ac_cv_ioctl_type)
  338. if test "$ac_cv_ioctl_type" = "1"; then
  339. AC_DEFINE(HAVE_IOCTL_INT_INT_DOTS,1,
  340. [Define if ioctl is declared as int ioctl(int d, int request,...)])
  341. fi
  342. if test "$ac_cv_ioctl_type" = "2"; then
  343. AC_DEFINE(HAVE_IOCTL_INT_ULONG_DOTS,2,
  344. [Define if ioctl is declared as int ioctl(int d, unsigned long request,...)])
  345. fi
  346. if test "$ac_cv_ioctl_type" = "3"; then
  347. AC_DEFINE(HAVE_IOCTL_INT_ULONGINT_DOTS,3,
  348. [Define if ioctl is declared as int ioctl(int d, unsigned long int request,...)])
  349. fi
  350. ])
  351. dnl check whether we can do rouding using asm optimization
  352. AC_DEFUN([AC_CHECK_X86_FLOAT_INT],
  353. [
  354. AC_MSG_CHECKING([for x86 float to int conversions])
  355. AC_CACHE_VAL(ac_cv_x86_float_int,
  356. [
  357. AC_LANG_SAVE
  358. AC_LANG_CPLUSPLUS
  359. AC_TRY_LINK([
  360. #if defined(__i386__)
  361. static inline long QRound (float inval)
  362. {
  363. long ret;
  364. __asm__ ("fistpl %0" : "=m" (ret) : "t" (inval) : "st");
  365. return ret;
  366. }
  367. #else
  368. error
  369. #endif
  370. ],
  371. [
  372. long i = QRound(41.93); /* should be 42 */
  373. ],
  374. ac_cv_x86_float_int=yes,
  375. ac_cv_x86_float_int=no)
  376. AC_LANG_RESTORE
  377. ])
  378. AC_MSG_RESULT($ac_cv_x86_float_int)
  379. if test "x$ac_cv_x86_float_int" = "xyes"; then
  380. AC_DEFINE(HAVE_X86_FLOAT_INT,1,
  381. [Define if you want to use optimized x86 float to int conversion code])
  382. fi
  383. ])
  384. dnl check if the assembler supports SSE instructions
  385. AC_DEFUN([AC_CHECK_X86_SSE],
  386. [
  387. AC_MSG_CHECKING([for x86 SSE instructions])
  388. AC_CACHE_VAL(ac_cv_x86_sse,
  389. [
  390. AC_TRY_COMPILE(,
  391. [
  392. #if defined(__GNUC__) && defined(__i386__)
  393. __asm__("movups %xmm0, (%esp)");
  394. #else
  395. /* IRIX's cc treats #error as a warning, make sure it errors out here */
  396. error Not gcc on x86
  397. #endif
  398. ],
  399. ac_cv_x86_sse=yes,
  400. ac_cv_x86_sse=no)
  401. ])
  402. AC_MSG_RESULT($ac_cv_x86_sse)
  403. if test "x$ac_cv_x86_sse" = "xyes"; then
  404. AC_DEFINE(HAVE_X86_SSE,1,
  405. [Define if your assembler supports x86 SSE instructions])
  406. fi
  407. ])
  408. dnl check whether we should try to emulate stdio fopen/fclose via
  409. dnl glibc facilities (this *really* depends on glibc internals)
  410. AC_DEFUN([AC_CHECK_ARTSDSP_STDIO_EMU],
  411. [
  412. AC_MSG_CHECKING([for stdio emulation in artsdsp])
  413. AC_CACHE_VAL(ac_cv_artsdsp_stdio_emu,
  414. [
  415. AC_LANG_SAVE
  416. AC_LANG_C
  417. AC_TRY_LINK([
  418. #define _GNU_SOURCE
  419. #include <stdio.h>
  420. ],
  421. [
  422. cookie_io_functions_t fns = { 0, 0, 0, 0 };
  423. struct fd_cookie *fdc = 0;
  424. FILE *out = fopencookie (fdc,"w", fns);
  425. out->_fileno = 0;
  426. ],
  427. ac_cv_artsdsp_stdio_emu=yes,
  428. ac_cv_artsdsp_stdio_emu=no)
  429. ])
  430. AC_LANG_RESTORE
  431. AC_MSG_RESULT($ac_cv_artsdsp_stdio_emu)
  432. if test "x$ac_cv_artsdsp_stdio_emu" = "xyes"; then
  433. AC_DEFINE(HAVE_ARTSDSP_STDIO_EMU,1,
  434. [Define if you want to use glibc facilities to emulate stdio accesses in artsdsp])
  435. fi
  436. ])
  437. dnl call the tests
  438. AC_ARG_WITH(libaudioio,
  439. [AC_HELP_STRING(--with-libaudioio,
  440. [enable support for libaudioio @<:@default=check@:>@])],
  441. [], with_libaudioio=check)
  442. if test "x$with_libaudioio" != xno; then
  443. AC_CHECK_LIBAUDIOIO
  444. if test "x$with_libaudioio" != xcheck && test -z "$LIBAUDIOIO"; then
  445. AC_MSG_FAILURE([--with-libaudioio was given, but test for libaudioio failed])
  446. fi
  447. fi
  448. AC_ARG_WITH(nas,
  449. [AC_HELP_STRING(--with-nas,
  450. [enable support for NAS @<:@default=check@:>@])],
  451. [], with_nas=check)
  452. if test "x$with_nas" != xno; then
  453. AC_CHECK_LIBAUDIONAS
  454. if test "x$with_nas" != xcheck && test -z "$LIBAUDIONAS"; then
  455. AC_MSG_FAILURE([--with-nas was given, but test for NAS failed])
  456. fi
  457. fi
  458. AC_ARG_WITH(esd,
  459. [AC_HELP_STRING(--with-esd,
  460. [enable support for EsounD @<:@default=check@:>@])],
  461. [], with_esd=check)
  462. if test "x$with_esd" != xno; then
  463. AC_CHECK_LIBESD
  464. if test "x$with_esd" != xcheck && test -z "$LIBESD"; then
  465. AC_MSG_FAILURE([--with-esd was given, but test for EsounD failed])
  466. fi
  467. fi
  468. AC_ARG_WITH(audiofile,
  469. [AC_HELP_STRING(--with-audiofile,
  470. [enable support for audiofile @<:@default=check@:>@])],
  471. [], with_audiofile=check)
  472. if test "x$with_audiofile" != xno; then
  473. AC_CHECK_LIBAUDIOFILE
  474. if test "x$with_audiofile" != xcheck && test -z "$LIBAUDIOFILE"; then
  475. AC_MSG_FAILURE([--with-audiofile was given, but test for audiofile failed])
  476. fi
  477. fi
  478. AM_CONDITIONAL(HAVE_WAVSUPPORT, test -n "$LIBAUDIOFILE")
  479. AC_ARG_WITH(sgilibaudio,
  480. [AC_HELP_STRING(--with-sgilibaudio,
  481. [enable support for SGI libaudio @<:@default=check@:>@])],
  482. [], with_sgilibaudio=check)
  483. if test "x$with_sgilibaudio" != xno; then
  484. AC_CHECK_SGILIBAUDIO
  485. if test "x$with_sgilibaudio" != xcheck && test -z "$SGILIBAUDIO"; then
  486. AC_MSG_FAILURE([--with-sgilibaudio was given, but test for SGI libaudio failed])
  487. fi
  488. fi
  489. AC_ARG_WITH(mas,
  490. [AC_HELP_STRING(--with-mas,
  491. [enable support for MAS @<:@default=check@:>@])],
  492. [], with_mas=check)
  493. if test "x$with_mas" != xno; then
  494. AC_CHECK_LIBMAS
  495. if test "x$with_mas" != xcheck && test -z "$LIBMAS"; then
  496. AC_MSG_FAILURE([--with-mas was given, but test for MAS failed])
  497. fi
  498. fi
  499. AC_CHECK_REALTIME_SCHED
  500. AC_CHECK_GETDOMAINNAME
  501. AC_CHECK_IOCTL_TYPE
  502. AC_CHECK_X86_FLOAT_INT
  503. AC_CHECK_X86_SSE
  504. AC_CHECK_ARTSDSP_STDIO_EMU
  505. KDE_CHECK_THREADING
  506. dnl somewhat more deeply nested template code than gcc understands by default
  507. if test "$GXX" = "yes"; then
  508. KDE_CHECK_COMPILER_FLAG(ftemplate-depth-99,
  509. [
  510. CXXFLAGS="$CXXFLAGS -ftemplate-depth-99"
  511. ])
  512. fi
  513. dnl check for ALSA audio support
  514. arts_with_alsa=yes
  515. AC_ARG_WITH(alsa, [ --with-alsa enable aRts ALSA support],
  516. [arts_with_alsa=$withval])
  517. if test "$arts_with_alsa" = "yes"; then
  518. AC_DEFUN([AC_CHECK_LIBASOUND],
  519. [
  520. ac_ldflags_save="$LDFLAGS"
  521. LDFLAGS="$all_libraries $LDFLAGS"
  522. kde_has_asoundlib=no
  523. AC_CHECK_HEADERS([ sys/asoundlib.h alsa/asoundlib.h ],
  524. [
  525. kde_has_asoundlib=yes
  526. ])
  527. dnl trial and error version check for ALSA 0.5.x / ALSA 0.9.x
  528. AC_LANG_SAVE
  529. AC_LANG_C
  530. if test "x$kde_has_asoundlib" = "xyes"; then
  531. AC_TRY_COMPILE([
  532. #include "confdefs.h"
  533. #ifdef HAVE_SYS_ASOUNDLIB_H
  534. #include <sys/asoundlib.h>
  535. #endif
  536. #ifdef HAVE_ALSA_ASOUNDLIB_H
  537. #include <alsa/asoundlib.h>
  538. #endif
  539. ],[
  540. #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)
  541. /* we have ALSA 0.9.x */
  542. #else
  543. #error not ALSA 0.9.x
  544. #endif
  545. ],
  546. kde_has_alsa_0_9=yes,
  547. kde_has_alsa_0_9=no)
  548. fi
  549. if test "x$kde_has_asoundlib" = "xyes"; then
  550. AC_TRY_COMPILE([
  551. #include "confdefs.h"
  552. #ifdef HAVE_SYS_ASOUNDLIB_H
  553. #include <sys/asoundlib.h>
  554. #endif
  555. #ifdef HAVE_ALSA_ASOUNDLIB_H
  556. #include <alsa/asoundlib.h>
  557. #endif
  558. ],[
  559. #if (SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0)
  560. /* we have ALSA 1.x */
  561. #else
  562. #error not ALSA 1.x
  563. #endif
  564. ],
  565. kde_has_alsa_1_0=yes,
  566. kde_has_alsa_1_0=no)
  567. fi
  568. if test "x$kde_has_asoundlib" = "xyes"; then
  569. AC_TRY_COMPILE([
  570. #include "confdefs.h"
  571. #ifdef HAVE_SYS_ASOUNDLIB_H
  572. #include <sys/asoundlib.h>
  573. #endif
  574. #ifdef HAVE_ALSA_ASOUNDLIB_H
  575. #include <alsa/asoundlib.h>
  576. #endif
  577. ],[
  578. #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5)
  579. /* we have ALSA 0.5.x */
  580. #else
  581. #error not ALSA 0.5.x
  582. #endif
  583. ],
  584. kde_has_alsa_0_5=yes,
  585. kde_has_alsa_0_5=no)
  586. fi
  587. AC_LANG_RESTORE
  588. if test "x$kde_has_asoundlib" = "xyes"; then
  589. AC_CHECK_LIB(asound,snd_seq_create_simple_port,[
  590. if test "x$kde_has_alsa_0_5" = "xyes"; then
  591. LIBASOUND="-lasound"
  592. AC_DEFINE(HAVE_LIBASOUND, 1,
  593. [Define if you have libasound.so.1 (required for ALSA 0.5.x support)])
  594. fi
  595. if test "x$kde_has_alsa_0_9" = "xyes"; then
  596. LIBASOUND="-lasound"
  597. AC_DEFINE(HAVE_LIBASOUND2, 1,
  598. [Define if you have libasound.so.2 (required for ALSA 0.9.x support)])
  599. AC_CHECK_LIB(asound,snd_pcm_resume,[
  600. AC_DEFINE(HAVE_SND_PCM_RESUME, 1,
  601. [Define if libasound has snd_pcm_resume()])])
  602. fi
  603. if test "x$kde_has_alsa_1_0" = "xyes"; then
  604. LIBASOUND="-lasound"
  605. AC_DEFINE(HAVE_LIBASOUND2, 1,
  606. [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
  607. AC_DEFINE(ALSA_PCM_OLD_SW_PARAMS_API, 1,
  608. [Define if you have alsa 1.x])
  609. AC_DEFINE(ALSA_PCM_OLD_HW_PARAMS_API, 1,
  610. [Define if you have alsa 1.x])
  611. AC_CHECK_LIB(asound,snd_pcm_resume,[
  612. AC_DEFINE(HAVE_SND_PCM_RESUME, 1,
  613. [Define if libasound has snd_pcm_resume()])])
  614. fi
  615. ])
  616. fi
  617. AC_SUBST(LIBASOUND)
  618. LDFLAGS="$ac_ldflags_save"
  619. ])
  620. AC_CHECK_LIBASOUND
  621. fi
  622. AC_SUBST(LIBASOUND)
  623. dnl check for IRIX audio support
  624. AC_MSG_CHECKING([for IRIX])
  625. if test `uname` = "IRIX" -o `uname` = "IRIX64" ; then
  626. AC_DEFINE(HAVE_IRIX, 1, [Define if you compile under IRIX])
  627. AC_MSG_RESULT("yes")
  628. else
  629. AC_MSG_RESULT("no")
  630. fi
  631. dnl check wether we want to use libcsl style sound I/O
  632. AC_ARG_ENABLE(csl,
  633. [ --enable-csl enable libcsl style sound I/O for aRts],
  634. [arts_want_csl="$enableval"],[arts_want_csl="no"])
  635. if test "$arts_want_csl" = "yes"; then
  636. LIBCSL="-lcsl"
  637. AC_DEFINE(HAVE_LIBCSL, 1,
  638. [Define if you have libcsl (required if you want to have CSL support)])
  639. else
  640. LIBCSL=""
  641. fi
  642. AC_SUBST(LIBCSL)
  643. dnl Check for pkg-config
  644. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  645. if test "$PKG_CONFIG" = "no"; then
  646. AC_MSG_ERROR([
  647. This package requires pkg-config.
  648. ])
  649. fi
  650. dnl Check for Glib-2.0
  651. # GLIB_CFLAGS: cflags for compiling glib dependant sources
  652. # GLIB_LIBADD: glib libraries (-l options)
  653. # GLIB_LDFLAGS: flags containing path to glib libraries (-L options)
  654. GLIB_PACKAGES="gmodule-2.0 gthread-2.0"
  655. GLIB_VERSION="1.3.3"
  656. AC_MSG_CHECKING(for GLib-2.0 (at least $GLIB_VERSION))
  657. if $PKG_CONFIG --atleast-pkgconfig-version 0.15 ; then
  658. if $PKG_CONFIG --atleast-version $GLIB_VERSION $GLIB_PACKAGES >/dev/null 2>&1 ; then
  659. GLIB_CFLAGS="`$PKG_CONFIG --cflags $GLIB_PACKAGES`"
  660. GLIB_LIBADD="`$PKG_CONFIG --libs-only-l --libs-only-other $GLIB_PACKAGES`"
  661. GLIB_LDFLAGS="`$PKG_CONFIG --libs-only-L $GLIB_PACKAGES`"
  662. AC_MSG_RESULT(yes)
  663. fi
  664. else
  665. if $PKG_CONFIG --atleast-version $GLIB_VERSION $GLIB_PACKAGES >/dev/null 2>&1 ; then
  666. GLIB_CFLAGS="`$PKG_CONFIG --cflags $GLIB_PACKAGES`"
  667. GLIB_LIBADD="`$PKG_CONFIG --libs $GLIB_PACKAGES`"
  668. GLIB_LDFLAGS="`$PKG_CONFIG --libs-only-L $GLIB_PACKAGES`"
  669. AC_MSG_RESULT(yes)
  670. AC_MSG_WARN([you may need to run make LDFLAGS=-pthread to compile arts])
  671. fi
  672. fi
  673. if test -z "$GLIB_LIBADD"; then
  674. AC_MSG_RESULT(not installed)
  675. AC_ERROR([
  676. Please install glib-2.0 (see http://www.gtk.org).
  677. ])
  678. DO_NOT_COMPILE="$DO_NOT_COMPILE gmcop"
  679. fi
  680. CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS"
  681. CFLAGS="$CFLAGS $GLIB_CFLAGS"
  682. AC_SUBST(GLIB_CFLAGS)
  683. AC_SUBST(GLIB_LIBADD)
  684. AC_SUBST(GLIB_LDFLAGS)
  685. AC_ARG_WITH(jack,
  686. [AC_HELP_STRING(--with-jack,
  687. [enable support for Jack @<:@default=check@:>@])],
  688. [], with_jack=check)
  689. if test "x$with_jack" != xno; then
  690. AC_MSG_CHECKING(for Jack Audio Connection Kit)
  691. if $PKG_CONFIG --atleast-version 0.90 jack >/dev/null 2>&1 ; then
  692. JACK_CFLAGS="`$PKG_CONFIG --cflags jack`"
  693. JACK_LIBADD="`$PKG_CONFIG --libs-only-l jack`"
  694. JACK_LDFLAGS="`$PKG_CONFIG --libs-only-L jack`"
  695. AC_MSG_RESULT(yes)
  696. AC_DEFINE(HAVE_LIBJACK, 1,
  697. [Define if you have libjack (required if you want Jack support)])
  698. else
  699. AC_MSG_RESULT(not installed)
  700. fi
  701. AC_SUBST(JACK_CFLAGS)
  702. AC_SUBST(JACK_LIBADD)
  703. AC_SUBST(JACK_LDFLAGS)
  704. if test "x$with_jack" != xcheck && test -z "$JACK_LIBADD"; then
  705. AC_MSG_FAILURE([--with-jack was given, but test for Jack failed])
  706. fi
  707. fi
  708. dnl OpenBSD requires an -lossaudio and soundcard.h to provide OSS audio I/O
  709. AC_CHECK_HEADERS(soundcard.h)
  710. AC_CHECK_LIB(ossaudio, _oss_ioctl, [LIBOSSAUDIO="-lossaudio"])
  711. AC_SUBST(LIBOSSAUDIO)
  712. AM_CONFIG_HEADER(mcop/arts_export.h)
  713. AM_CONFIG_HEADER(artsc/artsc_export.h)
  714. dnl Don't remove !
  715. dnl AC_OUTPUT(artsc/artsc-config)
  716. dnl Check if we are building as part of KDE. Arts can also be built as
  717. dnl a standalone snapshot in which case KDE may not be present and things
  718. dnl that depend on KDE should not be built.
  719. dnl AC_MSG_CHECKING(if building standalone aRts snapshot without KDE)
  720. dnl if test "$DCOPIDL" = ""; then
  721. dnl AC_MSG_RESULT(yes)
  722. dnl ARTS_BUILD_KDE=""
  723. dnl TQMOC="true"
  724. dnl DCOPIDL="true"
  725. dnl DCOPIDL2CPP="true"
  726. dnl AC_SUBST(TQMOC)
  727. dnl AC_SUBST(DCOPIDL)
  728. dnl AC_SUBST(DCOPIDL2CPP)
  729. dnl else
  730. dnl AC_MSG_RESULT(no)
  731. dnl if test "x$kde_use_qt_emb" = "xyes"; then
  732. dnl ARTS_BUILD_KDE="qtmcop kde knotify message"
  733. dnl else
  734. dnl ARTS_BUILD_KDE="x11 qtmcop kde knotify message"
  735. dnl fi
  736. dnl fi
  737. dnl AC_SUBST(ARTS_BUILD_KDE)
  738. MCOPIDL='$(top_builddir)/mcopidl/mcopidl'
  739. AC_SUBST(MCOPIDL)
  740. AC_SUBST(ARTS_MAJOR_VERSION)
  741. AC_SUBST(ARTS_MINOR_VERSION)
  742. AC_SUBST(ARTS_MICRO_VERSION)
  743. AC_SUBST(ARTS_VERSION)
  744. dnl Don't remove !
  745. dnl AC_OUTPUT(artsc/artsdsp)
  746. dnl AC_OUTPUT(soundserver/artsversion-new.h)
  747. dnl AC_OUTPUT(flow/gsl/gslconfig.h)