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 MINGW - `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__"
222 "xbcc32 "*) test -n "$SHLD" || SHLD="tlink32 -Tpd" ;;
223 "xcl "*) test -n "$SHLD" || SHLD="link -dll" ;;
224 "xgcc "*) test -n "$SHLD" || SHLD="gcc -mdll" ;;
225 *) test -n "$SHLD" || SHLD="unknown" ;;
229 lib_user32_test=-luser32
232 EXTRADEFS="-D__W32__"
235 "xbcc32 "*) test -n "$SHLD" || SHLD="tlink32 -Tpd" ;;
236 "xcl "*) test -n "$SHLD" || SHLD="link -dll" ;;
237 "xgcc "*) test -n "$SHLD" || SHLD="gcc -mdll" ;;
238 *) test -n "$SHLD" || SHLD="unknown" ;;
242 lib_user32_test=-luser32
246 test -n "$SHLD" || SHLD="ld -Bdynamic -G"
250 EXTRADEFS="-DSOLARIS"
251 test -n "$SHLD" || SHLD="/usr/ccs/bin/ld -G"
255 test -n "$SHLD" || SHLD="/usr/ccs/bin/ld -G"
259 if test "x$SIMD" = "xyes"; then
260 AC_DEFINE(USE_ALTIVEC,1,Define to 1 if you use altivec)
261 # EXTRACFLAGS="$EXTRACFLAGS -faltivec -mabi=altivec -maltivec" # for GCC3.
262 EXTRACFLAGS="$EXTRACFLAGS -faltivec"
264 AC_DEFINE(USE_ALTIVEC,0,Define to 1 if you use altivec)
266 CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
267 LDOPTS="-dynamic -undefined suppress -flat_namespace $LDOPTS"
268 test -n "$SHLD" || SHLD="$CC -dynamic -bundle -undefined suppress -flat_namespace $LDFLAGS"
273 if test "x$GCC" = xyes; then
276 SHLD="ld -Bdynamic -G"
283 dnl AC_EXEEX # obsolate
285 # Checks for libraries.
287 AC_CHECK_LIB(socket,socket)
288 AC_CHECK_LIB(dl,dlopen,lib_dl_opt=-ldl)
289 AC_CHECK_LIB(objc,NSLinkModule,lib_dl_opt=-lobjc) # Mac OS X need this.
290 AC_CHECK_LIB(xpg4,setlocale) # Mac OS X (and maybe NetBSD) need this.
291 AC_CHECK_FUNCS(gethostbyname,,[ AC_CHECK_LIB(nsl,gethostbyname) ])
295 if test "x$with_x" = xyes; then
296 if test "x$have_x" = xno; then
297 if test "x$x_config_flag" = xyes; then
298 AC_MSG_ERROR(Could not configure X)
300 AC_MSG_WARN(Could not configure X)
304 if test "x$with_x" = xyes -a "x$have_x" = xyes; then
305 if test "x$x_libraries" != x; then
306 ldflags_x_opt="-L$x_libraries"
307 LDFLAGS="$LDFLAGS $ldflags_x_opt"
308 SHLDFLAGS="$SHLDFLAGS $ldflags_x_opt"
312 if test "x$x_includes" != x; then
313 CPPFLAGS="$CPPFLAGS -I$x_includes"
316 AC_CHECK_LIB(X11,XOpenDisplay)
317 AC_MSG_CHECKING(X11 version 6)
318 AC_CACHE_VAL(timidity_cv_x11_version_6,
319 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]], [[
320 #if XlibSpecificationRelease < 6
323 ]])],[timidity_cv_x11_version_6=yes],[timidity_cv_x11_version_6=no]))
324 if test "$timidity_cv_x11_version_6" = "yes"; then
325 AC_MSG_RESULT(6 or newer)
326 dnl AC_DEFINE(HAVE_X11R6)
328 AC_MSG_RESULT(before 6)
331 dnl checking order required
333 AC_CHECK_LIB(Xext,XShapeCombineMask,have_xext=yes; LIBS="-lXext $LIBS",have_xext=no)
334 AC_CHECK_LIB(ICE,IceConnectionNumber)
335 AC_CHECK_LIB(SM,SmcOpenConnection,have_xprelibs=yes; LIBS="-lSM $LIBS",have_xprelibs=no)
336 AC_CHECK_LIB(Xt,XtVaAppInitialize,have_xt=yes; LIBS="-lXt $LIBS",have_xt=no)
337 AC_CHECK_LIB(Xmu,XmuInternAtom,LIBS="-lXmu $LIBS")
338 AC_CHECK_FUNCS(XmuRegisterExternalAgent)
339 AC_CHECK_LIB(Xaw3d,XawInitializeWidgetSet,have_xaw=3d,
340 [ AC_CHECK_LIB(Xaw,XawInitializeWidgetSet,have_xaw=yes,have_xaw=no) ])
341 AC_CHECK_LIB(Xm,XmCreateForm,have_xm=yes,have_xm=no)
342 AC_CHECK_FUNCS(XShmCreatePixmap)
345 dnl End of X configure
347 # Checks for header files.
393 [X11/extensions/XShm.h X11/Xmu/ExtAgent.h],[],[],[
394 #ifdef HAVE_X11_XLIB_H
395 #include <X11/Xlib.h>
398 AC_CHECK_HEADER(string.h,, [ AC_DEFINE(NO_STRING_H,1,Define to 1 if you do not have <string.h>.)])
400 # Checks for typedefs, structures, and compiler characteristics.
413 dnl keyword "volatile" check
414 AC_CACHE_CHECK(volatile declaration,timidity_cv_type_volatile,
415 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [[volatile int x]])],[timidity_cv_type_volatile=yes],[timidity_cv_type_volatile=no]))
416 if test $timidity_cv_type_volatile = no; then
417 AC_DEFINE(NO_VOLATILE,1,Define to 1 if you cannot use volatile keyword)
420 dnl union usenum check
421 AC_CACHE_CHECK(union semun declaration,timidity_cv_type_union_semun,
422 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
423 #include <sys/types.h>
426 ]], [[union semun x]])],[timidity_cv_type_union_semun=yes],[timidity_cv_type_union_semun=no]))
427 if test $timidity_cv_type_union_semun = yes; then
428 AC_DEFINE(HAVE_UNION_SEMUN,1,Define to 1 if you use semun keyword)
431 dnl Cygnus and Mingw memory struct optiontest
432 if test "x$CYGNUS" = xyes ||test "x$MINGW" = xyes; then
434 AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
435 if test -z "$ac_cv_prog_CC"; then
438 our_gcc="$ac_cv_prog_CC"
440 case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
442 if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
443 msnative_struct='-fnative-struct'
447 if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
448 msnative_struct='-mms-bitfields'
452 if test x"$msnative_struct" = x ; then
453 AC_MSG_RESULT([no way])
454 AC_MSG_WARN([produced binary will be incompatible with windows' GUI ])
456 CFLAGS="$CFLAGS $msnative_struct"
457 CPPFLAGS="$CPPFLAGS $msnative_struct"
458 AC_MSG_RESULT([${msnative_struct}])
463 dnl Cygnus Mingw32 mmsystem check
464 if test "x$CYGNUS" = xyes || test "x$MINGW" = xyes; then
465 AC_CACHE_CHECK(Cygwin new mmsystem,timidity_cv_header_new_mmsystem,
466 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
468 #include <mmsystem.h>
469 ]], [[return WOM_OPEN != 0x3BB]])],[timidity_cv_header_new_mmsystem=yes],[timidity_cv_header_new_mmsystem=no]))
470 if test $timidity_cv_header_new_mmsystem = yes; then
471 AC_DEFINE(HAVE_NEW_MMSYSTEM,1,Define to 1 if you have <mmsystem.h> file)
475 # Checks for library functions.
476 AC_FUNC_ERROR_AT_LINE
480 AC_FUNC_SETVBUF_REVERSED
517 AC_CHECK_FUNC(getopt_long,
518 AC_DEFINE([HAVE_GETOPT_LONG],1,[Define to 1 if you have `getopt_long function'])
519 tm_cv_needgetopt="no",
520 tm_cv_needgetopt="yes")
521 AM_CONDITIONAL([NEEDGETOPT], test "x$tm_cv_needgetopt" = "xyes")
524 if test "x$CYGNUS" = xyes; then
525 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
527 AC_CHECK_FUNC(opendir,,
528 [ EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
531 *)EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
535 if test "x$enable_network" = "xyes"; then
536 AC_CHECK_FUNC(socket,,
537 WAPI_CHECK_LIB(wsock32,WSAStartup,
538 [#include <winsock.h>],
540 [ EXTRALIBS="$EXTRALIBS -lwsock32"
541 EXTRADEFS="$EXTRADEFS -DWINSOCK" ]))
546 if test "x$CYGWIN" = xyes || test "x$MINGW" = xyes ; then
547 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
549 AC_CHECK_FUNC(opendir,,
550 [ EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
553 *)EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
557 if test "x$enable_network" = "xyes"; then
558 AC_CHECK_FUNC(socket,,
559 WAPI_CHECK_LIB(wsock32,WSAStartup,
560 [#include <winsock.h>],
562 [ EXTRALIBS="$EXTRALIBS -lwsock32"
563 EXTRADEFS="$EXTRADEFS -DWINSOCK" ]))
567 # Checks on extra paths
570 AC_ARG_WITH(tcl-includes,
571 [ --with-tcl-includes=DIR Tcl include file path ],
572 [ if test ! -d $withval; then
573 AC_MSG_WARN($withval is not found.)
575 tcl_include_dir="-I$withval"
577 AC_ARG_WITH(tcl-libs,
578 [ --with-tcl-libs=DIR Tcl library file path ],
579 [ if test ! -d $withval; then
580 AC_MSG_WARN($withval is not found.)
582 tcl_libdir="-L$withval" ])
583 AC_ARG_WITH(tk-includes,
584 [ --with-tk-includes=DIR Tk include file path ],
585 [ if test ! -d $withval; then
586 AC_MSG_WARN($withval is not found.)
588 tk_includes="-I$withval" ])
590 [ --with-tk-libs=DIR Tk library file path ],
591 [ if test ! -d $withval; then
592 AC_MSG_WARN($withval is not found.)
594 tk_libdir="-L$withval" ])
597 AC_ARG_WITH(offix-includes,
598 [ --with-offix-includes=DIR Offix include file path ],
599 [ if test ! -d $withval; then
600 AC_MSG_WARN($withval is not found.)
602 offix_include_dir="-I$withval" ])
603 AC_ARG_WITH(offix-libs,
604 [ --with-offix-libs=DIR Offix include file path ],
605 [ if test ! -d $withval; then
606 AC_MSG_WARN($withval is not found.)
608 offix_lib_dir="-L$withval" ])
614 dnl default(d): auto selection
615 dnl oss(d): OSS /dev/dsp
616 dnl alsa(d): ALSA pcm device
617 dnl sun(d): SunOS /dev/audio
618 dnl hpux(d): HPUX /dev/audio
619 dnl irix(d): IRIX audio
620 dnl mme(d): OSF/1 MME
621 dnl sb_dsp(d): BSD/OS 2.0 /dev/sb_dsp
622 dnl w32(d): Windows MMS
623 dnl darwin(d): Mac OS X pcm device
624 dnl alsa(s): ALSA pcm device
625 dnl alib(A): HPUX network audio (Alib)
626 dnl nas(n): Network Audio System
629 dnl portaudio(p) PortAudio
630 dnl vorbis(v): Ogg Vorbis
631 dnl flac(F): FLAC / OggFLAC
632 dnl speex(S): Ogg Speex
633 dnl gogo(g): MP3 GOGO
637 audio_targets='default oss alsa sun hpux irix mme sb_dsp w32 alib nas arts esd vorbis flac gogo portaudio jack ao'
639 AC_ARG_WITH(nas-library,
640 [ --with-nas-library=library NAS absolute library path(Don't use -laudio)])
641 AC_ARG_WITH(nas-includes,
642 [ --with-nas-includes=DIR NAS include files are in dir])
646 [ --enable-audio[=mode_list] Enable audio (Specify comma separated mode list):
647 default: Automatically select audio device.
649 sun: SunOS /dev/audio
650 hpux: HPUX /dev/audio
651 irix: IRIX audio library
653 sb_dsp: BSD/OS 2.0 /dev/sb_dsp
655 darwin: Darwin CoreAudio
656 alsa: ALSA pcm device
657 alib: HPUX network audio (Alib)
658 nas: NAS - Network Audio System
660 esd: EsounD - Enlightened Sound Daemon
667 gogo: MP3 GOGO (Only Windows is supported)],
668 [ enable_audio=$enableval
669 have_audio_opt=yes ],
674 test "x$enable_audio" = xyes && enable_audio=default
676 if test "x$enable_audio" != xno; then
677 for i in `echo $enable_audio | sed 's/,/ /g'`; do
678 eval "au_enable_$i=yes"
682 dnl Turn on default output mode
684 AC_ARG_WITH(default-output,
685 [ --with-default-output=<mode> Specify default output mode (optional):
686 (default|alsa|alib|arts|nas|
687 esd|wav|au|aiff|list|vorbis|flac|speex|
688 gogo|portaudio|jack|ao)],
689 [ if test "$enable_audio" != no; then
690 DEFAULT_PLAYMODE=$withval
691 eval "au_enable_$DEFAULT_PLAYMODE=yes"
693 AC_MSG_WARN(--with-default-output=$withval: audio is not enabled)
696 dnl compatibility matters.
697 dnl AC_ARG_ENABLE(esd,
698 dnl [ --enable-esd EsounD (Obsoleted. Use --enable-audio=esd)],
699 dnl [ au_enable_esd=$enableval ])
700 dnl AC_ARG_ENABLE(nas,
701 dnl [ --enable-nas NAS (Obsoleted. Use --enable-audio=nas)],
702 dnl [ au_enable_nas=$enableval ])
703 dnl AC_ARG_ENABLE(alsa,
704 dnl [ --enable-alsa ALSA (Obsoleted. Use --enable-audio=alsa)],
705 dnl [ au_enable_alsa=$enableval ])
707 dnl target-specific defaults
708 if test "x$au_enable_default" = xyes; then
710 *-*-linux*|*-*-freebsd*)
716 *-*-bsdi2.1|*-*-bsdi3.?|*-*-bsdi4.?)
747 AC_MSG_WARN(No --enable-audio=default audio for $target)
753 # Each audio mode's configurations
755 AC_MSG_CHECKING(enable_audio=oss)
756 if test "x$au_enable_oss" = xyes; then
757 EXTRADEFS="$EXTRADEFS -DAU_OSS"
758 SYSEXTRAS="$SYSEXTRAS oss_a.c"
759 if test "x$ac_cv_header_sys_soundcard_h" = xyes; then
760 AC_MSG_RESULT(yes - <sys/soundcard.h>)
764 dnl <linux/soundcard.h> or <machine/soundcard.h>
768 if test "x$ac_cv_header_soundcard_h" = xyes; then
769 AC_MSG_RESULT(yes - <soundcard.h>)
771 AC_MSG_WARN(<sys/soundcard.h> is not found)
776 AC_CHECK_LIB(ossaudio,open)
778 dnl Why OpenBSD use /dev/audio instead of /dev/dsp for OSS
781 if test ! -e "/dev/dsp"; then
782 oss_device=/dev/audio
791 AC_MSG_CHECKING(enable_audio=sun)
792 if test "x$au_enable_sun" = xyes; then
795 if test -f /usr/demo/SOUND/libaudio.a; then
796 EXTRALIBS="$EXTRALIBS /usr/demo/SOUND/libaudio.a"
799 AC_MSG_RESULT(Notice: libaudio.a is not found [(ignore)])
803 if test -f /usr/demo/SOUND/lib/libaudio.a; then
804 EXTRALIBS="$EXTRALIBS /usr/demo/SOUND/lib/libaudio.a"
807 AC_MSG_RESULT(Notice: libaudio.a is not found [(ignore)])
810 *) AC_MSG_RESULT(yes)
813 EXTRADEFS="$EXTRADEFS -DAU_SUN"
814 SYSEXTRAS="$SYSEXTRAS sun_a.c"
820 AC_MSG_CHECKING(enable_audio=hpux)
821 if test "x$au_enable_hpux" = xyes; then
823 *-*-hpux*) AC_MSG_RESULT(yes) ;;
824 *) AC_MSG_WARN(may not work on $target) ;;
826 EXTRADEFS="$EXTRADEFS -DAU_HPUX_AUDIO"
827 SYSEXTRAS="$SYSEXTRAS hpux_d_a.c"
833 AC_MSG_CHECKING(enable_audio=irix)
834 if test "x$au_enable_irix" = xyes; then
836 *-sgi-irix5*|*-sgi-irix6.2)
837 EXTRADEFS="$EXTRADEFS -DAU_AUDRIV -DSGI_OLDAL"
841 EXTRADEFS="$EXTRADEFS -DAU_AUDRIV -DSGI_NEWAL"
844 *) AC_MSG_WARN(may not work on $target) ;;
846 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_al.c"
847 EXTRALIBS="$EXTRASLIBS -laudio"
853 AC_MSG_CHECKING(enable_audio=mme)
854 if test "x$au_enable_mme" = xyes; then
856 *-dec-*) AC_MSG_RESULT(yes) ;;
857 *) AC_MSG_WARN(may not work on $target) ;;
859 EXTRADEFS="$EXTRADEFS -DAU_DEC -DAU_AUDRIV"
860 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_mme.c"
861 CPPFLAGS="$CPPFLAGS -I/usr/opt/MME210/include"
862 EXTRALIBS="$EXTRALIBS /usr/opt/MME220/lib/libmme.a"
868 AC_MSG_CHECKING(enable_audio=sb_dsp)
869 if test "x$au_enable_sb_dsp" = xyes; then
871 *-*-bsdi2.0) AC_MSG_RESULT(yes) ;;
872 *) AC_MSG_WARN(may not work on $target) ;;
874 EXTRADEFS="$EXTRADEFS -DAU_BSDI -DDEFAULT_RATE=22500"
875 SYSEXTRAS="$SYSEXTRAS bsd20_a.c"
881 AC_MSG_CHECKING(enable_audio=w32)
882 if test "x$au_enable_w32" = xyes; then
891 AC_MSG_WARN(may not work on $target)
894 SYSEXTRAS="$SYSEXTRAS w32_a.c"
895 EXTRALIBS="$EXTRALIBS -lwinmm"
896 EXTRADEFS="$EXTRADEFS -DAU_W32"
901 dnl Mac OS X / darwin-x86
902 AC_MSG_CHECKING(enable_audio=darwin)
903 if test "x$au_enable_darwin" = xyes; then
904 EXTRADEFS="$EXTRADEFS -DAU_DARWIN"
905 SYSEXTRAS="$SYSEXTRAS darwin_a.c"
906 EXTRALIBS="$EXTRALIBS -framework CoreAudio"
907 dnl just say yes or no :-P
912 AC_MSG_WARN(may not work on $target)
920 dnl alsa - Advanced Linux Sound Architecture
921 AC_MSG_CHECKING(enable_audio=alsa)
922 if test "x$au_enable_alsa" = xyes; then
923 AC_MSG_RESULT([yes, configuring alsa])
928 if test "x$alsa_found" = "xyes" ; then
929 dnl AC_MSG_RESULT(yes)
930 EXTRADEFS="$EXTRADEFS -DAU_ALSA"
931 SYSEXTRAS="$SYSEXTRAS alsa_a.c"
932 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ALSA_CFLAGS)
933 LIBS="$LIBS $ALSA_LIBS"
934 AC_CHECK_FUNCS(snd_seq_port_info_set_timestamping)
936 AC_MSG_WARN(Couldn't configure alsa.)
946 AC_MSG_CHECKING(enable_audio=alib)
947 if test "x$au_enable_alib" = xyes; then
949 *-*-hpux*) AC_MSG_RESULT(yes) ;;
950 *) AC_MSG_WARN(may not work on $target) ;;
952 SYSEXTRAS="$SYSEXTRAS hpux_a.c"
953 EXTRADEFS="$EXTRADEFS -DAU_HPUX_ALIB"
954 if test -d /opt/audio/include; then
955 CPPFLAGS="$CPPFLAGS -I/opt/audio/include"
957 if test -d /opt/audio/lib; then
958 EXTRALIBS="$EXTRALIBS -L/opt/audio/lib"
960 EXTRALIBS="$EXTRALIBS -lAlib"
966 AC_MSG_CHECKING(enable_audio=nas)
967 if test "x$au_enable_nas" = xyes; then
968 if test "x$with_x" != xyes; then
969 AC_MSG_ERROR(nas: --with-x option must be specified)
971 EXTRADEFS="$EXTRADEFS -DAU_NAS"
972 SYSEXTRAS="$SYSEXTRAS nas_a.c"
974 dnl -laudio conflicts another audio library,
975 dnl so I specify NAS library with absolete path.
977 if test "x$with_nas_library" != x; then
978 AC_MSG_RESULT($with_nas_library);
979 EXTRALIBS="$EXTRALIBS $with_nas_library"
982 MY_SEARCH_LIBS(AuOpenServer,
983 [$x_libraries/libaudio.a \
984 /usr/lib/libaudio.so \
985 /usr/lib/libaudio.a ],
986 [ AC_MSG_RESULT(NAS: $timidity_cv_search_AuOpenServer)
987 EXTRALIBS="$EXTRALIBS $timidity_cv_search_AuOpenServer"],
988 [AC_MSG_WARN(NAS library is not found.)])
990 test "x$with_nas_includes" != x && CPPFLAGS="$CPPFLAGS -I$with_nas_includes"
992 if test "x$have_xext" = xyes; then
995 if test "x$have_xprelibs" = xyes; then
996 lib_xprelibs_opt='-lSM -lICE'
1003 AC_MSG_CHECKING(enable_audio=arts)
1004 if test "x$au_enable_arts" = xyes; then
1005 AC_MSG_RESULT([yes, configuring aRts])
1008 KEEPLDFLAGS=$LDFLAGS
1012 LDFLAGS=$KEEPLDFLAGS
1013 if test "x$no_arts" = x; then
1014 dnl AC_MSG_RESULT(aRts: Enabled)
1015 EXTRADEFS="$EXTRADEFS -DAU_ARTS"
1016 SYSEXTRAS="$SYSEXTRAS aRts_a.c"
1017 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ARTS_CFLAGS)
1018 LIBS="$LIBS $ARTS_LIBS"
1020 AC_MSG_WARN(aRts: Couldn't configure)
1027 AC_MSG_CHECKING(enable_audio=esd)
1028 if test "x$au_enable_esd" = xyes; then
1029 AC_MSG_RESULT([yes, configuring esd])
1032 KEEPLDFLAGS=$LDFLAGS
1036 LDFLAGS=$KEEPLDFLAGS
1037 if test "x$no_esd" = x; then
1038 dnl AC_MSG_RESULT(EsounD: Enabled)
1039 EXTRADEFS="$EXTRADEFS -DAU_ESD"
1040 SYSEXTRAS="$SYSEXTRAS esd_a.c"
1041 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ESD_CFLAGS)
1042 LIBS="$LIBS $ESD_LIBS"
1044 AC_MSG_WARN(EsounD: Couldn't configure)
1051 AC_MSG_CHECKING(enable_audio=portaudio)
1052 if test "x$au_enable_portaudio" = xyes; then
1054 if test "x$CYGNUS" = xyes ||test "x$MINGW" = xyes; then
1055 SYSEXTRAS="$SYSEXTRAS portaudio_a.c w32_portaudio_dll.c"
1056 EXTRALIBS="$EXTRALIBS -lportaudio"
1057 EXTRADEFS="$EXTRADEFS -DAU_PORTAUDIO -DAU_PORTAUDIO_DLL"
1059 SYSEXTRAS="$SYSEXTRAS portaudio_a.c"
1060 EXTRALIBS="$EXTRALIBS -lportaudio"
1061 EXTRADEFS="$EXTRADEFS -DAU_PORTAUDIO"
1068 AC_MSG_CHECKING(enable_audio=jack)
1069 if test "x$au_enable_jack" = xyes; then
1071 SYSEXTRAS="$SYSEXTRAS jack_a.c"
1072 EXTRALIBS="$EXTRALIBS $(pkg-config --libs jack)"
1073 EXTRADEFS="$EXTRADEFS -DAU_JACK $(pkg-config --cflags jack)"
1079 AC_MSG_CHECKING(enable_audio=ao)
1080 if test "x$au_enable_ao" = xyes; then
1081 AC_MSG_RESULT([yes, configuring ao])
1083 if test "x$no_ao" = "x" ; then
1085 EXTRADEFS="$EXTRADEFS -DAU_AO"
1086 SYSEXTRAS="$SYSEXTRAS ao_a.c"
1087 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$AO_CFLAGS)
1088 LIBS="$LIBS $AO_LIBS"
1090 AC_MSG_WARN(Couldn't configure libao.)
1097 AC_MSG_CHECKING(enable_audio=vorbis)
1098 if test "x$au_enable_vorbis" = xyes; then
1099 AC_MSG_RESULT([yes, configuring vorbis])
1103 SYSEXTRAS="$SYSEXTRAS vorbis_a.c"
1104 EXTRADEFS="$EXTRADEFS -DAU_VORBIS $OGG_CFLAGS $VORBIS_CFLAGS"
1105 EXTRALIBS="$EXTRALIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"
1106 if test "x$CYGNUS" = "xyes"; then
1107 EXTRADEFS="-DAU_VORBIS_DLL $EXTRADEFS"
1108 SYSEXTRAS="$SYSEXTRAS w32g_vorbisenc_dll.c w32g_vorbis_dll.c w32g_ogg_dll.c"
1110 if test "x$MINGW" = "xyes"; then
1111 EXTRADEFS="-DAU_VORBIS_DLL $EXTRADEFS"
1112 SYSEXTRAS="$SYSEXTRAS w32g_vorbisenc_dll.c w32g_vorbis_dll.c w32g_ogg_dll.c"
1115 AC_MSG_WARN([Unable to configure vorbis, but ogg is there (???)])
1118 AC_MSG_WARN(Unable to configure vorbis!)
1125 dnl libFLAC - Free Lossless Audio Codec
1126 AC_MSG_CHECKING(enable_audio=flac)
1127 if test "x$au_enable_flac" = xyes; then
1128 AC_MSG_RESULT([yes, configuring flac])
1129 SYSEXTRAS="$SYSEXTRAS flac_a.c"
1131 EXTRADEFS="$EXTRADEFS -DAU_FLAC"
1132 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$LIBFLAC_CFLAGS)
1133 LIBS="$LIBS $LIBFLAC_LIBS"
1135 AM_PATH_LIBOGGFLAC([
1136 EXTRADEFS="$EXTRADEFS -DAU_OGGFLAC"
1137 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$LIBOGGFLAC_CFLAGS)
1138 LIBS="$LIBS $LIBOGGFLAC_LIBS"
1145 AC_MSG_CHECKING(enable_audio=speex)
1146 if test "x$au_enable_speex" = xyes; then
1147 AC_CACHE_VAL(have_speex,
1150 #include <ogg/ogg.h>
1155 [have_speex=yes], [have_speex=no])])
1156 AC_MSG_RESULT($have_speex)
1157 if test "x$have_speex" = xyes; then
1158 SYSEXTRAS="$SYSEXTRAS speex_a.c"
1159 EXTRALIBS="$EXTRALIBS -lspeex -logg"
1160 EXTRADEFS="$EXTRADEFS -DAU_SPEEX"
1166 dnl Win32 Gogo-no-coder
1167 AC_MSG_CHECKING(enable_audio=gogo)
1168 if test "x$au_enable_gogo" = xyes; then
1169 if test "x$CYGNUS" = "xyes"; then
1170 AC_MSG_RESULT(yes, configuring gogo)
1172 if test "x$MINGW" = "xyes"; then
1173 AC_MSG_RESULT(yes, configuring gogo)
1175 AC_MSG_WARN(May be gogo is not supported. You need hack the gogo_a.c)
1179 SYSEXTRAS="$SYSEXTRAS gogo_a.c w32_gogo.c"
1180 EXTRADEFS="$EXTRADEFS -DAU_GOGO -DAU_GOGO_DLL"
1181 EXTRALIBS="$EXTRALIBS -lgogo"
1186 dnl Pseudo audio device (Undocumented).
1187 if test "x$au_enable_none" = xyes; then
1188 EXTRADEFS="$EXTRADEFS -DAU_NONE -DAU_AUDRIV"
1189 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_none.c"
1192 dnl TIMIDITY_OUTPUT_ID
1194 AC_MSG_CHECKING(default output mode)
1195 if test "x$DEFAULT_PLAYMODE" = x; then
1196 DEFAULT_PLAYMODE=`echo $enable_audio | sed 's/,.*//'`
1198 case ".$DEFAULT_PLAYMODE" in
1199 .default) TIMIDITY_OUTPUT_ID=d ;;
1200 .oss) TIMIDITY_OUTPUT_ID=d ;;
1201 .alsa) TIMIDITY_OUTPUT_ID=s ;;
1202 .sun) TIMIDITY_OUTPUT_ID=d ;;
1203 .hpux) TIMIDITY_OUTPUT_ID=d ;;
1204 .irix) TIMIDITY_OUTPUT_ID=d ;;
1205 .mme) TIMIDITY_OUTPUT_ID=d ;;
1206 .sb_dsp) TIMIDITY_OUTPUT_ID=d ;;
1207 .darwin) TIMIDITY_OUTPUT_ID=d ;;
1208 .w32) TIMIDITY_OUTPUT_ID=d ;;
1209 .alib) TIMIDITY_OUTPUT_ID=A ;;
1210 .nas) TIMIDITY_OUTPUT_ID=n ;;
1211 .arts) TIMIDITY_OUTPUT_ID=R ;;
1212 .esd) TIMIDITY_OUTPUT_ID=e ;;
1213 .portaudio) TIMIDITY_OUTPUT_ID=p ;;
1214 .wav) TIMIDITY_OUTPUT_ID=w ;;
1215 .au) TIMIDITY_OUTPUT_ID=u ;;
1216 .aiff) TIMIDITY_OUTPUT_ID=a ;;
1217 .list) TIMIDITY_OUTPUT_ID=l ;;
1218 .vorbis) TIMIDITY_OUTPUT_ID=v ;;
1219 .flac) TIMIDITY_OUTPUT_ID=F ;;
1220 .speex) TIMIDITY_OUTPUT_ID=S ;;
1221 .gogo) TIMIDITY_OUTPUT_ID=g ;;
1222 .jack) TIMIDITY_OUTPUT_ID=j ;;
1223 *) TIMIDITY_OUTPUT_ID= ;;
1225 AC_MSG_RESULT($DEFAULT_PLAYMODE/$TIMIDITY_OUTPUT_ID)
1231 interface_targets='dynamic ncurses slang motif tcltk emacs vt100 xaw xskin gtk alsaseq winsyn winsyng portmidisyng'
1233 AC_ARG_ENABLE(interface,
1234 [ --enable-interface=[interface_list]
1235 Comma separated interface list ],
1236 [ for i in `echo $enableval | sed 's/,/ /g'`; do
1237 eval "enable_$i=yes"
1240 # Dynamic link configuration
1241 AC_ARG_ENABLE(dynamic,
1242 [ --enable-dynamic Enable dynamic link interface (default is no)
1243 --enable-dynamic=dynamic_list
1244 Comma separated dynamic interface list],
1245 [ dnl --enable-dynamic=yes to --enable-dynamic=dynamic
1246 if test "x$enable_dynamic" = xyes; then
1247 enable_dynamic=dynamic
1248 elif test "x$enable_dynamic" != xno; then
1249 for i in `echo $enableval | sed 's/,/ /g'`; do
1250 eval "enable_$i=dynamic"
1255 for i in $interface_targets; do
1256 eval "join_targets=$join_targets\$enable_$i"
1259 case ".$join_targets" in
1260 .*dynamic*) NEEDDLOPEN=yes;;
1264 dnl check -fpic option for gcc
1265 if test "x$GCC" = xyes; then SHCFLAGS="$SHCFLAGS -fPIC"; fi
1266 case "x$enable_ump" in xyes|xdynamic) EXTRACFLAGS="$EXTRACFLAGS -DXP_UNIX $SHCFLAGS";; esac
1268 dnl Which type of dynamic loader?
1269 if test "$NEEDDLOPEN" = "yes"; then
1272 WAPI_CHECK_FUNC(LoadLibrary,,[LoadLibrary(0);],have_dl=w32)
1273 test $wapi_cv_func_LoadLibrary = yes && have_dl=w32
1275 if test "$have_dl" = "no"; then
1276 AC_CHECK_FUNC(shl_load,have_dl=hpux)
1278 if test "$have_dl" = "no"; then
1279 dnl darwin has both dyld and libdl: in case user installed dlcompat.
1280 dnl dyld is recommended because libdl is a wrapper for dyld.
1281 AC_CHECK_FUNC(NSLinkModule,have_dl=dyld)
1283 if test "$have_dl" = "no" -a "x$ac_cv_lib_dl_dlopen" = xyes; then
1286 if test "$have_dl" = "no"; then
1287 AC_CHECK_FUNC(dlopen,have_dl=dlopen)
1289 if test "$have_dl" = "no"; then
1290 AC_CHECK_FUNC(dld_init,have_dl=dld)
1292 if test "$have_dl" = "no"; then
1293 AC_CHECK_LIB(dld,dld_init,have_dl=dld;lib_dl_opt=-ldld)
1296 AC_MSG_CHECKING(dynamic link method)
1299 AC_MSG_RESULT(use dl_dlopen.c)
1300 SYSEXTRAS="$SYSEXTRAS dl_dlopen.c"
1301 CHECK_DLSYM_UNDERSCORE(AC_DEFINE(DLSYM_NEEDS_UNDERSCORE,1,Define to 1 if you have to add "_" to every identifiers.))
1304 AC_MSG_RESULT(use dl_dld.c)
1305 SYSEXTRAS="$SYSEXTRAS dl_dld.c"
1308 AC_MSG_RESULT(use dl_hpux.c)
1309 SYSEXTRAS="$SYSEXTRAS dl_hpux.c"
1310 LDFLAGS="$LDFLAGS -Wl,-E $LDFLAGS"
1313 AC_MSG_RESULT(use dl_w32.c)
1314 SYSEXTRAS="$SYSEXTRAS dl_w32.c"
1317 AC_MSG_RESULT(use dl_dyld.c)
1318 SYSEXTRAS="$SYSEXTRAS dl_dyld.c"
1322 AC_MSG_WARN(no method to open a shared object)
1327 if test "$NEEDDLOPEN" = "yes"; then
1328 MY_DEFINE(IA_DYNAMIC)
1329 AC_DEFINE_UNQUOTED(SHARED_LIB_EXT,".$so", shared library extention)
1331 dnl EXTRADEFS="$EXTRADEFS \$(DEF_SHLIB_DIR)"
1332 test "x$GCC" = xyes -a "x$timidity_cv_ccoption_rdynamic" = xyes && timidity_LDFLAGS="-rdynamic"
1335 AM_CONDITIONAL(NEEDDLOPEN, test "$NEEDDLOPEN" = "yes")
1338 dnl Each interface section
1342 AM_CONDITIONAL(ENABLE_NCURSES, false)
1343 CONFIG_INTERFACE(ncurses,NCURSES,n,
1344 [ --enable-ncurses Enable ncurses interface (default is no)],
1345 [ AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h)
1347 dnl #include <ncurses/curses.h> is failure on Plamo Linux 1.3/ncurses 1.9.9e
1348 dnl because <ncurses/curses.h> includes <unctrl.h>:
1349 dnl /usr/include/ncurses/curses.h:34: unctrl.h: No such file or directory
1350 dnl But surely there is unctl.h at /usr/include/ncurses/unctrl.h.
1351 dnl configure must check ncurses header with -I/usr/include/ncurses option.
1353 case "$ac_cv_header_curses_h$ac_cv_header_ncurses_curses_h$ac_cv_header_ncurses_h" in
1355 *) for i in /usr/include /usr/local/include; do
1356 if test -f "$i/ncurses/curses.h" -a -f "$i/ncurses/unctrl.h"; then
1357 AC_MSG_WARN(ncurses test is failure. Please check config.h and common.makefile later)
1358 CPPFLAGS="$CPPFLAGS -I$i/ncurses"
1365 AC_CHECK_LIB(ncurses,initscr,lib_curses_opt=-lncurses,
1366 [ dnl checking pdcurses
1367 AC_CHECK_LIB(curses,PDC_set_ctrl_break,
1368 [ lib_curses_opt=-lcurses
1369 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
1370 lib_user32_opt="$lib_user32_test"
1372 [ dnl checking libpdcurses
1373 AC_CHECK_LIB(pdcurses,PDC_set_ctrl_break,
1374 [ lib_curses_opt=-lpdcurses
1375 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
1376 lib_user32_opt="$lib_user32_test"
1378 [ dnl OpenBSD use -lcurses instead of -lncurses.
1381 AC_CHECK_LIB(curses,initscr,lib_curses_opt=-lcurses,
1382 [ AC_MSG_WARN(ncurses interface is not enabled)
1383 enable_ncurses=no ])
1386 AC_MSG_WARN(ncurses interface is not enabled)
1395 [ LIBS="$LIBS $lib_curses_opt"
1398 EXTRALIBS="$EXTRALIBS -lmytinfo"
1401 INTERFACE_SRCS="$INTERFACE_SRCS ncurs_c.c"
1403 [ n_so_libs="$lib_curses_opt"
1406 EXTRALIBS="$EXTRALIBS -lmytinfo"
1411 AM_CONDITIONAL(ENABLE_SLANG, false)
1412 CONFIG_INTERFACE(slang,SLANG,s,
1413 [ --enable-slang Enable slang interface (default is no)],
1414 [ AC_CHECK_LIB(slang,SLang_init_tty,:,
1416 AC_MSG_WARN(slang interface is not enabled)
1418 AC_CHECK_HEADERS(slang/slang.h slang.h)
1420 [ LIBS="$LIBS -lslang"
1421 INTERFACE_SRCS="$INTERFACE_SRCS slang_c.c"
1423 [ s_so_libs="-lslang"
1424 AC_CHECK_LIB(termcap,initscr,s_so_libs="$s_so_libs -ltermcap")
1428 AM_CONDITIONAL(ENABLE_MOTIF, false)
1429 CONFIG_INTERFACE(motif,MOTIF,m,
1430 [ --enable-motif Enable motif interface (default is no)],
1431 [ if test "x$with_x" != xyes; then
1432 AC_MSG_ERROR(motif: --with-x option must be specified)
1434 if test "x$have_xm" != xyes; then
1435 AC_MSG_WARN(Motif library is not found.)
1442 if test "x$have_xprelibs" = xyes; then
1443 lib_xprelibs_opt='-lSM -lICE'
1445 INTERFACE_SRCS="$INTERFACE_SRCS motif_c.c motif_i.c motif_p.c"
1447 [ if test x$have_xprelibs = xyes; then
1448 m_so_libs="-lXext -lSM -lICE"
1450 m_so_libs="$ldflags_x_opt -lXm -lXt $m_so_libs -lX11"
1454 AM_CONDITIONAL(ENABLE_TCLTK, false)
1455 CONFIG_INTERFACE(tcltk,TCLTK,k,
1456 [ --enable-tcltk Enable tcltk interface (default is no)],
1457 [ if test "x$with_x" != xyes; then
1458 AC_MSG_ERROR(tcltk: --with-x option must be specified)
1462 KEEPCPPFLAGS=$CPPFLAGS
1463 KEEPLDFLAGS=$LDFLAGS
1466 CPPFLAGS="$tcl_include_dir $tk_includes $CPPFLAGS"
1467 LDFLAGS="$tcl_libdir $tk_libdir $LDFLAGS"
1468 LIBS="$LIBS $lib_dl_opt"
1472 for l in tcl tcl8.4 tcl8.3 tcl8.0jp tcl7.6jp tcl80jp tcl76jp tcl8.0 tcl7.6 tcl80 tcl76; do
1473 case "x$tcl_lib" in x) AC_CHECK_LIB($l,Tcl_Init,tcl_lib=-l$l);; esac
1475 LIBS="$LIBS $tcl_lib"
1476 for l in tk tk8.4 tk8.3 tk8.0jp tk4.2jp tk80jp tk42jp tk8.0 tk4.2 tk80 tk42; do
1477 case "x$tk_lib" in x) AC_CHECK_LIB($l,Tk_Init,tk_lib=-l$l);; esac
1481 if test "x$tcl_lib" = x -o "x$tk_lib" = x; then
1482 CPPFLAGS=$KEEPCPPFLAGS
1483 LDFLAGS=$KEEPLDFLAGS
1485 AC_MSG_WARN(tcl/tk is not enable)
1487 tcltk_dep='tclIndex'
1490 [ LIBS=`echo $LIBS | sed "s/-lX11/$tk_lib $tcl_lib -lX11/"`
1493 EXTRALIBS="$EXTRALIBS -lipc"
1496 INTERFACE_SRCS="$INTERFACE_SRCS tk_c.c"
1498 [ k_so_libs="$tcl_libdir $tk_libdir $tcl_lib $tk_lib $lib_dl_opt"
1501 k_so_libs="$k_so_libs -lipc"
1504 k_so_libs="$k_so_libs -lX11 -lm"
1506 AM_CONDITIONAL(ENABLE_DYNAMIC_TCLTK, test "x$enable_tcltk" = "xdynamic")
1509 AM_CONDITIONAL(ENABLE_EMACS, false)
1510 CONFIG_INTERFACE(emacs,EMACS,e,
1511 [ --enable-emacs Enable emacs interface (default is no)],
1513 [ ELFILES="$ELFILES timidity.el"
1514 INTERFACE_SRCS="$INTERFACE_SRCS emacs_c.c"
1516 [ ELFILES="$ELFILES timidity.el" ])
1519 AM_CONDITIONAL(ENABLE_VT100, false)
1520 CONFIG_INTERFACE(vt100,VT100,T,
1521 [ --enable-vt100 Enable VT100 interface (default is no)],
1523 [ INTERFACE_SRCS="$INTERFACE_SRCS vt100_c.c vt100.c" ])
1526 AM_CONDITIONAL(ENABLE_XAW, false)
1527 CONFIG_INTERFACE(xaw,XAW,a,
1528 [ --enable-xaw Enable athena interface (default is no)],
1529 [ if test "x$with_x" != xyes; then
1530 AC_MSG_ERROR(xaw: --with-x option must be specified)
1532 if test "x$have_xaw" != "xyes" -a "x$have_xaw" != "x3d"; then
1533 AC_MSG_WARN(X Athena Widget library is not found.)
1536 [ dnl Add -lXext -lSM -lICE -lXmu -lXt {-lXaw|-lXaw3d}
1537 if test "x$have_xext" = xyes; then
1540 if test "x$have_xprelibs" = xyes; then
1541 lib_xprelibs_opt='-lSM -lICE'
1545 if test "x$have_xaw" = x3d; then
1546 AC_DEFINE(XAW3D,1,Define to 1 if you have libXaw3d.)
1551 INTERFACE_SRCS="$INTERFACE_SRCS xaw_c.c xaw_i.c"
1553 [ if test "x$have_xext" = xyes; then
1554 a_so_libs="-lXext -lX11"
1560 a_so_libs="$a_so_libs -lcc_dynamic"
1563 if test "x$have_xprelibs" = xyes; then
1564 a_so_libs="-lSM -lICE $a_so_libs"
1566 if test "x$have_xaw" = xyes; then
1567 a_so_libs="-lXaw -lXmu -lXt $a_so_libs"
1568 elif test "x$have_xaw" = x3d; then
1569 AC_DEFINE(XAW3D,1,Define to 1 if you have libXaw3d.)
1570 a_so_libs="-lXaw3d -lXmu -lXt $a_so_libs"
1572 a_so_libs="$ldflags_x_opt $a_so_libs"
1574 AM_CONDITIONAL(ENABLE_DYNAMIC_XAW, test "x$enable_xaw" = "xdynamic")
1577 AM_CONDITIONAL(ENABLE_XSKIN, false)
1578 CONFIG_INTERFACE(xskin,XSKIN,i,
1579 [ --enable-xskin Enable X skin interface (default is no)],
1580 [ if test "x$with_x" != xyes; then
1581 AC_MSG_ERROR(xskin: --with-x option must be specified)
1584 [ INTERFACE_SRCS="$INTERFACE_SRCS xskin_c.c xskin_i.c xskin_loadBMP.c xskin_spectrum.c" ],
1585 [ i_so_libs="$ldflags_x_opt -lX11" ])
1588 AM_CONDITIONAL(ENABLE_GTK, false)
1589 CONFIG_INTERFACE(gtk, GTK, g,
1590 [ --enable-gtk Enable GTK+ interface (default is no)],
1591 [ AM_PATH_GTK(1.1.3,,enable_gtk=no) ],
1592 [ LIBS="$LIBS $GTK_LIBS"
1593 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$GTK_CFLAGS)
1594 INTERFACE_SRCS="$INTERFACE_SRCS gtk_c.c gtk_i.c gtk_p.c"
1596 [ if test "x$GCC" = xyes; then
1597 dnl Do not include -rdynamic option in $g_so_libs.
1598 for i in $GTK_LIBS; do
1601 *) g_so_libs="$g_so_libs $i" ;;
1605 g_so_libs="$GTK_LIBS"
1607 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$GTK_CFLAGS) ])
1609 dnl TiMidity Network MIDI Server
1610 AM_CONDITIONAL(ENABLE_SERVER, false)
1611 CONFIG_INTERFACE(server,SERVER,r,
1612 [ --enable-server Enable server interface (default is no)],
1614 [ INTERFACE_SRCS="$INTERFACE_SRCS server_c.c"
1615 AC_CHECK_HEADERS(sys/soundcard.h)
1618 dnl TiMidity ALSA sequencer server
1619 AM_CONDITIONAL(ENABLE_ALSASEQ, false)
1620 CONFIG_INTERFACE(alsaseq,ALSASEQ,A,
1621 [ --enable-alsaseq Enable ALSA sequencer server interface
1624 [ INTERFACE_SRCS="$INTERFACE_SRCS alsaseq_c.c"
1628 dnl TiMidity Windows synthesizer server
1629 AM_CONDITIONAL(ENABLE_WINSYN, false)
1630 CONFIG_INTERFACE(winsyn,WINSYN,W,
1631 [ --enable-winsyn Enable Windows Synthesizer interface
1634 [ INTERFACE_SRCS="$INTERFACE_SRCS winsyn_c.c rtsyn_common.c rtsyn_winmm.c" ])
1636 dnl TiMidity PortMIDI synthesizer server
1637 AM_CONDITIONAL(ENABLE_PORTMIDISYN, false)
1638 CONFIG_INTERFACE(portmidisyn,PORTMIDISYN,P,
1639 [ --enable-portmidisyn Enable PortMIDI Synthesizer interface
1642 [ INTERFACE_SRCS="$INTERFACE_SRCS portmidisyn_c.c rtsyn_common.c rtsyn_portmidi.c" ])
1644 dnl TiMidity Windows GUI synthesizer server
1645 AM_CONDITIONAL(ENABLE_W32G_SYN, false)
1646 CONFIG_INTERFACE(winsyng,W32G_SYN,W,
1647 [ --enable-winsyng Enable Windows GUI Synthesizer interface
1650 [ lib_w32gui_opt='-lgdi32 -lcomctl32 -lcomdlg32 -lole32'
1651 lib_user32_opt='-luser32'
1652 LDFLAGS="-mwindows $LDFLAGS"
1653 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"
1658 AM_CONDITIONAL(ENABLE_W32GUI, false)
1659 CONFIG_INTERFACE(w32gui, W32GUI, w,
1660 [ --enable-w32gui Enable Windows GUI interface (default is no)],
1662 [ lib_w32gui_opt='-lgdi32 -lcomctl32 -lcomdlg32 -lole32'
1663 lib_user32_opt='-luser32'
1664 LDFLAGS="-mwindows $LDFLAGS"
1665 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"
1668 dnl UMP configuration
1669 AM_CONDITIONAL(ENABLE_PLUGIN, false)
1670 CONFIG_INTERFACE(ump, PLUGIN, p,
1671 [ --enable-ump UMP configuration (default is no)],
1672 [ if test ! -d ump; then
1673 AC_MSG_ERROR(UMP Package is not exists. Can't configure it.)
1675 AC_CHECK_HEADER(X11/xpm.h,,AC_MSG_ERROR([UMP Package needs xpm.h[,] but could not find it.]))
1676 AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,:,AC_MSG_ERROR([UMP Package needs libXpm.a[,] but could not find it.]))
1677 if test "x$have_xext" = xyes; then
1680 if test "x$have_xprelibs" = xyes; then
1681 lib_xprelibs_opt='-lSM -lICE'
1689 dnl this rely on CFLAGS and LIBS
1690 AC_ARG_ENABLE(offix,
1691 [ --enable-offix Enable offix support (default is no)],
1692 [ if test "$enableval" = "yes"; then
1693 KEEPCPPFLAGS=$CPPFLAGS
1695 KEEPLDFLAGS=$LDFLAGS
1696 CPPFLAGS="$CPPFLAGS $offix_include_dir"
1697 LDFLAGS="$LDFLAGS $offix_lib_dir"
1698 LIBS="$LIBS $lib_xmu_opt $lib_xt_opt $lib_xprelibs_opt $lib_xext_opt -lX11"
1699 AC_CHECK_LIB(Dnd,DndInitialize,[
1701 lib_offix_opt="-lDnd"
1702 AC_DEFINE(OFFIX,1,Define to 1 if you need offix support)
1704 [ LDFLAGS=$KEEPLDFLAGS
1705 CPPFLAGS=$KEEPCPPFLAGS
1712 AC_ARG_ENABLE(network,
1713 [ --enable-network Enable network support (default is no)],
1714 [ if test "$enableval" = "yes"; then
1715 AC_DEFINE(SUPPORT_SOCKET,1,Define to 1 if you need network support)
1717 AM_CONDITIONAL(ENABLE_NETWORK, test "x$enable_network" = "xyes")
1719 dnl Sound Spectrogram Viewer
1720 AC_ARG_ENABLE(spectrogram,
1721 [ --enable-spectrogram Enable Sound Spectrogram Viewer (default is no)],
1722 [ if test "$enableval" = "yes"; then
1723 if test "x$with_x" != xyes; then
1724 AC_MSG_ERROR(spectrogram: --with-x option must be specified)
1726 AC_DEFINE(SUPPORT_SOUNDSPEC,1,Define to 1 if you need spectrogram vewer.)
1728 AM_CONDITIONAL(ENABLE_SOUND_SPEC, test "x$enable_spectrogram" = "xyes")
1730 dnl Wave Spline Interpolations
1731 AC_ARG_ENABLE(spline,
1732 [ --enable-spline=[method] Specify spline method.
1733 one of no,linear,cubic,lagrange,newton,gauss
1734 (default is linear)],
1735 [ case "x$enableval" in
1737 AC_DEFINE(DEFAULT_RESAMPLATION,resample_linear,Define resampler.)
1740 AC_DEFINE(DEFAULT_RESAMPLATION,resample_cspline,Define resampler.)
1743 AC_DEFINE(DEFAULT_RESAMPLATION,resample_lagrange,Define resampler.)
1746 AC_DEFINE(DEFAULT_RESAMPLATION,resample_newton,Define resampler.)
1749 AC_DEFINE(DEFAULT_RESAMPLATION,resample_gauss,Define resampler.)
1752 AC_DEFINE(DEFAULT_RESAMPLATION,resample_none,Define resampler.)
1755 AC_MSG_ERROR(Invalid method of --enable-spline)
1761 [ --enable-wrd Enable WRD interface for X (default is no)],
1762 [ if test "$enableval" = "yes"; then
1763 if test "x$with_x" != xyes; then
1764 AC_MSG_ERROR(wrd: --with-x option must be specified)
1766 AC_DEFINE(WRDT_X,1,Define to 1 if you need wrd support for X.)
1767 enable_sherry_wrd=yes
1768 AC_CHECK_LIB(z,zlibVersion,:,enable_sherry_wrd=no)
1769 AC_CHECK_HEADER(png.h,,enable_sherry_wrd=no)
1770 AC_CHECK_LIB(png,png_init_io,:,enable_sherry_wrd=no,-lz)
1771 if test "$enable_sherry_wrd" = yes; then
1772 AC_DEFINE(ENABLE_SHERRY,1,Define to 1 if you enable Sherry WRD)
1776 AC_MSG_WARN([Sherry WRD is disabled: png.h, libpng.a, libz.a are required])
1778 if test "x$have_xext" = xyes; then
1783 dnl end of interfaces
1790 AM_CONDITIONAL(ENABLE_WRD, test "x$enable_wrd" = "xyes")
1792 AM_CONDITIONAL(CYGNUS, test "x$CYGNUS" = xyes)
1793 AM_CONDITIONAL(MINGW, test "x$MINGW" = xyes)
1794 AM_CONDITIONAL(W32READDIR, test "x$W32READDIR" = "xyes")
1796 SET_UNIQ_WORDS(LDFLAGS,$LDFLAGS)
1797 SET_UNIQ_WORDS(SHLDFLAGS,$SHLDFLAGS)
1798 SET_UNIQ_WORDS(CFLAGS,$EXTRACFLAGS $CFLAGS)
1799 SET_UNIQ_WORDS(CPPFLAGS,$CPPFLAGS $EXTRADEFS)
1801 if test "x$oss_device" != x; then
1802 AC_DEFINE_UNQUOTED(OSS_DEVICE,"$oss_device", oss device name)
1805 if test "x$TIMIDITY_OUTPUT_ID" != x; then
1806 AC_DEFINE_UNQUOTED(TIMIDITY_OUTPUT_ID,"$TIMIDITY_OUTPUT_ID", the output specification)
1809 if test "x$with_x" = xyes; then
1810 dnl Order of X-library is: -lXm -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11
1811 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/"`
1813 LIBS="$LIBS $lib_dl_opt $lib_png_opt $lib_zip_opt $lib_user32_opt $lib_w32gui_opt $EXTRALIBS"
1814 SHLD="$SHLD $SHLDFLAGS"
1817 AC_SUBST(timidity_LDFLAGS)
1824 AC_SUBST(dynamic_targets)
1829 AC_SUBST(program_transform_name)
1830 AC_SUBST(INTERFACE_SRCS)
1831 AC_SUBST(pkgdatadir)
1841 doc/ja_JP.eucJP/Makefile
1843 interface/motif_bitmaps/Makefile
1844 interface/bitmaps/Makefile
1845 interface/pixmaps/Makefile