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 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 flac(F): FLAC / OggFLAC
612 dnl gogo(g): MP3 GOGO
616 audio_targets='default oss alsa sun hpux irix mme sb_dsp w32 alib nas arts esd vorbis flac gogo portaudio jack ao'
618 AC_ARG_WITH(nas-library,
619 [ --with-nas-library=library NAS absolute library path(Don't use -laudio)])
620 AC_ARG_WITH(nas-includes,
621 [ --with-nas-includes=DIR NAS include files are in dir])
625 [ --enable-audio[=mode_list] Enable audio (Specify comma separated mode list):
626 default: Automatically select audio device.
628 sun: SunOS /dev/audio
629 hpux: HPUX /dev/audio
630 irix: IRIX audio library
632 sb_dsp: BSD/OS 2.0 /dev/sb_dsp
634 darwin: Darwin CoreAudio
635 alsa: ALSA pcm device
636 alib: HPUX network audio (Alib)
637 nas: NAS - Network Audio System
639 esd: EsounD - Enlightened Sound Daemon
645 gogo: MP3 GOGO (Only Windows is supported)],
646 [ enable_audio=$enableval
647 have_audio_opt=yes ],
652 test "x$enable_audio" = xyes && enable_audio=default
654 if test "x$enable_audio" != xno; then
655 for i in `echo $enable_audio | sed 's/,/ /g'`; do
656 eval "au_enable_$i=yes"
660 dnl Turn on default output mode
662 AC_ARG_WITH(default-output,
663 [ --with-default-output=<mode> Specify default output mode (optional):
664 (default|alsa|alib|arts|nas|
665 esd|wav|au|aiff|list|vorbis|flac|
666 gogo|portaudio|jack|ao)],
667 [ if test "$enable_audio" != no; then
668 DEFAULT_PLAYMODE=$withval
669 eval "au_enable_$DEFAULT_PLAYMODE=yes"
671 AC_MSG_WARN(--with-default-output=$withval: audio is not enabled)
674 dnl compatibility matters.
675 dnl AC_ARG_ENABLE(esd,
676 dnl [ --enable-esd EsounD (Obsoleted. Use --enable-audio=esd)],
677 dnl [ au_enable_esd=$enableval ])
678 dnl AC_ARG_ENABLE(nas,
679 dnl [ --enable-nas NAS (Obsoleted. Use --enable-audio=nas)],
680 dnl [ au_enable_nas=$enableval ])
681 dnl AC_ARG_ENABLE(alsa,
682 dnl [ --enable-alsa ALSA (Obsoleted. Use --enable-audio=alsa)],
683 dnl [ au_enable_alsa=$enableval ])
685 dnl target-specific defaults
686 if test "x$au_enable_default" = xyes; then
688 *-*-linux*|*-*-freebsd*)
694 *-*-bsdi2.1|*-*-bsdi3.?|*-*-bsdi4.?)
725 AC_MSG_WARN(No --enable-audio=default audio for $target)
731 # Each audio mode's configurations
733 AC_MSG_CHECKING(enable_audio=oss)
734 if test "x$au_enable_oss" = xyes; then
735 EXTRADEFS="$EXTRADEFS -DAU_OSS"
736 SYSEXTRAS="$SYSEXTRAS oss_a.c"
737 if test "x$ac_cv_header_sys_soundcard_h" = xyes; then
738 AC_MSG_RESULT(yes - <sys/soundcard.h>)
742 dnl <linux/soundcard.h> or <machine/soundcard.h>
746 if test "x$ac_cv_header_soundcard_h" = xyes; then
747 AC_MSG_RESULT(yes - <soundcard.h>)
749 AC_MSG_WARN(<sys/soundcard.h> is not found)
754 AC_CHECK_LIB(ossaudio,open)
756 dnl Why OpenBSD use /dev/audio instead of /dev/dsp for OSS
759 if test ! -e "/dev/dsp"; then
760 oss_device=/dev/audio
769 AC_MSG_CHECKING(enable_audio=sun)
770 if test "x$au_enable_sun" = xyes; then
773 if test -f /usr/demo/SOUND/libaudio.a; then
774 EXTRALIBS="$EXTRALIBS /usr/demo/SOUND/libaudio.a"
777 AC_MSG_RESULT(Notice: libaudio.a is not found [(ignore)])
781 if test -f /usr/demo/SOUND/lib/libaudio.a; then
782 EXTRALIBS="$EXTRALIBS /usr/demo/SOUND/lib/libaudio.a"
785 AC_MSG_RESULT(Notice: libaudio.a is not found [(ignore)])
788 *) AC_MSG_RESULT(yes)
791 EXTRADEFS="$EXTRADEFS -DAU_SUN"
792 SYSEXTRAS="$SYSEXTRAS sun_a.c"
798 AC_MSG_CHECKING(enable_audio=hpux)
799 if test "x$au_enable_hpux" = xyes; then
801 *-*-hpux*) AC_MSG_RESULT(yes) ;;
802 *) AC_MSG_WARN(may not work on $target) ;;
804 EXTRADEFS="$EXTRADEFS -DAU_HPUX_AUDIO"
805 SYSEXTRAS="$SYSEXTRAS hpux_d_a.c"
811 AC_MSG_CHECKING(enable_audio=irix)
812 if test "x$au_enable_irix" = xyes; then
814 *-sgi-irix5*|*-sgi-irix6.2)
815 EXTRADEFS="$EXTRADEFS -DAU_AUDRIV -DSGI_OLDAL"
819 EXTRADEFS="$EXTRADEFS -DAU_AUDRIV -DSGI_NEWAL"
822 *) AC_MSG_WARN(may not work on $target) ;;
824 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_al.c"
825 EXTRALIBS="$EXTRASLIBS -laudio"
831 AC_MSG_CHECKING(enable_audio=mme)
832 if test "x$au_enable_mme" = xyes; then
834 *-dec-*) AC_MSG_RESULT(yes) ;;
835 *) AC_MSG_WARN(may not work on $target) ;;
837 EXTRADEFS="$EXTRADEFS -DAU_DEC -DAU_AUDRIV"
838 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_mme.c"
839 CPPFLAGS="$CPPFLAGS -I/usr/opt/MME210/include"
840 EXTRALIBS="$EXTRALIBS /usr/opt/MME220/lib/libmme.a"
846 AC_MSG_CHECKING(enable_audio=sb_dsp)
847 if test "x$au_enable_sb_dsp" = xyes; then
849 *-*-bsdi2.0) AC_MSG_RESULT(yes) ;;
850 *) AC_MSG_WARN(may not work on $target) ;;
852 EXTRADEFS="$EXTRADEFS -DAU_BSDI -DDEFAULT_RATE=22500"
853 SYSEXTRAS="$SYSEXTRAS bsd20_a.c"
859 AC_MSG_CHECKING(enable_audio=w32)
860 if test "x$au_enable_w32" = xyes; then
869 AC_MSG_WARN(may not work on $target)
872 SYSEXTRAS="$SYSEXTRAS w32_a.c"
873 EXTRALIBS="$EXTRALIBS -lwinmm"
874 EXTRADEFS="$EXTRADEFS -DAU_W32"
879 dnl Mac OS X / darwin-x86
880 AC_MSG_CHECKING(enable_audio=darwin)
881 if test "x$au_enable_darwin" = xyes; then
882 EXTRADEFS="$EXTRADEFS -DAU_DARWIN"
883 SYSEXTRAS="$SYSEXTRAS darwin_a.c"
884 EXTRALIBS="$EXTRALIBS -framework CoreAudio"
885 dnl just say yes or no :-P
890 AC_MSG_WARN(may not work on $target)
898 dnl alsa - Advanced Linux Sound Architecture
899 AC_MSG_CHECKING(enable_audio=alsa)
900 if test "x$au_enable_alsa" = xyes; then
901 AC_MSG_RESULT([yes, configuring alsa])
906 if test "x$alsa_found" = "xyes" ; then
907 dnl AC_MSG_RESULT(yes)
908 EXTRADEFS="$EXTRADEFS -DAU_ALSA"
909 SYSEXTRAS="$SYSEXTRAS alsa_a.c"
910 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ALSA_CFLAGS)
911 LIBS="$KEEPLIBS $ALSA_LIBS"
912 AC_CHECK_FUNCS(snd_seq_port_info_set_timestamping)
914 AC_MSG_WARN(Couldn't configure alsa.)
924 AC_MSG_CHECKING(enable_audio=alib)
925 if test "x$au_enable_alib" = xyes; then
927 *-*-hpux*) AC_MSG_RESULT(yes) ;;
928 *) AC_MSG_WARN(may not work on $target) ;;
930 SYSEXTRAS="$SYSEXTRAS hpux_a.c"
931 EXTRADEFS="$EXTRADEFS -DAU_HPUX_ALIB"
932 if test -d /opt/audio/include; then
933 CPPFLAGS="$CPPFLAGS -I/opt/audio/include"
935 if test -d /opt/audio/lib; then
936 EXTRALIBS="$EXTRALIBS -L/opt/audio/lib"
938 EXTRALIBS="$EXTRALIBS -lAlib"
944 AC_MSG_CHECKING(enable_audio=nas)
945 if test "x$au_enable_nas" = xyes; then
946 if test "x$with_x" != xyes; then
947 AC_MSG_ERROR(nas: --with-x option must be specified)
949 EXTRADEFS="$EXTRADEFS -DAU_NAS"
950 SYSEXTRAS="$SYSEXTRAS nas_a.c"
952 dnl -laudio conflicts another audio library,
953 dnl so I specify NAS library with absolete path.
955 if test "x$with_nas_library" != x; then
956 AC_MSG_RESULT($with_nas_library);
957 EXTRALIBS="$EXTRALIBS $with_nas_library"
960 MY_SEARCH_LIBS(AuOpenServer,
961 [$x_libraries/libaudio.a \
962 /usr/lib/libaudio.so \
963 /usr/lib/libaudio.a ],
964 [ AC_MSG_RESULT(NAS: $timidity_cv_search_AuOpenServer)
965 EXTRALIBS="$EXTRALIBS $timidity_cv_search_AuOpenServer"],
966 [AC_MSG_WARN(NAS library is not found.)])
968 test "x$with_nas_includes" != x && CPPFLAGS="$CPPFLAGS -I$with_nas_includes"
970 if test "x$have_xext" = xyes; then
973 if test "x$have_xprelibs" = xyes; then
974 lib_xprelibs_opt='-lSM -lICE'
981 AC_MSG_CHECKING(enable_audio=arts)
982 if test "x$au_enable_arts" = xyes; then
983 AC_MSG_RESULT([yes, configuring aRts])
991 if test "x$no_arts" = x; then
992 dnl AC_MSG_RESULT(aRts: Enabled)
993 EXTRADEFS="$EXTRADEFS -DAU_ARTS"
994 SYSEXTRAS="$SYSEXTRAS aRts_a.c"
995 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ARTS_CFLAGS)
996 LIBS="$LIBS $ARTS_LIBS"
998 AC_MSG_WARN(aRts: Couldn't configure)
1005 AC_MSG_CHECKING(enable_audio=esd)
1006 if test "x$au_enable_esd" = xyes; then
1007 AC_MSG_RESULT([yes, configuring esd])
1010 KEEPLDFLAGS=$LDFLAGS
1014 LDFLAGS=$KEEPLDFLAGS
1015 if test "x$no_esd" = x; then
1016 dnl AC_MSG_RESULT(EsounD: Enabled)
1017 EXTRADEFS="$EXTRADEFS -DAU_ESD"
1018 SYSEXTRAS="$SYSEXTRAS esd_a.c"
1019 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ESD_CFLAGS)
1020 LIBS="$LIBS $ESD_LIBS"
1022 AC_MSG_WARN(EsounD: Couldn't configure)
1029 AC_MSG_CHECKING(enable_audio=portaudio)
1030 if test "x$au_enable_portaudio" = xyes; then
1032 SYSEXTRAS="$SYSEXTRAS portaudio_a.c"
1033 EXTRALIBS="$EXTRALIBS -lportaudio"
1034 EXTRADEFS="$EXTRADEFS -DAU_PORTAUDIO"
1040 AC_MSG_CHECKING(enable_audio=jack)
1041 if test "x$au_enable_jack" = xyes; then
1043 SYSEXTRAS="$SYSEXTRAS jack_a.c"
1044 EXTRALIBS="$EXTRALIBS $(pkg-config --libs jack)"
1045 EXTRADEFS="$EXTRADEFS -DAU_JACK $(pkg-config --cflags jack)"
1051 AC_MSG_CHECKING(enable_audio=ao)
1052 if test "x$au_enable_ao" = xyes; then
1053 AC_MSG_RESULT([yes, configuring alsa])
1056 KEEPLDFLAGS=$LDFLAGS
1058 if test "x$no_ao" = "x" ; then
1059 dnl AC_MSG_RESULT(yes)
1060 EXTRADEFS="$EXTRADEFS -DAU_AO"
1061 SYSEXTRAS="$SYSEXTRAS ao_a.c"
1062 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$AO_CFLAGS)
1063 LIBS="$KEEPLIBS $AO_LIBS"
1064 AC_CHECK_FUNCS(snd_seq_port_info_set_timestamping)
1066 AC_MSG_WARN(Couldn't configure libao.)
1069 LDFLAGS=$KEEPLDFLAGS
1076 AC_MSG_CHECKING(enable_audio=vorbis)
1077 if test "x$au_enable_vorbis" = xyes; then
1078 AC_MSG_RESULT([yes, configuring vorbis])
1082 SYSEXTRAS="$SYSEXTRAS vorbis_a.c"
1083 EXTRADEFS="$EXTRADEFS -DAU_VORBIS $OGG_CFLAGS $VORBIS_CFLAGS"
1084 EXTRALIBS="$EXTRALIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"
1085 if test "x$CYGNUS" = "xyes"; then
1086 EXTRADEFS="-DAU_VORBIS_DLL $EXTRALIBS"
1087 SYSEXTRAS="$SYSEXTRAS w32g_vorbisenc_dll.c w32g_vorbis_dll.c w32g_ogg_dll.c"
1089 if test "x$MINGW" = "xyes"; then
1090 EXTRADEFS="-DAU_VORBIS_DLL $EXTRALIBS"
1091 SYSEXTRAS="$SYSEXTRAS w32g_vorbisenc_dll.c w32g_vorbis_dll.c w32g_ogg_dll.c"
1094 AC_MSG_WARN([Unable to configure vorbis, but ogg is there (???)])
1097 AC_MSG_WARN(Unable to configure vorbis!)
1104 AC_MSG_CHECKING(enable_audio=flac)
1105 if test "x$au_enable_flac" = xyes; then
1107 SYSEXTRAS="$SYSEXTRAS flac_a.c"
1108 EXTRALIBS="$EXTRALIBS -lOggFLAC -lFLAC -logg"
1109 EXTRADEFS="$EXTRADEFS -DAU_FLAC -DAU_OGGFLAC"
1114 dnl Win32 Gogo-no-coder
1115 AC_MSG_CHECKING(enable_audio=gogo)
1116 if test "x$au_enable_gogo" = xyes; then
1117 if test "x$CYGNUS" = "xyes"; then
1118 AC_MSG_RESULT(yes, configuring gogo)
1120 if test "x$MINGW" = "xyes"; then
1121 AC_MSG_RESULT(yes, configuring gogo)
1123 AC_MSG_WARN(May be gogo is not supported. You need hack the gogo_a.c)
1127 SYSEXTRAS="$SYSEXTRAS gogo_a.c w32_gogo.c"
1128 EXTRADEFS="$EXTRADEFS -DAU_GOGO -DAU_GOGO_DLL"
1129 EXTRALIBS="$EXTRALIBS -lgogo"
1134 dnl Pseudo audio device (Undocumented).
1135 if test "x$au_enable_none" = xyes; then
1136 EXTRADEFS="$EXTRADEFS -DAU_NONE -DAU_AUDRIV"
1137 SYSEXTRAS="$SYSEXTRAS audriv_a.c audriv_none.c"
1140 dnl TIMIDITY_OUTPUT_ID
1142 AC_MSG_CHECKING(default output mode)
1143 if test "x$DEFAULT_PLAYMODE" = x; then
1144 DEFAULT_PLAYMODE=`echo $enable_audio | sed 's/,.*//'`
1146 case ".$DEFAULT_PLAYMODE" in
1147 .default) TIMIDITY_OUTPUT_ID=d ;;
1148 .oss) TIMIDITY_OUTPUT_ID=d ;;
1149 .alsa) TIMIDITY_OUTPUT_ID=s ;;
1150 .sun) TIMIDITY_OUTPUT_ID=d ;;
1151 .hpux) TIMIDITY_OUTPUT_ID=d ;;
1152 .irix) TIMIDITY_OUTPUT_ID=d ;;
1153 .mme) TIMIDITY_OUTPUT_ID=d ;;
1154 .sb_dsp) TIMIDITY_OUTPUT_ID=d ;;
1155 .darwin) TIMIDITY_OUTPUT_ID=d ;;
1156 .w32) TIMIDITY_OUTPUT_ID=d ;;
1157 .alib) TIMIDITY_OUTPUT_ID=A ;;
1158 .nas) TIMIDITY_OUTPUT_ID=n ;;
1159 .arts) TIMIDITY_OUTPUT_ID=R ;;
1160 .esd) TIMIDITY_OUTPUT_ID=e ;;
1161 .portaudio) TIMIDITY_OUTPUT_ID=p ;;
1162 .wav) TIMIDITY_OUTPUT_ID=w ;;
1163 .au) TIMIDITY_OUTPUT_ID=u ;;
1164 .aiff) TIMIDITY_OUTPUT_ID=a ;;
1165 .list) TIMIDITY_OUTPUT_ID=l ;;
1166 .vorbis) TIMIDITY_OUTPUT_ID=v ;;
1167 .flac) TIMIDITY_OUTPUT_ID=F ;;
1168 .gogo) TIMIDITY_OUTPUT_ID=g ;;
1169 .jack) TIMIDITY_OUTPUT_ID=j ;;
1170 *) TIMIDITY_OUTPUT_ID= ;;
1172 AC_MSG_RESULT($DEFAULT_PLAYMODE/$TIMIDITY_OUTPUT_ID)
1178 interface_targets='dynamic ncurses slang motif tcltk emacs vt100 xaw xskin gtk alsaseq winsyn winsyng portmidisyng'
1180 AC_ARG_ENABLE(interface,
1181 [ --enable-interface=[interface_list]
1182 Comma separated interface list ],
1183 [ for i in `echo $enableval | sed 's/,/ /g'`; do
1184 eval "enable_$i=yes"
1187 # Dynamic link configuration
1188 AC_ARG_ENABLE(dynamic,
1189 [ --enable-dynamic Enable dynamic link interface (default is no)
1190 --enable-dynamic=dynamic_list
1191 Comma separated dynamic interface list],
1192 [ dnl --enable-dynamic=yes to --enable-dynamic=dynamic
1193 if test "x$enable_dynamic" = xyes; then
1194 enable_dynamic=dynamic
1195 elif test "x$enable_dynamic" != xno; then
1196 for i in `echo $enableval | sed 's/,/ /g'`; do
1197 eval "enable_$i=dynamic"
1202 for i in $interface_targets; do
1203 eval "join_targets=$join_targets\$enable_$i"
1206 case ".$join_targets" in
1207 .*dynamic*) NEEDDLOPEN=yes;;
1211 dnl check -fpic option for gcc
1212 if test "x$GCC" = xyes; then SHCFLAGS="$SHCFLAGS -fPIC"; fi
1213 case "x$enable_ump" in xyes|xdynamic) EXTRACFLAGS="$EXTRACFLAGS -DXP_UNIX $SHCFLAGS";; esac
1215 dnl Which type of dynamic loader?
1216 if test "$NEEDDLOPEN" = "yes"; then
1219 WAPI_CHECK_FUNC(LoadLibrary,,[LoadLibrary(0);],have_dl=w32)
1220 test $wapi_cv_func_LoadLibrary = yes && have_dl=w32
1222 if test "$have_dl" = "no"; then
1223 AC_CHECK_FUNC(shl_load,have_dl=hpux)
1225 if test "$have_dl" = "no"; then
1226 dnl darwin has both dyld and libdl: in case user installed dlcompat.
1227 dnl dyld is recommended because libdl is a wrapper for dyld.
1228 AC_CHECK_FUNC(NSLinkModule,have_dl=dyld)
1230 if test "$have_dl" = "no" -a "x$ac_cv_lib_dl_dlopen" = xyes; then
1233 if test "$have_dl" = "no"; then
1234 AC_CHECK_FUNC(dlopen,have_dl=dlopen)
1236 if test "$have_dl" = "no"; then
1237 AC_CHECK_FUNC(dld_init,have_dl=dld)
1239 if test "$have_dl" = "no"; then
1240 AC_CHECK_LIB(dld,dld_init,have_dl=dld;lib_dl_opt=-ldld)
1243 AC_MSG_CHECKING(dynamic link method)
1246 AC_MSG_RESULT(use dl_dlopen.c)
1247 SYSEXTRAS="$SYSEXTRAS dl_dlopen.c"
1248 CHECK_DLSYM_UNDERSCORE(AC_DEFINE(DLSYM_NEEDS_UNDERSCORE,1,Define to 1 if you have to add "_" to every identifiers.))
1251 AC_MSG_RESULT(use dl_dld.c)
1252 SYSEXTRAS="$SYSEXTRAS dl_dld.c"
1255 AC_MSG_RESULT(use dl_hpux.c)
1256 SYSEXTRAS="$SYSEXTRAS dl_hpux.c"
1257 LDFLAGS="$LDFLAGS -Wl,-E $LDFLAGS"
1260 AC_MSG_RESULT(use dl_w32.c)
1261 SYSEXTRAS="$SYSEXTRAS dl_w32.c"
1264 AC_MSG_RESULT(use dl_dyld.c)
1265 SYSEXTRAS="$SYSEXTRAS dl_dyld.c"
1269 AC_MSG_WARN(no method to open a shared object)
1274 if test "$NEEDDLOPEN" = "yes"; then
1275 MY_DEFINE(IA_DYNAMIC)
1276 AC_DEFINE_UNQUOTED(SHARED_LIB_EXT,".$so", shared library extention)
1278 dnl EXTRADEFS="$EXTRADEFS \$(DEF_SHLIB_DIR)"
1279 test "x$GCC" = xyes -a "x$timidity_cv_ccoption_rdynamic" = xyes && timidity_LDFLAGS="-rdynamic"
1282 AM_CONDITIONAL(NEEDDLOPEN, test "$NEEDDLOPEN" = "yes")
1285 dnl Each interface section
1289 AM_CONDITIONAL(ENABLE_NCURSES, false)
1290 CONFIG_INTERFACE(ncurses,NCURSES,n,
1291 [ --enable-ncurses Enable ncurses interface (default is no)],
1292 [ AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h)
1294 dnl #include <ncurses/curses.h> is failure on Plamo Linux 1.3/ncurses 1.9.9e
1295 dnl because <ncurses/curses.h> includes <unctrl.h>:
1296 dnl /usr/include/ncurses/curses.h:34: unctrl.h: No such file or directory
1297 dnl But surely there is unctl.h at /usr/include/ncurses/unctrl.h.
1298 dnl configure must check ncurses header with -I/usr/include/ncurses option.
1300 case "$ac_cv_header_curses_h$ac_cv_header_ncurses_curses_h$ac_cv_header_ncurses_h" in
1302 *) for i in /usr/include /usr/local/include; do
1303 if test -f "$i/ncurses/curses.h" -a -f "$i/ncurses/unctrl.h"; then
1304 AC_MSG_WARN(ncurses test is failure. Please check config.h and common.makefile later)
1305 CPPFLAGS="$CPPFLAGS -I$i/ncurses"
1312 AC_CHECK_LIB(ncurses,initscr,lib_curses_opt=-lncurses,
1313 [ dnl checking pdcurses
1314 AC_CHECK_LIB(curses,PDC_set_ctrl_break,
1315 [ lib_curses_opt=-lcurses
1316 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
1317 lib_user32_opt="$lib_user32_test"
1319 [ dnl checking libpdcurses
1320 AC_CHECK_LIB(pdcurses,PDC_set_ctrl_break,
1321 [ lib_curses_opt=-lpdcurses
1322 AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
1323 lib_user32_opt="$lib_user32_test"
1325 [ dnl OpenBSD use -lcurses instead of -lncurses.
1328 AC_CHECK_LIB(curses,initscr,lib_curses_opt=-lcurses,
1329 [ AC_MSG_WARN(ncurses interface is not enabled)
1330 enable_ncurses=no ])
1333 AC_MSG_WARN(ncurses interface is not enabled)
1342 [ LIBS="$LIBS $lib_curses_opt"
1345 EXTRALIBS="$EXTRALIBS -lmytinfo"
1348 INTERFACE_SRCS="$INTERFACE_SRCS ncurs_c.c"
1350 [ n_so_libs="$lib_curses_opt"
1353 EXTRALIBS="$EXTRALIBS -lmytinfo"
1358 AM_CONDITIONAL(ENABLE_SLANG, false)
1359 CONFIG_INTERFACE(slang,SLANG,s,
1360 [ --enable-slang Enable slang interface (default is no)],
1361 [ AC_CHECK_LIB(slang,SLang_init_tty,:,
1363 AC_MSG_WARN(slang interface is not enabled)
1365 AC_CHECK_HEADERS(slang/slang.h slang.h)
1367 [ LIBS="$LIBS -lslang"
1368 INTERFACE_SRCS="$INTERFACE_SRCS slang_c.c"
1370 [ s_so_libs="-lslang"
1371 AC_CHECK_LIB(termcap,initscr,s_so_libs="$s_so_libs -ltermcap")
1375 AM_CONDITIONAL(ENABLE_MOTIF, false)
1376 CONFIG_INTERFACE(motif,MOTIF,m,
1377 [ --enable-motif Enable motif interface (default is no)],
1378 [ if test "x$with_x" != xyes; then
1379 AC_MSG_ERROR(motif: --with-x option must be specified)
1381 if test "x$have_xm" != xyes; then
1382 AC_MSG_WARN(Motif library is not found.)
1389 if test "x$have_xprelibs" = xyes; then
1390 lib_xprelibs_opt='-lSM -lICE'
1392 INTERFACE_SRCS="$INTERFACE_SRCS motif_c.c motif_i.c motif_p.c"
1394 [ if test x$have_xprelibs = xyes; then
1395 m_so_libs="-lXext -lSM -lICE"
1397 m_so_libs="$ldflags_x_opt -lXm -lXt $m_so_libs -lX11"
1401 AM_CONDITIONAL(ENABLE_TCLTK, false)
1402 CONFIG_INTERFACE(tcltk,TCLTK,k,
1403 [ --enable-tcltk Enable tcltk interface (default is no)],
1404 [ if test "x$with_x" != xyes; then
1405 AC_MSG_ERROR(tcltk: --with-x option must be specified)
1409 KEEPCPPFLAGS=$CPPFLAGS
1410 KEEPLDFLAGS=$LDFLAGS
1413 CPPFLAGS="$tcl_include_dir $tk_includes $CPPFLAGS"
1414 LDFLAGS="$tcl_libdir $tk_libdir $LDFLAGS"
1415 LIBS="$LIBS $lib_dl_opt"
1419 for l in tcl tcl8.4 tcl8.3 tcl8.0jp tcl7.6jp tcl80jp tcl76jp tcl8.0 tcl7.6 tcl80 tcl76; do
1420 case "x$tcl_lib" in x) AC_CHECK_LIB($l,Tcl_Init,tcl_lib=-l$l);; esac
1422 LIBS="$LIBS $tcl_lib"
1423 for l in tk tk8.4 tk8.3 tk8.0jp tk4.2jp tk80jp tk42jp tk8.0 tk4.2 tk80 tk42; do
1424 case "x$tk_lib" in x) AC_CHECK_LIB($l,Tk_Init,tk_lib=-l$l);; esac
1428 if test "x$tcl_lib" = x -o "x$tk_lib" = x; then
1429 CPPFLAGS=$KEEPCPPFLAGS
1430 LDFLAGS=$KEEPLDFLAGS
1432 AC_MSG_WARN(tcl/tk is not enable)
1434 tcltk_dep='tclIndex'
1437 [ LIBS=`echo $LIBS | sed "s/-lX11/$tk_lib $tcl_lib -lX11/"`
1440 EXTRALIBS="$EXTRALIBS -lipc"
1443 INTERFACE_SRCS="$INTERFACE_SRCS tk_c.c"
1445 [ k_so_libs="$tcl_libdir $tk_libdir $tcl_lib $tk_lib $lib_dl_opt"
1448 k_so_libs="$k_so_libs -lipc"
1451 k_so_libs="$k_so_libs -lX11 -lm"
1453 AM_CONDITIONAL(ENABLE_DYNAMIC_TCLTK, test "x$enable_tcltk" = "xdynamic")
1456 AM_CONDITIONAL(ENABLE_EMACS, false)
1457 CONFIG_INTERFACE(emacs,EMACS,e,
1458 [ --enable-emacs Enable emacs interface (default is no)],
1460 [ ELFILES="$ELFILES timidity.el"
1461 INTERFACE_SRCS="$INTERFACE_SRCS emacs_c.c"
1463 [ ELFILES="$ELFILES timidity.el" ])
1466 AM_CONDITIONAL(ENABLE_VT100, false)
1467 CONFIG_INTERFACE(vt100,VT100,T,
1468 [ --enable-vt100 Enable VT100 interface (default is no)],
1470 [ INTERFACE_SRCS="$INTERFACE_SRCS vt100_c.c vt100.c" ])
1473 AM_CONDITIONAL(ENABLE_XAW, false)
1474 CONFIG_INTERFACE(xaw,XAW,a,
1475 [ --enable-xaw Enable athena interface (default is no)],
1476 [ if test "x$with_x" != xyes; then
1477 AC_MSG_ERROR(xaw: --with-x option must be specified)
1479 if test "x$have_xaw" != "xyes" -a "x$have_xaw" != "x3d"; then
1480 AC_MSG_WARN(X Athena Widget library is not found.)
1483 [ dnl Add -lXext -lSM -lICE -lXmu -lXt {-lXaw|-lXaw3d}
1484 if test "x$have_xext" = xyes; then
1487 if test "x$have_xprelibs" = xyes; then
1488 lib_xprelibs_opt='-lSM -lICE'
1492 if test "x$have_xaw" = x3d; then
1493 AC_DEFINE(XAW3D,1,Define to 1 if you have libXaw3d.)
1498 INTERFACE_SRCS="$INTERFACE_SRCS xaw_c.c xaw_i.c"
1500 [ if test "x$have_xext" = xyes; then
1501 a_so_libs="-lXext -lX11"
1507 a_so_libs="$a_so_libs -lcc_dynamic"
1510 if test "x$have_xprelibs" = xyes; then
1511 a_so_libs="-lSM -lICE $a_so_libs"
1513 if test "x$have_xaw" = xyes; then
1514 a_so_libs="-lXaw -lXmu -lXt $a_so_libs"
1515 elif test "x$have_xaw" = x3d; then
1516 AC_DEFINE(XAW3D,1,Define to 1 if you have libXaw3d.)
1517 a_so_libs="-lXaw3d -lXmu -lXt $a_so_libs"
1519 a_so_libs="$ldflags_x_opt $a_so_libs"
1521 AM_CONDITIONAL(ENABLE_DYNAMIC_XAW, test "x$enable_xaw" = "xdynamic")
1524 AM_CONDITIONAL(ENABLE_XSKIN, false)
1525 CONFIG_INTERFACE(xskin,XSKIN,i,
1526 [ --enable-xskin Enable X skin interface (default is no)],
1527 [ if test "x$with_x" != xyes; then
1528 AC_MSG_ERROR(xskin: --with-x option must be specified)
1531 [ INTERFACE_SRCS="$INTERFACE_SRCS xskin_c.c xskin_i.c xskin_loadBMP.c xskin_spectrum.c" ],
1532 [ i_so_libs="$ldflags_x_opt -lX11" ])
1535 AM_CONDITIONAL(ENABLE_GTK, false)
1536 CONFIG_INTERFACE(gtk, GTK, g,
1537 [ --enable-gtk Enable GTK+ interface (default is no)],
1538 [ AM_PATH_GTK(1.1.3,,enable_gtk=no) ],
1539 [ LIBS="$LIBS $GTK_LIBS"
1540 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$GTK_CFLAGS)
1541 INTERFACE_SRCS="$INTERFACE_SRCS gtk_c.c gtk_i.c gtk_p.c"
1543 [ if test "x$GCC" = xyes; then
1544 dnl Do not include -rdynamic option in $g_so_libs.
1545 for i in $GTK_LIBS; do
1548 *) g_so_libs="$g_so_libs $i" ;;
1552 g_so_libs="$GTK_LIBS"
1554 EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$GTK_CFLAGS) ])
1556 dnl TiMidity Network MIDI Server
1557 AM_CONDITIONAL(ENABLE_SERVER, false)
1558 CONFIG_INTERFACE(server,SERVER,r,
1559 [ --enable-server Enable server interface (default is no)],
1561 [ INTERFACE_SRCS="$INTERFACE_SRCS server_c.c"
1562 AC_CHECK_HEADERS(sys/soundcard.h)
1565 dnl TiMidity ALSA sequencer server
1566 AM_CONDITIONAL(ENABLE_ALSASEQ, false)
1567 CONFIG_INTERFACE(alsaseq,ALSASEQ,A,
1568 [ --enable-alsaseq Enable ALSA sequencer server interface
1571 [ INTERFACE_SRCS="$INTERFACE_SRCS alsaseq_c.c"
1575 dnl TiMidity Windows synthesizer server
1576 AM_CONDITIONAL(ENABLE_WINSYN, false)
1577 CONFIG_INTERFACE(winsyn,WINSYN,W,
1578 [ --enable-winsyn Enable Windows Synthesizer interface
1581 [ INTERFACE_SRCS="$INTERFACE_SRCS winsyn_c.c rtsyn_common.c rtsyn_winmm.c" ])
1583 dnl TiMidity PortMIDI synthesizer server
1584 AM_CONDITIONAL(ENABLE_PORTMIDISYN, false)
1585 CONFIG_INTERFACE(portmidisyn,PORTMIDISYN,P,
1586 [ --enable-portmidisyn Enable PortMIDI Synthesizer interface
1589 [ INTERFACE_SRCS="$INTERFACE_SRCS portmidisyn_c.c rtsyn_common.c rtsyn_portmidi.c" ])
1591 dnl TiMidity Windows GUI synthesizer server
1592 AM_CONDITIONAL(ENABLE_W32G_SYN, false)
1593 CONFIG_INTERFACE(winsyng,W32G_SYN,W,
1594 [ --enable-winsyng Enable Windows GUI Synthesizer interface
1597 [ lib_w32gui_opt='-lgdi32 -lcomctl32 -lcomdlg32 -lole32'
1598 lib_user32_opt='-luser32'
1599 LDFLAGS="-mwindows $LDFLAGS"
1600 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"
1605 AM_CONDITIONAL(ENABLE_W32GUI, false)
1606 CONFIG_INTERFACE(w32gui, W32GUI, w,
1607 [ --enable-w32gui Enable Windows GUI interface (default is no)],
1609 [ lib_w32gui_opt='-lgdi32 -lcomctl32 -lcomdlg32 -lole32'
1610 lib_user32_opt='-luser32'
1611 LDFLAGS="-mwindows $LDFLAGS"
1612 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"
1615 dnl UMP configuration
1616 AM_CONDITIONAL(ENABLE_PLUGIN, false)
1617 CONFIG_INTERFACE(ump, PLUGIN, p,
1618 [ --enable-ump UMP configuration (default is no)],
1619 [ if test ! -d ump; then
1620 AC_MSG_ERROR(UMP Package is not exists. Can't configure it.)
1622 AC_CHECK_HEADER(X11/xpm.h,,AC_MSG_ERROR([UMP Package needs xpm.h[,] but could not find it.]))
1623 AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,:,AC_MSG_ERROR([UMP Package needs libXpm.a[,] but could not find it.]))
1624 if test "x$have_xext" = xyes; then
1627 if test "x$have_xprelibs" = xyes; then
1628 lib_xprelibs_opt='-lSM -lICE'
1636 dnl this rely on CFLAGS and LIBS
1637 AC_ARG_ENABLE(offix,
1638 [ --enable-offix Enable offix support (default is no)],
1639 [ if test "$enableval" = "yes"; then
1640 KEEPCPPFLAGS=$CPPFLAGS
1642 KEEPLDFLAGS=$LDFLAGS
1643 CPPFLAGS="$CPPFLAGS $offix_include_dir"
1644 LDFLAGS="$LDFLAGS $offix_lib_dir"
1645 LIBS="$LIBS $lib_xmu_opt $lib_xt_opt $lib_xprelibs_opt $lib_xext_opt -lX11"
1646 AC_CHECK_LIB(Dnd,DndInitialize,[
1648 lib_offix_opt="-lDnd"
1649 AC_DEFINE(OFFIX,1,Define to 1 if you need offix support)
1651 [ LDFLAGS=$KEEPLDFLAGS
1652 CPPFLAGS=$KEEPCPPFLAGS
1659 AC_ARG_ENABLE(network,
1660 [ --enable-network Enable network support (default is no)],
1661 [ if test "$enableval" = "yes"; then
1662 AC_DEFINE(SUPPORT_SOCKET,1,Define to 1 if you need network support)
1664 AM_CONDITIONAL(ENABLE_NETWORK, test "x$enable_network" = "xyes")
1666 dnl Sound Spectrogram Viewer
1667 AC_ARG_ENABLE(spectrogram,
1668 [ --enable-spectrogram Enable Sound Spectrogram Viewer (default is no)],
1669 [ if test "$enableval" = "yes"; then
1670 if test "x$with_x" != xyes; then
1671 AC_MSG_ERROR(spectrogram: --with-x option must be specified)
1673 AC_DEFINE(SUPPORT_SOUNDSPEC,1,Define to 1 if you need spectrogram vewer.)
1675 AM_CONDITIONAL(ENABLE_SOUND_SPEC, test "x$enable_spectrogram" = "xyes")
1677 dnl Wave Spline Interpolations
1678 AC_ARG_ENABLE(spline,
1679 [ --enable-spline=[method] Specify spline method.
1680 one of no,linear,cubic,lagrange,newton,gauss
1681 (default is linear)],
1682 [ case "x$enableval" in
1684 AC_DEFINE(LINEAR_INTERPOLATION,1,Define to 1 if you use linear interpolation.)
1687 AC_DEFINE(CSPLINE_INTERPOLATION,1,Define to 1 if you use cubic-spline interpolation.)
1690 AC_DEFINE(LAGRANGE_INTERPOLATION,1,Define to 1 if you use Lagrange-polynomial interpolation.)
1693 AC_DEFINE(NEWTON_INTERPOLATION,1,Define to 1 if you use Newton-polynomial interpolation.)
1696 AC_DEFINE(GAUSS_INTERPOLATION,1,Define to 1 if you use Gauss interpolation.)
1699 AC_DEFINE(NO_INTERPOLATION,1,Define to 1 if you do not use complemention.)
1702 AC_MSG_ERROR(Invalid method of --enable-spline)
1708 [ --enable-wrd Enable WRD interface for X (default is no)],
1709 [ if test "$enableval" = "yes"; then
1710 if test "x$with_x" != xyes; then
1711 AC_MSG_ERROR(wrd: --with-x option must be specified)
1713 AC_DEFINE(WRDT_X,1,Define to 1 if you need wrd support for X.)
1714 enable_sherry_wrd=yes
1715 AC_CHECK_LIB(z,zlibVersion,:,enable_sherry_wrd=no)
1716 AC_CHECK_HEADER(png.h,,enable_sherry_wrd=no)
1717 AC_CHECK_LIB(png,png_init_io,:,enable_sherry_wrd=no,-lz)
1718 if test "$enable_sherry_wrd" = yes; then
1719 AC_DEFINE(ENABLE_SHERRY,1,Define to 1 if you enable Sherry WRD)
1723 AC_MSG_WARN([Sherry WRD is disabled: png.h, libpng.a, libz.a are required])
1725 if test "x$have_xext" = xyes; then
1730 dnl end of interfaces
1737 AM_CONDITIONAL(ENABLE_WRD, test "x$enable_wrd" = "xyes")
1739 AM_CONDITIONAL(CYGNUS, test "x$CYGNUS" = xyes)
1740 AM_CONDITIONAL(MINGW, test "x$MINGW" = xyes)
1741 AM_CONDITIONAL(W32READDIR, test "x$W32READDIR" = "xyes")
1743 SET_UNIQ_WORDS(LDFLAGS,$LDFLAGS)
1744 SET_UNIQ_WORDS(SHLDFLAGS,$SHLDFLAGS)
1745 SET_UNIQ_WORDS(CFLAGS,$EXTRACFLAGS $CFLAGS)
1746 SET_UNIQ_WORDS(CPPFLAGS,$CPPFLAGS $EXTRADEFS)
1748 if test "x$oss_device" != x; then
1749 AC_DEFINE_UNQUOTED(OSS_DEVICE,"$oss_device", oss device name)
1752 if test "x$TIMIDITY_OUTPUT_ID" != x; then
1753 AC_DEFINE_UNQUOTED(TIMIDITY_OUTPUT_ID,"$TIMIDITY_OUTPUT_ID", the output specification)
1756 if test "x$with_x" = xyes; then
1757 dnl Order of X-library is: -lXm -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11
1758 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/"`
1760 LIBS="$LIBS $lib_dl_opt $lib_png_opt $lib_zip_opt $lib_user32_opt $lib_w32gui_opt $EXTRALIBS"
1761 SHLD="$SHLD $SHLDFLAGS"
1764 AC_SUBST(timidity_LDFLAGS)
1771 AC_SUBST(dynamic_targets)
1776 AC_SUBST(program_transform_name)
1777 AC_SUBST(INTERFACE_SRCS)
1778 AC_SUBST(pkgdatadir)
1788 doc/ja_JP.eucJP/Makefile
1790 interface/motif_bitmaps/Makefile
1791 interface/bitmaps/Makefile
1792 interface/pixmaps/Makefile