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.
42 dnl tcltk_dep - make dependencies for tcl/tk interface
44 dnl so - File extension of shared object library.
45 dnl SHLD - Linker to make shared object library.
46 dnl SHLDFLAGS - Link flags to link shared object library.
47 dnl SHCFLAGS - Additional flags to compile shared object library.
50 # This is a autoscan-generated configure.scan.
53 # "AC_INIT(timidity/timidity.c)" is obsolate yet.
54 AC_INIT([TiMidity++],[current],[root@mput.dip.jp],[TiMidity++])
55 AC_CONFIG_AUX_DIR([autoconf])
57 AM_INIT_AUTOMAKE([gnu dist-bzip2])
58 AC_CONFIG_SRCDIR([timidity/timidity.c])
59 AC_CONFIG_HEADERS([config.h interface.h])
62 SHELL=${CONFIG_SHELL-"/bin/sh"}
65 dnl to use contains() macro (see autoconf/acinclude.m4)
68 # Check for compiler options -- such as debug flags.
70 dnl "--enable-debug" turnes -g on.
71 AC_MSG_CHECKING(if --enable-debug option specified)
73 [ --enable-debug Build a debugging version.],
74 [timidity_cv_debug="yes"], [timidity_cv_debug="no"])
75 if test "x$timidity_cv_debug" = "xyes"; then
76 AC_DEFINE(DEBUG,1,Define to 1 if you are in debug mode)
79 if test "x$timidity_cv_debug" = "xno"; then
80 AC_DEFINE(NDEBUG,1,Define to 1 if you are NOT in debug mode)
82 AC_MSG_RESULT($timidity_cv_debug)
84 CFLAGS=${CFLAGS-"-O2"}
86 dnl --with-x turns on if `--with-x' is NOT specified.
87 if test "x$with_x" = x; then
93 # Checking gcc environment
94 for i in `echo $LIBRARY_PATH|sed -e 's,:, ,g'`; do
95 LDFLAGS="$LDFLAGS -L${i}"
97 for i in `echo $C_INCLUDE_PATH|sed -e 's,:, ,g'`; do
98 CPPFLAGS="$CPPFLAGS -I${i}"
101 # add $prefix if specified.
102 if test "x$prefix" != xNONE -a "x$prefix" != "x$ac_default_prefix" -a "x$prefix" != "x/usr"; then
103 LDFLAGS="-L$prefix/lib $LDFLAGS"
104 SHLDFLAGS="-L$prefix/lib $SHLDFLAGS"
105 CPPFLAGS="-I$prefix/include $CPPFLAGS"
108 dnl add --with-includes, --with-libraries
109 AC_ARG_WITH(includes,
110 [ --with-includes=DIR Specify include directories (colon separated)],
112 for i in `echo "$withval"|sed -e 's,:, ,g'`; do
115 CPPFLAGS="$j$CPPFLAGS"
118 AC_ARG_WITH(libraries,
119 [ --with-libraries=DIR Specify library directories (colon separated)],
121 for i in `echo "$withval"|sed -e 's,:, ,g'`; do
128 dnl a bit hairly yet.(20020718:mput)
129 dnl CPPFLAGS="$CPPFLAGS \$(DEF_PKGDATADIR) \$(DEF_PKGLIBDIR) \$(DEF_DEFAULT_PATH)"
130 AC_ARG_WITH(default-path,
131 [ --with-default-path=DIR Where timidity.cfg is (PREFIX/share/timidity)],
132 [pkgdatadir=$withval],
134 if test "x$prefix" != "xNONE"; then
135 pkgdatadir='${prefix}/share/timidity'
137 pkgdatadir='/usr/local/share/timidity'
140 tmpdefpath="`eval \"echo ${pkgdatadir}\"`"
141 AC_DEFINE_UNQUOTED(DEFAULT_PATH,"$tmpdefpath",place to install patches)
142 AC_DEFINE(PKGDATADIR,DEFAULT_PATH,a compatibility matter. ignore it.)
144 AC_ARG_WITH(module-dir,
145 [ --with-module-dir=DIR Where to install interfaces (PREFIX/lib/timidity)],
146 [pkglibdir=$withval],
148 if test "x$prefix" != "xNONE"; then
149 pkglibdir='${prefix}/lib/timidity'
151 pkglibdir='/usr/local/lib/timidity'
154 tmplibdir="`eval \"echo ${pkglibdir}\"`"
155 AC_DEFINE_UNQUOTED(PKGLIBDIR,"$tmplibdir",place to install modules)
158 # Checks for programs.
161 AC_PROG_GCC_TRADITIONAL
166 CHECK_COMPILER_OPTION(rdynamic)
168 # Checks for target dependencies
171 [ --with-elf create ELF shared object instead of AOUT ],
172 [ ELFFORMAT=$withval ], [ ELFFORMAT="yes" ])
175 # [ --with-simd create SIMD friendly binary (default is no) ],
176 # [ SIMD=$withval ], [ SIMD="no" ])
181 test -n "$SHLD" || SHLD="ld -b"
185 dnl IRIX cc needs -signed option
186 case ".$CC" in .cc*) EXTRACFLAGS="-signed";; esac
187 test -n "$SHLD" || SHLD="cc -shared -all"
191 test -n "$SHLD" || SHLD="$CC -shared -nostartfiles"
196 dnl EXTRALIBS="$EXTRALIBS -lxpg4"
197 test -n "$SHLD" || SHLD="ld -Bshareable"
201 if test "$ELFFORMAT" = yes; then
202 test -n "$SHLD" || SHLD="ld -Bshareable"
205 SHLDFLAGS="-L/usr/X11R6/lib/aout $SHLDFLAGS"
206 test -n "$SHLD" || SHLD="env OBJFORMAT=aout ld -shared"
208 dnl EXTRALIBS="$EXTRALIBS -lxpg4"
213 # EXTRALIBS="$EXTRALIBS -lxpg4"
214 # test -n "$SHLD" || SHLD="ld -Bshareable"
219 EXTRADEFS="-D__W32__"
223 # test -n "$SHLD" || SHLD="tlink32 -Tpd"
224 test -n "$SHLD" || SHLD="BCC32 -WD"
226 BORLANDC_LDFLAGS="kernel32.lib winspool.lib comdlg32.lib advapi32.lib oleaut32.lib uuid.lib odbc32.lib wsock32.lib user32.lib shell32.lib cw32mt.lib"
227 BORLANDC_START='C0X32.OBJ'
228 CFLAGS="$CFLAGS -tWM -VM"
229 EXTRADEFS="$EXTRADEFS -D_WINDOWS -DWIN32"
232 test -n "$SHLD" || SHLD="link -dll"
233 VCPP_LDFLAGS="-nologo -incremental:no -nodefaultlib:libc.lib -nodefaultlib:msvcrt.lib kernel32.lib winspool.lib comdlg32.lib advapi32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib user32.lib shell32.lib libcmt.lib"
234 CFLAGS="$CFLAGS -nologo -Zp16 -MT -W3 -GX -Ob2"
235 EXTRADEFS="$EXTRADEFS -DNDEBUG -D_WINDOWS -DWIN32 -DMBCS -D_MT -YX -FD -c"
238 "xgcc"*) test -n "$SHLD" || SHLD="gcc -mdll" ;;
239 *) test -n "$SHLD" || SHLD="unknown" ;;
243 lib_user32_test=-luser32
246 EXTRADEFS="-D__W32__"
250 # test -n "$SHLD" || SHLD="tlink32 -Tpd"
251 test -n "$SHLD" || SHLD="BCC32 -WD"
253 BORLANDC_LDFLAGS="kernel32.lib winspool.lib comdlg32.lib advapi32.lib oleaut32.lib uuid.lib odbc32.lib wsock32.lib user32.lib shell32.lib cw32mt.lib"
254 BORLANDC_START='C0X32.OBJ'
255 CFLAGS="$CFLAGS -tWM -VM"
256 EXTRADEFS="$EXTRADEFS -D_WINDOWS -DWIN32"
259 test -n "$SHLD" || SHLD="link -dll"
261 VCPP_LDFLAGS="-nologo -incremental:no -nodefaultlib:libc.lib -nodefaultlib:msvcrt.lib kernel32.lib winspool.lib comdlg32.lib advapi32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib user32.lib shell32.lib libcmt.lib"
262 CFLAGS="$CFLAGS -nologo -Zp16 -MT -W3 -GX -Ob2"
263 EXTRADEFS="$EXTRADEFS -DNDEBUG -D_WINDOWS -DWIN32 -DMBCS -D_MT -YX -FD -c"
265 "xgcc"*) test -n "$SHLD" || SHLD="gcc -mdll" ;;
266 *) test -n "$SHLD" || SHLD="unknown" ;;
270 lib_user32_test=-luser32
274 test -n "$SHLD" || SHLD="ld -Bdynamic -G"
278 EXTRADEFS="-DSOLARIS"
279 test -n "$SHLD" || SHLD="/usr/ccs/bin/ld -G"
283 test -n "$SHLD" || SHLD="/usr/ccs/bin/ld -G"
287 if test "x$SIMD" = "xyes"; then
288 AC_DEFINE(USE_ALTIVEC,1,Define to 1 if you use altivec)
289 # EXTRACFLAGS="$EXTRACFLAGS -faltivec -mabi=altivec -maltivec" # for GCC3.
290 EXTRACFLAGS="$EXTRACFLAGS -faltivec"
292 AC_DEFINE(USE_ALTIVEC,0,Define to 1 if you use altivec)
294 CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
295 LDOPTS="-dynamic -undefined suppress -flat_namespace $LDOPTS"
296 test -n "$SHLD" || SHLD="$CC -dynamic -bundle -undefined suppress -flat_namespace $LDFLAGS"
301 if test "x$GCC" = xyes; then
304 SHLD="ld -Bdynamic -G"
311 dnl AC_EXEEX # obsolate
313 # Checks for libraries.
315 AC_CHECK_LIB(socket,socket)
316 AC_CHECK_LIB(dl,dlopen,lib_dl_opt=-ldl)
317 AC_CHECK_LIB(objc,NSLinkModule,lib_dl_opt=-lobjc) # Mac OS X need this.
318 if test "x$VCPP" != "xyes" && test "x$BORLANDC" != "xyes"; then
319 AC_CHECK_LIB(xpg4,setlocale) # Mac OS X (and maybe NetBSD) need this.
321 AC_CHECK_FUNCS(gethostbyname,,[ AC_CHECK_LIB(nsl,gethostbyname) ])
325 if test "x$with_x" = xyes; then
326 if test "x$have_x" = xno; then
327 if test "x$x_config_flag" = xyes; then
328 AC_MSG_ERROR(Could not configure X)
330 AC_MSG_WARN(Could not configure X)
334 if test "x$with_x" = xyes -a "x$have_x" = xyes; then
335 if test "x$x_libraries" != x; then
336 ldflags_x_opt="-L$x_libraries"
337 LDFLAGS="$LDFLAGS $ldflags_x_opt"
338 SHLDFLAGS="$SHLDFLAGS $ldflags_x_opt"
342 if test "x$x_includes" != x; then
343 CPPFLAGS="$CPPFLAGS -I$x_includes"
346 AC_CHECK_LIB(X11,XOpenDisplay)
347 AC_MSG_CHECKING(X11 version 6)
348 AC_CACHE_VAL(timidity_cv_x11_version_6,
349 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]], [[
350 #if XlibSpecificationRelease < 6
353 ]])],[timidity_cv_x11_version_6=yes],[timidity_cv_x11_version_6=no]))
354 if test "$timidity_cv_x11_version_6" = "yes"; then
355 AC_MSG_RESULT(6 or newer)
356 dnl AC_DEFINE(HAVE_X11R6)
358 AC_MSG_RESULT(before 6)
361 dnl checking order required
363 AC_CHECK_LIB(Xext,XShapeCombineMask,have_xext=yes; LIBS="-lXext $LIBS",have_xext=no)
364 AC_CHECK_LIB(ICE,IceConnectionNumber)
365 AC_CHECK_LIB(SM,SmcOpenConnection,have_xprelibs=yes; LIBS="-lSM $LIBS",have_xprelibs=no)
366 AC_CHECK_LIB(Xt,XtVaAppInitialize,have_xt=yes; LIBS="-lXt $LIBS",have_xt=no)
367 AC_CHECK_LIB(Xmu,XmuInternAtom,LIBS="-lXmu $LIBS")
368 AC_CHECK_FUNCS(XmuRegisterExternalAgent)
369 AC_CHECK_LIB(Xaw3d,XawInitializeWidgetSet,have_xaw=3d,
370 [ AC_CHECK_LIB(Xaw,XawInitializeWidgetSet,have_xaw=yes,have_xaw=no) ])
371 AC_CHECK_LIB(Xm,XmCreateForm,have_xm=yes,have_xm=no)
372 AC_CHECK_FUNCS(XShmCreatePixmap)
375 dnl End of X configure
377 # Checks for header files.
422 [X11/extensions/XShm.h X11/Xmu/ExtAgent.h],[],[],[
423 #ifdef HAVE_X11_XLIB_H
424 #include <X11/Xlib.h>
427 AC_CHECK_HEADER(string.h,, [ AC_DEFINE(NO_STRING_H,1,Define to 1 if you do not have <string.h>.)])
428 if test "x$VCPP" != xyes && test "x$BORLANDC" != xyes; then
429 AC_CHECK_HEADERS([malloc.h])
432 # Checks for typedefs, structures, and compiler characteristics.
445 dnl keyword "volatile" check
446 AC_CACHE_CHECK(volatile declaration,timidity_cv_type_volatile,
447 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [[volatile int x]])],[timidity_cv_type_volatile=yes],[timidity_cv_type_volatile=no]))
448 if test $timidity_cv_type_volatile = no; then
449 AC_DEFINE(NO_VOLATILE,1,Define to 1 if you cannot use volatile keyword)
452 dnl union usenum check
453 AC_CACHE_CHECK(union semun declaration,timidity_cv_type_union_semun,
454 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
455 #include <sys/types.h>
458 ]], [[union semun x]])],[timidity_cv_type_union_semun=yes],[timidity_cv_type_union_semun=no]))
459 if test $timidity_cv_type_union_semun = yes; then
460 AC_DEFINE(HAVE_UNION_SEMUN,1,Define to 1 if you use semun keyword)
463 dnl Cygnus and Mingw memory struct optiontest
464 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
468 AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
469 if test -z "$ac_cv_prog_CC"; then
472 our_gcc="$ac_cv_prog_CC"
474 case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
476 if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
477 msnative_struct='-fnative-struct'
481 if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
482 msnative_struct='-mms-bitfields'
486 if test x"$msnative_struct" = x ; then
487 AC_MSG_RESULT([no way])
488 AC_MSG_WARN([produced binary will be incompatible with windows' GUI ])
490 CFLAGS="$CFLAGS $msnative_struct"
491 CPPFLAGS="$CPPFLAGS $msnative_struct"
492 AC_MSG_RESULT([${msnative_struct}])
499 dnl Cygnus Mingw32 mmsystem check
500 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
501 AC_CACHE_CHECK(Cygwin new mmsystem,timidity_cv_header_new_mmsystem,
502 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
504 #include <mmsystem.h>
505 ]], [[return WOM_OPEN != 0x3BB]])],[timidity_cv_header_new_mmsystem=yes],[timidity_cv_header_new_mmsystem=no]))
506 if test $timidity_cv_header_new_mmsystem = yes; then
507 AC_DEFINE(HAVE_NEW_MMSYSTEM,1,Define to 1 if you have <mmsystem.h> file)
511 # Checks for library functions.
512 AC_FUNC_ERROR_AT_LINE
516 AC_FUNC_SETVBUF_REVERSED
518 if test "x$VCPP" != xyes && test "x$BORLANDC" != xyes; then
555 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes; then
556 AC_DEFINE(RETSIGTYPE,int)
557 AC_DEFINE(HAVE_GETCWD,int)
558 AC_DEFINE(HAVE_GETHOSTBYNAME,1)
559 AC_DEFINE(HAVE_POPEN,1)
560 AC_DEFINE(popen,_popen,[for VC])
561 AC_DEFINE(pclose,_pclose,[for VC])
562 AC_DEFINE(HAVE_SELECT,1)
563 AC_DEFINE(HAVE_SNPRINTF,1)
564 AC_DEFINE(HAVE_STRDUP,1)
565 AC_DEFINE(HAVE_STRERROR,1)
566 AC_DEFINE(HAVE_STRNCASECMP,1)
567 AC_DEFINE(HAVE_STRSTR,1)
568 AC_DEFINE(snprintf,_snprintf,[for VC])
569 AC_DEFINE(HAVE_SOCKET,1)
570 AC_DEFINE(HAVE_VSNPRINTF,1)
571 AC_DEFINE(vsnprintf,_vsnprintf,[for VC])
572 AC_DEFINE(TIMID_VERSION,[$(PACKAGE_VERSION)],[for windows gui])
573 AC_DEFINE(DEFAULT_PATH,[".\\"],[for windows])
576 AC_CHECK_FUNC(getopt_long,
577 AC_DEFINE([HAVE_GETOPT_LONG],1,[Define to 1 if you have `getopt_long function'])
578 tm_cv_needgetopt="no",
579 tm_cv_needgetopt="yes")
580 AM_CONDITIONAL([NEEDGETOPT], test "x$tm_cv_needgetopt" = "xyes")
582 # Checks on cygnus and MYSYS
583 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes; then
584 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
586 AC_CHECK_FUNC(opendir,,
587 [ EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
590 *)EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
594 if test "x$enable_network" = "xyes"; then
595 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes; then
596 EXTRALIBS="$EXTRALIBS wsock32.lib"
597 EXTRADEFS="$EXTRADEFS -DWINSOCK"
599 AC_CHECK_FUNC(socket,,
600 WAPI_CHECK_LIB(wsock32,WSAStartup,
601 [#include <winsock.h>],
603 [ EXTRALIBS="$EXTRALIBS -lwsock32"
604 EXTRADEFS="$EXTRADEFS -DWINSOCK" ]
611 # Checks on extra paths
614 AC_ARG_WITH(tcl-includes,
615 [ --with-tcl-includes=DIR Tcl include file path ],
616 [ if test ! -d $withval; then
617 AC_MSG_WARN($withval is not found.)
619 tcl_include_dir="-I$withval"
621 AC_ARG_WITH(tcl-libs,
622 [ --with-tcl-libs=DIR Tcl library file path ],
623 [ if test ! -d $withval; then
624 AC_MSG_WARN($withval is not found.)
626 tcl_libdir="-L$withval" ])
627 AC_ARG_WITH(tk-includes,
628 [ --with-tk-includes=DIR Tk include file path ],
629 [ if test ! -d $withval; then
630 AC_MSG_WARN($withval is not found.)
632 tk_includes="-I$withval" ])
634 [ --with-tk-libs=DIR Tk library file path ],
635 [ if test ! -d $withval; then
636 AC_MSG_WARN($withval is not found.)
638 tk_libdir="-L$withval" ])
641 AC_ARG_WITH(offix-includes,
642 [ --with-offix-includes=DIR Offix include file path ],
643 [ if test ! -d $withval; then
644 AC_MSG_WARN($withval is not found.)
646 offix_include_dir="-I$withval" ])
647 AC_ARG_WITH(offix-libs,
648 [ --with-offix-libs=DIR Offix include file path ],
649 [ if test ! -d $withval; then
650 AC_MSG_WARN($withval is not found.)
652 offix_lib_dir="-L$withval" ])
658 dnl default(d): auto selection
659 dnl oss(d): OSS /dev/dsp
660 dnl alsa(d): ALSA pcm device
661 dnl sun(d): SunOS /dev/audio
662 dnl hpux(d): HPUX /dev/audio
663 dnl irix(d): IRIX audio
664 dnl mme(d): OSF/1 MME
665 dnl sb_dsp(d): BSD/OS 2.0 /dev/sb_dsp
666 dnl w32(d): Windows MMS
667 dnl darwin(d): Mac OS X pcm device
668 dnl alsa(s): ALSA pcm device
669 dnl alib(A): HPUX network audio (Alib)
670 dnl nas(n): Network Audio System
673 dnl portaudio(p) PortAudio
674 dnl vorbis(v): Ogg Vorbis
675 dnl flac(F): FLAC / OggFLAC
676 dnl speex(S): Ogg Speex
677 dnl gogo(g): MP3 GOGO
681 audio_targets='default oss alsa sun hpux irix mme sb_dsp w32 alib nas arts esd vorbis flac gogo portaudio jack ao'
683 AC_ARG_WITH(nas-library,
684 [ --with-nas-library=library NAS absolute library path(Don't use -laudio)])
685 AC_ARG_WITH(nas-includes,
686 [ --with-nas-includes=DIR NAS include files are in dir])
690 [ --enable-audio[=mode_list] Enable audio (Specify comma separated mode list):
691 default: Automatically select audio device.
693 sun: SunOS /dev/audio
694 hpux: HPUX /dev/audio
695 irix: IRIX audio library
697 sb_dsp: BSD/OS 2.0 /dev/sb_dsp
699 darwin: Darwin CoreAudio
700 alsa: ALSA pcm device
701 alib: HPUX network audio (Alib)
702 nas: NAS - Network Audio System
704 esd: EsounD - Enlightened Sound Daemon
711 gogo: MP3 GOGO (Only Windows is supported)],
712 [ enable_audio=$enableval
713 have_audio_opt=yes ],
718 test "x$enable_audio" = xyes && enable_audio=default
720 if test "x$enable_audio" != xno; then
721 for i in `echo $enable_audio | sed 's/,/ /g'`; do
722 eval "au_enable_$i=yes"
726 dnl Turn on default output mode
728 AC_ARG_WITH(default-output,
729 [ --with-default-output=<mode> Specify default output mode (optional):
730 (default|alsa|alib|arts|nas|
731 esd|wav|au|aiff|list|vorbis|flac|speex|
732 gogo|portaudio|jack|ao)],
733 [ if test "$enable_audio" != no; then
734 DEFAULT_PLAYMODE=$withval
735 eval "au_enable_$DEFAULT_PLAYMODE=yes"
737 AC_MSG_WARN(--with-default-output=$withval: audio is not enabled)
740 dnl compatibility matters.
741 dnl AC_ARG_ENABLE(esd,
742 dnl [ --enable-esd EsounD (Obsoleted. Use --enable-audio=esd)],
743 dnl [ au_enable_esd=$enableval ])
744 dnl AC_ARG_ENABLE(nas,
745 dnl [ --enable-nas NAS (Obsoleted. Use --enable-audio=nas)],
746 dnl [ au_enable_nas=$enableval ])
747 dnl AC_ARG_ENABLE(alsa,
748 dnl [ --enable-alsa ALSA (Obsoleted. Use --enable-audio=alsa)],
749 dnl [ au_enable_alsa=$enableval ])
751 dnl target-specific defaults
752 if test "x$au_enable_default" = xyes; then
754 *-*-linux*|*-*-freebsd*)
760 *-*-bsdi2.1|*-*-bsdi3.?|*-*-bsdi4.?)
791 AC_MSG_WARN(No --enable-audio=default audio for $target)
797 # Each audio mode's configurations
799 AC_MSG_CHECKING(enable_audio=oss)
800 if test "x$au_enable_oss" = xyes; then
801 EXTRADEFS="$EXTRADEFS -DAU_OSS"
802 SYSEXTRAS="$SYSEXTRAS oss_a.c"
803 if test "x$ac_cv_header_sys_soundcard_h" = xyes; then
804 AC_MSG_RESULT(yes - <sys/soundcard.h>)
808 dnl <linux/soundcard.h> or <machine/soundcard.h>
812 if test "x$ac_cv_header_soundcard_h" = xyes; then
813 AC_MSG_RESULT(yes - <soundcard.h>)
815 AC_MSG_WARN(<sys/soundcard.h> is not found)
820 AC_CHECK_LIB(ossaudio,open)
822 dnl Why OpenBSD use /dev/audio instead of /dev/dsp for OSS
825 if test ! -e "/dev/dsp"; then
826 oss_device=/dev/audio
835 AC_MSG_CHECKING(enable_audio=sun)
836 if test "x$au_enable_sun" = xyes; then
839 if test -f /usr/demo/SOUND/libaudio.a; then
840 EXTRALIBS="$EXTRALIBS /usr/demo/SOUND/libaudio.a"
843 AC_MSG_RESULT(Notice: libaudio.a is not found [(ignore)])
847 if test -f /usr/demo/SOUND/lib/libaudio.a; then
848 EXTRALIBS="$EXTRALIBS /usr/demo/SOUND/lib/libaudio.a"
851 AC_MSG_RESULT(Notice: libaudio.a is not found [(ignore)])
854 *) AC_MSG_RESULT(yes)
857 EXTRADEFS="$EXTRADEFS -DAU_SUN"
858 SYSEXTRAS="$SYSEXTRAS sun_a.c"
864 AC_MSG_CHECKING(enable_audio=hpux)
865 if test "x$au_enable_hpux" = xyes; then
867 *-*-hpux*) AC_MSG_RESULT(yes) ;;
868 *) AC_MSG_WARN(may not work on $target) ;;
870 EXTRADEFS="$EXTRADEFS -DAU_HPUX_AUDIO"
871 SYSEXTRAS="$SYSEXTRAS hpux_d_a.c"
877 AC_MSG_CHECKING(enable_audio=irix)
878 if test "x$au_enable_irix" = xyes; then
880 *-sgi-irix5*|*-sgi-irix6.2)
881 EXTRADEFS="$EXTRADEFS -DAU_AUDRIV -DSGI_OLDAL"
885 EXTRADEFS="$EXTRADEFS -DAU_AUDRIV -DSGI_NEWAL"
888 *) AC_MSG_WARN(may not work on $target) ;;
890 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_al.c"
891 EXTRALIBS="$EXTRASLIBS -laudio"
897 AC_MSG_CHECKING(enable_audio=mme)
898 if test "x$au_enable_mme" = xyes; then
900 *-dec-*) AC_MSG_RESULT(yes) ;;
901 *) AC_MSG_WARN(may not work on $target) ;;
903 EXTRADEFS="$EXTRADEFS -DAU_DEC -DAU_AUDRIV"
904 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_mme.c"
905 CPPFLAGS="$CPPFLAGS -I/usr/opt/MME210/include"
906 EXTRALIBS="$EXTRALIBS /usr/opt/MME220/lib/libmme.a"
912 AC_MSG_CHECKING(enable_audio=sb_dsp)
913 if test "x$au_enable_sb_dsp" = xyes; then
915 *-*-bsdi2.0) AC_MSG_RESULT(yes) ;;
916 *) AC_MSG_WARN(may not work on $target) ;;
918 EXTRADEFS="$EXTRADEFS -DAU_BSDI -DDEFAULT_RATE=22500"
919 SYSEXTRAS="$SYSEXTRAS bsd20_a.c"
925 AC_MSG_CHECKING(enable_audio=w32)
926 if test "x$au_enable_w32" = xyes; then
935 AC_MSG_WARN(may not work on $target)
938 SYSEXTRAS="$SYSEXTRAS w32_a.c"
939 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes; then
940 EXTRALIBS="$EXTRALIBS winmm.lib"
942 EXTRALIBS="$EXTRALIBS -lwinmm"
944 EXTRADEFS="$EXTRADEFS -DAU_W32"
949 dnl Mac OS X / darwin-x86
950 AC_MSG_CHECKING(enable_audio=darwin)
951 if test "x$au_enable_darwin" = xyes; then
952 EXTRADEFS="$EXTRADEFS -DAU_DARWIN"
953 SYSEXTRAS="$SYSEXTRAS darwin_a.c"
954 EXTRALIBS="$EXTRALIBS -framework CoreAudio"
955 dnl just say yes or no :-P
960 AC_MSG_WARN(may not work on $target)
968 dnl alsa - Advanced Linux Sound Architecture
969 AC_MSG_CHECKING(enable_audio=alsa)
970 if test "x$au_enable_alsa" = xyes; then
971 AC_MSG_RESULT([yes, configuring alsa])
976 if test "x$alsa_found" = "xyes" ; then
977 dnl AC_MSG_RESULT(yes)
978 EXTRADEFS="$EXTRADEFS -DAU_ALSA"
979 SYSEXTRAS="$SYSEXTRAS alsa_a.c"
980 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ALSA_CFLAGS)
981 LIBS="$LIBS $ALSA_LIBS"
982 AC_CHECK_FUNCS(snd_seq_port_info_set_timestamping)
984 AC_MSG_WARN(Couldn't configure alsa.)
994 AC_MSG_CHECKING(enable_audio=alib)
995 if test "x$au_enable_alib" = xyes; then
997 *-*-hpux*) AC_MSG_RESULT(yes) ;;
998 *) AC_MSG_WARN(may not work on $target) ;;
1000 SYSEXTRAS="$SYSEXTRAS hpux_a.c"
1001 EXTRADEFS="$EXTRADEFS -DAU_HPUX_ALIB"
1002 if test -d /opt/audio/include; then
1003 CPPFLAGS="$CPPFLAGS -I/opt/audio/include"
1005 if test -d /opt/audio/lib; then
1006 EXTRALIBS="$EXTRALIBS -L/opt/audio/lib"
1008 EXTRALIBS="$EXTRALIBS -lAlib"
1014 AC_MSG_CHECKING(enable_audio=nas)
1015 if test "x$au_enable_nas" = xyes; then
1016 if test "x$with_x" != xyes; then
1017 AC_MSG_ERROR(nas: --with-x option must be specified)
1019 EXTRADEFS="$EXTRADEFS -DAU_NAS"
1020 SYSEXTRAS="$SYSEXTRAS nas_a.c"
1022 dnl -laudio conflicts another audio library,
1023 dnl so I specify NAS library with absolete path.
1025 if test "x$with_nas_library" != x; then
1026 AC_MSG_RESULT($with_nas_library);
1027 EXTRALIBS="$EXTRALIBS $with_nas_library"
1030 MY_SEARCH_LIBS(AuOpenServer,
1031 [$x_libraries/libaudio.a \
1032 /usr/lib/libaudio.so \
1033 /usr/lib/libaudio.a ],
1034 [ AC_MSG_RESULT(NAS: $timidity_cv_search_AuOpenServer)
1035 EXTRALIBS="$EXTRALIBS $timidity_cv_search_AuOpenServer"],
1036 [AC_MSG_WARN(NAS library is not found.)])
1038 test "x$with_nas_includes" != x && CPPFLAGS="$CPPFLAGS -I$with_nas_includes"
1040 if test "x$have_xext" = xyes; then
1043 if test "x$have_xprelibs" = xyes; then
1044 lib_xprelibs_opt='-lSM -lICE'
1051 AC_MSG_CHECKING(enable_audio=arts)
1052 if test "x$au_enable_arts" = xyes; then
1053 AC_MSG_RESULT([yes, configuring aRts])
1056 KEEPLDFLAGS=$LDFLAGS
1060 LDFLAGS=$KEEPLDFLAGS
1061 if test "x$no_arts" = x; then
1062 dnl AC_MSG_RESULT(aRts: Enabled)
1063 EXTRADEFS="$EXTRADEFS -DAU_ARTS"
1064 SYSEXTRAS="$SYSEXTRAS aRts_a.c"
1065 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ARTS_CFLAGS)
1066 LIBS="$LIBS $ARTS_LIBS"
1068 AC_MSG_WARN(aRts: Couldn't configure)
1075 AC_MSG_CHECKING(enable_audio=esd)
1076 if test "x$au_enable_esd" = xyes; then
1077 AC_MSG_RESULT([yes, configuring esd])
1080 KEEPLDFLAGS=$LDFLAGS
1084 LDFLAGS=$KEEPLDFLAGS
1085 if test "x$no_esd" = x; then
1086 dnl AC_MSG_RESULT(EsounD: Enabled)
1087 EXTRADEFS="$EXTRADEFS -DAU_ESD"
1088 SYSEXTRAS="$SYSEXTRAS esd_a.c"
1089 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ESD_CFLAGS)
1090 LIBS="$LIBS $ESD_LIBS"
1092 AC_MSG_WARN(EsounD: Couldn't configure)
1099 AC_MSG_CHECKING(enable_audio=portaudio)
1100 if test "x$au_enable_portaudio" = xyes; then
1102 if test "x$CYGNUS" = xyes ||test "x$MSYS" = xyes; then
1103 SYSEXTRAS="$SYSEXTRAS portaudio_a.c w32_portaudio_dll.c"
1104 EXTRALIBS="$EXTRALIBS -lportaudio"
1105 EXTRADEFS="$EXTRADEFS -DAU_PORTAUDIO -DAU_PORTAUDIO_DLL"
1107 SYSEXTRAS="$SYSEXTRAS portaudio_a.c"
1108 EXTRALIBS="$EXTRALIBS -lportaudio"
1109 EXTRADEFS="$EXTRADEFS -DAU_PORTAUDIO"
1116 AC_MSG_CHECKING(enable_audio=jack)
1117 if test "x$au_enable_jack" = xyes; then
1119 SYSEXTRAS="$SYSEXTRAS jack_a.c"
1120 EXTRALIBS="$EXTRALIBS $(pkg-config --libs jack)"
1121 EXTRADEFS="$EXTRADEFS -DAU_JACK $(pkg-config --cflags jack)"
1127 AC_MSG_CHECKING(enable_audio=ao)
1128 if test "x$au_enable_ao" = xyes; then
1129 AC_MSG_RESULT([yes, configuring ao])
1131 if test "x$no_ao" = "x" ; then
1133 EXTRADEFS="$EXTRADEFS -DAU_AO"
1134 SYSEXTRAS="$SYSEXTRAS ao_a.c"
1135 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$AO_CFLAGS)
1136 LIBS="$LIBS $AO_LIBS"
1138 AC_MSG_WARN(Couldn't configure libao.)
1145 AC_MSG_CHECKING(enable_audio=vorbis)
1146 if test "x$au_enable_vorbis" = xyes; then
1147 AC_MSG_RESULT([yes, configuring vorbis])
1151 SYSEXTRAS="$SYSEXTRAS vorbis_a.c"
1152 EXTRADEFS="$EXTRADEFS -DAU_VORBIS $OGG_CFLAGS $VORBIS_CFLAGS"
1153 EXTRALIBS="$EXTRALIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"
1154 if test "x$CYGNUS" = "xyes"; then
1155 EXTRADEFS="-DAU_VORBIS_DLL $EXTRADEFS"
1156 SYSEXTRAS="$SYSEXTRAS w32g_vorbisenc_dll.c w32g_vorbis_dll.c w32g_ogg_dll.c"
1158 if test "x$MSYS" = "xyes"; then
1159 EXTRADEFS="-DAU_VORBIS_DLL $EXTRADEFS"
1160 SYSEXTRAS="$SYSEXTRAS w32g_vorbisenc_dll.c w32g_vorbis_dll.c w32g_ogg_dll.c"
1163 AC_MSG_WARN([Unable to configure vorbis, but ogg is there (???)])
1166 AC_MSG_WARN(Unable to configure vorbis!)
1173 dnl libFLAC - Free Lossless Audio Codec
1174 if test "x$CYGNUS" = xyes || test "x$MSYS" = xyes ; then
1175 AC_MSG_CHECKING(enable_audio=flac)
1176 if test "x$au_enable_flac" = xyes; then
1177 AC_MSG_RESULT([yes, configuring flac])
1178 SYSEXTRAS="$SYSEXTRAS flac_a.c w32_libFLAC_dll.c w32_libOggFLAC_dll.c"
1180 EXTRADEFS="$EXTRADEFS -DAU_FLAC -DAU_FLAC_DLL"
1181 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$LIBFLAC_CFLAGS)
1182 LIBS="$LIBS $LIBFLAC_LIBS"
1184 AM_PATH_LIBOGGFLAC([
1185 EXTRADEFS="$EXTRADEFS -DAU_OGGFLAC -DAU_OGGFLAC_DLL"
1186 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$LIBOGGFLAC_CFLAGS)
1187 LIBS="$LIBS $LIBOGGFLAC_LIBS"
1193 AC_MSG_CHECKING(enable_audio=flac)
1194 if test "x$au_enable_flac" = xyes; then
1195 AC_MSG_RESULT([yes, configuring flac])
1196 SYSEXTRAS="$SYSEXTRAS flac_a.c"
1198 EXTRADEFS="$EXTRADEFS -DAU_FLAC"
1199 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$LIBFLAC_CFLAGS)
1200 LIBS="$LIBS $LIBFLAC_LIBS"
1202 AM_PATH_LIBOGGFLAC([
1203 EXTRADEFS="$EXTRADEFS -DAU_OGGFLAC"
1204 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$LIBOGGFLAC_CFLAGS)
1205 LIBS="$LIBS $LIBOGGFLAC_LIBS"
1212 AC_MSG_CHECKING(enable_audio=speex)
1213 if test "x$au_enable_speex" = xyes; then
1214 AC_CACHE_VAL(have_speex,
1217 #include <ogg/ogg.h>
1222 [have_speex=yes], [have_speex=no])])
1223 AC_MSG_RESULT($have_speex)
1224 if test "x$have_speex" = xyes; then
1225 SYSEXTRAS="$SYSEXTRAS speex_a.c"
1226 EXTRALIBS="$EXTRALIBS -lspeex -logg"
1227 EXTRADEFS="$EXTRADEFS -DAU_SPEEX"
1233 dnl Win32 Gogo-no-coder
1234 AC_MSG_CHECKING(enable_audio=gogo)
1235 if test "x$au_enable_gogo" = xyes; then
1236 if test "x$CYGNUS" = "xyes"; then
1237 AC_MSG_RESULT(yes, configuring gogo)
1239 if test "x$MSYS" = "xyes"; then
1240 AC_MSG_RESULT(yes, configuring gogo)
1242 AC_MSG_WARN(May be gogo is not supported. You need hack the gogo_a.c)
1246 SYSEXTRAS="$SYSEXTRAS gogo_a.c w32_gogo.c"
1247 EXTRADEFS="$EXTRADEFS -DAU_GOGO -DAU_GOGO_DLL"
1248 EXTRALIBS="$EXTRALIBS -lgogo"
1253 dnl Pseudo audio device (Undocumented).
1254 if test "x$au_enable_none" = xyes; then
1255 EXTRADEFS="$EXTRADEFS -DAU_NONE -DAU_AUDRIV"
1256 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_none.c"
1259 dnl TIMIDITY_OUTPUT_ID
1261 AC_MSG_CHECKING(default output mode)
1262 if test "x$DEFAULT_PLAYMODE" = x; then
1263 DEFAULT_PLAYMODE=`echo $enable_audio | sed 's/,.*//'`
1265 case ".$DEFAULT_PLAYMODE" in
1266 .default) TIMIDITY_OUTPUT_ID=d ;;
1267 .oss) TIMIDITY_OUTPUT_ID=d ;;
1268 .alsa) TIMIDITY_OUTPUT_ID=s ;;
1269 .sun) TIMIDITY_OUTPUT_ID=d ;;
1270 .hpux) TIMIDITY_OUTPUT_ID=d ;;
1271 .irix) TIMIDITY_OUTPUT_ID=d ;;
1272 .mme) TIMIDITY_OUTPUT_ID=d ;;
1273 .sb_dsp) TIMIDITY_OUTPUT_ID=d ;;
1274 .darwin) TIMIDITY_OUTPUT_ID=d ;;
1275 .w32) TIMIDITY_OUTPUT_ID=d ;;
1276 .alib) TIMIDITY_OUTPUT_ID=A ;;
1277 .nas) TIMIDITY_OUTPUT_ID=n ;;
1278 .arts) TIMIDITY_OUTPUT_ID=R ;;
1279 .esd) TIMIDITY_OUTPUT_ID=e ;;
1280 .portaudio) TIMIDITY_OUTPUT_ID=p ;;
1281 .wav) TIMIDITY_OUTPUT_ID=w ;;
1282 .au) TIMIDITY_OUTPUT_ID=u ;;
1283 .aiff) TIMIDITY_OUTPUT_ID=a ;;
1284 .list) TIMIDITY_OUTPUT_ID=l ;;
1285 .vorbis) TIMIDITY_OUTPUT_ID=v ;;
1286 .flac) TIMIDITY_OUTPUT_ID=F ;;
1287 .speex) TIMIDITY_OUTPUT_ID=S ;;
1288 .gogo) TIMIDITY_OUTPUT_ID=g ;;
1289 .jack) TIMIDITY_OUTPUT_ID=j ;;
1290 *) TIMIDITY_OUTPUT_ID= ;;
1292 AC_MSG_RESULT($DEFAULT_PLAYMODE/$TIMIDITY_OUTPUT_ID)
1298 interface_targets='dynamic ncurses slang motif tcltk emacs vt100 xaw xskin gtk alsaseq winsyn winsyng portmidisyng'
1300 AC_ARG_ENABLE(interface,
1301 [ --enable-interface=[interface_list]
1302 Comma separated interface list ],
1303 [ for i in `echo $enableval | sed 's/,/ /g'`; do
1304 eval "enable_$i=yes"
1307 # Dynamic link configuration
1308 AC_ARG_ENABLE(dynamic,
1309 [ --enable-dynamic Enable dynamic link interface (default is no)
1310 --enable-dynamic=dynamic_list
1311 Comma separated dynamic interface list],
1312 [ dnl --enable-dynamic=yes to --enable-dynamic=dynamic
1313 if test "x$enable_dynamic" = xyes; then
1314 enable_dynamic=dynamic
1315 elif test "x$enable_dynamic" != xno; then
1316 for i in `echo $enableval | sed 's/,/ /g'`; do
1317 eval "enable_$i=dynamic"
1322 for i in $interface_targets; do
1323 eval "join_targets=$join_targets\$enable_$i"
1326 case ".$join_targets" in
1327 .*dynamic*) NEEDDLOPEN=yes;;
1331 dnl check -fpic option for gcc
1332 if test "x$GCC" = xyes; then SHCFLAGS="$SHCFLAGS -fPIC"; fi
1333 case "x$enable_ump" in xyes|xdynamic) EXTRACFLAGS="$EXTRACFLAGS -DXP_UNIX $SHCFLAGS";; esac
1335 dnl Which type of dynamic loader?
1336 if test "$NEEDDLOPEN" = "yes"; then
1339 WAPI_CHECK_FUNC(LoadLibrary,,[LoadLibrary(0);],have_dl=w32)
1340 test $wapi_cv_func_LoadLibrary = yes && have_dl=w32
1342 if test "$have_dl" = "no"; then
1343 AC_CHECK_FUNC(shl_load,have_dl=hpux)
1345 if test "$have_dl" = "no"; then
1346 dnl darwin has both dyld and libdl: in case user installed dlcompat.
1347 dnl dyld is recommended because libdl is a wrapper for dyld.
1348 AC_CHECK_FUNC(NSLinkModule,have_dl=dyld)
1350 if test "$have_dl" = "no" -a "x$ac_cv_lib_dl_dlopen" = xyes; then
1353 if test "$have_dl" = "no"; then
1354 AC_CHECK_FUNC(dlopen,have_dl=dlopen)
1356 if test "$have_dl" = "no"; then
1357 AC_CHECK_FUNC(dld_init,have_dl=dld)
1359 if test "$have_dl" = "no"; then
1360 AC_CHECK_LIB(dld,dld_init,have_dl=dld;lib_dl_opt=-ldld)
1363 AC_MSG_CHECKING(dynamic link method)
1366 AC_MSG_RESULT(use dl_dlopen.c)
1367 SYSEXTRAS="$SYSEXTRAS dl_dlopen.c"
1368 CHECK_DLSYM_UNDERSCORE(AC_DEFINE(DLSYM_NEEDS_UNDERSCORE,1,Define to 1 if you have to add "_" to every identifiers.))
1371 AC_MSG_RESULT(use dl_dld.c)
1372 SYSEXTRAS="$SYSEXTRAS dl_dld.c"
1375 AC_MSG_RESULT(use dl_hpux.c)
1376 SYSEXTRAS="$SYSEXTRAS dl_hpux.c"
1377 LDFLAGS="$LDFLAGS -Wl,-E $LDFLAGS"
1380 AC_MSG_RESULT(use dl_w32.c)
1381 SYSEXTRAS="$SYSEXTRAS dl_w32.c"
1384 AC_MSG_RESULT(use dl_dyld.c)
1385 SYSEXTRAS="$SYSEXTRAS dl_dyld.c"
1389 AC_MSG_WARN(no method to open a shared object)
1394 if test "$NEEDDLOPEN" = "yes"; then
1395 MY_DEFINE(IA_DYNAMIC)
1396 AC_DEFINE_UNQUOTED(SHARED_LIB_EXT,".$so", shared library extention)
1398 dnl EXTRADEFS="$EXTRADEFS \$(DEF_SHLIB_DIR)"
1399 test "x$GCC" = xyes -a "x$timidity_cv_ccoption_rdynamic" = xyes && timidity_LDFLAGS="-rdynamic"
1402 AM_CONDITIONAL(NEEDDLOPEN, test "$NEEDDLOPEN" = "yes")
1405 dnl Each interface section
1409 AM_CONDITIONAL(ENABLE_NCURSES, false)
1410 CONFIG_INTERFACE(ncurses,NCURSES,n,
1411 [ --enable-ncurses Enable ncurses interface (default is no)],
1412 [ AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h)
1414 dnl #include <ncurses/curses.h> is failure on Plamo Linux 1.3/ncurses 1.9.9e
1415 dnl because <ncurses/curses.h> includes <unctrl.h>:
1416 dnl /usr/include/ncurses/curses.h:34: unctrl.h: No such file or directory
1417 dnl But surely there is unctl.h at /usr/include/ncurses/unctrl.h.
1418 dnl configure must check ncurses header with -I/usr/include/ncurses option.
1420 case "$ac_cv_header_curses_h$ac_cv_header_ncurses_curses_h$ac_cv_header_ncurses_h" in
1422 *) for i in /usr/include /usr/local/include; do
1423 if test -f "$i/ncurses/curses.h" -a -f "$i/ncurses/unctrl.h"; then
1424 AC_MSG_WARN(ncurses test is failure. Please check config.h and common.makefile later)
1425 CPPFLAGS="$CPPFLAGS -I$i/ncurses"
1432 AC_CHECK_LIB(ncurses,initscr,lib_curses_opt=-lncurses,
1433 [ dnl checking pdcurses
1434 AC_CHECK_LIB(curses,PDC_set_ctrl_break,
1435 [ lib_curses_opt=-lcurses
1436 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
1437 lib_user32_opt="$lib_user32_test"
1439 [ dnl checking libpdcurses
1440 AC_CHECK_LIB(pdcurses,PDC_set_ctrl_break,
1441 [ lib_curses_opt=-lpdcurses
1442 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
1443 lib_user32_opt="$lib_user32_test"
1445 [ dnl OpenBSD use -lcurses instead of -lncurses.
1448 AC_CHECK_LIB(curses,initscr,lib_curses_opt=-lcurses,
1449 [ AC_MSG_WARN(ncurses interface is not enabled)
1450 enable_ncurses=no ])
1453 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes; then
1454 lib_curses_opt=libpdcurses.lib
1455 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
1457 AC_MSG_WARN(ncurses interface is not enabled)
1467 [ LIBS="$LIBS $lib_curses_opt"
1470 EXTRALIBS="$EXTRALIBS -lmytinfo"
1473 INTERFACE_SRCS="$INTERFACE_SRCS ncurs_c.c"
1475 [ n_so_libs="$lib_curses_opt"
1478 EXTRALIBS="$EXTRALIBS -lmytinfo"
1483 AM_CONDITIONAL(ENABLE_SLANG, false)
1484 CONFIG_INTERFACE(slang,SLANG,s,
1485 [ --enable-slang Enable slang interface (default is no)],
1486 [ AC_CHECK_LIB(slang,SLang_init_tty,:,
1488 AC_MSG_WARN(slang interface is not enabled)
1490 AC_CHECK_HEADERS(slang/slang.h slang.h)
1492 [ LIBS="$LIBS -lslang"
1493 INTERFACE_SRCS="$INTERFACE_SRCS slang_c.c"
1495 [ s_so_libs="-lslang"
1496 AC_CHECK_LIB(termcap,initscr,s_so_libs="$s_so_libs -ltermcap")
1500 AM_CONDITIONAL(ENABLE_MOTIF, false)
1501 CONFIG_INTERFACE(motif,MOTIF,m,
1502 [ --enable-motif Enable motif interface (default is no)],
1503 [ if test "x$with_x" != xyes; then
1504 AC_MSG_ERROR(motif: --with-x option must be specified)
1506 if test "x$have_xm" != xyes; then
1507 AC_MSG_WARN(Motif library is not found.)
1514 if test "x$have_xprelibs" = xyes; then
1515 lib_xprelibs_opt='-lSM -lICE'
1517 INTERFACE_SRCS="$INTERFACE_SRCS motif_c.c motif_i.c motif_p.c"
1519 [ if test x$have_xprelibs = xyes; then
1520 m_so_libs="-lXext -lSM -lICE"
1522 m_so_libs="$ldflags_x_opt -lXm -lXt $m_so_libs -lX11"
1526 AM_CONDITIONAL(ENABLE_TCLTK, false)
1527 CONFIG_INTERFACE(tcltk,TCLTK,k,
1528 [ --enable-tcltk Enable tcltk interface (default is no)],
1529 [ if test "x$with_x" != xyes; then
1530 AC_MSG_ERROR(tcltk: --with-x option must be specified)
1534 KEEPCPPFLAGS=$CPPFLAGS
1535 KEEPLDFLAGS=$LDFLAGS
1538 CPPFLAGS="$tcl_include_dir $tk_includes $CPPFLAGS"
1539 LDFLAGS="$tcl_libdir $tk_libdir $LDFLAGS"
1540 LIBS="$LIBS $lib_dl_opt"
1544 for l in tcl tcl8.4 tcl8.3 tcl8.0jp tcl7.6jp tcl80jp tcl76jp tcl8.0 tcl7.6 tcl80 tcl76; do
1545 case "x$tcl_lib" in x) AC_CHECK_LIB($l,Tcl_Init,tcl_lib=-l$l);; esac
1547 LIBS="$LIBS $tcl_lib"
1548 for l in tk tk8.4 tk8.3 tk8.0jp tk4.2jp tk80jp tk42jp tk8.0 tk4.2 tk80 tk42; do
1549 case "x$tk_lib" in x) AC_CHECK_LIB($l,Tk_Init,tk_lib=-l$l);; esac
1553 if test "x$tcl_lib" = x -o "x$tk_lib" = x; then
1554 CPPFLAGS=$KEEPCPPFLAGS
1555 LDFLAGS=$KEEPLDFLAGS
1557 AC_MSG_WARN(tcl/tk is not enable)
1559 tcltk_dep='tclIndex'
1562 [ LIBS=`echo $LIBS | sed "s/-lX11/$tk_lib $tcl_lib -lX11/"`
1565 EXTRALIBS="$EXTRALIBS -lipc"
1568 INTERFACE_SRCS="$INTERFACE_SRCS tk_c.c"
1570 [ k_so_libs="$tcl_libdir $tk_libdir $tcl_lib $tk_lib $lib_dl_opt"
1573 k_so_libs="$k_so_libs -lipc"
1576 k_so_libs="$k_so_libs -lX11 -lm"
1578 AM_CONDITIONAL(ENABLE_DYNAMIC_TCLTK, test "x$enable_tcltk" = "xdynamic")
1581 AM_CONDITIONAL(ENABLE_EMACS, false)
1582 CONFIG_INTERFACE(emacs,EMACS,e,
1583 [ --enable-emacs Enable emacs interface (default is no)],
1585 [ ELFILES="$ELFILES timidity.el"
1586 INTERFACE_SRCS="$INTERFACE_SRCS emacs_c.c"
1588 [ ELFILES="$ELFILES timidity.el" ])
1591 AM_CONDITIONAL(ENABLE_VT100, false)
1592 CONFIG_INTERFACE(vt100,VT100,T,
1593 [ --enable-vt100 Enable VT100 interface (default is no)],
1595 [ INTERFACE_SRCS="$INTERFACE_SRCS vt100_c.c vt100.c" ])
1598 AM_CONDITIONAL(ENABLE_XAW, false)
1599 CONFIG_INTERFACE(xaw,XAW,a,
1600 [ --enable-xaw Enable athena interface (default is no)],
1601 [ if test "x$with_x" != xyes; then
1602 AC_MSG_ERROR(xaw: --with-x option must be specified)
1604 if test "x$have_xaw" != "xyes" -a "x$have_xaw" != "x3d"; then
1605 AC_MSG_WARN(X Athena Widget library is not found.)
1608 [ dnl Add -lXext -lSM -lICE -lXmu -lXt {-lXaw|-lXaw3d}
1609 if test "x$have_xext" = xyes; then
1612 if test "x$have_xprelibs" = xyes; then
1613 lib_xprelibs_opt='-lSM -lICE'
1617 if test "x$have_xaw" = x3d; then
1618 AC_DEFINE(XAW3D,1,Define to 1 if you have libXaw3d.)
1623 INTERFACE_SRCS="$INTERFACE_SRCS xaw_c.c xaw_i.c"
1625 [ if test "x$have_xext" = xyes; then
1626 a_so_libs="-lXext -lX11"
1632 a_so_libs="$a_so_libs -lcc_dynamic"
1635 if test "x$have_xprelibs" = xyes; then
1636 a_so_libs="-lSM -lICE $a_so_libs"
1638 if test "x$have_xaw" = xyes; then
1639 a_so_libs="-lXaw -lXmu -lXt $a_so_libs"
1640 elif test "x$have_xaw" = x3d; then
1641 AC_DEFINE(XAW3D,1,Define to 1 if you have libXaw3d.)
1642 a_so_libs="-lXaw3d -lXmu -lXt $a_so_libs"
1644 a_so_libs="$ldflags_x_opt $a_so_libs"
1646 AM_CONDITIONAL(ENABLE_DYNAMIC_XAW, test "x$enable_xaw" = "xdynamic")
1649 AM_CONDITIONAL(ENABLE_XSKIN, false)
1650 CONFIG_INTERFACE(xskin,XSKIN,i,
1651 [ --enable-xskin Enable X skin interface (default is no)],
1652 [ if test "x$with_x" != xyes; then
1653 AC_MSG_ERROR(xskin: --with-x option must be specified)
1656 [ INTERFACE_SRCS="$INTERFACE_SRCS xskin_c.c xskin_i.c xskin_loadBMP.c xskin_spectrum.c" ],
1657 [ i_so_libs="$ldflags_x_opt -lX11" ])
1660 AM_CONDITIONAL(ENABLE_GTK, false)
1661 CONFIG_INTERFACE(gtk, GTK, g,
1662 [ --enable-gtk Enable GTK+ interface (default is no)],
1663 [ AM_PATH_GTK(1.1.3,,enable_gtk=no) ],
1664 [ LIBS="$LIBS $GTK_LIBS"
1665 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$GTK_CFLAGS)
1666 INTERFACE_SRCS="$INTERFACE_SRCS gtk_c.c gtk_i.c gtk_p.c"
1668 [ if test "x$GCC" = xyes; then
1669 dnl Do not include -rdynamic option in $g_so_libs.
1670 for i in $GTK_LIBS; do
1673 *) g_so_libs="$g_so_libs $i" ;;
1677 g_so_libs="$GTK_LIBS"
1679 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$GTK_CFLAGS) ])
1681 dnl TiMidity Network MIDI Server
1682 AM_CONDITIONAL(ENABLE_SERVER, false)
1683 CONFIG_INTERFACE(server,SERVER,r,
1684 [ --enable-server Enable server interface (default is no)],
1686 [ INTERFACE_SRCS="$INTERFACE_SRCS server_c.c"
1687 AC_CHECK_HEADERS(sys/soundcard.h)
1690 dnl TiMidity ALSA sequencer server
1691 AM_CONDITIONAL(ENABLE_ALSASEQ, false)
1692 CONFIG_INTERFACE(alsaseq,ALSASEQ,A,
1693 [ --enable-alsaseq Enable ALSA sequencer server interface
1696 [ INTERFACE_SRCS="$INTERFACE_SRCS alsaseq_c.c"
1700 dnl TiMidity Windows synthesizer server
1701 AM_CONDITIONAL(ENABLE_WINSYN, false)
1702 CONFIG_INTERFACE(winsyn,WINSYN,W,
1703 [ --enable-winsyn Enable Windows Synthesizer interface
1706 [ INTERFACE_SRCS="$INTERFACE_SRCS winsyn_c.c rtsyn_common.c rtsyn_winmm.c" ])
1708 dnl TiMidity PortMIDI synthesizer server
1709 AM_CONDITIONAL(ENABLE_PORTMIDISYN, false)
1710 CONFIG_INTERFACE(portmidisyn,PORTMIDISYN,P,
1711 [ --enable-portmidisyn Enable PortMIDI Synthesizer interface
1714 [ INTERFACE_SRCS="$INTERFACE_SRCS portmidisyn_c.c rtsyn_common.c rtsyn_portmidi.c" ])
1716 dnl TiMidity Windows GUI synthesizer server
1717 AM_CONDITIONAL(ENABLE_W32G_SYN, false)
1718 CONFIG_INTERFACE(winsyng,W32G_SYN,W,
1719 [ --enable-winsyng Enable Windows GUI Synthesizer interface
1723 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes; then
1724 INTERFACE_SRCS="$INTERFACE_SRCS w32g_ini.c w32g_pref.c w32g_syn.c w32g_utl.c winsyn_c.c rtsyn_common.c rtsyn_winmm.c"
1725 lib_w32gui_opt='gdi32.lib comctl32.lib comdlg32.lib ole32.lib'
1726 lib_user32_opt='user32.lib'
1727 if test "x$VCPP" = xyes; then
1728 VCPP_LDFLAGS="$VCPP_LDFLAGS -subsystem:windows "
1730 BORLANDC_START='C0W32.OBJ'
1731 CFLAGS="$CFLAGS -tW"
1732 lib_w32gui_opt="-aa $lib_w32gui_opt"
1735 lib_w32gui_opt='-lgdi32 -lcomctl32 -lcomdlg32 -lole32'
1736 lib_user32_opt='-luser32'
1737 LDFLAGS="-mwindows $LDFLAGS"
1738 INTERFACE_SRCS="$INTERFACE_SRCS w32g_ini.c w32g_pref.c w32g_syn_escaped.c w32g_utl.c winsyn_c.c rtsyn_common.c rtsyn_winmm.c"
1744 AM_CONDITIONAL(ENABLE_W32GUI, false)
1745 CONFIG_INTERFACE(w32gui, W32GUI, w,
1746 [ --enable-w32gui Enable Windows GUI interface (default is no)],
1749 if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes; then
1750 INTERFACE_SRCS="$INTERFACE_SRCS w32g_c.c w32g_ini.c w32g_i.c w32g_playlist.c w32g_utl.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"
1751 lib_w32gui_opt='gdi32.lib comctl32.lib comdlg32.lib ole32.lib'
1752 lib_user32_opt='user32.lib'
1753 if test "x$VCPP" = xyes; then
1754 VCPP_LDFLAGS="$VCPP_LDFLAGS -subsystem:windows "
1756 BORLANDC_START='C0W32.OBJ'
1757 CFLAGS="$CFLAGS -tW"
1758 lib_w32gui_opt="-aa $lib_w32gui_opt"
1761 lib_w32gui_opt='-lgdi32 -lcomctl32 -lcomdlg32 -lole32'
1762 lib_user32_opt='-luser32'
1763 LDFLAGS="-mwindows $LDFLAGS"
1764 INTERFACE_SRCS="$INTERFACE_SRCS w32g_c.c w32g_ini.c w32g_i.c w32g_playlist.c w32g_utl.c w32g_pref.c w32g_subwin_escaped.c w32g_subwin2.c w32g_subwin3.c w32g_ut2.c w32g_dib.c wrdt_w32g.c w32g_mag.c"
1768 dnl UMP configuration
1769 AM_CONDITIONAL(ENABLE_PLUGIN, false)
1770 CONFIG_INTERFACE(ump, PLUGIN, p,
1771 [ --enable-ump UMP configuration (default is no)],
1772 [ if test ! -d ump; then
1773 AC_MSG_ERROR(UMP Package is not exists. Can't configure it.)
1775 AC_CHECK_HEADER(X11/xpm.h,,AC_MSG_ERROR([UMP Package needs xpm.h[,] but could not find it.]))
1776 AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,:,AC_MSG_ERROR([UMP Package needs libXpm.a[,] but could not find it.]))
1777 if test "x$have_xext" = xyes; then
1780 if test "x$have_xprelibs" = xyes; then
1781 lib_xprelibs_opt='-lSM -lICE'
1789 dnl this rely on CFLAGS and LIBS
1790 AC_ARG_ENABLE(offix,
1791 [ --enable-offix Enable offix support (default is no)],
1792 [ if test "$enableval" = "yes"; then
1793 KEEPCPPFLAGS=$CPPFLAGS
1795 KEEPLDFLAGS=$LDFLAGS
1796 CPPFLAGS="$CPPFLAGS $offix_include_dir"
1797 LDFLAGS="$LDFLAGS $offix_lib_dir"
1798 LIBS="$LIBS $lib_xmu_opt $lib_xt_opt $lib_xprelibs_opt $lib_xext_opt -lX11"
1799 AC_CHECK_LIB(Dnd,DndInitialize,[
1801 lib_offix_opt="-lDnd"
1802 AC_DEFINE(OFFIX,1,Define to 1 if you need offix support)
1804 [ LDFLAGS=$KEEPLDFLAGS
1805 CPPFLAGS=$KEEPCPPFLAGS
1812 AC_ARG_ENABLE(network,
1813 [ --enable-network Enable network support (default is no)],
1814 [ if test "$enableval" = "yes"; then
1815 AC_DEFINE(SUPPORT_SOCKET,1,Define to 1 if you need network support)
1817 AM_CONDITIONAL(ENABLE_NETWORK, test "x$enable_network" = "xyes")
1819 dnl Sound Spectrogram Viewer
1820 AC_ARG_ENABLE(spectrogram,
1821 [ --enable-spectrogram Enable Sound Spectrogram Viewer (default is no)],
1822 [ if test "$enableval" = "yes"; then
1823 if test "x$with_x" != xyes; then
1824 AC_MSG_ERROR(spectrogram: --with-x option must be specified)
1826 AC_DEFINE(SUPPORT_SOUNDSPEC,1,Define to 1 if you need spectrogram vewer.)
1828 AM_CONDITIONAL(ENABLE_SOUND_SPEC, test "x$enable_spectrogram" = "xyes")
1830 dnl Wave Spline Interpolations
1831 AC_ARG_ENABLE(spline,
1832 [ --enable-spline=[method] Specify spline method.
1833 one of no,linear,cubic,lagrange,newton,gauss
1834 (default is linear)],
1835 [ case "x$enableval" in
1837 AC_DEFINE(DEFAULT_RESAMPLATION,resample_linear,Define resampler.)
1840 AC_DEFINE(DEFAULT_RESAMPLATION,resample_cspline,Define resampler.)
1843 AC_DEFINE(DEFAULT_RESAMPLATION,resample_lagrange,Define resampler.)
1846 AC_DEFINE(DEFAULT_RESAMPLATION,resample_newton,Define resampler.)
1849 AC_DEFINE(DEFAULT_RESAMPLATION,resample_gauss,Define resampler.)
1852 AC_DEFINE(DEFAULT_RESAMPLATION,resample_none,Define resampler.)
1855 AC_MSG_ERROR(Invalid method of --enable-spline)
1861 [ --enable-wrd Enable WRD interface for X (default is no)],
1862 [ if test "$enableval" = "yes"; then
1863 if test "x$with_x" != xyes; then
1864 AC_MSG_ERROR(wrd: --with-x option must be specified)
1866 AC_DEFINE(WRDT_X,1,Define to 1 if you need wrd support for X.)
1867 enable_sherry_wrd=yes
1868 AC_CHECK_LIB(z,zlibVersion,:,enable_sherry_wrd=no)
1869 AC_CHECK_HEADER(png.h,,enable_sherry_wrd=no)
1870 AC_CHECK_LIB(png,png_init_io,:,enable_sherry_wrd=no,-lz)
1871 if test "$enable_sherry_wrd" = yes; then
1872 AC_DEFINE(ENABLE_SHERRY,1,Define to 1 if you enable Sherry WRD)
1876 AC_MSG_WARN([Sherry WRD is disabled: png.h, libpng.a, libz.a are required])
1878 if test "x$have_xext" = xyes; then
1883 dnl end of interfaces
1890 AM_CONDITIONAL(ENABLE_WRD, test "x$enable_wrd" = "xyes")
1891 AM_CONDITIONAL(CYGNUS, test "x$CYGNUS" = xyes)
1892 AM_CONDITIONAL(MSYS, test "x$MSYS" = xyes)
1893 AM_CONDITIONAL(VCPP, test "x$VCPP" = xyes)
1894 AM_CONDITIONAL(BORLANDC, test "x$BORLANDC" = xyes)
1896 AM_CONDITIONAL(W32READDIR, test "x$W32READDIR" = "xyes")
1898 SET_UNIQ_WORDS(LDFLAGS,$LDFLAGS)
1899 SET_UNIQ_WORDS(SHLDFLAGS,$SHLDFLAGS)
1900 SET_UNIQ_WORDS(CFLAGS,$EXTRACFLAGS $CFLAGS)
1901 SET_UNIQ_WORDS(CPPFLAGS,$CPPFLAGS $EXTRADEFS)
1903 if test "x$oss_device" != x; then
1904 AC_DEFINE_UNQUOTED(OSS_DEVICE,"$oss_device", oss device name)
1907 if test "x$TIMIDITY_OUTPUT_ID" != x; then
1908 AC_DEFINE_UNQUOTED(TIMIDITY_OUTPUT_ID,"$TIMIDITY_OUTPUT_ID", the output specification)
1911 if test "x$with_x" = xyes; then
1912 dnl Order of X-library is: -lXm -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11
1913 LIBS=`echo $LIBS | sed "s/-lX11/$lib_offix_opt $lib_xm_opt $lib_xaw_opt $lib_xmu_opt $lib_xt_opt $lib_xprelibs_opt $lib_xext_opt -lX11/"`
1915 LIBS="$LIBS $lib_dl_opt $lib_png_opt $lib_zip_opt $lib_user32_opt $lib_w32gui_opt $EXTRALIBS"
1916 SHLD="$SHLD $SHLDFLAGS"
1918 AC_SUBST(BORLANDC_START)
1919 AC_SUBST(BORLANDC_LDFLAGS)
1921 AC_SUBST(timidity_LDFLAGS)
1922 AC_SUBST(VCPP_LDFLAGS)
1929 AC_SUBST(dynamic_targets)
1934 AC_SUBST(program_transform_name)
1935 AC_SUBST(INTERFACE_SRCS)
1936 AC_SUBST(pkgdatadir)
1946 doc/ja_JP.eucJP/Makefile
1948 interface/motif_bitmaps/Makefile
1949 interface/bitmaps/Makefile
1950 interface/pixmaps/Makefile