1dnl ---
2dnl configure.ac for ecasound
3dnl
4dnl Many of the tests and macros in this file have been borrowed from
5dnl other GPL-licensed packages (Alsaplayer, ALSA, SIP, PyQt,
6dnl kpackage, etc, etc).
7dnl
8dnl refs:
9dnl  - http://www.gnu.org/software/autoconf/manual/
10dnl  - http://www.gnu.org/software/automake/manual/
11dnl  - http://www.gnu.org/software/libtool/manual/
12dnl ---
13
14dnl ------------------------------------------------------------------
15
16dnl ---
17dnl Initialize autoconf and automake
18dnl ---
19AC_INIT([ecasound], [2.9.3])
20AC_PREREQ(2.50)
21AC_CONFIG_SRCDIR([libecasound/audiofx.h])
22AM_INIT_AUTOMAKE([1.6.1])
23
24dnl FIXME: replace with AC_CONFIG_HEADERS when upgrading to a newer automake
25AM_CONFIG_HEADER([config.h])
26
27dnl ------------------------------------------------------------------
28
29echo "------------------------------------------------------------------"
30echo "1. Section: Basic setup"
31echo "------------------------------------------------------------------"
32
33dnl ---
34dnl Set library interface version numbers
35dnl
36dnl defines: LIBECASOUND_VERSION, LIBECASOUNDC_VERSION, LIBKVUTILS_VERSION
37dnl ---
38
39LIBECASOUND_VERSION=24
40LIBECASOUND_VERSION_AGE=0
41LIBECASOUNDC_VERSION=2
42LIBECASOUNDC_VERSION_AGE=1
43LIBKVUTILS_VERSION=10
44LIBKVUTILS_VERSION_AGE=0
45
46AC_SUBST(LIBECASOUND_VERSION)
47AC_SUBST(LIBECASOUND_VERSION_AGE)
48AC_SUBST(LIBECASOUNDC_VERSION)
49AC_SUBST(LIBECASOUNDC_VERSION_AGE)
50AC_SUBST(LIBKVUTILS_VERSION)
51AC_SUBST(LIBKVUTILS_VERSION_AGE)
52
53AC_DEFINE_UNQUOTED([LIBECASOUND_VERSION], ${LIBECASOUND_VERSION}, [libecasound interface version])
54AC_DEFINE_UNQUOTED([LIBECASOUND_VERSION_AGE], ${LIBECASOUND_VERSION_AGE}, [libecasound interface age])
55AC_DEFINE_UNQUOTED([LIBECASOUNDC_VERSION], ${LIBECASOUNDC_VERSION}, [libecasoundc interface version])
56AC_DEFINE_UNQUOTED([LIBKVUTILS_VERSION], ${LIBKVUTILS_VERSION}, [libkvutils interface version])
57AC_DEFINE_UNQUOTED([LIBKVUTILS_VERSION_AGE], ${LIBKVUTILS_VERSION_AGE}, [libkvutils interface age])
58
59dnl ------------------------------------------------------------------
60
61dnl --
62dnl Initialize default flags
63dnl --
64AC_PROG_CC
65AC_PROG_CXX
66AC_PROG_CPP
67AC_LANG_CPLUSPLUS
68AC_CANONICAL_HOST
69
70dnl ---
71dnl Set compiler flags
72dnl
73dnl AM_xxx flags are global flags that are always utilized
74dnl for compiling and linking.
75dnl
76dnl It is possible to add custom options by adding them
77dnl to the CPPFLAGS/CFLAGS/CXXFLAGS/LDFLAGS shell variables
78dnl when invoking the configure script. It is not possible
79dnl to override AM_xxx flags.
80dnl
81dnl modifies: AM_CXXFLAGS, AM_CFLAGS
82dnl ---
83EXTRACPPFLAGS="-D_REENTRANT -D_XOPEN_SOURCE=600"
84EXTRAGCCFLAGS="-ffast-math -fstrict-aliasing"
85EXTRACXXFLAGS="-std=c++98"
86if test x${GXX} = xyes; then
87   AM_CXXFLAGS="$AM_CXXFLAGS $EXTRAGCCFLAGS"
88   AM_CFLAGS="$AM_CFLAGS $EXTRAGCCFLAGS"
89fi
90AM_CPPFLAGS="$AM_CPPFLAGS $EXTRACPPFLAGS"
91AM_CXXFLAGS="$AM_CXXFLAGS $EXTRACXXFLAGS"
92
93AC_SUBST(AM_CFLAGS)
94AC_SUBST(AM_CXXFLAGS)
95AC_SUBST(AM_CPPFLAGS)
96AC_SUBST(AM_LDFLAGS)
97
98dnl ------------------------------------------------------------------
99
100dnl ---
101dnl Sets up default values
102dnl ---
103
104dnl Selected the Python ECI implementation.
105eca_platform_python_impl="python"
106
107dnl All components required by ecasound curses are found
108eca_platform_curses_support="yes"
109
110dnl ---
111dnl Sets up some operating system specific options
112dnl
113dnl modifies: AM_CXXFLAGS, AM_CFLAGS, AM_CPPFLAGS, AM_LIBS
114dnl ---
115
116case "$host" in
117	*-*-openbsd*)
118               AM_CFLAGS="$AM_CFLAGS -pthread"
119               AM_CXXFLAGS="$AM_CXXFLAGS -pthread"
120               echo "Setting OpenBSD compilation options for POSIX threads"
121               ;;
122	*-*-freebsd*)
123               AM_CFLAGS="$AM_CFLAGS -pthread"
124               AM_CPPFLAGS="$AM_CPPFLAGS -D_THREAD_SAFE -D_P1003_1B_VISIBLE"
125               AM_CXXFLAGS="$AM_CXXFLAGS -pthread"
126               echo "Setting FreeBSD compilation options for POSIX threads"
127               ;;
128	*-*-solaris*)
129               AM_CPPFLAGS="$AM_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS"
130	       LIBS="$LIBS -lposix4 -lpthread"
131	       echo "Setting Solaris compilation options for POSIX threads"
132	       if test x$CXX = xCC; then
133	          LIBS="$LIBS -mt"
134		  AM_CXXFLAGS="$AM_CXXFLAGS -instances=static"
135		  echo "Sun Workshop C++ compiler detected. Enabling static template instantation."
136	       fi
137               ;;
138	*-*-linux-gnu)
139	       ;;
140	alpha*-*-linux-*)
141	       AM_CFLAGS="$AM_CFLAGS -mieee"
142	       AM_CXXFLAGS="$AM_CXXFLAGS -mieee"
143	       echo "Enabling fully IEEE compliant floating-point code generation on Alpha."
144	       ;;
145	*darwin*)
146	       if test "$GCC" = yes; then
147		  AM_CPPFLAGS="$AM_CPPFLAGS -D_P1003_1B_VISIBLE"
148	       fi
149	       ;;
150	*)
151	       echo "Using generic settings for POSIX thread support."
152	       ;;
153esac
154
155dnl ------------------------------------------------------------------
156
157dnl ---
158dnl Check pthread and rt support
159dnl ---
160
161dnl switch to C while testing for pthread support
162AC_LANG_C
163AC_SEARCH_LIBS(pthread_create, pthread c_r,,
164		AC_MSG_ERROR([** POSIX.4 threads not installed or broken **]))
165AC_SEARCH_LIBS(clock_gettime, rt)
166dnl switch back to C++
167AC_LANG_CPLUSPLUS
168
169echo "------------------------------------------------------------------"
170echo "2. Section: Options for the configure script"
171echo "------------------------------------------------------------------"
172
173dnl ------------------------------------------------------------------
174
175dnl ---
176dnl Check whether to enable debugging
177dnl
178dnl defines: ECA_AM_DEBUG_MODE
179dnl modifies: AM_CXXFLAGS, AM_CFLAGS
180dnl ---
181
182AC_MSG_CHECKING(whether to enable debugging)
183AC_ARG_ENABLE(debug,
184[  --enable-debug	  Enable debugging (default = no)],
185  [
186    case "$enableval" in
187      y | yes)
188        AC_MSG_RESULT(yes)
189	include_debug=yes
190      ;;
191
192      n | no)
193        AC_MSG_RESULT(no)
194	include_debug=no
195      ;;
196
197      *)
198        AC_MSG_ERROR([Invalid parameter value for --enable-debug: $enableval])
199      ;;
200    esac
201 ]
202
203)
204AM_CONDITIONAL(ECA_AM_DEBUG_MODE, test x$include_debug = xyes)
205if test x$include_debug = xyes; then
206    EXTRADEBUGFLAGS="-Wall -O"
207    AC_DEFINE([ECA_DEBUG_MODE], 1, [debugging mode build])
208else
209    EXTRADEBUGFLAGS="-DNDEBUG"
210fi
211AM_CXXFLAGS="$AM_CXXFLAGS $EXTRADEBUGFLAGS"
212AM_CFLAGS="$AM_CFLAGS $EXTRADEBUGFLAGS"
213
214dnl ------------------------------------------------------------------
215
216dnl ---
217dnl Check for experimental mode
218dnl
219dnl defines: ECA_FEELING_EXPERIMENTAL, ECA_AM_FEELING_EXPERIMENTAL
220dnl ---
221AC_ARG_ENABLE(experimental,
222	      [  --enable-experimental	  Enable experimental code (default = no)],
223	      [
224	      case "$enableval" in
225	        y | yes)
226		  AC_MSG_RESULT(yes)
227		  experimental=yes
228		;;
229
230		n | no)
231		  AC_MSG_RESULT(no)
232		  experimental=no
233		;;
234
235		*)
236		  AC_MSG_ERROR([Invalid parameter value for --enable-experimental: $enableval])
237		;;
238	      esac
239	      ])
240if test x$experimental = xyes; then
241    AC_DEFINE([ECA_FEELING_EXPERIMENTAL], 1, [enable experimental features])
242fi
243AM_CONDITIONAL(ECA_AM_FEELING_EXPERIMENTAL, test x$experimental = xyes)
244
245dnl ------------------------------------------------------------------
246
247dnl ---
248dnl Sets the ecasound prefix variable
249dnl
250dnl defines: ECA_PREFIX, ECA_S_PREFIX
251dnl ---
252
253dnl Define ecaprefix, prefer user-specified prefix if given
254if test "x${prefix}" = "xNONE"; then
255    ecaprefix=${ac_default_prefix}
256else
257    ecaprefix=${prefix}
258fi
259ECA_S_PREFIX=${ecaprefix}
260
261AC_SUBST(ECA_S_PREFIX)
262AC_DEFINE_UNQUOTED([ECA_PREFIX], "${ecaprefix}", [Ecasound configure script prefix])
263
264dnl ------------------------------------------------------------------
265
266dnl ---
267dnl Check whether to enable design-by-contract assertations
268dnl
269dnl modifies: AM_CXXFLAGS, AM_CFLAGS
270dnl ---
271
272AC_MSG_CHECKING(whether to check design-by-contract assertions)
273enable_dbc_d=yes
274AC_ARG_ENABLE(dbc,
275[  --disable-dbc		  Don't check design-by-contract assertions (default = check)],
276  [
277    case "$enableval" in
278      y | yes)
279        AC_MSG_RESULT(yes)
280	enable_dbc_d=yes
281      ;;
282
283      n | no)
284        AC_MSG_RESULT(no)
285	enable_dbc_d=no
286      ;;
287
288      *)
289        AC_MSG_ERROR([Invalid parameter value for --enable-dbc: $enableval])
290      ;;
291    esac
292 ],[
293    AC_MSG_RESULT(yes)
294 ]
295)
296if test x$enable_dbc_d = xyes; then
297AM_CXXFLAGS="$AM_CXXFLAGS -DENABLE_DBC"
298AM_CFLAGS="$AM_CFLAGS -DENABLE_DBC"
299fi
300
301dnl ------------------------------------------------------------------
302
303dnl ---
304dnl Check whether to disable effects
305dnl
306dnl defines: ECA_AM_DISABLE_EFFECTS, ECA_DISABLE_EFFECTS
307dnl ---
308
309AC_MSG_CHECKING(whether to enable effects)
310AC_ARG_ENABLE(effects,
311[  --disable-effects	  Disable effects (default = no)],
312  [
313    echo "Enableval: ${enableval}."
314    case "$enableval" in
315      y | yes)
316        AC_MSG_RESULT(yes)
317	enable_effects_d=yes
318      ;;
319
320      n | no)
321        AC_MSG_RESULT(no)
322	enable_effects_d=no
323      ;;
324
325      *)
326        AC_MSG_ERROR([Invalid parameter value for --enable-effects: $enableval])
327      ;;
328    esac
329  ],[
330    AC_MSG_RESULT(yes)
331    enable_effects_d=yes
332  ]
333)
334AM_CONDITIONAL(ECA_AM_DISABLE_EFFECTS, test x$enable_effects_d = xno)
335if test x$enable_effects_d = xno; then
336    AC_DEFINE([ECA_DISABLE_EFFECTS], 1, [disable all effects])
337fi
338
339dnl ------------------------------------------------------------------
340
341dnl ---
342dnl Check for extra compile flags
343dnl
344dnl modifies: ECA_S_EXTRA_CPPFLAGS, ECA_S_EXTRA_LIBS
345dnl ---
346
347AC_ARG_WITH(extra-cppflags,
348	[  --with-extra-cppflags=FLAGS pass extra flags to cpp ],
349	[
350	    ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${withval}"
351	])
352AC_ARG_WITH(extra-libs,
353	[  --with-extra-libs=FLAGS pass extra flags to linker ],
354	[
355	    ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${withval}"
356	])
357
358dnl ------------------------------------------------------------------
359
360dnl ---
361dnl Check for LFS (--with-largefile, --disable-largefile
362dnl
363dnl NOTE: AC_CHECK_LARGEFILE is defined in acinlude.m4 and
364dnl       use AC_SYS_LARGEFILE to perform the check.
365dnl
366dnl Refs:
367dnl   http://www.gnu.org/software/hello/manual/autoconf/System-Services.html
368dnl   http://ac-archive.sourceforge.net/largefile/future.html
369dnl
370dnl defines: enable_largefile
371dnl ---
372AC_CHECK_LARGEFILE
373
374dnl ------------------------------------------------------------------
375
376
377dnl ------------------------------------------------------------------
378
379dnl ---
380dnl Check for OSS driver support
381dnl
382dnl defines: ECA_COMPILE_OSS, ECA_AM_COMPILE_OSS
383dnl ---
384
385AC_CHECK_HEADER(sys/soundcard.h,oss_support=yes,oss_support=no)
386AC_ARG_ENABLE(oss,
387              [  --disable-oss		  Disable OSS (default = no)],
388	      [
389	      case "$enableval" in
390	        y | yes)
391		  AC_MSG_RESULT(yes)
392		  oss_support=yes
393		;;
394
395		n | no)
396		  AC_MSG_RESULT(no)
397		  oss_support=no
398		;;
399
400		*)
401		  AC_MSG_ERROR([Invalid parameter value for --enable-oss: $enableval])
402		;;
403	      esac
404	      ])
405AM_CONDITIONAL(ECA_AM_COMPILE_OSS, test x$oss_support = xyes)
406if test x$oss_support = xyes; then
407    AC_DEFINE([ECA_COMPILE_OSS], 1, [enable OSS audio input/output])
408fi
409
410dnl ---
411dnl Disabling OSS trigger functions
412dnl
413dnl defines: ECA_DISABLE_OSS_TRIGGER
414dnl ---
415AC_ARG_ENABLE(osstrigger,
416	      [  --disable-osstrigger 	  Disable the use of OSS trigger functions (default = no)],
417	      [
418	      case "$enableval" in
419	        y | yes)
420		  AC_MSG_RESULT(yes)
421		  osstrigger=yes
422		;;
423
424		n | no)
425		  AC_MSG_RESULT(no)
426		  osstrigger=no
427		;;
428
429		*)
430		  AC_MSG_ERROR([Invalid parameter value for --enable-osstrigger: $enableval])
431		;;
432	      esac
433	      ])
434if test x$osstrigger = xyes; then
435    AC_DEFINE([ECA_DISABLE_OSS_TRIGGER], 1, [disable use of OSS trigger API])
436fi
437
438dnl ------------------------------------------------------------------
439
440dnl --
441dnl Check for aRts support
442dnl
443dnl defines: ECA_AM_COMPILE_ARTS, ECA_COMPILE_ARTS
444dnl modifies: ECA_S_EXTRA_CPPFLAGS, ECA_S_EXTRA_LIBS
445dnl --
446AC_PATH_PROG(ARTSC_CONFIG,artsc-config,none)
447if test x$ARTSC_CONFIG = xnone; then
448  arts_support=no
449else
450  arts_support=yes
451  ECA_ARTSC_CFLAGS="`$ARTSC_CONFIG --cflags`"
452  ECA_ARTSC_LIBS="`$ARTSC_CONFIG --libs`"
453fi
454
455if test x$arts_support = xyes; then
456  old_LIBS=$LIBS
457  LIBS="$LIBS $ECA_ARTSC_LIBS"
458  old_CFLAGS=$CFLAGS
459  CFLAGS="$CFLAGS $ECA_ARTSC_CFLAGS"
460  AC_LANG_C
461  AC_TRY_LINK(
462  [ #include <artsc.h> ],
463  [
464	arts_init();
465	return 0;
466  ],
467  [ /bin/true ],
468  [ arts_support=no ]
469  )
470  AC_LANG_CPLUSPLUS
471  LIBS=${old_LIBS}
472  CFLAGS=${old_CFLAGS}
473fi
474
475AC_ARG_ENABLE(arts,
476	      [  --disable-arts	  Disable aRts support (default = no)],
477	      [
478	      case "$enableval" in
479	        y | yes)
480		  AC_MSG_RESULT(yes)
481		  arts_support=yes
482		;;
483
484		n | no)
485		  AC_MSG_RESULT(no)
486		  arts_support=no
487		;;
488
489		*)
490		  AC_MSG_ERROR([Invalid parameter value for --enable-arts: $enableval])
491		;;
492	      esac
493	      ])
494AM_CONDITIONAL(ECA_AM_COMPILE_ARTS, test x$arts_support = xyes)
495if test x$arts_support = xyes; then
496    ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${ECA_ARTSC_CFLAGS}"
497    ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${ECA_ARTSC_LIBS}"
498    AC_DEFINE([ECA_COMPILE_ARTS], 1, [enable aRts support])
499fi
500
501dnl ------------------------------------------------------------------
502
503dnl --
504dnl Check for libsamplerate
505dnl
506dnl defines: ECA_AM_COMPILE_SAMPLERATE, ECA_COMPILE_SAMPLERATE
507dnl modifies: ECA_S_EXTRA_CPPFLAGS, ECA_S_EXTRA_LIBS
508dnl --
509AC_CHECK_HEADER(samplerate.h,samplerate_support=yes,samplerate_support=no)
510AC_ARG_WITH(libsamplerate,
511	    [  --with-libsamplerate=DIR	Compile against libsamplerate installed in DIR],
512	    [
513	        ECA_SAMPLERATE_LIBS="-L${withval}/lib"
514		ECA_SAMPLERATE_INCLUDES="-I${withval}/include"
515		samplerate_support=yes
516	    ])
517AC_ARG_ENABLE(libsamplerate,
518	      [  --disable-libsamplerate Disable libsamplerate support (default = no)],
519	      [
520	      case "$enableval" in
521	        y | yes)
522		  AC_MSG_RESULT(yes)
523		  samplerate_support=yes
524		;;
525
526		n | no)
527		  AC_MSG_RESULT(no)
528		  samplerate_support=no
529		;;
530
531		*)
532		  AC_MSG_ERROR([Invalid parameter value for --enable-samplerate: $enableval])
533		;;
534	      esac
535	      ])
536AM_CONDITIONAL(ECA_AM_COMPILE_SAMPLERATE, test x$samplerate_support = xyes)
537
538if test x$samplerate_support = xyes; then
539    ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${ECA_SAMPLERATE_INCLUDES}"
540    ECA_SAMPLERATE_LIBS="${ECA_SAMPLERATE_LIBS} -lsamplerate"
541    ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${ECA_SAMPLERATE_LIBS}"
542    AC_DEFINE([ECA_COMPILE_SAMPLERATE], 1, [enable libsamplerate support])
543fi
544
545dnl ------------------------------------------------------------------
546
547dnl --
548dnl Checks for pyecasound
549dnl
550dnl defines: ECA_S_PYTHON_INCLUDES, ECA_S_PYTHON_DLMODULES,
551dnl          ECA_AM_PYECASOUND_CEXT, ECA_AM_PYECASOUND_INSTALL
552dnl --
553
554dnl default impl depends on target platform
555pyecasound_support=${eca_platform_python_impl}
556
557AC_ARG_ENABLE(pyecasound,
558	      [  --enable-pyecasound 	  Enable compilation of pyecasound (default = python)],
559	      [
560	      case "$enableval" in
561	        y | yes)
562		  pyecasound_support=python
563		;;
564
565		n | no | none)
566		  pyecasound_support=none
567		;;
568
569		python)
570		  pyecasound_support=python
571		;;
572
573		*)
574		  pyecasound_support=python
575		;;
576	      esac
577	      ])
578
579dnl --
580dnl Python interpreter and installation prefix
581
582AC_PATH_PROG(PYTHONPATH,python,none)
583if test x$PYTHONPATH = xnone; then
584  pyecasound_support=none
585  python_install_prefix=""
586else
587  python_install_prefix=`python -c "import sys; print (sys.prefix)"`
588fi
589
590dnl --
591dnl Python modules
592
593AC_MSG_CHECKING([for Python libraries])
594AC_ARG_WITH(python-modules,
595	    [  --with-python-modules=DIR install Python modules in DIR])
596
597if test "X$with_python_modules" = "X"
598then
599    if test x${python_install_prefix} != x${ecaprefix} -a \
600            x${ecaprefix} != x/usr -a \
601	    x${ecaprefix} != x/usr/local ; then
602        pyecasound_support=none
603	AC_MSG_RESULT([none])
604	if test x$PYTHONPATH != xnone; then
605	    python_prefix_tmp=`python -c "import sys; print (sys.prefix + '/lib/python' + sys.version[[:3]])"`
606	else
607	    python_prefix_tmp="DIR"
608	fi
609        AC_MSG_WARN([
610	***
611	*** Python modules won't be installed as the module install prefix does
612	*** not match ecasound's build prefix! To override, set python
613	*** module directory explicitly (for example
614	*** "--with-python-modules=${python_prefix_tmp}").
615	***
616	])
617    else
618        pymoddirs="/usr/local/lib /usr/lib"
619        dnl -- Double-brackets to espace the real brackets
620        pymoddirsmore=`python -c "import sys; print (sys.prefix + '/lib/python' + sys.version[[:3]])"`
621        pymoddirs="$pymoddirs $pymoddirsmore"
622	AC_MSG_RESULT($pymoddirs)
623    fi
624else
625    pymoddirs=$with_python_modules
626    AC_MSG_RESULT($pymoddirs)
627fi
628
629dnl ---
630dnl a hack to support broken debian python installs
631
632AC_ARG_ENABLE(python-force-site-packages,
633	      [  --enable-python-force-site-packages force install Python modules into site-packages even when it doesn't exist [default=no] ],
634	      [
635	      case "$enableval" in
636	        y | yes)
637		  AC_MSG_RESULT(yes)
638		  python_force_site_packages=yes
639		;;
640
641		n | no)
642		  AC_MSG_RESULT(no)
643		  python_force_site_packages=no
644		;;
645
646		*)
647		  AC_MSG_ERROR([Invalid parameter value for --enable-python-force-site-packages: $enableval])
648		;;
649	      esac
650	      ])
651
652AC_FIND_FILE(lib-dynload,$pymoddirs,ECA_S_PYTHON_MODULES)
653dnl Use site-packages in preference if it is there.
654if test -d $ECA_S_PYTHON_MODULES/site-packages -o "X$python_force_site_packages" = "Xyes"
655then
656    ECA_S_PYTHON_MODULES=$ECA_S_PYTHON_MODULES/site-packages
657    ECA_S_PYTHON_DLMODULES=$ECA_S_PYTHON_MODULES
658else
659    ECA_S_PYTHON_DLMODULES=$ECA_S_PYTHON_MODULES/lib-dynload
660fi
661AC_SUBST(ECA_S_PYTHON_MODULES)
662AC_SUBST(ECA_S_PYTHON_DLMODULES)
663
664dnl if test x$disable_pyecasound = xyes ; then pyecasound_support=no ; fi
665AM_CONDITIONAL(ECA_AM_PYECASOUND_CEXT, test x$pyecasound_support = xc)
666AM_CONDITIONAL(ECA_AM_PYECASOUND_INSTALL, test x$pyecasound_support != xnone)
667
668dnl ------------------------------------------------------------------
669
670dnl --
671dnl Checks for rubyecasound
672dnl
673dnl defines: ECA_S_RUBY_SITEDIR,
674dnl          ECA_AM_RUBYECASOUND_INSTALL
675dnl --
676
677dnl default to enabled if Ruby interpreter available
678rubyecasound_support=yes
679
680AC_ARG_ENABLE(rubyecasound,
681	      [  --enable-rubyecasound	  Enable rubyecasound (default = yes)],
682	      [
683	      case "$enableval" in
684	        y | yes)
685		  rubyecasound_support=yes
686		;;
687
688		n | no | none)
689		  rubyecasound_support=no
690		;;
691
692		*)
693		  rubyecasound_support=no
694		;;
695	      esac
696	      ])
697
698dnl --
699dnl Ruby interpreter and installation prefix
700
701AC_PATH_PROG(RUBYPATH,ruby,none)
702if test x$RUBYPATH = xnone; then
703  rubyecasound_support=no
704  ECA_S_RUBY_SITEDIR=""
705else
706  ECA_S_RUBY_SITEDIR="`ruby -e 'require "rbconfig"; include RbConfig; print CONFIG[["sitedir"]] + "/" + CONFIG[["MAJOR"]] + "." + CONFIG[["MINOR"]]'`"
707fi
708
709AC_SUBST(ECA_S_RUBY_SITEDIR)
710AM_CONDITIONAL(ECA_AM_RUBYECASOUND_INSTALL, test x$rubyecasound_support = xyes)
711
712dnl ------------------------------------------------------------------
713
714echo "------------------------------------------------------------------"
715echo "3. Section: Programs "
716echo "------------------------------------------------------------------"
717
718dnl ------------------------------------------------------------------
719
720AC_CHECK_CXX_NAMESPACE_SUPPORT
721
722dnl ------------------------------------------------------------------
723
724dnl --
725dnl Autotools and libtool
726dnl --
727AC_LANG_C
728dnl do not add 'AC_DISABLE_SHARED' as pyecasound needs shared
729dnl objects at link time (note that all the major libs are static)
730AC_PROG_LIBTOOL
731AC_LANG_CPLUSPLUS
732
733dnl ------------------------------------------------------------------
734
735echo "------------------------------------------------------------------"
736echo "4. Section: Libraries"
737echo "------------------------------------------------------------------"
738
739dnl ---
740dnl Check system libraries
741dnl ---
742
743dnl switch to C for testing
744AC_LANG_C
745dnl see also section 7 - functions
746AC_SEARCH_LIBS(inet_ntoa, socket nsl,, AC_MSG_ERROR([*** required inet_ntoa() function not found! ***]))
747AC_SEARCH_LIBS(nanosleep, rt posix4)
748AC_SEARCH_LIBS(sched_setscheduler, rt posix4)
749AC_SEARCH_LIBS(socket, socket nsl,, AC_MSG_ERROR([*** required socket() function not found! ***]))
750AC_SEARCH_LIBS(sin, m,, AC_MSG_ERROR([*** required sin() function not found! ***]))
751AC_SEARCH_LIBS(dlopen, dl,, AC_MSG_ERROR([*** required dlopen() function not found! ***]))
752dnl switch back to C++
753AC_LANG_CPLUSPLUS
754
755dnl ------------------------------------------------------------------
756
757dnl ---
758dnl Checks for ncurses/termcap
759dnl
760dnl defines: ECA_AM_USE_NCURSES, ECA_AM_USE_TERMCAP, ECA_USE_NCURSES_H,
761dnl          ECA_USE_CURSES_H, ECA_HAVE_NCURSES_CURSES_H
762dnl ---
763
764dnl switch to C for testing
765AC_LANG_C
766
767AC_CHECK_LIB(ncurses, main, termcap_library=ncurses,
768	AC_CHECK_LIB(termcap, main, termcap_library=termcap,
769		termcap_library=none))
770
771AC_ARG_ENABLE(ncurses,
772	      [  --disable-ncurses	  Disable ncurses (default = no)],
773	      [
774	      case "$enableval" in
775	        y | yes)
776		  AC_MSG_RESULT(yes)
777		  termcap_library=ncurses
778		;;
779
780		n | no)
781		  AC_MSG_RESULT(no)
782		  termcap_library=none
783		;;
784
785		*)
786		  AC_MSG_ERROR([Invalid parameter value for --enable-ncurses: $enableval])
787		;;
788	      esac
789	      ])
790
791AM_CONDITIONAL(ECA_AM_USE_NCURSES, test $termcap_library = ncurses)
792AM_CONDITIONAL(ECA_AM_USE_TERMCAP, test $termcap_library = termcap)
793
794if test x$termcap_library = xtermcap; then
795    AC_CHECK_HEADER(curses.h,
796        AC_DEFINE([ECA_USE_CURSES_H], 1, [use ncurses.h for curses interface]),
797	AC_MSG_ERROR([*** curses.h not found! Try with "./configure --disable-ncurses". ***]))
798fi
799
800if test x$termcap_library = xncurses; then
801    AC_CHECK_HEADER(ncurses/ncurses.h,
802        AC_DEFINE([ECA_USE_NCURSES_NCURSES_H], 1, [ncurses headers are installed in ncurses subdir <ncurses/ncurses.h>]),
803        [
804	    AC_CHECK_HEADER(ncurses.h,
805		AC_DEFINE([ECA_USE_NCURSES_H], 1, [use curses.h for curses interface]),
806		AC_MSG_ERROR([*** Neither ncurses.h or ncurses/ncurses.h found! Try with "./configure --disable-ncurses". ***]))
807	])
808fi
809
810if test $termcap_library = xnone ; then
811    eca_platform_curses_support=no
812fi
813
814dnl switch back to C++
815AC_LANG_CPLUSPLUS
816
817dnl ------------------------------------------------------------------
818
819dnl ---
820dnl Audiofile library
821dnl
822dnl defines: ECA_AM_COMPILE_AUDIOFILE, ECA_COMPILE_AUDIOFILE
823dnl modifies: ECA_S_EXTRA_LIBS
824dnl ---
825AC_CHECK_LIB(audiofile,main,af_support=yes,af_support=no)
826AC_ARG_ENABLE(audiofile,
827  [  --disable-audiofile	  Disable libaudiofile (default = no)],
828  [
829    case "$enableval" in
830      y | yes)
831        AC_MSG_RESULT(yes)
832	af_support=yes
833      ;;
834
835      n | no)
836        AC_MSG_RESULT(no)
837	af_support=no
838      ;;
839
840      *)
841        AC_MSG_ERROR([Invalid parameter value for --enable-audiofile: $enableval])
842      ;;
843    esac
844 ]
845)
846AM_CONDITIONAL(ECA_AM_COMPILE_AUDIOFILE, test x$af_support = xyes)
847
848if test x$af_support = xyes; then
849    ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} -laudiofile"
850    AC_DEFINE([ECA_COMPILE_AUDIOFILE], 1, [enable libaudiofile support])
851fi
852
853dnl ------------------------------------------------------------------
854
855dnl ---
856dnl Libsndfile support
857dnl
858dnl defines: ECA_AM_COMPILE_SNDFILE, ECA_COMPILE_SNDFILE
859dnl ---
860AC_CHECK_LIB(sndfile,main,sndfile_support=yes,sndfile_support=no)
861AC_ARG_ENABLE(sndfile,
862  [  --disable-sndfile	  Disable libsndfile (default = no)],
863  [
864    case "$enableval" in
865      y | yes)
866        AC_MSG_RESULT(yes)
867	sndfile_support=yes
868      ;;
869
870      n | no)
871        AC_MSG_RESULT(no)
872	sndfile_support=no
873      ;;
874
875      *)
876        AC_MSG_ERROR([Invalid parameter value for --enable-sndfile: $enableval])
877      ;;
878    esac
879  ]
880)
881
882if test x$sndfile_support = xyes; then
883  AC_LANG_C
884  AC_TRY_LINK(
885  [ #include <sndfile.h> ],
886  [
887	SF_INFO sfinfo;
888	sfinfo.frames = 0;
889	return 0;
890  ],
891  [ /bin/true ],
892  [
893    sndfile_support=no
894    AC_MSG_WARN([Found an old version of libsndfile. Libsndfile 1.0.0 or newer is required.])
895  ]
896  )
897  AC_LANG_CPLUSPLUS
898fi
899
900AM_CONDITIONAL(ECA_AM_COMPILE_SNDFILE, test x$sndfile_support = xyes)
901
902if test x$sndfile_support = xyes; then
903    ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} -lsndfile"
904    AC_DEFINE([ECA_COMPILE_SNDFILE], 1, [enable libsndfile support])
905fi
906
907dnl ------------------------------------------------------------------
908
909dnl ---
910dnl Check for ALSA driver support
911dnl
912dnl defines: ECA_AM_COMPILE_ALSA
913dnl ---
914
915AC_ARG_ENABLE(alsa,
916              [  --disable-alsa	  Disable ALSA (default = no)],
917	      [
918	      case "$enableval" in
919	        y | yes)
920		  AC_MSG_RESULT(yes)
921		  alsa_support=yes
922		;;
923
924		n | no)
925		  AC_MSG_RESULT(no)
926		  alsa_support=no
927		;;
928
929		*)
930		  AC_MSG_ERROR([Invalid parameter value for --enable-alsa: $enableval])
931		;;
932	      esac
933	      ])
934if test x$alsa_support = x; then
935    AC_CHECK_LIB(asound, snd_pcm_delay,
936		 alsa_support=yes,
937	         [
938		   alsa_support=no
939		   AC_MSG_WARN([ALSA version older than 0.9.0 not supported - update to a newer version or compile with --disable-alsa])
940		 ])
941fi
942AC_LANG_C
943AC_SEARCH_LIBS(snd_pcm_open, asound)
944AC_CHECK_FUNCS(snd_pcm_sw_params_set_tstamp_type)
945AC_LANG_CPLUSPLUS
946
947AM_CONDITIONAL(ECA_AM_COMPILE_ALSA, test x$alsa_support = xyes)
948
949if test x$alsa_support = xyes; then
950    ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} -lasound"
951    AC_DEFINE([ECA_COMPILE_ALSA], 1, [enable ALSA support])
952fi
953
954dnl ------------------------------------------------------------------
955
956AC_CHECK_JACK
957ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${ECA_S_JACK_INCLUDES}"
958ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${ECA_S_JACK_LIBS}"
959
960dnl ------------------------------------------------------------------
961
962dnl ---
963dnl Check for already installed libkvutils
964dnl
965dnl defines: ECA_AM_KVUTILS_INSTALLED
966dnl ---
967AC_CHECK_LIB(kvutils,main,kvutils_installed=yes,kvutils_installed=no)
968AM_CONDITIONAL(ECA_AM_KVUTILS_INSTALLED, test x$kvutils_installed = xyes)
969
970dnl ------------------------------------------------------------------
971
972dnl --
973dnl Check whether to use an already installed readline library
974dnl
975dnl defines: ECA_AM_SYSTEM_READLINE, ECA_S_READLINE_INCLUDES,
976dnl          ECA_S_READLINE_LIBS
977dnl --
978
979AC_MSG_CHECKING(whether to build with system readline)
980AC_ARG_ENABLE(sys_readline,
981  [  --enable-sys-readline	  Compile with system readline (default=yes)],
982  [
983    case "$enableval" in
984      y | yes)
985        AC_MSG_RESULT(yes)
986        enable_sysreadline=yes
987      ;;
988
989      n | no)
990        AC_MSG_RESULT(no)
991        enable_sysreadline=no
992      ;;
993
994      *)
995        AC_MSG_ERROR([Invalid parameter value for --enable-sys-readline: $enableval])
996      ;;
997    esac
998  ],
999  [
1000    AC_MSG_RESULT(yes)
1001    enable_sysreadline=yes
1002  ]
1003)
1004
1005dnl Check for readline.h or readline/readline.h (same with history.h)
1006dnl and for readline and history libraries
1007
1008if test x$enable_sysreadline = xyes; then
1009  AC_CHECK_HEADER(readline.h, ECA_S_READLINE_INCLUDES=/usr/include,
1010    [AC_CHECK_HEADER(readline/readline.h,
1011		     ECA_S_READLINE_INCLUDES=/usr/include/readline,
1012      [
1013        AC_MSG_WARN([*** readline headers not installed ***])
1014	enable_sysreadline=no
1015      ])])
1016
1017  AC_CHECK_HEADER(history.h,,
1018    [AC_CHECK_HEADER(readline/history.h,,
1019      [
1020        AC_MSG_WARN([*** readline history headers not installed ***])
1021	enable_sysreadline=no
1022      ])
1023    ])
1024
1025  if test x${termcap_library} = xnone; then
1026     readline_extra_libs="";
1027  else
1028     readline_extra_libs="-l${termcap_library}"
1029  fi
1030
1031  AC_CHECK_LIB(readline, main, ECA_S_READLINE_LIBS="-lreadline",
1032    [
1033      AC_MSG_WARN([*** readline support not installed ***])
1034      enable_sysreadline=no
1035    ], ${readline_extra_libs})
1036
1037  AC_CHECK_LIB(history, main, ECA_S_READLINE_LIBS="${ECA_S_READLINE_LIBS} -lhistory",
1038    [
1039      AC_MSG_WARN([*** readline support not installed ***])
1040      enable_sysreadline=no
1041    ], ${readline_extra_libs})
1042
1043else
1044  ECA_S_READLINE_INCLUDES=""
1045  ECA_S_READLINE_LIBS=""
1046fi
1047
1048# if no readline library is found, disable platform-curses toggle
1049if test $enable_sysreadline = no ; then
1050    eca_platform_curses_support=no
1051fi
1052
1053AM_CONDITIONAL(ECA_AM_SYSTEM_READLINE, test x$enable_sysreadline = xyes)
1054AC_SUBST(ECA_S_READLINE_INCLUDES)
1055AC_SUBST(ECA_S_READLINE_LIBS)
1056
1057dnl ------------------------------------------------------------------
1058
1059dnl --
1060dnl Check for liboil (optional)
1061dnl --
1062
1063PKG_CHECK_MODULES([LIBOIL], [liboil-0.3], HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
1064AC_MSG_CHECKING(whether to use liboil)
1065AC_ARG_ENABLE(liboil,
1066  [  --enable-liboil		Use liboil if available (default=no)],
1067  [
1068    case "$enableval" in
1069      y | yes)
1070        if test "x${HAVE_LIBOIL}" = xyes ; then
1071	  AC_MSG_RESULT(yes)
1072          enable_liboil=yes
1073        else
1074          AC_MSG_RESULT(no)
1075	  AC_MSG_WARN([--enable-liboil given but liboil library not available])
1076        fi
1077      ;;
1078
1079      n | no)
1080        AC_MSG_RESULT(no)
1081        enable_liboil=no
1082      ;;
1083
1084      *)
1085        AC_MSG_ERROR([Invalid parameter value for --enable-liboil: $enableval])
1086      ;;
1087    esac
1088  ],
1089  [
1090    if test "x${HAVE_LIBOIL}" = xyes ; then
1091      AC_MSG_RESULT(yes)
1092      enable_liboil=yes
1093    else
1094      AC_MSG_RESULT(no)
1095      AC_MSG_WARN([disabling liboil as library devel files are not available])
1096    fi
1097  ]
1098)
1099
1100if test "x${enable_liboil}" = "xyes" ; then
1101  ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${LIBOIL_CFLAGS}"
1102  ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${LIBOIL_LIBS}"
1103  AC_DEFINE([ECA_USE_LIBOIL], 1, [Use liboil])
1104fi
1105
1106dnl ------------------------------------------------------------------
1107
1108dnl --
1109dnl Check for liblilv (optional)
1110dnl --
1111
1112AC_MSG_CHECKING(whether to use liblilv for LV2 support)
1113AC_ARG_ENABLE(liblilv,
1114  [  --enable-liblilv		Use liblilv if available (default=yes)],
1115  [
1116    case "$enableval" in
1117      y | yes)
1118        PKG_CHECK_MODULES([LIBLILV], [lv2 lilv-0], HAVE_LIBLILV=yes, HAVE_LIBLILV=no)
1119        if test "x${HAVE_LIBLILV}" = xyes ; then
1120	  AC_MSG_RESULT(yes)
1121          enable_liblilv=yes
1122        else
1123          AC_MSG_RESULT(no)
1124	  AC_MSG_WARN([--enable-liblilv given but liblilv library not available])
1125        fi
1126      ;;
1127
1128      n | no)
1129        AC_MSG_RESULT(no)
1130        enable_liblilv=no
1131      ;;
1132
1133      *)
1134        AC_MSG_ERROR([Invalid parameter value for --enable-liblilv: $enableval])
1135      ;;
1136    esac
1137  ],
1138  [
1139    PKG_CHECK_MODULES([LIBLILV], [lv2core lilv-0 > 0.5.0 ], HAVE_LIBLILV=yes, HAVE_LIBLILV=no)
1140    enable_liblilv=${HAVE_LIBLILV}
1141    AC_MSG_RESULT(${enable_liblilv})
1142  ]
1143)
1144
1145if test "x${enable_liblilv}" = "xyes" ; then
1146  ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${LIBLILV_CFLAGS}"
1147  ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${LIBLILV_LIBS}"
1148  AC_DEFINE([ECA_USE_LIBLILV], 1, [Use liblilv for LV2 support])
1149fi
1150
1151dnl ------------------------------------------------------------------
1152
1153dnl --
1154dnl Check for liblo (optional)
1155dnl --
1156
1157PKG_CHECK_MODULES([LIBLO], [liblo], HAVE_LIBLO=yes, HAVE_LIBLO=no)
1158AC_MSG_CHECKING(whether to use liblo for OSC support)
1159AC_ARG_ENABLE(liblo,
1160  [  --enable-liblo		Use liblo if available (default=yes)],
1161  [
1162    case "$enableval" in
1163      y | yes)
1164        if test "x${HAVE_LIBLO}" = xyes ; then
1165	  AC_MSG_RESULT(yes)
1166          enable_liblo=yes
1167        else
1168          AC_MSG_RESULT(no)
1169	  AC_MSG_WARN([--enable-liblo given but liblo library not available])
1170        fi
1171      ;;
1172
1173      n | no)
1174        AC_MSG_RESULT(no)
1175        enable_liblo=no
1176      ;;
1177
1178      *)
1179        AC_MSG_ERROR([Invalid parameter value for --enable-liblo: $enableval])
1180      ;;
1181    esac
1182  ],
1183  [
1184    enable_liblo=${HAVE_LIBLO}
1185    AC_MSG_RESULT(${enable_liblo})
1186  ]
1187)
1188
1189if test "x${enable_liblo}" = "xyes" ; then
1190  ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${LIBLO_CFLAGS}"
1191  ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${LIBLO_LIBS}"
1192  AC_DEFINE([ECA_USE_LIBLO], 1, [Use liblo for OSC support])
1193fi
1194
1195dnl ------------------------------------------------------------------
1196
1197dnl All non-std external libraries that libecasound depends on
1198AC_SUBST(ECA_S_EXTRA_CPPFLAGS)
1199AC_SUBST(ECA_S_EXTRA_LIBS)
1200
1201dnl ------------------------------------------------------------------
1202
1203echo "------------------------------------------------------------------"
1204echo "5. Section: Headers"
1205echo "------------------------------------------------------------------"
1206
1207dnl ------------------------------------------------------------------
1208
1209dnl ---
1210dnl Checks for system header files.
1211dnl ---
1212AC_HEADER_TIME
1213dnl Note! Header filenames must be on the same line!
1214AC_CHECK_HEADERS(dlfcn.h errno.h fcntl.h regex.h signal.h unistd.h sys/poll.h sys/stat.h sys/socket.h sys/time.h sys/types.h sys/wait.h sys/select.h,,
1215		 AC_MSG_ERROR([*** not all required header files were found ***]))
1216AC_CHECK_HEADERS(execinfo.h features.h inttypes.h locale.h ladspa.h sched.h stdint.h sys/mman.h termios.h)
1217
1218dnl ------------------------------------------------------------------
1219
1220dnl ---
1221dnl C++ specific checks
1222dnl ---
1223dnl AC_HEADER_STDC
1224AC_HEADER_STDC
1225dnl --- AC_CHECK_HEADER(stl.h,,
1226dnl ---	AC_MSG_WARN([** C++/STL header files not found! ***]))
1227AC_LANG_CPLUSPLUS
1228AC_CHECK_HEADER(map,nostlmap=0,nostlmap=1)
1229if test "x$nostlmap" = "x1" ; then
1230	AC_MSG_ERROR([C++ header files not found! Searched for '<map>' (STL).])
1231fi
1232
1233dnl ------------------------------------------------------------------
1234
1235echo "------------------------------------------------------------------"
1236echo "6. Section: Typedefs and structures"
1237echo "------------------------------------------------------------------"
1238
1239dnl ---
1240dnl Checks for typedefs, structures, and compiler characteristics.
1241dnl ---
1242
1243AC_LANG_C
1244dnl AC_C_CONST
1245AC_C_BIGENDIAN
1246AC_TYPE_SIZE_T
1247AC_LANG_CPLUSPLUS
1248
1249dnl ------------------------------------------------------------------
1250
1251echo "------------------------------------------------------------------"
1252echo "7. Section: Functions"
1253echo "------------------------------------------------------------------"
1254
1255dnl ---
1256dnl Checks for functions.
1257dnl ---
1258AC_LANG_C
1259AC_FUNC_MMAP
1260AC_CHECK_FUNCS(execvp gettimeofday pthread_mutexattr_init,,
1261		      AC_MSG_ERROR([*** not all required library functions were found ***]))
1262
1263AC_CHECK_FUNCS(clock_gettime)
1264AC_CHECK_FUNCS(mlockall)
1265AC_CHECK_FUNCS(munlockall)
1266AC_CHECK_FUNCS(nanosleep)
1267AC_CHECK_FUNCS(pause)
1268AC_CHECK_FUNCS(posix_memalign)
1269AC_CHECK_FUNCS(pthread_self)
1270AC_CHECK_FUNCS(pthread_getschedparam)
1271AC_CHECK_FUNCS(pthread_setschedparam)
1272AC_CHECK_FUNCS(pthread_sigmask)
1273AC_CHECK_FUNCS(pthread_kill)
1274AC_CHECK_FUNCS(sched_get_priority_max)
1275AC_CHECK_FUNCS(sched_getparam)
1276AC_CHECK_FUNCS(sched_getscheduler)
1277AC_CHECK_FUNCS(sched_setscheduler)
1278AC_CHECK_FUNCS(setlocale)
1279AC_CHECK_FUNCS(sigprocmask)
1280AC_CHECK_FUNCS(sigwait)
1281AC_CHECK_FUNCS(usleep)
1282AC_LANG_CPLUSPLUS
1283
1284dnl ------------------------------------------------------------------
1285
1286dnl ---
1287dnl Check whether to disable all use of shared libs
1288dnl
1289dnl Note! Must be run after all other autoconf tests as
1290dnl       'ld' doesn't understand -all-static.
1291dnl
1292dnl defines: ECA_STATIC_ONLY, ECA_AM_STATIC_ONLY
1293dnl modifies: AM_CXXFLAGS, AM_CFLAGS, AM_LDFLAGS
1294dnl ---
1295AC_ARG_ENABLE(all-static,
1296	      [  --enable-all-static	  Build only static binaries (default = no)],
1297	      [
1298	      case "$enableval" in
1299	        y | yes)
1300		  AC_MSG_RESULT(yes)
1301		  enable_all_static=yes
1302		;;
1303
1304		n | no)
1305		  AC_MSG_RESULT(no)
1306		  enable_all_static=no
1307		;;
1308
1309		*)
1310		  AC_MSG_ERROR([Invalid parameter value for --enable-all-static: $enableval])
1311		;;
1312	      esac
1313	      ])
1314if test x$enable_all_static = xyes; then
1315    AC_DEFINE([ECA_ALL_STATIC], 1, [disable all use of shared libs])
1316    AM_CXXFLAGS="$AM_CXXFLAGS -static"
1317    AM_CFLAGS="$AM_CFLAGS -static"
1318    AM_LDFLAGS="$AM_LDFLAGS -Bstatic -all-static"
1319fi
1320AM_CONDITIONAL(ECA_AM_ALL_STATIC, test x$enable_all_static = xyes)
1321
1322dnl ------------------------------------------------------------------
1323
1324dnl ---
1325dnl Checks for platform options
1326dnl ---
1327
1328if test $eca_platform_curses_support == yes ; then
1329    AC_DEFINE([ECA_PLATFORM_CURSES], 1, [enable ecasound curses console interface])
1330fi
1331
1332dnl ------------------------------------------------------------------
1333
1334echo "------------------------------------------------------------------"
1335echo "8. Section: Output"
1336echo "------------------------------------------------------------------"
1337
1338dnl ---
1339dnl Create output files
1340dnl ---
1341
1342AC_OUTPUT([
1343Makefile
1344libecasound/Makefile
1345libecasound/libecasound-config
1346libecasound/plugins/Makefile
1347libecasoundc/Makefile
1348libecasoundc/libecasoundc-config
1349pyecasound/Makefile
1350rubyecasound/Makefile
1351ecasound/Makefile
1352ecatools/Makefile
1353kvutils/Makefile
1354Documentation/Makefile
1355Documentation/users_guide/Makefile
1356Documentation/programmers_guide/Makefile
1357examples/Makefile
1358])
1359
1360dnl ---
1361dnl Print summary of the configured options
1362dnl ---
1363
1364echo "-----------------------------------------------------------------"
1365echo "Following packages are now configured:"
1366echo "ecasound:               yes (ecasound,libecasound,libecasoundc)"
1367echo "ecatools:               yes"
1368if test x$pyecasound_support != xnone ; then
1369	if test x$pyecasound_support = xc ; then
1370		echo "pyecasound:             yes (as Python C extension module)"
1371	else
1372		echo "pyecasound:             yes (as native Python module)"
1373	fi
1374else
1375	echo "pyecasound:             no"
1376fi
1377if test x$rubyecasound_support = xyes ; then
1378	echo "rubyecasound:           yes"
1379else
1380	echo "rubyecasound:           no"
1381fi
1382echo "libkvutils:             yes"
1383
1384echo "-----------------------------------------------------------------"
1385echo "Compiler options:"
1386echo "CFLAGS:                 $AM_CFLAGS $CFLAGS"
1387echo "CXXFLAGS:               $AM_CXXFLAGS $CXXFLAGS"
1388echo "CPPFLAGS:               $AM_CPPFLAGS $CPPFLAGS"
1389echo "LDFLAGS:                $AM_LDFLAGS $LDFLAGS"
1390
1391echo "-----------------------------------------------------------------"
1392echo "Following features were selected:"
1393if test x$include_debug = xyes ; then
1394	echo "Debugging info:         yes"
1395else
1396	echo "Debugging info:         no"
1397fi
1398if test x$enable_effects_d = xyes ; then
1399	echo "Effects enabled:        yes"
1400else
1401	echo "Effects enabled:        no"
1402fi
1403if test x$termcap_library = xtermcap ; then
1404	echo "Termcap:                termcap"
1405fi
1406if test x$termcap_library = xncurses; then
1407	echo "Termcap:                ncurses"
1408fi
1409if test x$termcap_library = xnone; then
1410	echo "Termcap:                none"
1411fi
1412if test x$enable_sysreadline = xyes ; then
1413	echo "Use system readline:    yes"
1414else
1415	echo "Use system readline:    no"
1416fi
1417	echo "Use curses interface:   $eca_platform_curses_support"
1418if test x$af_support = xyes ; then
1419	echo "Libaudiofile:           yes"
1420else
1421	echo "Libaudiofile:           no"
1422fi
1423if test x$sndfile_support = xyes ; then
1424	echo "Libsndfile:             yes"
1425else
1426	echo "Libsndfile:             no"
1427fi
1428if test x$alsa_support = xyes ; then
1429	echo "ALSA support:           yes"
1430else
1431	echo "ALSA support:           no"
1432fi
1433if test x$oss_support = xyes ; then
1434	echo "OSS support:            yes"
1435else
1436	echo "OSS support:            no"
1437fi
1438if test x$arts_support = xyes ; then
1439	echo "aRts support:           yes"
1440else
1441	echo "aRts support:           no"
1442fi
1443if test x$jack_support = xyes ; then
1444	echo "JACK support:           yes"
1445else
1446	echo "JACK support:           no"
1447fi
1448if test x$samplerate_support = xyes ; then
1449	echo "Libsamplerate support   yes"
1450else
1451	echo "Libsamplerate support   no"
1452fi
1453if test x$enable_liblilv = xyes ; then
1454	echo "LV2 (liblilv) support:  yes"
1455else
1456	echo "LV2 (liblilv) support:  no"
1457fi
1458if test x$enable_liboil = xyes ; then
1459	echo "Liboil support:         yes"
1460else
1461	echo "Liboil support:         no"
1462fi
1463if test x$enable_liblo = xyes ; then
1464	echo "Liblo (OSC) support:    yes"
1465else
1466	echo "Liblo (OSC) support:    no"
1467fi
1468
1469echo "-----------------------------------------------------------------"
1470echo "Following directories are used:"
1471echo "Directory prefix:       "$ECA_S_PREFIX
1472if test x$pyecasound_support = xc ; then
1473	echo "Python include dir:     "$ECA_S_PYTHON_INCLUDES
1474fi
1475if test x$pyecasound_support != xnone ; then
1476	echo "Python module dir:      "$ECA_S_PYTHON_MODULES
1477fi
1478if test x$rubyecasound_support != xnone ; then
1479	echo "Ruby module dir:        "$ECA_S_RUBY_SITEDIR
1480fi
1481if test "x$ECA_S_EXTRA_CPPFLAGS" != "x" ; then
1482	echo "Extra headers:          "$ECA_S_EXTRA_CPPFLAGS
1483fi
1484if test "x$ECA_S_EXTRA_LIBS" != "x" ; then
1485	echo "Extra libs:            "$ECA_S_EXTRA_LIBS
1486fi
1487
1488echo "-------------------------------------------------------------------"
1489echo "Type 'make' to compile the package and 'make install' to install."
1490echo "Remember to use GNU Make, often installed as 'gmake'."
1491echo "-------------------------------------------------------------------"
1492
1493dnl ------------------------------------------------------------------
1494dnl X. Section: End
1495dnl ------------------------------------------------------------------
1496