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++],[2.13.0-rc2],[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 mmsystem check
432 if test "x$CYGNUS" = xyes; then
433 AC_CACHE_CHECK(Cygwin new mmsystem,timidity_cv_header_new_mmsystem,
434 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
436 #include <mmsystem.h>
437 ]], [[return WOM_OPEN != 0x3BB]])],[timidity_cv_header_new_mmsystem=yes],[timidity_cv_header_new_mmsystem=no]))
438 if test $timidity_cv_header_new_mmsystem = yes; then
439 AC_DEFINE(HAVE_NEW_MMSYSTEM,1,Define to 1 if you have <mmsystem.h> file)
443 dnl MINGW mmsystem check
444 if test "x$MINGW" = xyes; then
445 AC_CACHE_CHECK(Mingw new mmsystem,timidity_cv_header_new_mmsystem,
446 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
448 #include <mmsystem.h>
449 ]], [[return WOM_OPEN != 0x3BB]])],[timidity_cv_header_new_mmsystem=yes],[timidity_cv_header_new_mmsystem=no]))
450 if test $timidity_cv_header_new_mmsystem = yes; then
451 AC_DEFINE(HAVE_NEW_MMSYSTEM,1,Define to 1 if you have <mmsystem.h> file)
455 # Checks for library functions.
456 AC_FUNC_ERROR_AT_LINE
460 AC_FUNC_SETVBUF_REVERSED
497 AC_CHECK_FUNC(getopt_long,
498 AC_DEFINE([HAVE_GETOPT_LONG],1,[Define to 1 if you have `getopt_long function'])
499 tm_cv_needgetopt="no",
500 tm_cv_needgetopt="yes")
501 AM_CONDITIONAL([NEEDGETOPT], test "x$tm_cv_needgetopt" = "xyes")
504 if test "x$CYGNUS" = xyes; then
505 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
507 AC_CHECK_FUNC(opendir,,
508 [ EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
511 *)EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
515 if test "x$enable_network" = "xyes"; then
516 AC_CHECK_FUNC(socket,,
517 WAPI_CHECK_LIB(wsock32,WSAStartup,
518 [#include <winsock.h>],
520 [ EXTRALIBS="$EXTRALIBS -lwsock32"
521 EXTRADEFS="$EXTRADEFS -DWINSOCK" ]))
526 if test "x$CYGWIN" = xyes; then
527 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
529 AC_CHECK_FUNC(opendir,,
530 [ EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
533 *)EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
537 if test "x$enable_network" = "xyes"; then
538 AC_CHECK_FUNC(socket,,
539 WAPI_CHECK_LIB(wsock32,WSAStartup,
540 [#include <winsock.h>],
542 [ EXTRALIBS="$EXTRALIBS -lwsock32"
543 EXTRADEFS="$EXTRADEFS -DWINSOCK" ]))
547 # Checks on extra paths
550 AC_ARG_WITH(tcl-includes,
551 [ --with-tcl-includes=DIR Tcl include file path ],
552 [ if test ! -d $withval; then
553 AC_MSG_WARN($withval is not found.)
555 tcl_include_dir="-I$withval"
557 AC_ARG_WITH(tcl-libs,
558 [ --with-tcl-libs=DIR Tcl library file path ],
559 [ if test ! -d $withval; then
560 AC_MSG_WARN($withval is not found.)
562 tcl_libdir="-L$withval" ])
563 AC_ARG_WITH(tk-includes,
564 [ --with-tk-includes=DIR Tk include file path ],
565 [ if test ! -d $withval; then
566 AC_MSG_WARN($withval is not found.)
568 tk_includes="-I$withval" ])
570 [ --with-tk-libs=DIR Tk library file path ],
571 [ if test ! -d $withval; then
572 AC_MSG_WARN($withval is not found.)
574 tk_libdir="-L$withval" ])
577 AC_ARG_WITH(offix-includes,
578 [ --with-offix-includes=DIR Offix include file path ],
579 [ if test ! -d $withval; then
580 AC_MSG_WARN($withval is not found.)
582 offix_include_dir="-I$withval" ])
583 AC_ARG_WITH(offix-libs,
584 [ --with-offix-libs=DIR Offix include file path ],
585 [ if test ! -d $withval; then
586 AC_MSG_WARN($withval is not found.)
588 offix_lib_dir="-L$withval" ])
594 dnl default(d): auto selection
595 dnl oss(d): OSS /dev/dsp
596 dnl alsa(d): ALSA pcm device
597 dnl sun(d): SunOS /dev/audio
598 dnl hpux(d): HPUX /dev/audio
599 dnl irix(d): IRIX audio
600 dnl mme(d): OSF/1 MME
601 dnl sb_dsp(d): BSD/OS 2.0 /dev/sb_dsp
602 dnl w32(d): Windows MMS
603 dnl darwin(d): Mac OS X pcm device
604 dnl alsa(s): ALSA pcm device
605 dnl alib(A): HPUX network audio (Alib)
606 dnl nas(n): Network Audio System
609 dnl portaudio(p) PortAudio
610 dnl vorbis(v): Ogg Vorbis
611 dnl gogo(g): MP3 GOGO
614 audio_targets='default oss alsa sun hpux irix mme sb_dsp w32 alib nas arts esd vorbis gogo portaudio jack'
616 AC_ARG_WITH(nas-library,
617 [ --with-nas-library=library NAS absolute library path(Don't use -laudio)])
618 AC_ARG_WITH(nas-includes,
619 [ --with-nas-includes=DIR NAS include files are in dir])
623 [ --enable-audio[=mode_list] Enable audio (Specify comma separated mode list):
624 default: Automatically select audio device.
626 sun: SunOS /dev/audio
627 hpux: HPUX /dev/audio
628 irix: IRIX audio library
630 sb_dsp: BSD/OS 2.0 /dev/sb_dsp
632 darwin: Darwin CoreAudio
633 alsa: ALSA pcm device
634 alib: HPUX network audio (Alib)
635 nas: NAS - Network Audio System
637 esd: EsounD - Enlightened Sound Daemon
641 gogo: MP3 GOGO (Only Windows is supported)],
642 [ enable_audio=$enableval
643 have_audio_opt=yes ],
648 test "x$enable_audio" = xyes && enable_audio=default
650 if test "x$enable_audio" != xno; then
651 for i in `echo $enable_audio | sed 's/,/ /g'`; do
652 eval "au_enable_$i=yes"
656 dnl Turn on default output mode
658 AC_ARG_WITH(default-output,
659 [ --with-default-output=<mode> Specify default output mode (optional):
660 (default|alsa|alib|arts|nas|
661 esd|wav|au|aiff|list|vorbis|
662 gogo|portaudio|jack)],
663 [ if test "$enable_audio" != no; then
664 DEFAULT_PLAYMODE=$withval
665 eval "au_enable_$DEFAULT_PLAYMODE=yes"
667 AC_MSG_WARN(--with-default-output=$withval: audio is not enabled)
670 dnl compatibility matters.
671 dnl AC_ARG_ENABLE(esd,
672 dnl [ --enable-esd EsounD (Obsoleted. Use --enable-audio=esd)],
673 dnl [ au_enable_esd=$enableval ])
674 dnl AC_ARG_ENABLE(nas,
675 dnl [ --enable-nas NAS (Obsoleted. Use --enable-audio=nas)],
676 dnl [ au_enable_nas=$enableval ])
677 dnl AC_ARG_ENABLE(alsa,
678 dnl [ --enable-alsa ALSA (Obsoleted. Use --enable-audio=alsa)],
679 dnl [ au_enable_alsa=$enableval ])
681 dnl target-specific defaults
682 if test "x$au_enable_default" = xyes; then
684 *-*-linux*|*-*-freebsd*)
690 *-*-bsdi2.1|*-*-bsdi3.?|*-*-bsdi4.?)
721 AC_MSG_WARN(No --enable-audio=default audio for $target)
727 # Each audio mode's configurations
729 AC_MSG_CHECKING(enable_audio=oss)
730 if test "x$au_enable_oss" = xyes; then
731 EXTRADEFS="$EXTRADEFS -DAU_OSS"
732 SYSEXTRAS="$SYSEXTRAS oss_a.c"
733 if test "x$ac_cv_header_sys_soundcard_h" = xyes; then
734 AC_MSG_RESULT(yes - <sys/soundcard.h>)
738 dnl <linux/soundcard.h> or <machine/soundcard.h>
742 if test "x$ac_cv_header_soundcard_h" = xyes; then
743 AC_MSG_RESULT(yes - <soundcard.h>)
745 AC_MSG_WARN(<sys/soundcard.h> is not found)
750 AC_CHECK_LIB(ossaudio,open)
752 dnl Why OpenBSD use /dev/audio instead of /dev/dsp for OSS
755 if test ! -e "/dev/dsp"; then
756 oss_device=/dev/audio
765 AC_MSG_CHECKING(enable_audio=sun)
766 if test "x$au_enable_sun" = xyes; then
769 if test -f /usr/demo/SOUND/libaudio.a; then
770 EXTRALIBS="$EXTRALIBS /usr/demo/SOUND/libaudio.a"
773 AC_MSG_RESULT(Notice: libaudio.a is not found [(ignore)])
777 if test -f /usr/demo/SOUND/lib/libaudio.a; then
778 EXTRALIBS="$EXTRALIBS /usr/demo/SOUND/lib/libaudio.a"
781 AC_MSG_RESULT(Notice: libaudio.a is not found [(ignore)])
784 *) AC_MSG_RESULT(yes)
787 EXTRADEFS="$EXTRADEFS -DAU_SUN"
788 SYSEXTRAS="$SYSEXTRAS sun_a.c"
794 AC_MSG_CHECKING(enable_audio=hpux)
795 if test "x$au_enable_hpux" = xyes; then
797 *-*-hpux*) AC_MSG_RESULT(yes) ;;
798 *) AC_MSG_WARN(may not work on $target) ;;
800 EXTRADEFS="$EXTRADEFS -DAU_HPUX_AUDIO"
801 SYSEXTRAS="$SYSEXTRAS hpux_d_a.c"
807 AC_MSG_CHECKING(enable_audio=irix)
808 if test "x$au_enable_irix" = xyes; then
810 *-sgi-irix5*|*-sgi-irix6.2)
811 EXTRADEFS="$EXTRADEFS -DAU_AUDRIV -DSGI_OLDAL"
815 EXTRADEFS="$EXTRADEFS -DAU_AUDRIV -DSGI_NEWAL"
818 *) AC_MSG_WARN(may not work on $target) ;;
820 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_al.c"
821 EXTRALIBS="$EXTRASLIBS -laudio"
827 AC_MSG_CHECKING(enable_audio=mme)
828 if test "x$au_enable_mme" = xyes; then
830 *-dec-*) AC_MSG_RESULT(yes) ;;
831 *) AC_MSG_WARN(may not work on $target) ;;
833 EXTRADEFS="$EXTRADEFS -DAU_DEC -DAU_AUDRIV"
834 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_mme.c"
835 CPPFLAGS="$CPPFLAGS -I/usr/opt/MME210/include"
836 EXTRALIBS="$EXTRALIBS /usr/opt/MME220/lib/libmme.a"
842 AC_MSG_CHECKING(enable_audio=sb_dsp)
843 if test "x$au_enable_sb_dsp" = xyes; then
845 *-*-bsdi2.0) AC_MSG_RESULT(yes) ;;
846 *) AC_MSG_WARN(may not work on $target) ;;
848 EXTRADEFS="$EXTRADEFS -DAU_BSDI -DDEFAULT_RATE=22500"
849 SYSEXTRAS="$SYSEXTRAS bsd20_a.c"
855 AC_MSG_CHECKING(enable_audio=w32)
856 if test "x$au_enable_w32" = xyes; then
865 AC_MSG_WARN(may not work on $target)
868 SYSEXTRAS="$SYSEXTRAS w32_a.c"
869 EXTRALIBS="$EXTRALIBS -lwinmm"
870 EXTRADEFS="$EXTRADEFS -DAU_W32"
875 dnl Mac OS X / darwin-x86
876 AC_MSG_CHECKING(enable_audio=darwin)
877 if test "x$au_enable_darwin" = xyes; then
878 EXTRADEFS="$EXTRADEFS -DAU_DARWIN"
879 SYSEXTRAS="$SYSEXTRAS darwin_a.c"
880 EXTRALIBS="$EXTRALIBS -framework CoreAudio"
881 dnl just say yes or no :-P
886 AC_MSG_WARN(may not work on $target)
894 dnl alsa - Advanced Linux Sound Architecture
895 AC_MSG_CHECKING(enable_audio=alsa)
896 if test "x$au_enable_alsa" = xyes; then
897 AC_MSG_RESULT([yes, configuring alsa])
902 if test "x$alsa_found" = "xyes" ; then
903 dnl AC_MSG_RESULT(yes)
904 EXTRADEFS="$EXTRADEFS -DAU_ALSA"
905 SYSEXTRAS="$SYSEXTRAS alsa_a.c"
906 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ALSA_CFLAGS)
907 LIBS="$KEEPLIBS $ALSA_LIBS"
908 AC_CHECK_FUNCS(snd_seq_port_info_set_timestamping)
910 AC_MSG_WARN(Couldn't configure alsa.)
920 AC_MSG_CHECKING(enable_audio=alib)
921 if test "x$au_enable_alib" = xyes; then
923 *-*-hpux*) AC_MSG_RESULT(yes) ;;
924 *) AC_MSG_WARN(may not work on $target) ;;
926 SYSEXTRAS="$SYSEXTRAS hpux_a.c"
927 EXTRADEFS="$EXTRADEFS -DAU_HPUX_ALIB"
928 if test -d /opt/audio/include; then
929 CPPFLAGS="$CPPFLAGS -I/opt/audio/include"
931 if test -d /opt/audio/lib; then
932 EXTRALIBS="$EXTRALIBS -L/opt/audio/lib"
934 EXTRALIBS="$EXTRALIBS -lAlib"
940 AC_MSG_CHECKING(enable_audio=nas)
941 if test "x$au_enable_nas" = xyes; then
942 if test "x$with_x" != xyes; then
943 AC_MSG_ERROR(nas: --with-x option must be specified)
945 EXTRADEFS="$EXTRADEFS -DAU_NAS"
946 SYSEXTRAS="$SYSEXTRAS nas_a.c"
948 dnl -laudio conflicts another audio library,
949 dnl so I specify NAS library with absolete path.
951 if test "x$with_nas_library" != x; then
952 AC_MSG_RESULT($with_nas_library);
953 EXTRALIBS="$EXTRALIBS $with_nas_library"
956 MY_SEARCH_LIBS(AuOpenServer,
957 [$x_libraries/libaudio.a \
958 /usr/lib/libaudio.so \
959 /usr/lib/libaudio.a ],
960 [ AC_MSG_RESULT(NAS: $timidity_cv_search_AuOpenServer)
961 EXTRALIBS="$EXTRALIBS $timidity_cv_search_AuOpenServer"],
962 [AC_MSG_WARN(NAS library is not found.)])
964 test "x$with_nas_includes" != x && CPPFLAGS="$CPPFLAGS -I$with_nas_includes"
966 if test "x$have_xext" = xyes; then
969 if test "x$have_xprelibs" = xyes; then
970 lib_xprelibs_opt='-lSM -lICE'
977 AC_MSG_CHECKING(enable_audio=arts)
978 if test "x$au_enable_arts" = xyes; then
979 AC_MSG_RESULT([yes, configuring aRts])
987 if test "x$no_arts" = x; then
988 dnl AC_MSG_RESULT(aRts: Enabled)
989 EXTRADEFS="$EXTRADEFS -DAU_ARTS"
990 SYSEXTRAS="$SYSEXTRAS aRts_a.c"
991 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ARTS_CFLAGS)
992 LIBS="$LIBS $ARTS_LIBS"
994 AC_MSG_WARN(aRts: Couldn't configure)
1001 AC_MSG_CHECKING(enable_audio=esd)
1002 if test "x$au_enable_esd" = xyes; then
1003 AC_MSG_RESULT([yes, configuring esd])
1006 KEEPLDFLAGS=$LDFLAGS
1010 LDFLAGS=$KEEPLDFLAGS
1011 if test "x$no_esd" = x; then
1012 dnl AC_MSG_RESULT(EsounD: Enabled)
1013 EXTRADEFS="$EXTRADEFS -DAU_ESD"
1014 SYSEXTRAS="$SYSEXTRAS esd_a.c"
1015 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ESD_CFLAGS)
1016 LIBS="$LIBS $ESD_LIBS"
1018 AC_MSG_WARN(EsounD: Couldn't configure)
1025 AC_MSG_CHECKING(enable_audio=portaudio)
1026 if test "x$au_enable_portaudio" = xyes; then
1028 SYSEXTRAS="$SYSEXTRAS portaudio_a.c"
1029 EXTRALIBS="$EXTRALIBS -lportaudio"
1030 EXTRADEFS="$EXTRADEFS -DAU_PORTAUDIO"
1036 AC_MSG_CHECKING(enable_audio=jack)
1037 if test "x$au_enable_jack" = xyes; then
1039 SYSEXTRAS="$SYSEXTRAS jack_a.c"
1040 EXTRALIBS="$EXTRALIBS $(pkg-config --libs jack)"
1041 EXTRADEFS="$EXTRADEFS -DAU_JACK $(pkg-config --cflags jack)"
1047 AC_MSG_CHECKING(enable_audio=vorbis)
1048 if test "x$au_enable_vorbis" = xyes; then
1049 AC_MSG_RESULT([yes, configuring vorbis])
1053 SYSEXTRAS="$SYSEXTRAS vorbis_a.c"
1054 EXTRADEFS="$EXTRADEFS -DAU_VORBIS $OGG_CFLAGS $VORBIS_CFLAGS"
1055 EXTRALIBS="$EXTRALIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"
1056 if test "x$CYGNUS" = "xyes"; then
1057 EXTRADEFS="-DAU_VORBIS_DLL $EXTRALIBS"
1058 SYSEXTRAS="$SYSEXTRAS w32g_vorbisenc_dll.c w32g_vorbis_dll.c w32g_ogg_dll.c"
1060 if test "x$MINGW" = "xyes"; then
1061 EXTRADEFS="-DAU_VORBIS_DLL $EXTRALIBS"
1062 SYSEXTRAS="$SYSEXTRAS w32g_vorbisenc_dll.c w32g_vorbis_dll.c w32g_ogg_dll.c"
1065 AC_MSG_WARN([Unable to configure vorbis, but ogg is there (???)])
1068 AC_MSG_WARN(Unable to configure vorbis!)
1075 dnl Win32 Gogo-no-coder
1076 AC_MSG_CHECKING(enable_audio=gogo)
1077 if test "x$au_enable_gogo" = xyes; then
1078 if test "x$CYGNUS" = "xyes"; then
1079 AC_MSG_RESULT(yes, configuring gogo)
1081 if test "x$MINGW" = "xyes"; then
1082 AC_MSG_RESULT(yes, configuring gogo)
1084 AC_MSG_WARN(May be gogo is not supported. You need hack the gogo_a.c)
1088 SYSEXTRAS="$SYSEXTRAS gogo_a.c w32_gogo.c"
1089 EXTRADEFS="$EXTRADEFS -DAU_GOGO -DAU_GOGO_DLL"
1090 EXTRALIBS="$EXTRALIBS -lgogo"
1095 dnl Pseudo audio device (Undocumented).
1096 if test "x$au_enable_none" = xyes; then
1097 EXTRADEFS="$EXTRADEFS -DAU_NONE -DAU_AUDRIV"
1098 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_none.c"
1101 dnl TIMIDITY_OUTPUT_ID
1103 AC_MSG_CHECKING(default output mode)
1104 if test "x$DEFAULT_PLAYMODE" = x; then
1105 DEFAULT_PLAYMODE=`echo $enable_audio | sed 's/,.*//'`
1107 case ".$DEFAULT_PLAYMODE" in
1108 .default) TIMIDITY_OUTPUT_ID=d ;;
1109 .oss) TIMIDITY_OUTPUT_ID=d ;;
1110 .alsa) TIMIDITY_OUTPUT_ID=s ;;
1111 .sun) TIMIDITY_OUTPUT_ID=d ;;
1112 .hpux) TIMIDITY_OUTPUT_ID=d ;;
1113 .irix) TIMIDITY_OUTPUT_ID=d ;;
1114 .mme) TIMIDITY_OUTPUT_ID=d ;;
1115 .sb_dsp) TIMIDITY_OUTPUT_ID=d ;;
1116 .darwin) TIMIDITY_OUTPUT_ID=d ;;
1117 .w32) TIMIDITY_OUTPUT_ID=d ;;
1118 .alib) TIMIDITY_OUTPUT_ID=A ;;
1119 .nas) TIMIDITY_OUTPUT_ID=n ;;
1120 .arts) TIMIDITY_OUTPUT_ID=R ;;
1121 .esd) TIMIDITY_OUTPUT_ID=e ;;
1122 .portaudio) TIMIDITY_OUTPUT_ID=p ;;
1123 .wav) TIMIDITY_OUTPUT_ID=w ;;
1124 .au) TIMIDITY_OUTPUT_ID=u ;;
1125 .aiff) TIMIDITY_OUTPUT_ID=a ;;
1126 .list) TIMIDITY_OUTPUT_ID=l ;;
1127 .vorbis) TIMIDITY_OUTPUT_ID=v ;;
1128 .gogo) TIMIDITY_OUTPUT_ID=g ;;
1129 .jack) TIMIDITY_OUTPUT_ID=j ;;
1130 *) TIMIDITY_OUTPUT_ID= ;;
1132 AC_MSG_RESULT($DEFAULT_PLAYMODE/$TIMIDITY_OUTPUT_ID)
1138 interface_targets='dynamic ncurses slang motif tcltk emacs vt100 xaw xskin gtk alsaseq winsyn winsyng portmidisyng'
1140 AC_ARG_ENABLE(interface,
1141 [ --enable-interface=[interface_list]
1142 Comma separated interface list ],
1143 [ for i in `echo $enableval | sed 's/,/ /g'`; do
1144 eval "enable_$i=yes"
1147 # Dynamic link configuration
1148 AC_ARG_ENABLE(dynamic,
1149 [ --enable-dynamic Enable dynamic link interface (default is no)
1150 --enable-dynamic=dynamic_list
1151 Comma separated dynamic interface list],
1152 [ dnl --enable-dynamic=yes to --enable-dynamic=dynamic
1153 if test "x$enable_dynamic" = xyes; then
1154 enable_dynamic=dynamic
1155 elif test "x$enable_dynamic" != xno; then
1156 for i in `echo $enableval | sed 's/,/ /g'`; do
1157 eval "enable_$i=dynamic"
1162 for i in $interface_targets; do
1163 eval "join_targets=$join_targets\$enable_$i"
1166 case ".$join_targets" in
1167 .*dynamic*) NEEDDLOPEN=yes;;
1171 dnl check -fpic option for gcc
1172 if test "x$GCC" = xyes; then SHCFLAGS="$SHCFLAGS -fPIC"; fi
1173 case "x$enable_ump" in xyes|xdynamic) EXTRACFLAGS="$EXTRACFLAGS -DXP_UNIX $SHCFLAGS";; esac
1175 dnl Which type of dynamic loader?
1176 if test "$NEEDDLOPEN" = "yes"; then
1179 WAPI_CHECK_FUNC(LoadLibrary,,[LoadLibrary(0);],have_dl=w32)
1180 test $wapi_cv_func_LoadLibrary = yes && have_dl=w32
1182 if test "$have_dl" = "no"; then
1183 AC_CHECK_FUNC(shl_load,have_dl=hpux)
1185 if test "$have_dl" = "no"; then
1186 dnl darwin has both dyld and libdl: in case user installed dlcompat.
1187 dnl dyld is recommended because libdl is a wrapper for dyld.
1188 AC_CHECK_FUNC(NSLinkModule,have_dl=dyld)
1190 if test "$have_dl" = "no" -a "x$ac_cv_lib_dl_dlopen" = xyes; then
1193 if test "$have_dl" = "no"; then
1194 AC_CHECK_FUNC(dlopen,have_dl=dlopen)
1196 if test "$have_dl" = "no"; then
1197 AC_CHECK_FUNC(dld_init,have_dl=dld)
1199 if test "$have_dl" = "no"; then
1200 AC_CHECK_LIB(dld,dld_init,have_dl=dld;lib_dl_opt=-ldld)
1203 AC_MSG_CHECKING(dynamic link method)
1206 AC_MSG_RESULT(use dl_dlopen.c)
1207 SYSEXTRAS="$SYSEXTRAS dl_dlopen.c"
1208 CHECK_DLSYM_UNDERSCORE(AC_DEFINE(DLSYM_NEEDS_UNDERSCORE,1,Define to 1 if you have to add "_" to every identifiers.))
1211 AC_MSG_RESULT(use dl_dld.c)
1212 SYSEXTRAS="$SYSEXTRAS dl_dld.c"
1215 AC_MSG_RESULT(use dl_hpux.c)
1216 SYSEXTRAS="$SYSEXTRAS dl_hpux.c"
1217 LDFLAGS="$LDFLAGS -Wl,-E $LDFLAGS"
1220 AC_MSG_RESULT(use dl_w32.c)
1221 SYSEXTRAS="$SYSEXTRAS dl_w32.c"
1224 AC_MSG_RESULT(use dl_dyld.c)
1225 SYSEXTRAS="$SYSEXTRAS dl_dyld.c"
1229 AC_MSG_WARN(no method to open a shared object)
1234 if test "$NEEDDLOPEN" = "yes"; then
1235 MY_DEFINE(IA_DYNAMIC)
1236 AC_DEFINE_UNQUOTED(SHARED_LIB_EXT,".$so", shared library extention)
1238 dnl EXTRADEFS="$EXTRADEFS \$(DEF_SHLIB_DIR)"
1239 test "x$GCC" = xyes -a "x$timidity_cv_ccoption_rdynamic" = xyes && timidity_LDFLAGS="-rdynamic"
1242 AM_CONDITIONAL(NEEDDLOPEN, test "$NEEDDLOPEN" = "yes")
1245 dnl Each interface section
1249 AM_CONDITIONAL(ENABLE_NCURSES, false)
1250 CONFIG_INTERFACE(ncurses,NCURSES,n,
1251 [ --enable-ncurses Enable ncurses interface (default is no)],
1252 [ AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h)
1254 dnl #include <ncurses/curses.h> is failure on Plamo Linux 1.3/ncurses 1.9.9e
1255 dnl because <ncurses/curses.h> includes <unctrl.h>:
1256 dnl /usr/include/ncurses/curses.h:34: unctrl.h: No such file or directory
1257 dnl But surely there is unctl.h at /usr/include/ncurses/unctrl.h.
1258 dnl configure must check ncurses header with -I/usr/include/ncurses option.
1260 case "$ac_cv_header_curses_h$ac_cv_header_ncurses_curses_h$ac_cv_header_ncurses_h" in
1262 *) for i in /usr/include /usr/local/include; do
1263 if test -f "$i/ncurses/curses.h" -a -f "$i/ncurses/unctrl.h"; then
1264 AC_MSG_WARN(ncurses test is failure. Please check config.h and common.makefile later)
1265 CPPFLAGS="$CPPFLAGS -I$i/ncurses"
1272 AC_CHECK_LIB(ncurses,initscr,lib_curses_opt=-lncurses,
1273 [ dnl checking pdcurses
1274 AC_CHECK_LIB(curses,PDC_set_ctrl_break,
1275 [ lib_curses_opt=-lcurses
1276 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
1277 lib_user32_opt="$lib_user32_test"
1279 [ dnl checking libpdcurses
1280 AC_CHECK_LIB(pdcurses,PDC_set_ctrl_break,
1281 [ lib_curses_opt=-lpdcurses
1282 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
1283 lib_user32_opt="$lib_user32_test"
1285 [ dnl OpenBSD use -lcurses instead of -lncurses.
1288 AC_CHECK_LIB(curses,initscr,lib_curses_opt=-lcurses,
1289 [ AC_MSG_WARN(ncurses interface is not enabled)
1290 enable_ncurses=no ])
1293 AC_MSG_WARN(ncurses interface is not enabled)
1302 [ LIBS="$LIBS $lib_curses_opt"
1305 EXTRALIBS="$EXTRALIBS -lmytinfo"
1308 INTERFACE_SRCS="$INTERFACE_SRCS ncurs_c.c"
1310 [ n_so_libs="$lib_curses_opt"
1313 EXTRALIBS="$EXTRALIBS -lmytinfo"
1318 AM_CONDITIONAL(ENABLE_SLANG, false)
1319 CONFIG_INTERFACE(slang,SLANG,s,
1320 [ --enable-slang Enable slang interface (default is no)],
1321 [ AC_CHECK_LIB(slang,SLang_init_tty,:,
1323 AC_MSG_WARN(slang interface is not enabled)
1325 AC_CHECK_HEADERS(slang/slang.h slang.h)
1327 [ LIBS="$LIBS -lslang"
1328 INTERFACE_SRCS="$INTERFACE_SRCS slang_c.c"
1330 [ s_so_libs="-lslang"
1331 AC_CHECK_LIB(termcap,initscr,s_so_libs="$s_so_libs -ltermcap")
1335 AM_CONDITIONAL(ENABLE_MOTIF, false)
1336 CONFIG_INTERFACE(motif,MOTIF,m,
1337 [ --enable-motif Enable motif interface (default is no)],
1338 [ if test "x$with_x" != xyes; then
1339 AC_MSG_ERROR(motif: --with-x option must be specified)
1341 if test "x$have_xm" != xyes; then
1342 AC_MSG_WARN(Motif library is not found.)
1349 if test "x$have_xprelibs" = xyes; then
1350 lib_xprelibs_opt='-lSM -lICE'
1352 INTERFACE_SRCS="$INTERFACE_SRCS motif_c.c motif_i.c motif_p.c"
1354 [ if test x$have_xprelibs = xyes; then
1355 m_so_libs="-lXext -lSM -lICE"
1357 m_so_libs="$ldflags_x_opt -lXm -lXt $m_so_libs -lX11"
1361 AM_CONDITIONAL(ENABLE_TCLTK, false)
1362 CONFIG_INTERFACE(tcltk,TCLTK,k,
1363 [ --enable-tcltk Enable tcltk interface (default is no)],
1364 [ if test "x$with_x" != xyes; then
1365 AC_MSG_ERROR(tcltk: --with-x option must be specified)
1369 KEEPCPPFLAGS=$CPPFLAGS
1370 KEEPLDFLAGS=$LDFLAGS
1373 CPPFLAGS="$tcl_include_dir $tk_includes $CPPFLAGS"
1374 LDFLAGS="$tcl_libdir $tk_libdir $LDFLAGS"
1375 LIBS="$LIBS $lib_dl_opt"
1379 for l in tcl tcl8.4 tcl8.3 tcl8.0jp tcl7.6jp tcl80jp tcl76jp tcl8.0 tcl7.6 tcl80 tcl76; do
1380 case "x$tcl_lib" in x) AC_CHECK_LIB($l,Tcl_Init,tcl_lib=-l$l);; esac
1382 LIBS="$LIBS $tcl_lib"
1383 for l in tk tk8.4 tk8.3 tk8.0jp tk4.2jp tk80jp tk42jp tk8.0 tk4.2 tk80 tk42; do
1384 case "x$tk_lib" in x) AC_CHECK_LIB($l,Tk_Init,tk_lib=-l$l);; esac
1388 if test "x$tcl_lib" = x -o "x$tk_lib" = x; then
1389 CPPFLAGS=$KEEPCPPFLAGS
1390 LDFLAGS=$KEEPLDFLAGS
1392 AC_MSG_WARN(tcl/tk is not enable)
1394 tcltk_dep='tclIndex'
1397 [ LIBS=`echo $LIBS | sed "s/-lX11/$tk_lib $tcl_lib -lX11/"`
1400 EXTRALIBS="$EXTRALIBS -lipc"
1403 INTERFACE_SRCS="$INTERFACE_SRCS tk_c.c"
1405 [ k_so_libs="$tcl_libdir $tk_libdir $tcl_lib $tk_lib $lib_dl_opt"
1408 k_so_libs="$k_so_libs -lipc"
1411 k_so_libs="$k_so_libs -lX11 -lm"
1413 AM_CONDITIONAL(ENABLE_DYNAMIC_TCLTK, test "x$enable_tcltk" = "xdynamic")
1416 AM_CONDITIONAL(ENABLE_EMACS, false)
1417 CONFIG_INTERFACE(emacs,EMACS,e,
1418 [ --enable-emacs Enable emacs interface (default is no)],
1420 [ ELFILES="$ELFILES timidity.el"
1421 INTERFACE_SRCS="$INTERFACE_SRCS emacs_c.c"
1423 [ ELFILES="$ELFILES timidity.el" ])
1426 AM_CONDITIONAL(ENABLE_VT100, false)
1427 CONFIG_INTERFACE(vt100,VT100,T,
1428 [ --enable-vt100 Enable VT100 interface (default is no)],
1430 [ INTERFACE_SRCS="$INTERFACE_SRCS vt100_c.c vt100.c" ])
1433 AM_CONDITIONAL(ENABLE_XAW, false)
1434 CONFIG_INTERFACE(xaw,XAW,a,
1435 [ --enable-xaw Enable athena interface (default is no)],
1436 [ if test "x$with_x" != xyes; then
1437 AC_MSG_ERROR(xaw: --with-x option must be specified)
1439 if test "x$have_xaw" != "xyes" -a "x$have_xaw" != "x3d"; then
1440 AC_MSG_WARN(X Athena Widget library is not found.)
1443 [ dnl Add -lXext -lSM -lICE -lXmu -lXt {-lXaw|-lXaw3d}
1444 if test "x$have_xext" = xyes; then
1447 if test "x$have_xprelibs" = xyes; then
1448 lib_xprelibs_opt='-lSM -lICE'
1452 if test "x$have_xaw" = x3d; then
1453 AC_DEFINE(XAW3D,1,Define to 1 if you have libXaw3d.)
1458 INTERFACE_SRCS="$INTERFACE_SRCS xaw_c.c xaw_i.c"
1460 [ if test "x$have_xext" = xyes; then
1461 a_so_libs="-lXext -lX11"
1467 a_so_libs="$a_so_libs -lcc_dynamic"
1470 if test "x$have_xprelibs" = xyes; then
1471 a_so_libs="-lSM -lICE $a_so_libs"
1473 if test "x$have_xaw" = xyes; then
1474 a_so_libs="-lXaw -lXmu -lXt $a_so_libs"
1475 elif test "x$have_xaw" = x3d; then
1476 AC_DEFINE(XAW3D,1,Define to 1 if you have libXaw3d.)
1477 a_so_libs="-lXaw3d -lXmu -lXt $a_so_libs"
1479 a_so_libs="$ldflags_x_opt $a_so_libs"
1481 AM_CONDITIONAL(ENABLE_DYNAMIC_XAW, test "x$enable_xaw" = "xdynamic")
1484 AM_CONDITIONAL(ENABLE_XSKIN, false)
1485 CONFIG_INTERFACE(xskin,XSKIN,i,
1486 [ --enable-xskin Enable X skin interface (default is no)],
1487 [ if test "x$with_x" != xyes; then
1488 AC_MSG_ERROR(xskin: --with-x option must be specified)
1491 [ INTERFACE_SRCS="$INTERFACE_SRCS xskin_c.c xskin_i.c xskin_loadBMP.c xskin_spectrum.c" ],
1492 [ i_so_libs="$ldflags_x_opt -lX11" ])
1495 AM_CONDITIONAL(ENABLE_GTK, false)
1496 CONFIG_INTERFACE(gtk, GTK, g,
1497 [ --enable-gtk Enable GTK+ interface (default is no)],
1498 [ AM_PATH_GTK(1.1.3,,enable_gtk=no) ],
1499 [ LIBS="$LIBS $GTK_LIBS"
1500 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$GTK_CFLAGS)
1501 INTERFACE_SRCS="$INTERFACE_SRCS gtk_c.c gtk_i.c gtk_p.c"
1503 [ if test "x$GCC" = xyes; then
1504 dnl Do not include -rdynamic option in $g_so_libs.
1505 for i in $GTK_LIBS; do
1508 *) g_so_libs="$g_so_libs $i" ;;
1512 g_so_libs="$GTK_LIBS"
1514 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$GTK_CFLAGS) ])
1516 dnl TiMidity Network MIDI Server
1517 AM_CONDITIONAL(ENABLE_SERVER, false)
1518 CONFIG_INTERFACE(server,SERVER,r,
1519 [ --enable-server Enable server interface (default is no)],
1521 [ INTERFACE_SRCS="$INTERFACE_SRCS server_c.c"
1522 AC_CHECK_HEADERS(sys/soundcard.h)
1525 dnl TiMidity ALSA sequencer server
1526 AM_CONDITIONAL(ENABLE_ALSASEQ, false)
1527 CONFIG_INTERFACE(alsaseq,ALSASEQ,A,
1528 [ --enable-alsaseq Enable ALSA sequencer server interface
1531 [ INTERFACE_SRCS="$INTERFACE_SRCS alsaseq_c.c"
1535 dnl TiMidity Windows synthesizer server
1536 AM_CONDITIONAL(ENABLE_WINSYN, false)
1537 CONFIG_INTERFACE(winsyn,WINSYN,W,
1538 [ --enable-winsyn Enable Windows Synthesizer interface
1541 [ INTERFACE_SRCS="$INTERFACE_SRCS winsyn_c.c rtsyn_common.c rtsyn_winmm.c" ])
1543 dnl TiMidity PortMIDI synthesizer server
1544 AM_CONDITIONAL(ENABLE_PORTMIDISYN, false)
1545 CONFIG_INTERFACE(portmidisyn,PORTMIDISYN,P,
1546 [ --enable-portmidisyn Enable PortMIDI Synthesizer interface
1549 [ INTERFACE_SRCS="$INTERFACE_SRCS portmidisyn_c.c rtsyn_common.c rtsyn_portmidi.c" ])
1551 dnl TiMidity Windows GUI synthesizer server
1552 AM_CONDITIONAL(ENABLE_W32G_SYN, false)
1553 CONFIG_INTERFACE(winsyng,W32G_SYN,W,
1554 [ --enable-winsyng Enable Windows GUI Synthesizer interface
1557 [ lib_w32gui_opt='-lgdi32 -lcomctl32 -lcomdlg32 -lole32'
1558 lib_user32_opt='-luser32'
1559 LDFLAGS="-mwindows $LDFLAGS"
1560 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"
1565 AM_CONDITIONAL(ENABLE_W32GUI, false)
1566 CONFIG_INTERFACE(w32gui, W32GUI, w,
1567 [ --enable-w32gui Enable Windows GUI interface (default is no)],
1569 [ lib_w32gui_opt='-lgdi32 -lcomctl32 -lcomdlg32 -lole32'
1570 lib_user32_opt='-luser32'
1571 LDFLAGS="-mwindows $LDFLAGS"
1572 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"
1575 dnl UMP configuration
1576 AM_CONDITIONAL(ENABLE_PLUGIN, false)
1577 CONFIG_INTERFACE(ump, PLUGIN, p,
1578 [ --enable-ump UMP configuration (default is no)],
1579 [ if test ! -d ump; then
1580 AC_MSG_ERROR(UMP Package is not exists. Can't configure it.)
1582 AC_CHECK_HEADER(X11/xpm.h,,AC_MSG_ERROR([UMP Package needs xpm.h[,] but could not find it.]))
1583 AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,:,AC_MSG_ERROR([UMP Package needs libXpm.a[,] but could not find it.]))
1584 if test "x$have_xext" = xyes; then
1587 if test "x$have_xprelibs" = xyes; then
1588 lib_xprelibs_opt='-lSM -lICE'
1596 dnl this rely on CFLAGS and LIBS
1597 AC_ARG_ENABLE(offix,
1598 [ --enable-offix Enable offix support (default is no)],
1599 [ if test "$enableval" = "yes"; then
1600 KEEPCPPFLAGS=$CPPFLAGS
1602 KEEPLDFLAGS=$LDFLAGS
1603 CPPFLAGS="$CPPFLAGS $offix_include_dir"
1604 LDFLAGS="$LDFLAGS $offix_lib_dir"
1605 LIBS="$LIBS $lib_xmu_opt $lib_xt_opt $lib_xprelibs_opt $lib_xext_opt -lX11"
1606 AC_CHECK_LIB(Dnd,DndInitialize,[
1608 lib_offix_opt="-lDnd"
1609 AC_DEFINE(OFFIX,1,Define to 1 if you need offix support)
1611 [ LDFLAGS=$KEEPLDFLAGS
1612 CPPFLAGS=$KEEPCPPFLAGS
1619 AC_ARG_ENABLE(network,
1620 [ --enable-network Enable network support (default is no)],
1621 [ if test "$enableval" = "yes"; then
1622 AC_DEFINE(SUPPORT_SOCKET,1,Define to 1 if you need network support)
1624 AM_CONDITIONAL(ENABLE_NETWORK, test "x$enable_network" = "xyes")
1626 dnl Sound Spectrogram Viewer
1627 AC_ARG_ENABLE(spectrogram,
1628 [ --enable-spectrogram Enable Sound Spectrogram Viewer (default is no)],
1629 [ if test "$enableval" = "yes"; then
1630 if test "x$with_x" != xyes; then
1631 AC_MSG_ERROR(spectrogram: --with-x option must be specified)
1633 AC_DEFINE(SUPPORT_SOUNDSPEC,1,Define to 1 if you need spectrogram vewer.)
1635 AM_CONDITIONAL(ENABLE_SOUND_SPEC, test "x$enable_spectrogram" = "xyes")
1637 dnl Wave Spline Interpolations
1638 AC_ARG_ENABLE(spline,
1639 [ --enable-spline=[method] Specify spline method.
1640 one of no,linear,cubic,lagrange,newton,gauss
1641 (default is linear)],
1642 [ case "x$enableval" in
1644 AC_DEFINE(LINEAR_INTERPOLATION,1,Define to 1 if you use linear interpolation.)
1647 AC_DEFINE(CSPLINE_INTERPOLATION,1,Define to 1 if you use cubic-spline interpolation.)
1650 AC_DEFINE(LAGRANGE_INTERPOLATION,1,Define to 1 if you use Lagrange-polynomial interpolation.)
1653 AC_DEFINE(NEWTON_INTERPOLATION,1,Define to 1 if you use Newton-polynomial interpolation.)
1656 AC_DEFINE(GAUSS_INTERPOLATION,1,Define to 1 if you use Gauss interpolation.)
1659 AC_DEFINE(NO_INTERPOLATION,1,Define to 1 if you do not use complemention.)
1662 AC_MSG_ERROR(Invalid method of --enable-spline)
1668 [ --enable-wrd Enable WRD interface for X (default is no)],
1669 [ if test "$enableval" = "yes"; then
1670 if test "x$with_x" != xyes; then
1671 AC_MSG_ERROR(wrd: --with-x option must be specified)
1673 AC_DEFINE(WRDT_X,1,Define to 1 if you need wrd support for X.)
1674 enable_sherry_wrd=yes
1675 AC_CHECK_LIB(z,zlibVersion,:,enable_sherry_wrd=no)
1676 AC_CHECK_HEADER(png.h,,enable_sherry_wrd=no)
1677 AC_CHECK_LIB(png,png_init_io,:,enable_sherry_wrd=no,-lz)
1678 if test "$enable_sherry_wrd" = yes; then
1679 AC_DEFINE(ENABLE_SHERRY,1,Define to 1 if you enable Sherry WRD)
1683 AC_MSG_WARN([Sherry WRD is disabled: png.h, libpng.a, libz.a are required])
1685 if test "x$have_xext" = xyes; then
1690 dnl end of interfaces
1697 AM_CONDITIONAL(ENABLE_WRD, test "x$enable_wrd" = "xyes")
1699 AM_CONDITIONAL(CYGNUS, test "x$CYGNUS" = xyes)
1700 AM_CONDITIONAL(MINGW, test "x$MINGW" = xyes)
1701 AM_CONDITIONAL(W32READDIR, test "x$W32READDIR" = "xyes")
1703 SET_UNIQ_WORDS(LDFLAGS,$LDFLAGS)
1704 SET_UNIQ_WORDS(SHLDFLAGS,$SHLDFLAGS)
1705 SET_UNIQ_WORDS(CFLAGS,$EXTRACFLAGS $CFLAGS)
1706 SET_UNIQ_WORDS(CPPFLAGS,$CPPFLAGS $EXTRADEFS)
1708 if test "x$oss_device" != x; then
1709 AC_DEFINE_UNQUOTED(OSS_DEVICE,"$oss_device", oss device name)
1712 if test "x$TIMIDITY_OUTPUT_ID" != x; then
1713 AC_DEFINE_UNQUOTED(TIMIDITY_OUTPUT_ID,"$TIMIDITY_OUTPUT_ID", the output specification)
1716 if test "x$with_x" = xyes; then
1717 dnl Order of X-library is: -lXm -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11
1718 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/"`
1720 LIBS="$LIBS $lib_dl_opt $lib_png_opt $lib_zip_opt $lib_user32_opt $lib_w32gui_opt $EXTRALIBS"
1721 SHLD="$SHLD $SHLDFLAGS"
1724 AC_SUBST(timidity_LDFLAGS)
1731 AC_SUBST(dynamic_targets)
1736 AC_SUBST(program_transform_name)
1737 AC_SUBST(INTERFACE_SRCS)
1738 AC_SUBST(pkgdatadir)
1748 doc/ja_JP.eucJP/Makefile
1750 interface/motif_bitmaps/Makefile
1751 interface/bitmaps/Makefile
1752 interface/pixmaps/Makefile