1 dnl TiMidity++ -- MIDI to WAVE converter and player
2 dnl Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>
3 dnl Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>
5 dnl This program is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 2 of the License, or
8 dnl (at your option) any later version.
10 dnl This program is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 dnl GNU General Public License for more details.
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with this program; if not, write to the Free Software
17 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 dnl configure.in created from configure.scan
20 dnl by URABE, Shyouhei <root@mput.dip.jp> on 2002.07.06
23 dnl CFLAGS - Flags for compile.
24 dnl CPPFLAGS - Flags for cpp
25 dnl LDFLAGS - Flags for linker
26 dnl ac_cpp: $CPP $CPPFLAGS
27 dnl ac_compile: ${CC-cc} -c $CFLAGS $CPPFLAGS
28 dnl ac_link: ${CC-cc} -o * $CFLAGS $CPPFLAGS $LDFLAGS *.c $LIBS
29 dnl EXTRACFLAGS - Extra flags to compile. Adds to CFLAGS.
30 dnl EXTRADEFS - Extra define macros. Adds to CPPFLAGS.
31 dnl EXTRALIBS - Extra libraries Adds to LIBS.
32 dnl SYSEXTRAS - Additional source codes to compile.
33 dnl lib_*_opt - Optional libraries. Adds to LIBS.
35 dnl - add to -L LDFLAGS
37 dnl - add to -I CPPFLAGS
38 dnl CYGNUS - `yes' if cygnus windows environment.
39 dnl MSYS - `yes' if Mingw windows environment.
43 dnl tcltk_dep - make dependencies for tcl/tk interface
45 dnl so - File extension of shared object library.
46 dnl SHLD - Linker to make shared object library.
47 dnl SHLDFLAGS - Link flags to link shared object library.
48 dnl SHCFLAGS - Additional flags to compile shared object library.
51 # This is a autoscan-generated configure.scan.
54 # "AC_INIT(timidity/timidity.c)" is obsolate yet.
55 AC_INIT([TiMidity++],[2.15.0],[timidity-talk@lists.sourceforge.net],[TiMidity++])
56 AC_CONFIG_AUX_DIR([autoconf])
58 AM_INIT_AUTOMAKE([gnu dist-bzip2])
59 AC_CONFIG_SRCDIR([timidity/timidity.c])
60 AC_CONFIG_HEADERS([config.h interface.h])
63 SHELL=${CONFIG_SHELL-"/bin/sh"}
65 TCLSH=${TCLSH-"tclsh"}
67 dnl to use contains() macro (see autoconf/acinclude.m4)
70 # Check for compiler options -- such as debug flags.
72 dnl "--enable-debug" turnes -g on.
73 AC_MSG_CHECKING(if --enable-debug option specified)
75 AS_HELP_STRING([--enable-debug], [Build a debugging version.]),
76 [timidity_cv_debug="yes"], [timidity_cv_debug="no"])
77 if test "x$timidity_cv_debug" = xyes; then
78 AC_DEFINE(DEBUG,1,Define to 1 if you are in debug mode)
81 if test "x$timidity_cv_debug" = "xno"; then
82 AC_DEFINE(NDEBUG,1,Define to 1 if you are NOT in debug mode)
84 AC_MSG_RESULT($timidity_cv_debug)
86 if test "x$CFLAGS" = "x"; then
90 dnl --with-x turns on if `--with-x' is NOT specified.
91 if test "x$with_x" = "x"; then
97 # Checking gcc environment
98 for i in `echo $LIBRARY_PATH|sed -e 's,:, ,g'`; do
99 LDFLAGS="$LDFLAGS -L${i}"
101 for i in `echo $C_INCLUDE_PATH|sed -e 's,:, ,g'`; do
102 CPPFLAGS="$CPPFLAGS -I${i}"
105 # add $prefix if specified.
106 if test "x$prefix" != xNONE -a "x$prefix" != "x$ac_default_prefix" -a "x$prefix" != "x/usr"; then
107 LDFLAGS="-L$prefix/lib $LDFLAGS"
108 SHLDFLAGS="-L$prefix/lib $SHLDFLAGS"
109 CPPFLAGS="-I$prefix/include $CPPFLAGS"
112 dnl add --with-includes, --with-libraries
113 AC_ARG_WITH(includes,
114 AS_HELP_STRING([--with-includes=DIR], [Specify include directories (colon separated)]),
116 for i in `echo "$withval"|sed -e 's,:, ,g'`; do
119 CPPFLAGS="$j$CPPFLAGS"
122 AC_ARG_WITH(libraries,
123 AS_HELP_STRING([--with-libraries=DIR], [Specify library directories (colon separated)]),
125 for i in `echo "$withval"|sed -e 's,:, ,g'`; do
132 dnl a bit hairly yet.(20020718:mput)
133 dnl CPPFLAGS="$CPPFLAGS \$(DEF_PKGDATADIR) \$(DEF_PKGLIBDIR) \$(DEF_DEFAULT_PATH)"
134 AC_ARG_WITH(default-path,
135 AS_HELP_STRING([--with-default-path=DIR], [Where timidity.cfg is (PREFIX/share/timidity)]),
136 [pkgdatadir=$withval],
138 if test "x$prefix" != "xNONE"; then
139 pkgdatadir='${prefix}/share/timidity'
141 pkgdatadir='/usr/local/share/timidity'
144 tmpdefpath="`eval \"echo ${pkgdatadir}\"`"
145 AC_DEFINE_UNQUOTED(DEFAULT_PATH,"$tmpdefpath",place to install patches)
146 AC_DEFINE(PKGDATADIR,DEFAULT_PATH,a compatibility matter. ignore it.)
148 AC_ARG_WITH(module-dir,
149 AS_HELP_STRING([--with-module-dir=DIR], [Where to install interfaces (PREFIX/lib/timidity)]),
150 [pkglibdir=$withval],
152 if test "x$prefix" != "xNONE"; then
153 pkglibdir='${prefix}/lib/timidity'
155 pkglibdir='/usr/local/lib/timidity'
158 tmplibdir="`eval \"echo ${pkglibdir}\"`"
159 AC_DEFINE_UNQUOTED(PKGLIBDIR,"$tmplibdir",place to install modules)
161 AC_ARG_WITH(xaw-resource-prefix,
162 AS_HELP_STRING([--with-xaw-resource-prefix=DIR], [What prefix to install X resource files to (optional, used by Xaw/Motif interfaces)]),
163 [xawresdir=$withval], [])
164 AM_CONDITIONAL(XAW_INSTALL_RESOURCE_FILES, test "x$xawresdir" != "x")
167 # Checks for programs.
170 AC_PROG_GCC_TRADITIONAL
173 AC_CHECK_PROG([AR], [${ac_tool_prefix}ar], [${ac_tool_prefix}ar])
176 AC_CHECK_PROG([WINDRES], [${ac_tool_prefix}windres], [${ac_tool_prefix}windres])
177 CHECK_COMPILER_OPTION(rdynamic)
179 if test "x$NOCFLAGS" = xyes; then
180 if test "x$GCC" = xyes; then
187 # Checks for target dependencies
190 AS_HELP_STRING([--with-elf], [create ELF shared object instead of AOUT]),
191 [ ELFFORMAT=$withval ], [ ELFFORMAT="yes" ])
194 # AS_HELP_STRING([--with-simd], [create SIMD friendly binary (default is no) ]),
195 # [ SIMD=$withval ], [ SIMD="no" ])
200 test -n "$SHLD" || SHLD="ld -b"
204 dnl IRIX cc needs -signed option
205 case ".$CC" in .cc*) EXTRACFLAGS="-signed";; esac
206 test -n "$SHLD" || SHLD="cc -shared -all"
210 test -n "$SHLD" || SHLD="$CC -shared -nostartfiles"
215 dnl EXTRALIBS="$EXTRALIBS -lxpg4"
216 test -n "$SHLD" || SHLD="ld -Bshareable"
220 if test "$ELFFORMAT" = yes; then
221 test -n "$SHLD" || SHLD="ld -Bshareable"
224 SHLDFLAGS="-L/usr/X11R6/lib/aout $SHLDFLAGS"
225 test -n "$SHLD" || SHLD="env OBJFORMAT=aout ld -shared"
227 dnl EXTRALIBS="$EXTRALIBS -lxpg4"
232 # EXTRALIBS="$EXTRALIBS -lxpg4"
233 # test -n "$SHLD" || SHLD="ld -Bshareable"
237 *-*-cygwin*|*-*-mingw*)
247 EXTRADEFS="-D__W32__"
248 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}"
249 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/speex"
250 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/rcpcv"
251 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/portaudio/pa_common"
252 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/portmidi/pm_common"
253 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/portmidi/porttime"
254 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/libao"
255 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/libmpg123/include"
256 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/opus"
257 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/pdcurses"
258 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/ogg"
259 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/vorbis"
260 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/OggFLAC"
261 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/FLAC"
262 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/gogo"
263 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/Winamp"
264 CPPFLAGS="$CPPFLAGS -I. -I../cygwin/"
268 # test -n "$SHLD" || SHLD="tlink32 -Tpd"
269 test -n "$SHLD" || SHLD="BCC32 -WD"
271 BORLANDC_LDFLAGS="kernel32.lib winspool.lib comdlg32.lib advapi32.lib oleaut32.lib uuid.lib odbc32.lib ws2_32.lib user32.lib shell32.lib cw32mt.lib"
272 BORLANDC_START='C0X32.OBJ'
273 CFLAGS="$CFLAGS -tWM -VM"
274 EXTRADEFS="$EXTRADEFS -D_WINDOWS -DWIN32"
277 test -n "$SHLD" || SHLD="polink -DLL"
280 *" -MT "*) NODEF="-nodefaultlib:pocrt.lib -nodefaultlib:crt.lib -defaultlib:crtmt.lib" ;;
281 *" -MD "*) NODEF="-nodefaultlib:crtmt.lib -nodefaultlib:crt.lib -defaultlib:pocrt.lib" ;;
282 *) CFLAGS="$CFLAGS -MT"; NODEF="-nodefaultlib:pocrt.lib -nodefaultlib:crtmt.lib -defaultlib:crt.lib" ;;
284 POCC_LDFLAGS="$NODEF winmm.lib ws2_32.lib user32.lib kernel32.lib shell32.lib gdi32.lib comctl32.lib comdlg32.lib ole32.lib advapi32.lib oldnames.lib"
285 CFLAGS="$CFLAGS -Ze -D__POCC__OLDNAMES"
286 EXTRADEFS="$EXTRADEFS -D_WINDOWS -DWIN32"
289 test -n "$SHLD" || SHLD="dmc -WD"
291 DMC_LDFLAGS="winmm.lib ws2_32.lib user32.lib kernel32.lib shell32.lib gdi32.lib comctl32.lib comdlg32.lib ole32.lib advapi32.lib"
292 CFLAGS="$CFLAGS -mn -j0"
294 EXTRADEFS="$EXTRADEFS -D_WINDOWS -DWIN32"
296 "xwcc386_w.sh "*|xwcc386)
298 CFLAGS="$CFLAGS -br -bm -5s -zk0 -zp=16 -w=4 -D_WINDOWS -DWIN32 -DINCLUDE_WINDOWS_H"
301 EXTRALIBS="$EXTRALIBS kernel32.lib winspool.lib comdlg32.lib advapi32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib user32.lib shell32.lib"
304 test -n "$SHLD" || SHLD="link -dll"
307 *" -MT "*) NODEF="-nodefaultlib:msvcrt.lib -nodefaultlib:msvcrtd.lib -nodefaultlib:libcmtd.lib -nodefaultlib:libc.lib -nodefaultlib:libcd.lib" ;;
308 *" -MD "*) NODEF="-nodefaultlib:libcmt.lib -nodefaultlib:libcmtd.lib -nodefaultlib:msvcrtd.lib -nodefaultlib:libc.lib -nodefaultlib:libcd.lib" ;;
309 *" -MTd "*) NODEF="-nodefaultlib:msvcrt.lib -nodefaultlib:msvcrtd.lib -nodefaultlib:libcmt.lib -nodefaultlib:libc.lib -nodefaultlib:libcd.lib" ;;
310 *" -MDd "*) NODEF="-nodefaultlib:libcmt.lib -nodefaultlib:libcmtd.lib -nodefaultlib:msvcrt.lib -nodefaultlib:libc.lib -nodefaultlib:libcd.lib" ;;
311 *) CFLAGS="$CFLAGS -MT"; NODEF="-nodefaultlib:msvcrt.lib -nodefaultlib:msvcrtd.lib -nodefaultlib:libcmtd.lib -nodefaultlib:libc.lib -nodefaultlib:libcd.lib" ;;
313 VCPP_LDFLAGS="-nologo -incremental:no $NODEF kernel32.lib winspool.lib comdlg32.lib advapi32.lib oleaut32.lib uuid.lib ws2_32.lib user32.lib shell32.lib"
314 CFLAGS="$CFLAGS -nologo -Zp16 -W3 -GX -Ob2"
315 EXTRADEFS="$EXTRADEFS -DNDEBUG -D_WINDOWS -DWIN32 -DMBCS -D_MT -YX -FD -c"
317 x*gcc*) test -n "$SHLD" || SHLD="gcc -mdll"; MINGWGCC=yes ;;
318 *) test -n "$SHLD" || SHLD="unknown" ;;
322 lib_user32_test=-luser32
326 test -n "$SHLD" || SHLD="ld -Bdynamic -G"
330 EXTRADEFS="-DSOLARIS"
331 test -n "$SHLD" || SHLD="/usr/ccs/bin/ld -G"
335 test -n "$SHLD" || SHLD="/usr/ccs/bin/ld -G"
339 if test "x$SIMD" = xyes; then
340 AC_DEFINE(USE_ALTIVEC,1,Define to 1 if you use altivec)
341 # EXTRACFLAGS="$EXTRACFLAGS -faltivec -mabi=altivec -maltivec" # for GCC3.
342 EXTRACFLAGS="$EXTRACFLAGS -faltivec"
344 AC_DEFINE(USE_ALTIVEC,0,Define to 1 if you use altivec)
346 CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
347 LDOPTS="-dynamic -undefined suppress -flat_namespace $LDOPTS"
348 test -n "$SHLD" || SHLD="$CC -dynamic -bundle -undefined suppress -flat_namespace $LDFLAGS"
353 if test "x$GCC" = xyes; then
356 SHLD="ld -Bdynamic -G"
363 dnl AC_EXEEX # obsolate
365 # Checks for libraries.
367 AC_CHECK_LIB(socket,socket)
368 AC_CHECK_LIB(dl,dlopen,lib_dl_opt=-ldl)
369 AC_CHECK_LIB(objc,NSLinkModule,lib_dl_opt=-lobjc) # Mac OS X need this.
370 if test "x$VCPP" != xyes && test "x$BORLANDC" != xyes && test "x$WATCOM_C" != xyes && test "x$POCC" != xyes; then
371 AC_CHECK_LIB(xpg4,setlocale) # Mac OS X (and maybe NetBSD) need this.
373 AC_CHECK_FUNCS(gethostbyname,,[ AC_CHECK_LIB(nsl,gethostbyname) ])
376 dnl Xft for trace window
378 AS_HELP_STRING([--enable-xft], [Enable use of Xft in X trace mode]))
381 [ --with-xawlib=lib Try to link to these xaw widget libraries by the
382 order specified by the comma separated value list:
387 default is --with-xawlib=xaw3d,xaw],
388 [ with_xawlib="$withval" ], [ with_xawlib="xaw3d,xaw" ])
391 if test "x$with_x" = xyes; then
392 if test "x$have_x" = "xno"; then
393 if test "x$x_config_flag" = xyes; then
394 AC_MSG_ERROR(Could not configure X)
396 AC_MSG_WARN(Could not configure X)
400 if test "x$with_x" = xyes -a "x$have_x" = xyes; then
401 if test "x$x_libraries" != "x"; then
402 ldflags_x_opt="-L$x_libraries"
403 LDFLAGS="$LDFLAGS $ldflags_x_opt"
404 SHLDFLAGS="$SHLDFLAGS $ldflags_x_opt"
408 if test "x$x_includes" != "x"; then
409 CPPFLAGS="$CPPFLAGS -I$x_includes"
412 AC_CHECK_LIB(X11,XOpenDisplay,
413 AC_DEFINE(HAVE_LIBX11,1,Define to 1 if you have the `X11' library (-lX11).))
414 AC_MSG_CHECKING(X11 version 6)
415 AC_CACHE_VAL(timidity_cv_x11_version_6,
416 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]], [[
417 #if XlibSpecificationRelease < 6
420 ]])],[timidity_cv_x11_version_6=yes],[timidity_cv_x11_version_6=no]))
421 if test "$timidity_cv_x11_version_6" = "yes"; then
422 AC_MSG_RESULT(6 or newer)
423 dnl AC_DEFINE(HAVE_X11R6)
425 AC_MSG_RESULT(before 6)
428 dnl checking order required
430 AC_CHECK_LIB(Xext,XShapeCombineMask,have_xext=yes; LIBS="-lXext $LIBS",have_xext=no)
431 AC_CHECK_LIB(ICE,IceConnectionNumber)
432 AC_CHECK_LIB(SM,SmcOpenConnection,have_xprelibs=yes; LIBS="-lSM $LIBS",have_xprelibs=no)
433 AC_CHECK_LIB(Xt,XtVaAppInitialize,have_xt=yes; LIBS="-lXt $LIBS",have_xt=no)
434 AC_CHECK_LIB(Xmu,XmuInternAtom,LIBS="-lXmu $LIBS")
435 AC_CHECK_FUNCS(XmuRegisterExternalAgent)
436 if test "x$enable_xft" = xyes; then
437 AC_CHECK_LIB(Xft,XftInit,
438 AC_DEFINE(HAVE_LIBXFT,1,Define to 1 if you have the 'Xft' library.),
441 for i in `echo $with_xawlib | sed 's/,/ /g'`; do
444 AC_CHECK_LIB(Xaw,XawInitializeWidgetSet,have_xaw=yes,have_xaw=no)
447 AC_CHECK_LIB(Xaw3d,XawInitializeWidgetSet,
449 AC_CHECK_HEADER(X11/Xaw3d/Tip.h,
450 AC_DEFINE(HAVE_XAW3D_TIP,1,Define to 1 if you have the <X11/Xaw3d/Tip.h> header file.),
457 AC_CHECK_LIB(neXtaw,XawInitializeWidgetSet,have_xaw=next,have_xaw=no)
460 AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData)
461 AC_CHECK_LIB(XawPlus,XawInitializeWidgetSet,have_xaw=plus,have_xaw=no)
467 if test "x$have_xaw" != "xno"; then break; fi
469 AC_CHECK_LIB(Xm,XmCreateForm,have_xm=yes,have_xm=no)
470 AC_CHECK_FUNCS(XShmCreatePixmap)
473 dnl End of X configure
475 # Checks for header files.
479 if test "x$WATCOM_C" != xyes ; then
526 if test "x$DMC" != xyes ; then
533 [X11/extensions/XShm.h X11/Xmu/ExtAgent.h],[],[],[
534 #ifdef HAVE_X11_XLIB_H
535 #include <X11/Xlib.h>
538 AC_CHECK_HEADER(string.h,, [ AC_DEFINE(NO_STRING_H,1,Define to 1 if you do not have <string.h>.)])
540 # Checks for typedefs, structures, and compiler characteristics.
541 if test "x$WATCOM_C" != xyes ; then
551 if test "x$DMC" != xyes ; then
554 if test "x$POCC" != xyes ; then
559 # Older versions of MinGW do not define ssize_t in sys/types
560 AC_MSG_CHECKING([for ssize_t])
561 AC_CACHE_VAL(ac_cv_type_$1,
562 [AC_EGREP_CPP([ssize_t@<:@^a-zA-Z_0-9@:>@],
563 [#include <sys/types.h>
567 #endif], [ac_cv_type_ssize_t=yes], [ac_cv_type_ssize_t=no])])
569 AC_MSG_RESULT([$ac_cv_type_ssize_t])
570 if test $ac_cv_type_ssize_t = yes; then
571 AC_DEFINE(HAVE_SSIZE_T, 1,
572 [Define to 1 if the system has the type `ssize_t'.])
575 dnl keyword "volatile" check
576 AC_CACHE_CHECK(volatile declaration,timidity_cv_type_volatile,
577 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [[volatile int x]])],[timidity_cv_type_volatile=yes],[timidity_cv_type_volatile=no]))
578 if test $timidity_cv_type_volatile = no; then
579 AC_DEFINE(NO_VOLATILE,1,Define to 1 if you cannot use volatile keyword)
582 dnl union usenum check
583 AC_CACHE_CHECK(union semun declaration,timidity_cv_type_union_semun,
584 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
585 #include <sys/types.h>
588 ]], [[union semun x]])],[timidity_cv_type_union_semun=yes],[timidity_cv_type_union_semun=no]))
589 if test $timidity_cv_type_union_semun = yes; then
590 AC_DEFINE(HAVE_UNION_SEMUN,1,Define to 1 if you use semun keyword)
593 dnl Cygnus and Mingw memory struct optiontest
594 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
598 AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
599 if test -z "$ac_cv_prog_CC"; then
602 our_gcc="$ac_cv_prog_CC"
604 case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
606 if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
607 msnative_struct='-fnative-struct'
611 if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
612 msnative_struct='-mms-bitfields'
616 if test x"$msnative_struct" = "x"; then
617 AC_MSG_RESULT([no way])
618 AC_MSG_WARN([produced binary will be incompatible with windows' GUI ])
620 CFLAGS="$CFLAGS $msnative_struct"
621 CPPFLAGS="$CPPFLAGS $msnative_struct"
622 AC_MSG_RESULT([${msnative_struct}])
629 dnl Cygnus Mingw32 mmsystem check
630 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
631 AC_CACHE_CHECK(Cygwin new mmsystem,timidity_cv_header_new_mmsystem,
632 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
633 #define _WIN32_WINDOWS 0x0400
635 #include <mmsystem.h>
636 ]], [[return WOM_OPEN != 0x3BB]])],[timidity_cv_header_new_mmsystem=yes],[timidity_cv_header_new_mmsystem=no]))
637 if test $timidity_cv_header_new_mmsystem = yes; then
638 AC_DEFINE(HAVE_NEW_MMSYSTEM,1,Define to 1 if you have <mmsystem.h> file)
642 # Checks for library functions.
643 AC_FUNC_ERROR_AT_LINE
644 if test "x$DMC" != xyes ; then
648 if test "x$DMC" != xyes ; then
651 AC_FUNC_SETVBUF_REVERSED
653 if test "x$GCC" == xyes; then
654 AC_DEFINE(VOID_SIGHANDLER)
656 if test "x$VCPP" != xyes && test "x$BORLANDC" != xyes && test "x$WATCOM_C" != xyes && test "x$POCC" != xyes; then
659 AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(HAVE_PTHREAD_CREATE,1,[Define to 1 if you have the `pthread_create' function.])])
699 if test "x$VCPP" = xyes; then
700 AC_DEFINE(RETSIGTYPE,int)
701 AC_DEFINE(HAVE_GETCWD,1)
703 if test "x$POCC" = xyes; then
704 AC_DEFINE(HAVE_GETCWD,1)
705 AC_DEFINE(HAVE_GETHOSTBYNAME,1)
706 AC_DEFINE(HAVE_POPEN,1)
707 AC_DEFINE(HAVE_SELECT,1)
708 AC_DEFINE(HAVE_SNPRINTF,1)
709 AC_DEFINE(HAVE_STRDUP,1)
710 AC_DEFINE(HAVE_STRERROR,1)
711 AC_DEFINE(HAVE_STRCASECMP,1)
712 AC_DEFINE(HAVE_STRSTR,1)
713 AC_DEFINE(HAVE_SOCKET,1)
714 AC_DEFINE(HAVE_VSNPRINTF,1)
715 AC_DEFINE(HAVE_GETOPT,1)
716 AC_DEFINE(TIMID_VERSION,[$(PACKAGE_VERSION)],[for windows gui])
718 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes || test "x$WATCOM_C" = xyes; then
719 AC_DEFINE(HAVE_GETHOSTBYNAME,1)
720 AC_DEFINE(HAVE_POPEN,1)
721 AC_DEFINE(popen,_popen,[for VC])
722 AC_DEFINE(pclose,_pclose,[for VC])
723 AC_DEFINE(HAVE_SELECT,1)
724 AC_DEFINE(HAVE_SNPRINTF,1)
725 AC_DEFINE(HAVE_STRDUP,1)
726 AC_DEFINE(HAVE_STRERROR,1)
727 AC_DEFINE(HAVE_STRNCASECMP,1)
728 AC_DEFINE(HAVE_STRSTR,1)
729 AC_DEFINE(snprintf,_snprintf,[for VC])
730 AC_DEFINE(HAVE_SOCKET,1)
731 AC_DEFINE(HAVE_VSNPRINTF,1)
732 dnl AC_DEFINE(vsnprintf,_vsnprintf,[for VC])
733 AC_DEFINE(TIMID_VERSION,[$(PACKAGE_VERSION)],[for windows gui])
736 AC_CHECK_FUNC(getopt_long,
737 AC_DEFINE([HAVE_GETOPT_LONG],1,[Define to 1 if you have `getopt_long' function])
738 tm_cv_needgetopt="no",
739 tm_cv_needgetopt="yes")
740 AM_CONDITIONAL([NEEDGETOPT], test "x$tm_cv_needgetopt" = xyes)
742 AC_CHECK_FUNC(open_memstream, [
743 AC_DEFINE([HAVE_OPEN_MEMSTREAM],1,[Define to 1 if you have `open_memstream' function])
747 dnl *** va_copy checks (from GLIB)
750 AC_CACHE_CHECK([for an implementation of va_copy()],lib_cv_va_copy,[
751 AC_RUN_IFELSE([AC_LANG_SOURCE([[
753 void f (int i, ...) {
754 va_list args1, args2;
756 va_copy (args2, args1);
757 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
759 va_end (args1); va_end (args2);
765 [lib_cv_va_copy=yes],
770 AC_CACHE_CHECK([for an implementation of __va_copy()],lib_cv___va_copy,[
771 AC_RUN_IFELSE([AC_LANG_SOURCE([[
773 void f (int i, ...) {
774 va_list args1, args2;
776 __va_copy (args2, args1);
777 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
779 va_end (args1); va_end (args2);
785 [lib_cv___va_copy=yes],
786 [lib_cv___va_copy=no],
787 [lib_cv___va_copy=no])
790 if test "x$lib_cv_va_copy" = xyes; then
792 else if test "x$lib_cv___va_copy" = xyes; then
793 va_copy_func=__va_copy
797 if test -n "$va_copy_func"; then
798 AC_DEFINE_UNQUOTED(VA_COPY,$va_copy_func,[A 'va_copy' style function])
801 AC_CACHE_CHECK([whether va_lists can be copied by value],lib_cv_va_val_copy,[
802 AC_RUN_IFELSE([AC_LANG_SOURCE([[
804 void f (int i, ...) {
805 va_list args1, args2;
808 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
810 va_end (args1); va_end (args2);
816 [lib_cv_va_val_copy=yes],
817 [lib_cv_va_val_copy=no],
818 [lib_cv_va_val_copy=no])
821 if test "x$lib_cv_va_val_copy" = "xno"; then
822 AC_DEFINE(VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
825 # Checks on cygnus and MYSYS
826 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
827 case "$ac_cv_header_dirent_dirent_h$ac_cv_header_dirent_sys_ndir_h$ac_cv_header_dirent_sys_dir_h$ac_cv_header_dirent_ndir_h" in
829 AC_CHECK_FUNC(opendir,,
830 [ EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
833 *)EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
837 if test "x$enable_network" = "xyes"; then
838 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes || test "x$WATCOM_C" = xyes || test "x$DMC" = xyes || test "x$POCC" = xyes; then
839 EXTRALIBS="$EXTRALIBS ws2_32.lib"
840 EXTRADEFS="$EXTRADEFS -DWINSOCK"
842 AC_CHECK_FUNC(socket,,
843 WAPI_CHECK_LIB(ws2_32,WSAStartup,
844 [#include <winsock.h>],
846 [ EXTRALIBS="$EXTRALIBS -lws2_32"
847 EXTRADEFS="$EXTRADEFS -DWINSOCK" ]
854 # Checks on extra paths
857 AC_ARG_WITH(tcl-includes,
858 AS_HELP_STRING([--with-tcl-includes=DIR], [Tcl include file path]),
859 [ if test ! -d $withval; then
860 AC_MSG_WARN($withval is not found.)
862 tcl_include_dir="-I$withval"
864 AC_ARG_WITH(tcl-libs,
865 AS_HELP_STRING([--with-tcl-libs=DIR], [Tcl library file path]),
866 [ if test ! -d $withval; then
867 AC_MSG_WARN($withval is not found.)
869 tcl_libdir="-L$withval" ])
870 AC_ARG_WITH(tk-includes,
871 AS_HELP_STRING([--with-tk-includes=DIR], [Tk include file path]),
872 [ if test ! -d $withval; then
873 AC_MSG_WARN($withval is not found.)
875 tk_includes="-I$withval" ])
877 AS_HELP_STRING([--with-tk-libs=DIR], [Tk library file path]),
878 [ if test ! -d $withval; then
879 AC_MSG_WARN($withval is not found.)
881 tk_libdir="-L$withval" ])
884 AC_ARG_WITH(offix-includes,
885 AS_HELP_STRING([--with-offix-includes=DIR], [Offix include file path]),
886 [ if test ! -d $withval; then
887 AC_MSG_WARN($withval is not found.)
889 offix_include_dir="-I$withval" ])
890 AC_ARG_WITH(offix-libs,
891 AS_HELP_STRING([--with-offix-libs=DIR], [Offix include file path]),
892 [ if test ! -d $withval; then
893 AC_MSG_WARN($withval is not found.)
895 offix_lib_dir="-L$withval" ])
897 # audio encoder/decoder libraries
900 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
903 AC_DEFINE(HAVE_OGG,1, [Define to 1 if you have the <ogg/ogg.h> header file.])
904 AC_DEFINE(HAVE_LIBVORBIS,1, [Define to 1 if you have the <vorbis/codec.h> header file.])
908 AC_DEFINE(HAVE_OGG,1, [Define to 1 if you have the <ogg/ogg.h> header file.])
911 AC_DEFINE(HAVE_LIBVORBIS,1, [Define to 1 if you have the <vorbis/codec.h> header file.])
921 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
923 AC_DEFINE(HAVE_LIBFLAC,1, [Define to 1 if you have the <FLAC/all.h> header file.])
925 AC_CHECK_HEADER(FLAC/all.h, [
927 AC_DEFINE(HAVE_LIBFLAC,1, [Define to 1 if you have the <FLAC/all.h> header file.])
934 dnl if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
936 dnl AC_DEFINE(HAVE_LIBOGGFLAC,1, [Define to 1 if you have the <OggFLAC/all.h> header file.])
938 dnl AC_CHECK_HEADER(OggFLAC/all.h, [
940 dnl AC_DEFINE(HAVE_LIBOGGFLAC,1, [Define to 1 if you have the <OggFLAC/all.h> header file.])
947 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
949 AC_DEFINE(HAVE_LIBGOGO,1, [Define to 1 if you have the <gogo/gogo.h> header file.])
951 AC_CHECK_HEADER(gogo/gogo.h, [
953 AC_DEFINE(HAVE_LIBGOGO,1, [Define to 1 if you have the <gogo/gogo.h> header file.])
960 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
962 AC_DEFINE(HAVE_LIBMPG123,1, [Define to 1 if you have the <mpg123.h> header file.])
964 AC_CHECK_HEADER(mpg123.h, [
966 AC_DEFINE(HAVE_LIBMPG123,1, [Define to 1 if you have the <mpg123.h> header file.])
967 EXTRALIBS="$EXTRALIBS -lmpg123"
977 dnl default(d): auto selection
978 dnl oss(d): OSS /dev/dsp
979 dnl alsa(d): ALSA pcm device
980 dnl sun(d): SunOS /dev/audio
981 dnl hpux(d): HPUX /dev/audio
982 dnl irix(d): IRIX audio
983 dnl mme(d): OSF/1 MME
984 dnl sb_dsp(d): BSD/OS 2.0 /dev/sb_dsp
985 dnl w32(d): Windows MMS
986 dnl darwin(d): Mac OS X pcm device
987 dnl alsa(s): ALSA pcm device
988 dnl alib(A): HPUX network audio (Alib)
989 dnl nas(n): Network Audio System
992 dnl portaudio(p) PortAudio
993 dnl portaudio(O) PortAudio (w32; DirectSound)
994 dnl portaudio(P) PortAudio (w32; WDM KernelStreaming)
995 dnl portaudio(K) PortAudio (w32; WDM KernelStreaming)
996 dnl portaudio(W) PortAudio (w32; WASAPI)
997 dnl w32ks(k): Windows WDM KernelStreaming
998 dnl w32wasapi(x) Windows WASAPI
999 dnl npipe(N): Windows named pipe
1000 dnl vorbis(v): Ogg Vorbis
1001 dnl flac(F): FLAC / OggFLAC
1002 dnl opus(U): Ogg Opus
1003 dnl speex(S): Ogg Speex
1004 dnl gogo(g): MP3 GOGO
1008 dnl benchmark(b) Benchmark
1009 dnl macintosh(m) Macintosh pcm device
1010 dnl macqt(q): Macintosh QuickTime pcm device
1011 dnl aiff(a): output AIFF audio file
1012 dnl sun(u): output Sun audio file
1013 dnl raw(r): output raw sound data
1014 dnl volumecalc(V) output analyze text
1015 dnl wave(w): output RIFF WAVE sound data
1017 audio_targets='default oss alsa sun hpux irix mme sb_dsp w32 w32ks w32wasapi alib nas arts esd vorbis flac opus lame gogo portaudio npipe jack ao'
1019 AC_ARG_WITH(nas-library,
1020 AS_HELP_STRING([--with-nas-library=library], [NAS absolute library path(Don't use -laudio)]))
1021 AC_ARG_WITH(nas-includes,
1022 AS_HELP_STRING([--with-nas-includes=DIR], [NAS include files are in dir]))
1025 AC_ARG_ENABLE(audio,
1026 [ --enable-audio[=mode_list] Enable audio (Specify comma separated mode list):
1027 default: Automatically select audio device.
1029 sun: SunOS /dev/audio
1030 hpux: HPUX /dev/audio
1031 irix: IRIX audio library
1033 sb_dsp: BSD/OS 2.0 /dev/sb_dsp
1035 w32ks: Windows WDM KernelStreaming
1036 w32wasapi: Windows WASAPI
1037 darwin: Darwin CoreAudio
1038 alsa: ALSA pcm device
1039 alib: HPUX network audio (Alib)
1040 nas: NAS - Network Audio System
1042 esd: EsounD - Enlightened Sound Daemon
1043 portaudio: PortAudio
1044 npipe: Named Pipe(windows)
1048 flac: FLAC / OggFLAC
1051 gogo: MP3 GOGO (Only Windows is supported)
1052 lame: LAME (Only Windows is supported)
1053 benchmark: Benchmark
1055 [ enable_audio=$enableval
1056 have_audio_opt=yes ],
1058 have_audio_opt=no ])
1061 test "x$enable_audio" = xyes && enable_audio=default
1063 if test "x$enable_audio" != "xno"; then
1064 for i in `echo $enable_audio | sed 's/,/ /g'`; do
1065 eval "au_enable_$i=yes"
1069 dnl Turn on default output mode
1071 AC_ARG_WITH(default-output,
1072 AS_HELP_STRING([--with-default-output=<mode>],
1073 [Specify default output mode (optional):
1074 (default|alsa|alib|arts|nas|
1075 esd|wav|au|aiff|list|vorbis|flac|opus|speex|
1076 lame|gogo|portaudio|npipe|jack|ao)]),
1077 [ if test "$enable_audio" != no; then
1078 DEFAULT_PLAYMODE=$withval
1079 eval "au_enable_$DEFAULT_PLAYMODE=yes"
1081 AC_MSG_WARN([--with-default-output=$withval: audio is not enabled])
1084 dnl compatibility matters.
1085 dnl AC_ARG_ENABLE(esd,
1086 dnl [ --enable-esd EsounD (Obsoleted. Use --enable-audio=esd)],
1087 dnl [ au_enable_esd=$enableval ])
1088 dnl AC_ARG_ENABLE(nas,
1089 dnl [ --enable-nas NAS (Obsoleted. Use --enable-audio=nas)],
1090 dnl [ au_enable_nas=$enableval ])
1091 dnl AC_ARG_ENABLE(alsa,
1092 dnl [ --enable-alsa ALSA (Obsoleted. Use --enable-audio=alsa)],
1093 dnl [ au_enable_alsa=$enableval ])
1095 dnl target-specific defaults
1096 if test "x$au_enable_default" = xyes; then
1100 if test "x$DEFAULT_PLAYMODE" = "x"; then
1101 DEFAULT_PLAYMODE="alsa"
1108 au_enable_sb_dsp=yes
1110 *-*-bsdi2.1|*-*-bsdi3.?|*-*-bsdi4.?)
1141 au_enable_darwin=yes
1144 AC_MSG_WARN(No --enable-audio=default audio for $target)
1150 # Each audio mode's configurations
1152 AC_MSG_CHECKING(enable_audio=oss)
1153 if test "x$au_enable_oss" = xyes; then
1154 EXTRADEFS="$EXTRADEFS -DAU_OSS"
1155 SYSEXTRAS="$SYSEXTRAS oss_a.c"
1156 if test "x$ac_cv_header_sys_soundcard_h" = xyes; then
1157 AC_MSG_RESULT(yes - <sys/soundcard.h>)
1161 dnl <linux/soundcard.h> or <machine/soundcard.h>
1165 if test "x$ac_cv_header_soundcard_h" = xyes; then
1166 AC_MSG_RESULT(yes - <soundcard.h>)
1168 AC_MSG_WARN(<sys/soundcard.h> is not found)
1173 AC_CHECK_LIB(ossaudio,open)
1175 dnl Why OpenBSD use /dev/audio instead of /dev/dsp for OSS
1178 if test ! -e "/dev/dsp"; then
1179 oss_device=/dev/audio
1188 AC_MSG_CHECKING(enable_audio=sun)
1189 if test "x$au_enable_sun" = xyes; then
1192 if test -f /usr/demo/SOUND/libaudio.a; then
1193 EXTRALIBS="$EXTRALIBS /usr/demo/SOUND/libaudio.a"
1196 AC_MSG_RESULT(Notice: libaudio.a is not found [(ignore)])
1200 if test -f /usr/demo/SOUND/lib/libaudio.a; then
1201 EXTRALIBS="$EXTRALIBS /usr/demo/SOUND/lib/libaudio.a"
1204 AC_MSG_RESULT(Notice: libaudio.a is not found [(ignore)])
1207 *) AC_MSG_RESULT(yes)
1210 EXTRADEFS="$EXTRADEFS -DAU_SUN"
1211 SYSEXTRAS="$SYSEXTRAS sun_a.c"
1217 AC_MSG_CHECKING(enable_audio=hpux)
1218 if test "x$au_enable_hpux" = xyes; then
1220 *-*-hpux*) AC_MSG_RESULT(yes) ;;
1221 *) AC_MSG_WARN(may not work on $target) ;;
1223 EXTRADEFS="$EXTRADEFS -DAU_HPUX_AUDIO"
1224 SYSEXTRAS="$SYSEXTRAS hpux_d_a.c"
1230 AC_MSG_CHECKING(enable_audio=irix)
1231 if test "x$au_enable_irix" = xyes; then
1233 *-sgi-irix5*|*-sgi-irix6.2)
1234 EXTRADEFS="$EXTRADEFS -DAU_AUDRIV -DSGI_OLDAL"
1238 EXTRADEFS="$EXTRADEFS -DAU_AUDRIV -DSGI_NEWAL"
1241 *) AC_MSG_WARN(may not work on $target) ;;
1243 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_al.c"
1244 EXTRALIBS="$EXTRASLIBS -laudio"
1250 AC_MSG_CHECKING(enable_audio=mme)
1251 if test "x$au_enable_mme" = xyes; then
1253 *-dec-*) AC_MSG_RESULT(yes) ;;
1254 *) AC_MSG_WARN(may not work on $target) ;;
1256 EXTRADEFS="$EXTRADEFS -DAU_DEC -DAU_AUDRIV"
1257 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_mme.c"
1258 CPPFLAGS="$CPPFLAGS -I/usr/opt/MME210/include"
1259 EXTRALIBS="$EXTRALIBS /usr/opt/MME220/lib/libmme.a"
1265 AC_MSG_CHECKING(enable_audio=sb_dsp)
1266 if test "x$au_enable_sb_dsp" = xyes; then
1268 *-*-bsdi2.0) AC_MSG_RESULT(yes) ;;
1269 *) AC_MSG_WARN(may not work on $target) ;;
1271 EXTRADEFS="$EXTRADEFS -DAU_BSDI -DDEFAULT_RATE=22500"
1272 SYSEXTRAS="$SYSEXTRAS bsd20_a.c"
1278 AC_MSG_CHECKING(enable_audio=w32)
1279 if test "x$au_enable_w32" = xyes; then
1288 AC_MSG_WARN(may not work on $target)
1291 SYSEXTRAS="$SYSEXTRAS w32_a.c"
1292 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes || test "x$WATCOM_C" = xyes || test "x$DMC" = xyes || test "x$POCC" = xyes; then
1293 EXTRALIBS="$EXTRALIBS winmm.lib"
1295 EXTRALIBS="$EXTRALIBS -lwinmm"
1297 EXTRADEFS="$EXTRADEFS -DAU_W32"
1302 dnl Mac OS X / darwin-x86
1303 AC_MSG_CHECKING(enable_audio=darwin)
1304 if test "x$au_enable_darwin" = xyes; then
1305 EXTRADEFS="$EXTRADEFS -DAU_DARWIN"
1306 SYSEXTRAS="$SYSEXTRAS darwin_a.c"
1307 EXTRALIBS="$EXTRALIBS -framework CoreAudio"
1308 dnl just say yes or no :-P
1311 AC_MSG_RESULT(yes);;
1313 AC_MSG_WARN(may not work on $target)
1321 dnl alsa - Advanced Linux Sound Architecture
1322 AC_MSG_CHECKING(enable_audio=alsa)
1323 if test "x$au_enable_alsa" = xyes; then
1324 AC_MSG_RESULT([yes, configuring alsa])
1327 KEEPLDFLAGS=$LDFLAGS
1329 if test "x$alsa_found" = xyes ; then
1330 dnl AC_MSG_RESULT(yes)
1331 EXTRADEFS="$EXTRADEFS -DAU_ALSA"
1332 SYSEXTRAS="$SYSEXTRAS alsa_a.c"
1333 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ALSA_CFLAGS)
1334 LIBS="$LIBS $ALSA_LIBS"
1335 AC_CHECK_FUNCS(snd_seq_port_info_set_timestamping)
1337 AC_MSG_WARN(Couldn't configure alsa.)
1340 LDFLAGS=$KEEPLDFLAGS
1347 AC_MSG_CHECKING(enable_audio=alib)
1348 if test "x$au_enable_alib" = xyes; then
1350 *-*-hpux*) AC_MSG_RESULT(yes) ;;
1351 *) AC_MSG_WARN(may not work on $target) ;;
1353 SYSEXTRAS="$SYSEXTRAS hpux_a.c"
1354 EXTRADEFS="$EXTRADEFS -DAU_HPUX_ALIB"
1355 if test -d /opt/audio/include; then
1356 CPPFLAGS="$CPPFLAGS -I/opt/audio/include"
1358 if test -d /opt/audio/lib; then
1359 EXTRALIBS="$EXTRALIBS -L/opt/audio/lib"
1361 EXTRALIBS="$EXTRALIBS -lAlib"
1367 AC_MSG_CHECKING(enable_audio=nas)
1368 if test "x$au_enable_nas" = xyes; then
1369 if test "x$with_x" != xyes; then
1370 AC_MSG_ERROR(nas: --with-x option must be specified)
1372 EXTRADEFS="$EXTRADEFS -DAU_NAS"
1373 SYSEXTRAS="$SYSEXTRAS nas_a.c"
1375 dnl -laudio conflicts another audio library,
1376 dnl so I specify NAS library with absolete path.
1378 if test "x$with_nas_library" != "x"; then
1379 AC_MSG_RESULT($with_nas_library);
1380 EXTRALIBS="$EXTRALIBS $with_nas_library"
1383 MY_SEARCH_LIBS(AuOpenServer,
1384 [$x_libraries/libaudio.a \
1385 /usr/lib/libaudio.so \
1386 /usr/lib/libaudio.a ],
1387 [ AC_MSG_RESULT(NAS: $timidity_cv_search_AuOpenServer)
1388 EXTRALIBS="$EXTRALIBS $timidity_cv_search_AuOpenServer"],
1389 [AC_MSG_WARN(NAS library is not found.)])
1391 test "x$with_nas_includes" != "x" && CPPFLAGS="$CPPFLAGS -I$with_nas_includes"
1393 if test "x$have_xext" = xyes; then
1396 if test "x$have_xprelibs" = xyes; then
1397 lib_xprelibs_opt='-lSM -lICE'
1404 AC_MSG_CHECKING(enable_audio=arts)
1405 if test "x$au_enable_arts" = xyes; then
1406 AC_MSG_RESULT([yes, configuring aRts])
1407 dnl **** Check for aRts Sound Server ****
1408 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
1409 if test x$ARTSCCONFIG != "x" -a x$ARTSCCONFIG != x'"$ARTSCCONFIG"';
1412 for i in `$ARTSCCONFIG --cflags`
1415 -I*) ARTSC_CFLAGS="$ARTSC_CFLAGS $i";;
1418 ARTSC_LIBS=`$ARTSCCONFIG --libs`
1419 save_CFLAGS="$CFLAGS"
1420 CFLAGS="$CFLAGS $ARTSC_CFLAGS"
1421 AC_TRY_COMPILE([#include <artsc.h>],[arts_stream_t stream;],
1422 [AC_SUBST(ARTSLIBS, $ARTSC_LIBS)
1423 AC_SUBST(ARTSINCL, $ARTSC_CFLAGS)
1424 AC_DEFINE(HAVE_ARTS, 1, [Define if you have ARTS sound server])
1427 CFLAGS="$save_CFLAGS"
1430 if test "$have_arts" = "yes"; then
1431 dnl AC_MSG_RESULT(aRts: Enabled)
1432 EXTRADEFS="$EXTRADEFS -DAU_ARTS"
1433 SYSEXTRAS="$SYSEXTRAS aRts_a.c"
1434 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ARTSC_CFLAGS)
1435 LIBS="$LIBS $ARTSC_LIBS"
1437 AC_MSG_WARN(aRts: Couldn't configure)
1444 AC_MSG_CHECKING(enable_audio=esd)
1445 if test "x$au_enable_esd" = xyes; then
1446 AC_MSG_RESULT([yes, configuring esd])
1449 KEEPLDFLAGS=$LDFLAGS
1453 LDFLAGS=$KEEPLDFLAGS
1454 if test "x$no_esd" = "x"; then
1455 dnl AC_MSG_RESULT(EsounD: Enabled)
1456 EXTRADEFS="$EXTRADEFS -DAU_ESD"
1457 SYSEXTRAS="$SYSEXTRAS esd_a.c"
1458 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ESD_CFLAGS)
1459 LIBS="$LIBS $ESD_LIBS"
1461 AC_MSG_WARN(EsounD: Couldn't configure)
1468 AC_MSG_CHECKING(enable_audio=portaudio)
1469 if test "x$au_enable_portaudio" = xyes; then
1471 if test "x$CYGNUS" = xyes ||test "x$MSYS" = xyes; then
1472 AC_ARG_ENABLE(dynamic-portaudio,
1473 AS_HELP_STRING([--dynamic-portaudio], [Dynamic Link PortAudio.]),
1474 [timidity_cv_dynamic_portaudio="yes"], [timidity_cv_dynamic_portaudio="no"])
1475 if test "x$timidity_cv_dynamic_portaudio" = xyes; then
1476 SYSEXTRAS="$SYSEXTRAS portaudio_a.c w32_portaudio_dll.c"
1477 dnl EXTRALIBS="$EXTRALIBS -lportaudio"
1478 CPPFLAGS="$CPPFLAGS -I../portaudio/pa_common/"
1479 EXTRADEFS="$EXTRADEFS -DAU_PORTAUDIO -DAU_PORTAUDIO_DLL -DPORTAUDIO_V19"
1481 dnl SYSEXTRAS="$SYSEXTRAS portaudio_a.c"
1482 SYSEXTRAS="$SYSEXTRAS portaudio_a.c w32_portaudio_dll.c"
1483 dnl EXTRALIBS="$EXTRALIBS -lportaudio"
1484 CPPFLAGS="$CPPFLAGS -I../portaudio/pa_common/"
1485 dnl EXTRADEFS="$EXTRADEFS -DAU_PORTAUDIO -DPORTAUDIO_V19"
1486 EXTRADEFS="$EXTRADEFS -DAU_PORTAUDIO -DAU_PORTAUDIO_DLL -DPORTAUDIO_V19"
1489 SYSEXTRAS="$SYSEXTRAS portaudio_a.c"
1490 EXTRALIBS="$EXTRALIBS -lportaudio"
1491 EXTRADEFS="$EXTRADEFS -DAU_PORTAUDIO"
1497 dnl npipe (windows named pipe)
1498 if test "x$CYGNUS" = xyes ||test "x$MSYS" = xyes; then
1499 AC_MSG_CHECKING(enable_audio=npipe)
1500 if test "x$au_enable_npipe" = xyes; then
1502 SYSEXTRAS="$SYSEXTRAS npipe_a.c"
1503 EXTRADEFS="$EXTRADEFS -DAU_NPIPE"
1510 AC_MSG_CHECKING(enable_audio=jack)
1511 if test "x$au_enable_jack" = xyes; then
1513 SYSEXTRAS="$SYSEXTRAS jack_a.c"
1514 EXTRALIBS="$EXTRALIBS $(pkg-config --libs jack)"
1515 EXTRADEFS="$EXTRADEFS -DAU_JACK $(pkg-config --cflags jack)"
1521 AC_MSG_CHECKING(enable_audio=ao)
1522 if test "x$au_enable_ao" = xyes; then
1523 AC_MSG_RESULT([yes, configuring ao])
1525 if test "x$no_ao" = "x" ; then
1526 # AC_MSG_RESULT(yes)
1527 EXTRADEFS="$EXTRADEFS -DAU_AO"
1528 SYSEXTRAS="$SYSEXTRAS ao_a.c"
1529 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$AO_CFLAGS)
1530 LIBS="$LIBS $AO_LIBS"
1532 AC_MSG_WARN(Couldn't configure libao.)
1539 AC_MSG_CHECKING(enable_audio=vorbis)
1540 if test "x$au_enable_vorbis" = xyes; then
1541 AC_MSG_RESULT([yes, configuring vorbis])
1542 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
1543 AC_ARG_ENABLE(dynamic-vorbis,
1544 AS_HELP_STRING([--dynamic-vorbis], [Dynamic Link OggVorbis.]),
1545 [timidity_cv_dynamic_vorbis="yes"], [timidity_cv_dynamic_vorbis="no"])
1546 if test "x$timidity_cv_dynamic_vorbis" = xyes; then
1548 EXTRADEFS="$EXTRADEFS -DAU_VORBIS -DAU_VORBIS_DLL"
1549 SYSEXTRAS="$SYSEXTRAS vorbis_a.c w32g_vorbisenc_dll.c w32g_vorbis_dll.c w32g_ogg_dll.c"
1551 AC_CHECK_HEADER(vorbis/vorbisenc.h,, [
1553 EXTRADEFS="$EXTRADEFS -DAU_VORBIS"
1554 SYSEXTRAS="$SYSEXTRAS vorbis_a.c"
1561 SYSEXTRAS="$SYSEXTRAS vorbis_a.c"
1562 EXTRADEFS="$EXTRADEFS -DAU_VORBIS $OGG_CFLAGS $VORBIS_CFLAGS"
1563 EXTRALIBS="$EXTRALIBS $VORBIS_LIBS $VORBISENC_LIBS $VORBISFILE_LIBS $OGG_LIBS"
1564 if test "x$MINGWGCC" = xyes ; then
1565 EXTRADEFS="-DAU_VORBIS_DLL $EXTRADEFS"
1566 SYSEXTRAS="$SYSEXTRAS w32g_vorbisenc_dll.c w32g_vorbis_dll.c w32g_ogg_dll.c"
1569 AC_MSG_WARN([Unable to configure vorbis, but ogg is there (???)])
1572 AC_MSG_WARN(Unable to configure vorbis!)
1580 dnl libFLAC - Free Lossless Audio Codec
1581 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes ; then
1582 AC_MSG_CHECKING(enable_audio=flac)
1583 if test "x$au_enable_flac" = xyes; then
1584 AC_MSG_RESULT([yes, configuring flac])
1586 SYSEXTRAS="$SYSEXTRAS flac_a.c w32_libFLAC_dll.c w32_libOggFLAC_dll.c"
1587 EXTRADEFS="$EXTRADEFS -DAU_FLAC -DAU_FLAC_DLL -DAU_OGGFLAC"
1588 dnl AC_CHECK_HEADER(FLAC/all.h, [
1589 dnl EXTRADEFS="$EXTRADEFS -DAU_FLAC -DAU_FLAC_DLL"
1591 dnl AC_CHECK_HEADER(OggFLAC/all.h, [
1592 dnl EXTRADEFS="$EXTRADEFS -DAU_OGGFLAC -DAU_OGGFLAC_DLL"
1594 dnl AM_PATH_LIBFLAC([
1595 dnl EXTRADEFS="$EXTRADEFS -DAU_FLAC -DAU_FLAC_DLL"
1596 dnl EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$LIBFLAC_CFLAGS)
1597 dnl LIBS="$LIBS $LIBFLAC_LIBS"
1599 dnl AM_PATH_LIBOGGFLAC([
1600 dnl EXTRADEFS="$EXTRADEFS -DAU_OGGFLAC -DAU_OGGFLAC_DLL"
1601 dnl EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$LIBOGGFLAC_CFLAGS)
1602 dnl LIBS="$LIBS $LIBOGGFLAC_LIBS"
1608 AC_MSG_CHECKING(enable_audio=flac)
1609 if test "x$au_enable_flac" = xyes; then
1610 AC_MSG_RESULT([yes, configuring flac])
1611 SYSEXTRAS="$SYSEXTRAS flac_a.c"
1614 EXTRADEFS="$EXTRADEFS -DAU_FLAC"
1615 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$LIBFLAC_CFLAGS)
1616 LIBS="$LIBS $LIBFLAC_LIBS"
1618 AM_PATH_LIBOGGFLAC([
1620 EXTRADEFS="$EXTRADEFS -DAU_OGGFLAC"
1621 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$LIBOGGFLAC_CFLAGS)
1622 LIBS="$LIBS $LIBOGGFLAC_LIBS"
1630 AC_MSG_CHECKING(enable_audio=opus)
1631 if test "x$au_enable_opus" = xyes; then
1632 AC_MSG_RESULT([yes, configuring opus])
1633 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
1634 AC_ARG_ENABLE(dynamic-opus,
1635 AS_HELP_STRING([--dynamic-opus], [Dynamic Link Opus.]),
1636 [timidity_cv_dynamic_opus="yes"], [timidity_cv_dynamic_opus="no"])
1637 if test "x$timidity_cv_dynamic_opus" = xyes; then
1638 AC_CHECK_HEADER(opus/opus.h,, [
1640 EXTRADEFS="-DAU_OPUS -DAU_OPUS_DLL $EXTRADEFS"
1641 SYSEXTRAS="$SYSEXTRAS w32g_opus_dll.c w32g_ogg_dll.c"
1644 AC_CHECK_HEADER(opus/opus.h,, [
1646 EXTRADEFS="-DAU_OPUS -DAU_OPUS_DLL $EXTRADEFS"
1647 EXTRALIBS="$EXTRALIBS $OPUS_LIBS $OGG_LIBS"
1654 SYSEXTRAS="$SYSEXTRAS opus_a.c"
1655 EXTRADEFS="$EXTRADEFS -DAU_OPUS $OGG_CFLAGS $OPUS_CFLAGS"
1656 EXTRALIBS="$EXTRALIBS $OPUS_LIBS $OGG_LIBS"
1657 if test "x$MINGWGCC" = xyes ; then
1658 EXTRADEFS="-DAU_OPUS_DLL $EXTRADEFS"
1659 SYSEXTRAS="$SYSEXTRAS w32g_opus_dll.c w32g_ogg_dll.c"
1662 AC_MSG_WARN([Unable to configure opus, but ogg is there (???)])
1665 AC_MSG_WARN(Unable to configure opus!)
1674 AC_MSG_CHECKING(enable_audio=speex)
1675 if test "x$au_enable_speex" = xyes; then
1676 AC_MSG_RESULT(yes, configuring speex)
1677 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
1679 SYSEXTRAS="$SYSEXTRAS speex_a.c"
1680 EXTRALIBS="$EXTRALIBS -lspeex -logg"
1681 EXTRADEFS="$EXTRADEFS -DAU_SPEEX"
1682 dnl EXTRADEFS="$EXTRADEFS -DAU_SPEEX -DAU_SPEEX_DLL"
1683 dnl SYSEXTRAS="$SYSEXTRAS w32g_speex_dll.c"
1685 AC_CACHE_VAL(timidity_cv_have_speex,
1687 #include <speex/speex.h>
1688 #include <ogg/ogg.h>
1693 [have_speex=yes], [have_speex=no])])
1694 AC_MSG_RESULT($have_speex)
1695 if test "x$have_speex" = xyes; then
1696 SYSEXTRAS="$SYSEXTRAS speex_a.c"
1697 EXTRALIBS="$EXTRALIBS -lspeex -logg"
1698 EXTRADEFS="$EXTRADEFS -DAU_SPEEX"
1705 dnl Win32 Gogo-no-coder
1706 AC_MSG_CHECKING(enable_audio=gogo)
1707 if test "x$au_enable_gogo" = xyes; then
1708 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
1709 AC_MSG_RESULT(yes, configuring gogo)
1711 AC_MSG_WARN(May be gogo is not supported. You need hack the gogo_a.c)
1713 AC_CHECK_HEADER(gogo/gogo.h, [
1716 SYSEXTRAS="$SYSEXTRAS gogo_a.c w32_gogo.c"
1717 EXTRADEFS="$EXTRADEFS -DAU_GOGO -DAU_GOGO_DLL"
1718 dnl EXTRALIBS="$EXTRALIBS -lgogo"
1724 AC_MSG_CHECKING(enable_audio=lame)
1725 if test "x$au_enable_lame" = xyes; then
1726 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
1727 AC_MSG_RESULT([yes, configuring lame])
1730 AC_MSG_WARN(May be lame is not supported. You need hack the lame_a.c)
1732 dnl AC_CHECK_HEADERS(timidity/BladeMP3EncDLL.h timidity/LameEnc.h, [
1736 dnl #if HAVE_BLADEMP3ENCDLL_H
1737 dnl # include "windows.h"
1738 dnl # include "BladeMP3EncDLL.h"
1741 SYSEXTRAS="$SYSEXTRAS lame_a.c"
1742 EXTRADEFS="$EXTRADEFS -DAU_LAME"
1743 dnl EXTRALIBS="$EXTRALIBS"
1749 AC_MSG_CHECKING(enable_audio=benchmark)
1750 if test "x$au_enable_npipe" = xno; then
1754 dnl SYSEXTRAS="$SYSEXTRAS benchmark_a.c"
1755 EXTRADEFS="$EXTRADEFS -DAU_BENCHMARK"
1758 dnl Pseudo audio device (Undocumented).
1759 if test "x$au_enable_none" = xyes; then
1760 EXTRADEFS="$EXTRADEFS -DAU_NONE -DAU_AUDRIV"
1761 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_none.c"
1764 dnl TIMIDITY_OUTPUT_ID
1766 AC_MSG_CHECKING(default output mode)
1767 if test "x$DEFAULT_PLAYMODE" = "x"; then
1768 DEFAULT_PLAYMODE=`echo $enable_audio | sed 's/,.*//'`
1770 case ".$DEFAULT_PLAYMODE" in
1771 .default) TIMIDITY_OUTPUT_ID=d ;;
1772 .oss) TIMIDITY_OUTPUT_ID=d ;;
1773 .alsa) TIMIDITY_OUTPUT_ID=s ;;
1774 .sun) TIMIDITY_OUTPUT_ID=d ;;
1775 .hpux) TIMIDITY_OUTPUT_ID=d ;;
1776 .irix) TIMIDITY_OUTPUT_ID=d ;;
1777 .mme) TIMIDITY_OUTPUT_ID=d ;;
1778 .sb_dsp) TIMIDITY_OUTPUT_ID=d ;;
1779 .darwin) TIMIDITY_OUTPUT_ID=d ;;
1780 .w32) TIMIDITY_OUTPUT_ID=d ;;
1781 .alib) TIMIDITY_OUTPUT_ID=A ;;
1782 .nas) TIMIDITY_OUTPUT_ID=n ;;
1783 .arts) TIMIDITY_OUTPUT_ID=R ;;
1784 .esd) TIMIDITY_OUTPUT_ID=e ;;
1785 .portaudio) TIMIDITY_OUTPUT_ID=p ;;
1786 .npipe) TIMIDITY_OUTPUT_ID=N ;;
1787 .wav) TIMIDITY_OUTPUT_ID=w ;;
1788 .au) TIMIDITY_OUTPUT_ID=u ;;
1789 .aiff) TIMIDITY_OUTPUT_ID=a ;;
1790 .list) TIMIDITY_OUTPUT_ID=l ;;
1791 .vorbis) TIMIDITY_OUTPUT_ID=v ;;
1792 .flac) TIMIDITY_OUTPUT_ID=F ;;
1793 .opus) TIMIDITY_OUTPUT_ID=U ;;
1794 .speex) TIMIDITY_OUTPUT_ID=S ;;
1795 .gogo) TIMIDITY_OUTPUT_ID=g ;;
1796 .lame) TIMIDITY_OUTPUT_ID=L ;;
1797 .jack) TIMIDITY_OUTPUT_ID=j ;;
1798 .ao) TIMIDITY_OUTPUT_ID=O ;;
1799 *) TIMIDITY_OUTPUT_ID= ;;
1801 AC_MSG_RESULT($DEFAULT_PLAYMODE/$TIMIDITY_OUTPUT_ID)
1808 interface_targets='dynamic ncurses slang motif tcltk emacs vt100 xaw xskin gtk alsaseq winsyn winsyng portmidisyng npsyn'
1810 AC_ARG_ENABLE(interface,
1811 AS_HELP_STRING([--enable-interface=[interface_list]], [Comma separated interface list]),
1812 [ for i in `echo $enableval | sed 's/,/ /g'`; do
1813 eval "enable_$i=yes"
1816 # Dynamic link configuration
1817 AC_ARG_ENABLE(dynamic,
1818 AS_HELP_STRING([--enable-dynamic], [Enable dynamic link interface (default is no)])
1819 AS_HELP_STRING([--enable-dynamic=dynamic_list] [Comma separated dynamic interface list]),
1820 [ dnl --enable-dynamic=yes to --enable-dynamic=dynamic
1821 if test "x$enable_dynamic" = xyes; then
1822 enable_dynamic=dynamic
1823 elif test "x$enable_dynamic" != "xno"; then
1824 for i in `echo $enableval | sed 's/,/ /g'`; do
1825 eval "enable_$i=dynamic"
1830 for i in $interface_targets; do
1831 eval "join_targets=$join_targets\$enable_$i"
1834 case ".$join_targets" in
1835 .*dynamic*) NEEDDLOPEN=yes;;
1839 dnl check -fpic option for gcc
1840 if test "x$GCC" = xyes; then SHCFLAGS="$SHCFLAGS -fPIC"; fi
1841 case "x$enable_ump" in xyes|xdynamic) EXTRACFLAGS="$EXTRACFLAGS -DXP_UNIX $SHCFLAGS";; esac
1843 dnl check -masm option for gcc
1844 dnl if test "x$GCC" = xyes; then EXTRACFLAGS="$EXTRACFLAGS -masm=intel"; fi
1846 dnl Which type of dynamic loader?
1847 if test "$NEEDDLOPEN" = "yes"; then
1852 AC_CHECK_FUNC(socket,,
1853 WAPI_CHECK_LIB(ws2_32,WSAStartup,
1854 [#include <winsock.h>],
1856 [ EXTRALIBS="$EXTRALIBS -lws2_32"
1857 EXTRADEFS="$EXTRADEFS -DWINSOCK" ]
1860 WAPI_CHECK_FUNC(LoadLibrary,,[LoadLibrary((LPSTR)0);],have_dl=w32)
1861 test $wapi_cv_func_LoadLibrary = yes && have_dl=w32
1863 if test "$have_dl" = "no"; then
1864 AC_CHECK_FUNC(shl_load,have_dl=hpux)
1866 if test "$have_dl" = "no"; then
1867 dnl darwin has both dyld and libdl: in case user installed dlcompat.
1868 dnl dyld is recommended because libdl is a wrapper for dyld.
1869 AC_CHECK_FUNC(NSLinkModule,have_dl=dyld)
1871 if test "$have_dl" = "no" -a "x$ac_cv_lib_dl_dlopen" = xyes; then
1874 if test "$have_dl" = "no"; then
1875 AC_CHECK_FUNC(dlopen,have_dl=dlopen)
1877 if test "$have_dl" = "no"; then
1878 AC_CHECK_FUNC(dld_init,have_dl=dld)
1880 if test "$have_dl" = "no"; then
1881 AC_CHECK_LIB(dld,dld_init,have_dl=dld;lib_dl_opt=-ldld)
1884 AC_MSG_CHECKING(dynamic link method)
1887 AC_MSG_RESULT(use dl_dlopen.c)
1888 SYSEXTRAS="$SYSEXTRAS dl_dlopen.c"
1889 CHECK_DLSYM_UNDERSCORE(AC_DEFINE(DLSYM_NEEDS_UNDERSCORE,1,Define to 1 if you have to add "_" to every identifiers.))
1892 AC_MSG_RESULT(use dl_dld.c)
1893 SYSEXTRAS="$SYSEXTRAS dl_dld.c"
1896 AC_MSG_RESULT(use dl_hpux.c)
1897 SYSEXTRAS="$SYSEXTRAS dl_hpux.c"
1898 LDFLAGS="$LDFLAGS -Wl,-E $LDFLAGS"
1901 AC_MSG_RESULT(use dl_w32.c)
1902 SYSEXTRAS="$SYSEXTRAS dl_w32.c"
1905 AC_MSG_RESULT(use dl_dyld.c)
1906 SYSEXTRAS="$SYSEXTRAS dl_dyld.c"
1910 AC_MSG_WARN(no method to open a shared object)
1917 if test "$NEEDDLOPEN" = "yes"; then
1918 MY_DEFINE(IA_DYNAMIC)
1919 AC_DEFINE_UNQUOTED(SHARED_LIB_EXT,".$so", shared library extention)
1921 dnl EXTRADEFS="$EXTRADEFS \$(DEF_SHLIB_DIR)"
1922 if test "x$GCC" = xyes; then
1923 if test "x$timidity_cv_ccoption_rdynamic" = xyes; then
1924 timidity_LDFLAGS="-rdynamic"
1926 timidity_LDFLAGS="-Wl,--export-dynamic"
1931 AM_CONDITIONAL(NEEDDLOPEN, test "$NEEDDLOPEN" = "yes")
1935 AS_HELP_STRING([--enable-xdnd], [Enable xdnd support (default is no)]),
1936 [ if test "$enableval" = "yes"; then
1937 AC_DEFINE(XDND,1,Define to 1 if you want xdnd support.)
1942 AM_CONDITIONAL(ENABLE_XDND, test "x$enable_xdnd" = xyes)
1945 dnl Each interface section
1949 AM_CONDITIONAL(ENABLE_NCURSES, false)
1950 CONFIG_INTERFACE(ncurses,NCURSES,n,
1951 AS_HELP_STRING([--enable-ncurses], [Enable ncurses interface (default is no)]),
1952 [ AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h)
1954 dnl #include <ncurses/curses.h> is failure on Plamo Linux 1.3/ncurses 1.9.9e
1955 dnl because <ncurses/curses.h> includes <unctrl.h>:
1956 dnl /usr/include/ncurses/curses.h:34: unctrl.h: No such file or directory
1957 dnl But surely there is unctl.h at /usr/include/ncurses/unctrl.h.
1958 dnl configure must check ncurses header with -I/usr/include/ncurses option.
1960 case "$ac_cv_header_curses_h$ac_cv_header_ncurses_curses_h$ac_cv_header_ncurses_h" in
1962 *) for i in /usr/include /usr/local/include; do
1963 if test -f "$i/ncurses/curses.h" -a -f "$i/ncurses/unctrl.h"; then
1964 AC_MSG_WARN(ncurses test is failure. Please check config.h and common.makefile later)
1965 CPPFLAGS="$CPPFLAGS -I$i/ncurses"
1972 AC_CHECK_LIB(ncurses,initscr,lib_curses_opt=-lncurses,
1973 [ dnl checking pdcurses
1974 AC_CHECK_LIB(curses,PDC_set_ctrl_break,
1975 [ lib_curses_opt=-lcurses
1976 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
1977 lib_user32_opt="$lib_user32_test"
1978 AC_CHECK_LIB(curses, vwprintw,
1979 AC_DEFINE(HAVE_VWPRINTW, 1,
1980 [Define to 1 if you have the `vwprintw' function.]))
1982 [ dnl checking libpdcurses
1983 AC_CHECK_LIB(pdcurses,PDC_set_ctrl_break,
1984 [ lib_curses_opt=-lpdcurses
1985 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
1986 lib_user32_opt="$lib_user32_test"
1987 AC_CHECK_LIB(pdcurses, vwprintw,
1988 AC_DEFINE(HAVE_VWPRINTW, 1,
1989 [Define to 1 if you have the `vwprintw' function.]))
1991 [ dnl OpenBSD use -lcurses instead of -lncurses.
1994 AC_CHECK_LIB(curses,initscr,lib_curses_opt=-lcurses,
1995 [ AC_MSG_WARN(ncurses interface is not enabled)
1996 enable_ncurses=no ])
1999 lib_curses_opt=-lpdcurses
2000 EXTRAINCS="$EXTRAINCS -I\${top_srcdir}/pdcurses"
2001 timidity_LDFLAGS="$timidity_LDFLAGS -L\${top_srcdir}/pdcurses/win32"
2002 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
2003 AC_DEFINE(HAVE_VWPRINTW, 1,
2004 [Define to 1 if you have the `vwprintw' function.])
2005 AC_MSG_RESULT([use internal pdcurses])
2008 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes || test "x$WATCOM_C" = xyes || test "x$DMC" = xyes || test "x$POCC" = xyes; then
2009 lib_curses_opt=libpdcurses.lib
2010 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
2011 AC_CHECK_LIB(pdcurses, vwprintw,
2012 AC_DEFINE(HAVE_VWPRINTW, 1,
2013 [Define to 1 if you have the `vwprintw' function.]))
2015 AC_MSG_WARN(ncurses interface is not enabled)
2025 [ LIBS="$LIBS $lib_curses_opt"
2028 EXTRALIBS="$EXTRALIBS -lmytinfo"
2031 INTERFACE_SRCS="$INTERFACE_SRCS ncurs_c.c"
2033 [ n_so_libs="$lib_curses_opt"
2036 EXTRALIBS="$EXTRALIBS -lmytinfo"
2041 AM_CONDITIONAL(ENABLE_SLANG, false)
2042 CONFIG_INTERFACE(slang,SLANG,s,
2043 AS_HELP_STRING([--enable-slang], [Enable slang interface (default is no)]),
2044 [ AC_CHECK_LIB(slang,SLang_init_tty,:,
2046 AC_MSG_WARN(slang interface is not enabled)
2048 AC_CHECK_HEADERS(slang/slang.h slang.h)
2052 AC_CHECK_LIB(termcap,initscr,
2053 [ LIBS="$LIBS -lslang -ltermcap"
2054 INTERFACE_SRCS="$INTERFACE_SRCS slang_c.c"
2056 [ AC_MSG_WARN(slang interface is not enabled)
2061 LIBS="$LIBS -lslang"
2062 INTERFACE_SRCS="$INTERFACE_SRCS slang_c.c"
2066 [ s_so_libs="-lslang"
2067 AC_CHECK_LIB(termcap,initscr,s_so_libs="$s_so_libs -ltermcap")
2071 AM_CONDITIONAL(ENABLE_MOTIF, false)
2072 CONFIG_INTERFACE(motif,MOTIF,m,
2073 AS_HELP_STRING([--enable-motif], [Enable motif interface (default is no)]),
2074 [ if test "x$with_x" != xyes; then
2075 AC_MSG_ERROR(motif: --with-x option must be specified)
2077 if test "x$have_xm" != xyes; then
2078 AC_MSG_WARN(Motif library is not found.)
2085 if test "x$have_xprelibs" = xyes; then
2086 lib_xprelibs_opt='-lSM -lICE'
2088 INTERFACE_SRCS="$INTERFACE_SRCS motif_c.c motif_i.c motif_p.c"
2090 [ if test x$have_xprelibs = xyes; then
2091 m_so_libs="-lXext -lSM -lICE"
2093 m_so_libs="$ldflags_x_opt -lXm -lXt $m_so_libs -lX11"
2097 AM_CONDITIONAL(ENABLE_TCLTK, false)
2098 CONFIG_INTERFACE(tcltk,TCLTK,k,
2099 AS_HELP_STRING([--enable-tcltk], [Enable tcltk interface (default is no)]),
2100 [ if test "x$with_x" != xyes; then
2101 AC_MSG_ERROR(tcltk: --with-x option must be specified)
2105 KEEPCPPFLAGS=$CPPFLAGS
2106 KEEPLDFLAGS=$LDFLAGS
2109 CPPFLAGS="$tcl_include_dir $tk_includes $CPPFLAGS"
2110 LDFLAGS="$tcl_libdir $tk_libdir $LDFLAGS"
2111 LIBS="$LIBS $lib_dl_opt"
2115 for l in tcl tcl8.6 tcl8.5 tcl8.4 tcl84 tcl8.3 tcl8.0jp tcl7.6jp tcl80jp tcl76jp tcl8.0 tcl7.6 tcl80 tcl76; do
2116 case "x$tcl_lib" in x) AC_CHECK_LIB($l,Tcl_Init,tcl_lib=-l$l);; esac
2118 LIBS="$LIBS $tcl_lib"
2119 for l in tk tk8.6 tk8.5 tk8.4 tcl84 tk8.3 tk8.0jp tk4.2jp tk80jp tk42jp tk8.0 tk4.2 tk80 tk42; do
2120 case "x$tk_lib" in x) AC_CHECK_LIB($l,Tk_Init,tk_lib=-l$l);; esac
2124 if test "x$tcl_lib" = "x" -o "x$tk_lib" = "x"; then
2125 CPPFLAGS=$KEEPCPPFLAGS
2126 LDFLAGS=$KEEPLDFLAGS
2128 AC_MSG_WARN(tcl/tk is not enable)
2130 tcltk_dep='tclIndex'
2133 [ LIBS="$tk_lib $tcl_lib -lX11 $LIBS"
2136 EXTRALIBS="$EXTRALIBS -lipc"
2139 INTERFACE_SRCS="$INTERFACE_SRCS tk_c.c"
2141 [ k_so_libs="$tcl_libdir $tk_libdir $tcl_lib $tk_lib $lib_dl_opt"
2144 k_so_libs="$k_so_libs -lipc"
2147 k_so_libs="$k_so_libs -lX11 -lm"
2149 AM_CONDITIONAL(ENABLE_DYNAMIC_TCLTK, test "x$enable_tcltk" = "xdynamic")
2152 AM_CONDITIONAL(ENABLE_EMACS, false)
2153 CONFIG_INTERFACE(emacs,EMACS,e,
2154 AS_HELP_STRING([--enable-emacs], [Enable emacs interface (default is no)]),
2156 [ ELFILES="$ELFILES timidity.el"
2157 INTERFACE_SRCS="$INTERFACE_SRCS emacs_c.c"
2159 [ AM_CONDITIONAL(ENABLE_EMACS, true)
2160 ELFILES="$ELFILES timidity.el" ])
2163 AM_CONDITIONAL(ENABLE_VT100, false)
2164 CONFIG_INTERFACE(vt100,VT100,T,
2165 AS_HELP_STRING([--enable-vt100], [Enable VT100 interface (default is no)]),
2167 [ INTERFACE_SRCS="$INTERFACE_SRCS vt100_c.c vt100.c" ])
2170 AM_CONDITIONAL(ENABLE_XAW, false)
2171 CONFIG_INTERFACE(xaw,XAW,a,
2172 AS_HELP_STRING([--enable-xaw], [Enable athena interface (default is no)]),
2173 [ if test "x$with_x" != xyes; then
2174 AC_MSG_ERROR(xaw: --with-x option must be specified)
2176 if test "x$have_xaw" = "xno"; then
2177 AC_MSG_WARN(X Athena Widget library is not found.)
2180 [ dnl Add -lXext -lSM -lICE -lXmu -lXt {-lXaw|-lXaw3d}
2181 if test "x$have_xext" = xyes; then
2184 if test "x$have_xprelibs" = xyes; then
2185 lib_xprelibs_opt='-lSM -lICE'
2189 if test "x$enable_xft" = xyes && test "x$have_xaw" != "xno"; then
2190 XFT_CFLAGS="$(pkg-config --cflags xft)";
2191 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$XFT_CFLAGS)
2192 lib_xft_opt="-lXft";
2199 AC_DEFINE(XAW3D,1,Define to 1 if you use libXaw3d.)
2203 AC_DEFINE(XAWPLUS,1,Define to 1 if you use libXawPlus.)
2204 lib_xaw_opt="-lXpm -lXawPlus"
2207 AC_DEFINE(NEXTAW,1,Define to 1 if you use libneXtaw.)
2208 lib_xaw_opt=-lneXtaw
2211 INTERFACE_SRCS="$INTERFACE_SRCS xaw_c.c xaw_i.c x_trace.c $XDND_SRCS"
2213 [ if test "x$have_xext" = xyes; then
2214 a_so_libs="-lXext -lX11"
2220 a_so_libs="$a_so_libs -lcc_dynamic"
2223 if test "x$have_xprelibs" = xyes; then
2224 a_so_libs="-lSM -lICE $a_so_libs"
2228 a_so_libs="-lXaw -lXmu -lXt $a_so_libs"
2231 AC_DEFINE(XAW3D,1,Define to 1 if you use libXaw3d.)
2232 a_so_libs="-lXaw3d -lXmu -lXt $a_so_libs"
2235 AC_DEFINE(XAWPLUS,1,Define to 1 if you use libXawPlus.)
2236 a_so_libs="-lXawPlus -lXpm -lXmu -lXt $a_so_libs"
2239 AC_DEFINE(NEXTAW,1,Define to 1 if you use libneXtaw.)
2240 a_so_libs="-lneXtaw -lXmu -lXt $a_so_libs"
2243 if test "x$enable_xft" = xyes && test "x$have_xaw" != "xno"; then
2244 XFT_CFLAGS="$(pkg-config --cflags xft)";
2245 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$XFT_CFLAGS)
2246 a_so_libs="$a_so_libs -lXft";
2248 a_so_libs="$ldflags_x_opt $a_so_libs"
2250 AM_CONDITIONAL(ENABLE_DYNAMIC_XAW, test "x$enable_xaw" = "xdynamic")
2253 AM_CONDITIONAL(ENABLE_XSKIN, false)
2254 CONFIG_INTERFACE(xskin,XSKIN,i,
2255 AS_HELP_STRING([--enable-xskin], [Enable X skin interface (default is no)]),
2256 [ if test "x$with_x" != xyes; then
2257 AC_MSG_ERROR(xskin: --with-x option must be specified)
2260 [ INTERFACE_SRCS="$INTERFACE_SRCS xskin_c.c xskin_i.c xskin_loadBMP.c xskin_spectrum.c" ],
2261 [ i_so_libs="$ldflags_x_opt -lX11" ])
2264 AM_CONDITIONAL(ENABLE_GTK, false)
2265 CONFIG_INTERFACE(gtk, GTK, g,
2266 AS_HELP_STRING([--enable-gtk], [Enable GTK+ interface (default is no)]),
2267 [ AM_PATH_GTK_2_0(2.0.0,
2268 [AC_DEFINE(HAVE_GTK_2,1,Define to 1 if you have GTK+ 2.x)],
2269 [AM_PATH_GTK(1.1.3,,enable_gtk=no)]) ],
2270 [ LIBS="$LIBS $GTK_LIBS"
2271 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$GTK_CFLAGS)
2272 INTERFACE_SRCS="$INTERFACE_SRCS gtk_c.c gtk_i.c gtk_p.c"
2274 [ if test "x$GCC" = xyes; then
2275 dnl Do not include -rdynamic option in $g_so_libs.
2276 for i in $GTK_LIBS; do
2279 *) g_so_libs="$g_so_libs $i" ;;
2283 g_so_libs="$GTK_LIBS"
2285 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$GTK_CFLAGS) ])
2287 dnl TiMidity Network MIDI Server
2288 AM_CONDITIONAL(ENABLE_SERVER, false)
2289 CONFIG_INTERFACE(server,SERVER,r,
2290 AS_HELP_STRING([--enable-server], [Enable server interface (default is no)]),
2292 [ INTERFACE_SRCS="$INTERFACE_SRCS server_c.c"
2293 AC_CHECK_HEADERS(sys/soundcard.h)
2296 dnl TiMidity ALSA sequencer server
2297 AM_CONDITIONAL(ENABLE_ALSASEQ, false)
2298 CONFIG_INTERFACE(alsaseq,ALSASEQ,A,
2299 AS_HELP_STRING([--enable-alsaseq], [Enable ALSA sequencer server interface
2301 [ INTERFACE_SRCS="$INTERFACE_SRCS alsaseq_c.c"
2305 [ MY_DEFINE(IA_ALSASEQ)
2308 dnl TiMidity Windows synthesizer server
2309 AM_CONDITIONAL(ENABLE_WINSYN, false)
2310 CONFIG_INTERFACE(winsyn,WINSYN,W,
2311 AS_HELP_STRING([--enable-winsyn], [Enable Windows Synthesizer interface
2314 [ WINSYN="yes"; INTERFACE_SRCS="$INTERFACE_SRCS winsyn_c.c rtsyn_common.c rtsyn_winmm.c"; ])
2316 dnl TiMidity PortMIDI synthesizer server
2317 AM_CONDITIONAL(ENABLE_PORTMIDISYN, false)
2318 CONFIG_INTERFACE(portmidisyn,PORTMIDISYN,P,
2319 AS_HELP_STRING([--enable-portmidisyn], [Enable PortMIDI Synthesizer interface
2322 [ INTERFACE_SRCS="$INTERFACE_SRCS rtsyn_common.c rtsyn_portmidi.c portmidisyn_c.c";
2323 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
2324 LIBS="$LIBS -lportmidi";
2327 dnl TiMidity NamedPipe synthesizer server
2328 AM_CONDITIONAL(ENABLE_NPSYN, false)
2329 CONFIG_INTERFACE(npsyn,NPSYN,W,
2330 AS_HELP_STRING([--enable-npsyn], [Enable Windows Named Pipe Synthesizer interface
2333 [ NPSYN="yes"; INTERFACE_SRCS="$INTERFACE_SRCS npsyn_c.c rtsyn_common.c rtsyn_npipe.c"; ])
2337 dnl TiMidity Windows GUI synthesizer server
2338 AM_CONDITIONAL(ENABLE_W32G_SYN, false)
2339 CONFIG_INTERFACE(winsyng,W32G_SYN,W,
2340 AS_HELP_STRING([--enable-winsyng], [Enable Windows GUI Synthesizer interface
2345 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes || test "x$WATCOM_C" = xyes || test "x$DMC" = xyes || test "x$POCC" = xyes; then
2346 INTERFACE_SRCS="$INTERFACE_SRCS w32g_ini.c w32g_pref.c w32g_syn.c w32g_utl.c w32g_soundspec.c winsyn_c.c rtsyn_common.c rtsyn_winmm.c"
2347 lib_w32gui_opt='gdi32.lib comctl32.lib comdlg32.lib ole32.lib shlwapi.lib'
2348 lib_user32_opt='user32.lib'
2349 EXTRADEFS="$EXTRADEFS -D__W32G__ -DTWSYNG32"
2350 if test "x$VCPP" = xyes; then
2351 VCPP_LDFLAGS="$VCPP_LDFLAGS -subsystem:windows "
2353 if test "x$BORLANDC" = xyes; then
2354 BORLANDC_START='C0W32.OBJ'
2355 CFLAGS="$CFLAGS -tW"
2356 lib_w32gui_opt="-aa $lib_w32gui_opt"
2358 if test "x$WATCOM_C" = xyes; then
2359 CFLAGS="$CFLAGS -bw"
2360 WATCOM_LDFLAGS="$WATCOM_LDFLAGS SYS nt_win"
2362 if test "x$DMC" = xyes; then
2364 lib_w32gui_opt="$lib_w32gui_opt -L/exet:nt/su:windows:4.0"
2366 if test "x$POCC" = xyes; then
2367 POCC_LDFLAGS="$POCC_LDFLAGS -subsystem:windows "
2370 lib_w32gui_opt='-lgdi32 -lcomctl32 -lcomdlg32 -lole32 -lshlwapi'
2371 lib_user32_opt='-luser32'
2372 EXTRADEFS="$EXTRADEFS -D__W32G__ -DTWSYNG32"
2373 LDFLAGS="-mwindows $LDFLAGS"
2374 INTERFACE_SRCS="$INTERFACE_SRCS w32g_ini.c w32g_pref.c w32g_syn.c w32g_utl.c w32g_soundspec.c winsyn_c.c rtsyn_common.c rtsyn_winmm.c"
2380 AM_CONDITIONAL(ENABLE_W32GUI, false)
2381 CONFIG_INTERFACE(w32gui, W32GUI, w,
2382 AS_HELP_STRING([--enable-w32gui], [Enable Windows GUI interface (default is no)]),
2386 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes || test "x$WATCOM_C" = xyes || test "x$DMC" = xyes || test "x$POCC" = xyes; then
2387 INTERFACE_SRCS="$INTERFACE_SRCS w32g_c.c w32g_ini.c w32g_i.c w32g_playlist.c w32g_utl.c w32g_soundspec.c w32g_pref.c w32g_subwin.c w32g_subwin2.c w32g_subwin3.c w32g_ut2.c w32g_dib.c wrdt_w32g.c w32g_mag.c"
2388 lib_w32gui_opt='gdi32.lib comctl32.lib comdlg32.lib ole32.lib shlwapi.lib'
2389 lib_user32_opt='user32.lib'
2390 EXTRADEFS="$EXTRADEFS -D__W32G__ "
2391 if test "x$VCPP" = xyes; then
2392 VCPP_LDFLAGS="$VCPP_LDFLAGS -subsystem:windows "
2394 if test "x$BORLANDC" = xyes; then
2395 BORLANDC_START='C0W32.OBJ'
2396 CFLAGS="$CFLAGS -tW"
2397 lib_w32gui_opt="-aa $lib_w32gui_opt"
2399 if test "x$WATCOM_C" = xyes; then
2400 CFLAGS="$CFLAGS -bw"
2401 WATCOM_LDFLAGS="$WATCOM_LDFLAGS SYS nt_win"
2403 if test "x$DMC" = xyes; then
2404 lib_w32gui_opt="$lib_w32gui_opt -L/SU:window"
2407 if test "x$POCC" = xyes; then
2408 POCC_LDFLAGS="$POCC_LDFLAGS -subsystem:windows "
2411 lib_w32gui_opt='-lgdi32 -lcomctl32 -lcomdlg32 -lole32 -lshlwapi'
2412 lib_user32_opt='-luser32'
2413 EXTRADEFS="$EXTRADEFS -D__W32G__ "
2414 LDFLAGS="-mwindows $LDFLAGS"
2415 INTERFACE_SRCS="$INTERFACE_SRCS w32g_c.c w32g_ini.c w32g_i.c w32g_playlist.c w32g_utl.c w32g_soundspec.c w32g_pref.c w32g_subwin.c w32g_subwin2.c w32g_subwin3.c w32g_ut2.c w32g_dib.c wrdt_w32g.c w32g_mag.c"
2419 dnl UMP configuration
2420 AM_CONDITIONAL(ENABLE_PLUGIN, false)
2421 CONFIG_INTERFACE(ump, PLUGIN, p,
2422 AS_HELP_STRING([--enable-ump], [UMP configuration (default is no)]),
2423 [ if test ! -d ump; then
2424 AC_MSG_ERROR(UMP Package is not exists. Can't configure it.)
2426 AC_CHECK_HEADER(X11/xpm.h,,AC_MSG_ERROR([UMP Package needs xpm.h[,] but could not find it.]))
2427 AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,:,AC_MSG_ERROR([UMP Package needs libXpm.a[,] but could not find it.]))
2428 if test "x$have_xext" = xyes; then
2431 if test "x$have_xprelibs" = xyes; then
2432 lib_xprelibs_opt='-lSM -lICE'
2438 dnl Window Driver interface
2439 AC_ARG_ENABLE(windrv,
2440 AS_HELP_STRING([--enable-windrv], [Windows Driver interface(requires winsyn) ]),
2441 [ if test "$enableval" = "yes"; then
2442 if test "x$VCPP" != xyes && test "x$MINGWGCC" != xyes && test "x$BORLANDC" != xyes && test "x$WATCOM_C" != xyes && test "x$DMC" != xyes && test "x$POCC" != xyes; then
2443 AC_MSG_ERROR(windrv: Only Support VC++ or Mingw or Borland C or Open Watcom PellesC and Digital Mars)
2444 elif test "x$WINSYN" != xyes; then
2445 AC_MSG_ERROR(windrv: Driver must have winsyn interface)
2447 AC_DEFINE(WINDRV,1,Define to 1 if you cpmpile windos driver.)
2449 if test "x$WATCOM_C" = xyes; then DLLFLAG="-bd" ;fi
2450 if test "x$DMC" = xyes; then DLLFLAG="-WD" ;fi
2451 CFLAGS="$CFLAGS -DANOTHER_MAIN "
2454 CFLAGS="$CFLAGS $DLLFLAG "
2457 dnl this rely on CFLAGS and LIBS
2458 AC_ARG_ENABLE(offix,
2459 AS_HELP_STRING([--enable-offix], [Enable offix support (default is no)]),
2460 [ if test "$enableval" = "yes"; then
2461 KEEPCPPFLAGS=$CPPFLAGS
2463 KEEPLDFLAGS=$LDFLAGS
2464 CPPFLAGS="$CPPFLAGS $offix_include_dir"
2465 LDFLAGS="$LDFLAGS $offix_lib_dir"
2466 LIBS="$LIBS $lib_xmu_opt $lib_xt_opt $lib_xprelibs_opt $lib_xext_opt -lX11"
2467 AC_CHECK_LIB(Dnd,DndInitialize,[
2469 lib_offix_opt="-lDnd"
2470 AC_DEFINE(OFFIX,1,Define to 1 if you need offix support)
2472 [ LDFLAGS=$KEEPLDFLAGS
2473 CPPFLAGS=$KEEPCPPFLAGS
2480 AC_ARG_ENABLE(network,
2481 AS_HELP_STRING([--enable-network], [Enable network support (default is no)]),
2482 [ if test "$enableval" = "yes"; then
2483 AC_DEFINE(SUPPORT_SOCKET,1,Define to 1 if you need network support)
2485 AM_CONDITIONAL(ENABLE_NETWORK, test "x$enable_network" = xyes)
2487 dnl Multi-thread support
2488 AC_ARG_ENABLE(thread,
2489 AS_HELP_STRING([--enable-thread], [Enable thread support (default is no)]),
2490 [ if test "$enableval" = "yes"; then
2491 AC_DEFINE(ENABLE_THREAD,1,Define to 1 if you need thread support)
2493 AM_CONDITIONAL(ENABLE_THREAD, test "x$enable_thread" = xyes)
2495 dnl LargeFile Source support
2496 AC_ARG_ENABLE(largefile,
2497 AS_HELP_STRING([--enable-largefile], [Enable LargeFile Source support (default is no)]),
2498 [ if test "$enableval" = "yes"; then
2499 AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size support])
2500 AC_DEFINE(_LARGEFILE_SOURCE, 1, [Define for ftello and fseeko extension.])
2502 AM_CONDITIONAL(ENABLE_LARGEFILE, test "x$enable_largefile" = xyes)
2504 dnl Sound Spectrogram Viewer
2505 AC_ARG_ENABLE(spectrogram,
2506 AS_HELP_STRING([--enable-spectrogram], [Enable Sound Spectrogram Viewer (default is no)]),
2507 [ if test "$enableval" = "yes"; then
2508 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
2509 if test "x$W32G_GUI" = xyes; then
2510 AC_MSG_RESULT(use w32g_soundspec.c)
2511 AC_DEFINE(W32SOUNDSPEC,1,Define to 1 if you need spectrogram viewer.)
2513 AC_MSG_RESULT(use w32_soundspec.c)
2514 AC_DEFINE(W32SOUNDSPEC,1,Define to 1 if you need spectrogram viewer.)
2515 SYSEXTRAS="$SYSEXTRAS w32_soundspec.c"
2516 lib_w32gui_opt='-lgdi32'
2518 elif test "x$with_x" = xyes; then
2521 AC_MSG_ERROR(spectrogram: --with-x option must be specified)
2523 AC_DEFINE(SUPPORT_SOUNDSPEC,1,Define to 1 if you need spectrogram viewer.)
2526 AM_CONDITIONAL(W32SOUNDSPEC, test "x$enable_spectrogram" = xyes -a "x$WIN32" = xyes)
2527 AM_CONDITIONAL(ENABLE_SOUND_SPEC, test "x$enable_spectrogram" = xyes -a "x$with_x" = xyes)
2529 dnl Wave Resample Interpolations
2530 AC_ARG_ENABLE(spline,
2531 AS_HELP_STRING([--enable-spline=[method]],
2532 [Specify spline method. one of no,linear,cubic,lagrange,newton,gauss,sharp,linerper,sine,square (default is gauss)]),
2533 [ case "x$enableval" in
2535 AC_DEFINE(DEFAULT_RESAMPLATION_NUM,1,Define resampler num.)
2536 AC_DEFINE(DEFAULT_RESAMPLATION,resample_linear,Define resampler.)
2537 AC_DEFINE(DEFAULT_RESAMPLATION_ORDER,0,Define resampler order.)
2540 AC_DEFINE(DEFAULT_RESAMPLATION_NUM,2,Define resampler num.)
2541 AC_DEFINE(DEFAULT_RESAMPLATION,resample_cspline,Define resampler.)
2542 AC_DEFINE(DEFAULT_RESAMPLATION_ORDER,0,Define resampler order.)
2545 AC_DEFINE(DEFAULT_RESAMPLATION_NUM,3,Define resampler num.)
2546 AC_DEFINE(DEFAULT_RESAMPLATION,resample_lagrange,Define resampler.)
2547 AC_DEFINE(DEFAULT_RESAMPLATION_ORDER,0,Define resampler order.)
2550 AC_DEFINE(DEFAULT_RESAMPLATION_NUM,4,Define resampler num.)
2551 AC_DEFINE(DEFAULT_RESAMPLATION,resample_newton,Define resampler.)
2552 AC_DEFINE(DEFAULT_RESAMPLATION_ORDER,11,Define resampler order.)
2555 AC_DEFINE(DEFAULT_RESAMPLATION_NUM,5,Define resampler num.)
2556 AC_DEFINE(DEFAULT_RESAMPLATION,resample_gauss,Define resampler.)
2557 AC_DEFINE(DEFAULT_RESAMPLATION_ORDER,24,Define resampler order.)
2560 AC_DEFINE(DEFAULT_RESAMPLATION_NUM,6,Define resampler num.)
2561 AC_DEFINE(DEFAULT_RESAMPLATION,resample_sharp,Define resampler.)
2562 AC_DEFINE(DEFAULT_RESAMPLATION_ORDER,2,Define resampler order.)
2565 AC_DEFINE(DEFAULT_RESAMPLATION_NUM,7,Define resampler num.)
2566 AC_DEFINE(DEFAULT_RESAMPLATION,resample_liner_p,Define resampler.)
2567 AC_DEFINE(DEFAULT_RESAMPLATION_ORDER,100,Define resampler order.)
2570 AC_DEFINE(DEFAULT_RESAMPLATION_NUM,8,Define resampler num.)
2571 AC_DEFINE(DEFAULT_RESAMPLATION,resample_sine,Define resampler.)
2572 AC_DEFINE(DEFAULT_RESAMPLATION_ORDER,0,Define resampler order.)
2575 AC_DEFINE(DEFAULT_RESAMPLATION_NUM,9,Define resampler num.)
2576 AC_DEFINE(DEFAULT_RESAMPLATION,resample_square,Define resampler.)
2577 AC_DEFINE(DEFAULT_RESAMPLATION_ORDER,0,Define resampler order.)
2580 AC_DEFINE(DEFAULT_RESAMPLATION_NUM,0,Define resampler num.)
2581 AC_DEFINE(DEFAULT_RESAMPLATION,resample_none,Define resampler.)
2582 AC_DEFINE(DEFAULT_RESAMPLATION_ORDER,0,Define resampler order.)
2585 AC_MSG_ERROR(Invalid method of --enable-spline)
2589 dnl Wave Resample Filter
2590 AC_ARG_ENABLE(filter,
2591 AS_HELP_STRING([--enable-filter=[method]],
2592 [Specify filter method. one of no,lpf12,lpf24,lpfbw,lpf12x2,lpf24x2,lpf6,lpf18,lpftfo,hpfbw,bpfbw (default is no)]),
2593 [ case "x$enableval" in
2595 AC_DEFINE(DEFAULT_RESAMPLATION_FILTER,1,Define resampler filter.)
2598 AC_DEFINE(DEFAULT_RESAMPLATION_FILTER,2,Define resampler filter.)
2601 AC_DEFINE(DEFAULT_RESAMPLATION_FILTER,3,Define resampler filter.)
2604 AC_DEFINE(DEFAULT_RESAMPLATION_FILTER,4,Define resampler filter.)
2607 AC_DEFINE(DEFAULT_RESAMPLATION_FILTER,5,Define resampler filter.)
2610 AC_DEFINE(DEFAULT_RESAMPLATION_FILTER,6,Define resampler filter.)
2613 AC_DEFINE(DEFAULT_RESAMPLATION_FILTER,7,Define resampler filter.)
2616 AC_DEFINE(DEFAULT_RESAMPLATION_FILTER,8,Define resampler filter.)
2619 AC_DEFINE(DEFAULT_RESAMPLATION_FILTER,9,Define resampler filter.)
2622 AC_DEFINE(DEFAULT_RESAMPLATION_FILTER,10,Define resampler filter.)
2625 AC_DEFINE(DEFAULT_RESAMPLATION_FILTER,0,Define resampler filter.)
2628 AC_MSG_ERROR(Invalid method of --enable-filter)
2634 AS_HELP_STRING([--enable-wrd], [Enable WRD interface (default is no)]),
2635 [ if test "$enableval" = "yes"; then
2636 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
2637 LIBS="-lgdi32 $LIBS"
2638 INTERFACE_SRCS="$INTERFACE_SRCS wrdt_wcon.c wrdt_tty.c"
2639 elif test "x$with_x" = xyes; then
2641 AC_DEFINE(WRDT_X,1,Define to 1 if you need wrd support for X.)
2642 enable_sherry_wrd=yes
2643 AC_CHECK_LIB(z,zlibVersion,:,enable_sherry_wrd=no)
2644 AC_CHECK_HEADER(png.h,,enable_sherry_wrd=no)
2645 AC_CHECK_LIB(png,png_init_io,:,enable_sherry_wrd=no,-lz)
2646 if test "$enable_sherry_wrd" = yes; then
2647 AC_DEFINE(ENABLE_SHERRY,1,Define to 1 if you enable Sherry WRD)
2651 AC_MSG_WARN([Sherry WRD is disabled: png.h, libpng.a, libz.a are required])
2653 if test "x$have_xext" = xyes; then
2657 AC_MSG_ERROR(wrd: --with-x option must be specified)
2662 dnl end of interfaces
2669 dnl Internal audio datatype format
2670 if test "${enable_datatype}" = ""; then
2671 AC_DEFINE(DATA_T_DOUBLE,1,[Define to 1 if you need `double' audio data type.])
2672 AC_DEFINE(VERSION_DATA_T,"f64",[Define version information prefix.])
2674 AC_ARG_ENABLE(datatype,
2675 AS_HELP_STRING([--enable-datatype=[type]],
2676 [Specify audio data type. one of int32,float,double (default is double)]),
2677 [ case "x$enableval" in
2679 AC_DEFINE(DATA_T_INT32,1,[Define to 1 if you need `int32' audio data type.])
2680 AC_DEFINE(VERSION_DATA_T,"i32",[Define version information prefix.])
2683 AC_DEFINE(DATA_T_FLOAT,1,[Define to 1 if you need `float' audio data type.])
2684 AC_DEFINE(VERSION_DATA_T,"f32",[Define version information prefix.])
2687 AC_DEFINE(DATA_T_DOUBLE,1,[Define to 1 if you need `double' audio data type.])
2688 AC_DEFINE(VERSION_DATA_T,"f64",[Define version information prefix.])
2691 AC_MSG_ERROR(Invalid type of --enable-datatype)
2697 if test "${enable_ext_instruct}" != ""; then
2698 AC_ARG_ENABLE(ext-instruct,
2699 AS_HELP_STRING([--enable-ext-instruct=[instruction]],
2700 [Specify arch optimize flag. one of none,mmx,sse,sse2,sse3,ssse3,sse41,sse42,avx,avx2 (default is none)]),
2701 [ case "x$enableval" in
2705 AC_DEFINE(USE_MMX,1,[Define to 1 if you need MMX instructions.])
2706 AC_DEFINE(VERSION_EXT_INST,"mmx",[Define ext-instruction information prefix.])
2707 if test "x$GCC" = xyes; then
2708 CFLAGS="$CFLAGS -mmmx"
2712 AC_DEFINE(USE_SSE,1,[Define to 1 if you need SSE instructions.])
2713 AC_DEFINE(VERSION_EXT_INST,"sse",[Define ext-instruction information prefix.])
2714 if test "x$GCC" = xyes; then
2715 CFLAGS="$CFLAGS -msse -mfpmath=sse,387"
2719 AC_DEFINE(USE_SSE2,1,[Define to 1 if you need SSE2 instructions.])
2720 AC_DEFINE(VERSION_EXT_INST,"sse2",[Define ext-instruction information prefix.])
2721 if test "x$GCC" = xyes; then
2722 CFLAGS="$CFLAGS -msse2 -mfpmath=sse,387"
2726 AC_DEFINE(USE_SSE3,1,[Define to 1 if you need SSE3 instructions.])
2727 AC_DEFINE(VERSION_EXT_INST,"sse3",[Define ext-instruction information prefix.])
2728 if test "x$GCC" = xyes; then
2729 CFLAGS="$CFLAGS -msse3 -mfpmath=sse,387"
2733 AC_DEFINE(USE_SSSE3,1,[Define to 1 if you need SSSE3 instructions.])
2734 AC_DEFINE(VERSION_EXT_INST,"ssse3",[Define ext-instruction information prefix.])
2735 if test "x$GCC" = xyes; then
2736 CFLAGS="$CFLAGS -mssse3 -mfpmath=sse,387"
2740 AC_DEFINE(USE_SSE4,1,[Define to 1 if you need SSE4 instructions.])
2741 AC_DEFINE(USE_SSE41,1,[Define to 1 if you need SSE4.1 instructions.])
2742 AC_DEFINE(VERSION_EXT_INST,"sse41",[Define ext-instruction information prefix.])
2743 if test "x$GCC" = xyes; then
2744 CFLAGS="$CFLAGS -msse4.1 -mfpmath=sse,387"
2748 AC_DEFINE(USE_SSE4,1,[Define to 1 if you need SSE4 instructions.])
2749 AC_DEFINE(USE_SSE42,1,[Define to 1 if you need SSE4.2 instructions.])
2750 AC_DEFINE(VERSION_EXT_INST,"sse42",[Define ext-instruction information prefix.])
2751 if test "x$GCC" = xyes; then
2752 CFLAGS="$CFLAGS -msse4.2 -mfpmath=sse,387"
2756 AC_DEFINE(USE_AVX,1,[Define to 1 if you need AVX instructions.])
2757 AC_DEFINE(VERSION_EXT_INST,"avx",[Define ext-instruction information prefix.])
2758 if test "x$GCC" = xyes; then
2759 CFLAGS="$CFLAGS -mavx -mfpmath=sse,387"
2763 AC_DEFINE(USE_AVX2,1,[Define to 1 if you need AVX2 instructions.])
2764 AC_DEFINE(VERSION_EXT_INST,"avx2",[Define ext-instruction information prefix.])
2765 if test "x$GCC" = xyes; then
2766 CFLAGS="$CFLAGS -mavx2 -mfpmath=sse,387"
2770 AC_MSG_ERROR(Invalid type of --enable-datatype)
2780 AM_CONDITIONAL(ENABLE_WRD, test "x$enable_wrd" = xyes)
2781 AM_CONDITIONAL(W32G_GUI, test "x$W32G_GUI" = xyes)
2782 AM_CONDITIONAL(WINDRV, test "x$WINDRV" = xyes)
2783 AM_CONDITIONAL(CYGNUS, test "x$CYGNUS" = xyes)
2784 AM_CONDITIONAL(MSYS, test "x$MSYS" = xyes)
2785 AM_CONDITIONAL(VCPP, test "x$VCPP" = xyes)
2786 AM_CONDITIONAL(POCC, test "x$POCC" = xyes)
2787 AM_CONDITIONAL(BORLANDC, test "x$BORLANDC" = xyes)
2788 AM_CONDITIONAL(WATCOM_C, test "x$WATCOM_C" = xyes)
2789 AM_CONDITIONAL(DMC, test "x$DMC" = xyes)
2790 AM_CONDITIONAL(MINGWGCC, test "x$MINGWGCC" = xyes)
2792 AM_CONDITIONAL(W32READDIR, test "x$W32READDIR" = xyes)
2794 SET_UNIQ_WORDS(LDFLAGS,$LDFLAGS)
2795 SET_UNIQ_WORDS(SHLDFLAGS,$SHLDFLAGS)
2796 SET_UNIQ_WORDS(CFLAGS,$EXTRACFLAGS $CFLAGS)
2797 SET_UNIQ_WORDS(CPPFLAGS,$CPPFLAGS $EXTRADEFS)
2799 if test "x$oss_device" != "x"; then
2800 AC_DEFINE_UNQUOTED(OSS_DEVICE,"$oss_device", oss device name)
2803 if test "x$TIMIDITY_OUTPUT_ID" != "x"; then
2804 AC_DEFINE_UNQUOTED(TIMIDITY_OUTPUT_ID,"$TIMIDITY_OUTPUT_ID", the output specification)
2807 if test "x$au_enable_nas" = xyes -o \
2808 "x$enable_motif" = xyes -o \
2809 "x$enable_tcltk" = xyes -o \
2810 "x$enable_xaw" = xyes -o \
2811 "x$enable_xskin" = xyes -a "x$with_x" = xyes; then
2812 dnl Order of X-library is: -lXdnd -lXm -lXaw -lXft -lXmu -lXt -lSM -lICE -lXext -lX11
2813 LIBS="$lib_offix_opt $lib_xm_opt $lib_xaw_opt $lib_xft_opt $lib_xmu_opt $lib_xt_opt $lib_xprelibs_opt $lib_xext_opt -lX11 $LIBS"
2815 LIBS="$LIBS $lib_dl_opt $lib_png_opt $lib_zip_opt $lib_user32_opt $lib_w32gui_opt $EXTRALIBS"
2816 SHLD="$SHLD $SHLDFLAGS"
2818 AC_SUBST(BORLANDC_START)
2819 AC_SUBST(BORLANDC_LDFLAGS)
2821 AC_SUBST(timidity_LDFLAGS)
2822 AC_SUBST(WATCOM_LDFLAGS)
2823 AC_SUBST(DMC_LDFLAGS)
2824 AC_SUBST(VCPP_LDFLAGS)
2825 AC_SUBST(POCC_LDFLAGS)
2834 AC_SUBST(dynamic_targets)
2840 AC_SUBST(program_transform_name)
2841 AC_SUBST(INTERFACE_SRCS)
2842 AC_SUBST(pkgdatadir)
2852 doc/ja_JP.eucJP/Makefile
2853 doc/ja_JP.utf8/Makefile
2855 interface/motif_bitmaps/Makefile
2856 interface/bitmaps/Makefile
2857 interface/pixmaps/Makefile