forked from geofft/timidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
2271 lines (2117 loc) · 65.5 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl TiMidity++ -- MIDI to WAVE converter and player
dnl Copyright (C) 1999-2002 Masanao Izumo <[email protected]>
dnl Copyright (C) 1995 Tuukka Toivonen <[email protected]>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl configure.in created from configure.scan
dnl by URABE, Shyouhei <[email protected]> on 2002.07.06
dnl variable note:
dnl CFLAGS - Flags for compile.
dnl CPPFLAGS - Flags for cpp
dnl LDFLAGS - Flags for linker
dnl ac_cpp: $CPP $CPPFLAGS
dnl ac_compile: ${CC-cc} -c $CFLAGS $CPPFLAGS
dnl ac_link: ${CC-cc} -o * $CFLAGS $CPPFLAGS $LDFLAGS *.c $LIBS
dnl EXTRACFLAGS - Extra flags to compile. Adds to CFLAGS.
dnl EXTRADEFS - Extra define macros. Adds to CPPFLAGS.
dnl EXTRALIBS - Extra libraries Adds to LIBS.
dnl SYSEXTRAS - Additional source codes to compile.
dnl lib_*_opt - Optional libraries. Adds to LIBS.
dnl LIBRARY_PATH
dnl - add to -L LDFLAGS
dnl C_INCLUDE_PATH
dnl - add to -I CPPFLAGS
dnl MSYS - `yes' if cygnus or Mingw windows environment.
dnl WISH - wish
dnl LN_S - ln -s
dnl tcltk_dep - make dependencies for tcl/tk interface
dnl
dnl so - File extension of shared object library.
dnl SHLD - Linker to make shared object library.
dnl SHLDFLAGS - Link flags to link shared object library.
dnl SHCFLAGS - Additional flags to compile shared object library.
dnl (such as -fPIC)
# This is a autoscan-generated configure.scan.
# AC_PREREQ(2.56)
# "AC_INIT(timidity/timidity.c)" is obsolate yet.
AC_INIT([TiMidity++],[2.13.2],[[email protected]],[TiMidity++])
AC_CONFIG_AUX_DIR([autoconf])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([gnu dist-bzip2])
AC_CONFIG_SRCDIR([timidity/timidity.c])
AC_CONFIG_HEADERS([config.h interface.h])
AM_MAINTAINER_MODE
SHELL=${CONFIG_SHELL-"/bin/sh"}
WISH=${WISH-"wish"}
dnl to use contains() macro (see autoconf/acinclude.m4)
CONTAINS_INIT
# Check for compiler options -- such as debug flags.
dnl "--enable-debug" turnes -g on.
AC_MSG_CHECKING(if --enable-debug option specified)
AC_ARG_ENABLE(debug,
[ --enable-debug Build a debugging version.],
[timidity_cv_debug="yes"], [timidity_cv_debug="no"])
if test "x$timidity_cv_debug" = "xyes"; then
AC_DEFINE(DEBUG,1,Define to 1 if you are in debug mode)
CFLAGS=${CFLAGS-"-g"}
fi
if test "x$timidity_cv_debug" = "xno"; then
AC_DEFINE(NDEBUG,1,Define to 1 if you are NOT in debug mode)
fi
AC_MSG_RESULT($timidity_cv_debug)
if test "x$CFLAGS" = "x"; then
NOCFLAGS="yes"
fi
dnl --with-x turns on if `--with-x' is NOT specified.
if test "x$with_x" = x; then
with_x=yes
else
x_config_flag=yes
fi
# Checking gcc environment
for i in `echo $LIBRARY_PATH|sed -e 's,:, ,g'`; do
LDFLAGS="$LDFLAGS -L${i}"
done
for i in `echo $C_INCLUDE_PATH|sed -e 's,:, ,g'`; do
CPPFLAGS="$CPPFLAGS -I${i}"
done
# add $prefix if specified.
if test "x$prefix" != xNONE -a "x$prefix" != "x$ac_default_prefix" -a "x$prefix" != "x/usr"; then
LDFLAGS="-L$prefix/lib $LDFLAGS"
SHLDFLAGS="-L$prefix/lib $SHLDFLAGS"
CPPFLAGS="-I$prefix/include $CPPFLAGS"
fi
dnl add --with-includes, --with-libraries
AC_ARG_WITH(includes,
[ --with-includes=DIR Specify include directories (colon separated)],
[ j=' '
for i in `echo "$withval"|sed -e 's,:, ,g'`; do
j="${j}-I${i} "
done
CPPFLAGS="$j$CPPFLAGS"
])
AC_ARG_WITH(libraries,
[ --with-libraries=DIR Specify library directories (colon separated)],
[ j=' '
for i in `echo "$withval"|sed -e 's,:, ,g'`; do
j="${j}-L${i} "
done
LDFLAGS="$j$LDFLAGS"
])
dnl a bit hairly yet.(20020718:mput)
dnl CPPFLAGS="$CPPFLAGS \$(DEF_PKGDATADIR) \$(DEF_PKGLIBDIR) \$(DEF_DEFAULT_PATH)"
AC_ARG_WITH(default-path,
[ --with-default-path=DIR Where timidity.cfg is (PREFIX/share/timidity)],
[pkgdatadir=$withval],
[
if test "x$prefix" != "xNONE"; then
pkgdatadir='${prefix}/share/timidity'
else
pkgdatadir='/usr/local/share/timidity'
fi
])
tmpdefpath="`eval \"echo ${pkgdatadir}\"`"
AC_DEFINE_UNQUOTED(DEFAULT_PATH,"$tmpdefpath",place to install patches)
AC_DEFINE(PKGDATADIR,DEFAULT_PATH,a compatibility matter. ignore it.)
AC_ARG_WITH(module-dir,
[ --with-module-dir=DIR Where to install interfaces (PREFIX/lib/timidity)],
[pkglibdir=$withval],
[
if test "x$prefix" != "xNONE"; then
pkglibdir='${prefix}/lib/timidity'
else
pkglibdir='/usr/local/lib/timidity'
fi
])
tmplibdir="`eval \"echo ${pkglibdir}\"`"
AC_DEFINE_UNQUOTED(PKGLIBDIR,"$tmplibdir",place to install modules)
AC_ARG_WITH(xaw-resource-prefix,
[ --with-xaw-resource-prefix=DIR What prefix to install XAW's resource files to
(optinal)], [xawresdir=$withval], [])
AM_CONDITIONAL(XAW_INSTALL_RESOURCE_FILES, test "x$xawresdir" != "x")
AC_SUBST(xawresdir)
# Checks for programs.
AM_PATH_LISPDIR
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_AWK
AC_PROG_RANLIB
AC_PROG_LN_S
CHECK_COMPILER_OPTION(rdynamic)
if test "x$NOCFLAGS" = "xyes"; then
if test "x$GCC" = "xyes"; then
CFLAGS="-O2"
else
CFLAGS=""
fi
fi
# Checks for target dependencies
AC_ARG_WITH(elf,
[ --with-elf create ELF shared object instead of AOUT ],
[ ELFFORMAT=$withval ], [ ELFFORMAT="yes" ])
# AC_ARG_WITH(simd,
# [ --with-simd create SIMD friendly binary (default is no) ],
# [ SIMD=$withval ], [ SIMD="no" ])
case "$target" in
*-*-hpux*)
EXTRADEFS="-DHPUX"
test -n "$SHLD" || SHLD="ld -b"
so="sl"
;;
*-sgi-irix*)
dnl IRIX cc needs -signed option
case ".$CC" in .cc*) EXTRACFLAGS="-signed";; esac
test -n "$SHLD" || SHLD="cc -shared -all"
so="so"
;;
*-*-netbsd*)
test -n "$SHLD" || SHLD="$CC -shared -nostartfiles"
so="so"
;;
*-*-freebsd2*)
dnl EXTRALIBS="$EXTRALIBS -lxpg4"
test -n "$SHLD" || SHLD="ld -Bshareable"
so="so"
;;
*-*-freebsd*)
if test "$ELFFORMAT" = yes; then
test -n "$SHLD" || SHLD="ld -Bshareable"
else
SHCFLAGS=-aou
SHLDFLAGS="-L/usr/X11R6/lib/aout $SHLDFLAGS"
test -n "$SHLD" || SHLD="env OBJFORMAT=aout ld -shared"
fi
dnl EXTRALIBS="$EXTRALIBS -lxpg4"
so="so"
;;
# *-*-freebsd*)
# EXTRALIBS="$EXTRALIBS -lxpg4"
# test -n "$SHLD" || SHLD="ld -Bshareable"
# so="so"
# ;;
*-*-cygwin*|*-*-mingw*)
EXTRADEFS="-D__W32__"
# ??
case "x${CC} " in
"xbcc32 "*|xbcc32)
# test -n "$SHLD" || SHLD="tlink32 -Tpd"
test -n "$SHLD" || SHLD="BCC32 -WD"
BORLANDC=yes
BORLANDC_LDFLAGS="kernel32.lib winspool.lib comdlg32.lib advapi32.lib oleaut32.lib uuid.lib odbc32.lib ws2_32.lib user32.lib shell32.lib cw32mt.lib"
BORLANDC_START='C0X32.OBJ'
CFLAGS="$CFLAGS -tWM -VM"
EXTRADEFS="$EXTRADEFS -D_WINDOWS -DWIN32"
;;
"xcc "*|xcc)
test -n "$SHLD" || SHLD="polink -DLL"
POCC=yes
case " $CFLAGS " in
*" -MT "*) NODEF="-nodefaultlib:pocrt.lib -nodefaultlib:crt.lib -defaultlib:crtmt.lib" ;;
*" -MD "*) NODEF="-nodefaultlib:crtmt.lib -nodefaultlib:crt.lib -defaultlib:pocrt.lib" ;;
*) CFLAGS="$CFLAGS -MT"; NODEF="-nodefaultlib:pocrt.lib -nodefaultlib:crtmt.lib -defaultlib:crt.lib" ;;
esac
POCC_LDFLAGS="$NODEF winmm.lib ws2_32.lib user32.lib kernel32.lib shell32.lib gdi32.lib comctl32.lib comdlg32.lib ole32.lib advapi32.lib oldnames.lib"
CFLAGS="$CFLAGS -Ze -D__POCC__OLDNAMES"
EXTRADEFS="$EXTRADEFS -D_WINDOWS -DWIN32"
;;
"xdmc "*|xdmc)
test -n "$SHLD" || SHLD="dmc -WD"
DMC=yes
DMC_LDFLAGS="winmm.lib ws2_32.lib user32.lib kernel32.lib shell32.lib gdi32.lib comctl32.lib comdlg32.lib ole32.lib advapi32.lib"
CFLAGS="$CFLAGS -mn -j0"
DLLFLAG=" "
EXTRADEFS="$EXTRADEFS -D_WINDOWS -DWIN32"
;;
"xwcc386_w.sh "*|xwcc386)
WATCOM_C=yes
CFLAGS="$CFLAGS -br -bm -5s -zk0 -zp=16 -w=4 -D_WINDOWS -DWIN32 -DINCLUDE_WINDOWS_H"
DLLFLAG=" "
WATCOM_LDFLAGS=
EXTRALIBS="$EXTRALIBS kernel32.lib winspool.lib comdlg32.lib advapi32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib user32.lib shell32.lib"
;;
"xcl "*|xcl)
test -n "$SHLD" || SHLD="link -dll"
VCPP=yes
case " $CFLAGS " in
*" -MT "*) NODEF="-nodefaultlib:msvcrt.lib -nodefaultlib:msvcrtd.lib -nodefaultlib:libcmtd.lib -nodefaultlib:libc.lib -nodefaultlib:libcd.lib" ;;
*" -MD "*) NODEF="-nodefaultlib:libcmt.lib -nodefaultlib:libcmtd.lib -nodefaultlib:msvcrtd.lib -nodefaultlib:libc.lib -nodefaultlib:libcd.lib" ;;
*" -MTd "*) NODEF="-nodefaultlib:msvcrt.lib -nodefaultlib:msvcrtd.lib -nodefaultlib:libcmt.lib -nodefaultlib:libc.lib -nodefaultlib:libcd.lib" ;;
*" -MDd "*) NODEF="-nodefaultlib:libcmt.lib -nodefaultlib:libcmtd.lib -nodefaultlib:msvcrt.lib -nodefaultlib:libc.lib -nodefaultlib:libcd.lib" ;;
*) CFLAGS="$CFLAGS -MT"; NODEF="-nodefaultlib:msvcrt.lib -nodefaultlib:msvcrtd.lib -nodefaultlib:libcmtd.lib -nodefaultlib:libc.lib -nodefaultlib:libcd.lib" ;;
esac
VCPP_LDFLAGS="-nologo -incremental:no $NODEF kernel32.lib winspool.lib comdlg32.lib advapi32.lib oleaut32.lib uuid.lib ws2_32.lib user32.lib shell32.lib"
CFLAGS="$CFLAGS -nologo -Zp16 -W3 -GX -Ob2"
EXTRADEFS="$EXTRADEFS -DNDEBUG -D_WINDOWS -DWIN32 -DMBCS -D_MT -YX -FD -c"
;;
x*gcc*) test -n "$SHLD" || SHLD="gcc -mdll"; MINGWGCC=yes ;;
*) test -n "$SHLD" || SHLD="unknown" ;;
esac
so="dll"
MSYS=yes
lib_user32_test=-luser32
;;
*-dec-*)
EXTRADEFS="-DDEC"
test -n "$SHLD" || SHLD="ld -Bdynamic -G"
so="so"
;;
*-*-solaris*)
EXTRADEFS="-DSOLARIS"
test -n "$SHLD" || SHLD="/usr/ccs/bin/ld -G"
so="so"
;;
*-*-nextstep*)
test -n "$SHLD" || SHLD="/usr/ccs/bin/ld -G"
so="so"
;;
*-*-darwin*)
if test "x$SIMD" = "xyes"; then
AC_DEFINE(USE_ALTIVEC,1,Define to 1 if you use altivec)
# EXTRACFLAGS="$EXTRACFLAGS -faltivec -mabi=altivec -maltivec" # for GCC3.
EXTRACFLAGS="$EXTRACFLAGS -faltivec"
else
AC_DEFINE(USE_ALTIVEC,0,Define to 1 if you use altivec)
fi
CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
LDOPTS="-dynamic -undefined suppress -flat_namespace $LDOPTS"
test -n "$SHLD" || SHLD="$CC -dynamic -bundle -undefined suppress -flat_namespace $LDFLAGS"
so="bundle"
;;
*)
test -n "$SHLD" || \
if test "x$GCC" = xyes; then
SHLD="$CC -shared"
else
SHLD="ld -Bdynamic -G"
fi
so="so"
;;
esac
dnl For .exe
dnl AC_EXEEX # obsolate
# Checks for libraries.
AC_CHECK_LIB(m,sqrt)
AC_CHECK_LIB(socket,socket)
AC_CHECK_LIB(dl,dlopen,lib_dl_opt=-ldl)
AC_CHECK_LIB(objc,NSLinkModule,lib_dl_opt=-lobjc) # Mac OS X need this.
if test "x$VCPP" != "xyes" && test "x$BORLANDC" != "xyes" && test "x$WATCOM_C" != "xyes" && test "x$POCC" != "xyes"; then
AC_CHECK_LIB(xpg4,setlocale) # Mac OS X (and maybe NetBSD) need this.
fi
AC_CHECK_FUNCS(gethostbyname,,[ AC_CHECK_LIB(nsl,gethostbyname) ])
AC_PATH_XTRA
AC_ARG_WITH(xawlib,
[ --with-xawlib=lib Try to link to these xaw widget libraries by the
order specified by the comma separated value list:
xaw: X11's libXaw
xaw3d: Xaw3d
neXtaw: neXtaw
XawPlus: XawPlus
default is --with-xawlib=xaw3d,xaw],
[ with_xawlib="$withval" ], [ with_xawlib="xaw3d,xaw" ])
# Checks for X
if test "x$with_x" = xyes; then
if test "x$have_x" = xno; then
if test "x$x_config_flag" = xyes; then
AC_MSG_ERROR(Could not configure X)
else
AC_MSG_WARN(Could not configure X)
fi
fi
fi
if test "x$with_x" = xyes -a "x$have_x" = xyes; then
if test "x$x_libraries" != x; then
ldflags_x_opt="-L$x_libraries"
LDFLAGS="$LDFLAGS $ldflags_x_opt"
SHLDFLAGS="$SHLDFLAGS $ldflags_x_opt"
else
ldflags_x_opt=
fi
if test "x$x_includes" != x; then
CPPFLAGS="$CPPFLAGS -I$x_includes"
fi
AC_CHECK_LIB(X11,XOpenDisplay)
AC_MSG_CHECKING(X11 version 6)
AC_CACHE_VAL(timidity_cv_x11_version_6,
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]], [[
#if XlibSpecificationRelease < 6
fail;
#endif
]])],[timidity_cv_x11_version_6=yes],[timidity_cv_x11_version_6=no]))
if test "$timidity_cv_x11_version_6" = "yes"; then
AC_MSG_RESULT(6 or newer)
dnl AC_DEFINE(HAVE_X11R6)
else
AC_MSG_RESULT(before 6)
fi
dnl checking order required
KEEPLIBS=$LIBS
AC_CHECK_LIB(Xext,XShapeCombineMask,have_xext=yes; LIBS="-lXext $LIBS",have_xext=no)
AC_CHECK_LIB(ICE,IceConnectionNumber)
AC_CHECK_LIB(SM,SmcOpenConnection,have_xprelibs=yes; LIBS="-lSM $LIBS",have_xprelibs=no)
AC_CHECK_LIB(Xt,XtVaAppInitialize,have_xt=yes; LIBS="-lXt $LIBS",have_xt=no)
AC_CHECK_LIB(Xmu,XmuInternAtom,LIBS="-lXmu $LIBS")
AC_CHECK_FUNCS(XmuRegisterExternalAgent)
for i in `echo $with_xawlib | sed 's/,/ /g'`; do
case "$i" in
"xaw")
AC_CHECK_LIB(Xaw,XawInitializeWidgetSet,have_xaw=yes,have_xaw=no)
;;
"xaw3d")
AC_CHECK_LIB(Xaw3d,XawInitializeWidgetSet,
[ have_xaw=3d;
AC_CHECK_HEADER(X11/Xaw3d/Tip.h,
AC_DEFINE(HAVE_XAW3D_TIP,1,Define to 1 if you have the <X11/Xaw3d/Tip.h> header file.),
)
],
have_xaw=no
)
;;
"neXtaw")
AC_CHECK_LIB(neXtaw,XawInitializeWidgetSet,have_xaw=next,have_xaw=no)
;;
"XawPlus")
AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData)
AC_CHECK_LIB(XawPlus,XawInitializeWidgetSet,have_xaw=plus,have_xaw=no)
;;
*)
have_xaw=no
;;
esac
if test "x$have_xaw" != "xno"; then break; fi
done
AC_CHECK_LIB(Xm,XmCreateForm,have_xm=yes,have_xm=no)
AC_CHECK_FUNCS(XShmCreatePixmap)
LIBS=$KEEPLIBS
fi
dnl End of X configure
# Checks for header files.
AC_HEADER_STDC
#AC_HEADER_STDBOOL
AC_HEADER_SYS_WAIT
if test "x$WATCOM_C" != xyes ; then
AC_HEADER_TIME
fi
AC_HEADER_DIRENT
AC_CHECK_HEADERS( \
[arpa/inet.h \
errno.h \
getopt.h \
glob.h \
dlfcn.h \
fcntl.h \
inttypes.h \
limits.h \
machine/endian.h \
malloc.h \
memory.h \
netdb.h \
netinet/in.h \
nlist.h \
stddef.h \
stdlib.h \
stdint.h \
string.h \
strings.h \
stropts.h \
soundcard.h \
alsa/asoundlib.h \
sys/asoundlib.h \
sys/audioio.h \
sys/awe_voice.h\
sys/ioctl.h \
sys/ipc.h \
sys/param.h \
sys/shm.h \
sys/socket.h \
sys/soundcard.h \
sys/param.h \
sys/time.h \
sys/types.h \
sys/stat.h \
sys/sysctl.h \
termios.h \
X11/Xlib.h])
if test "x$DMC" != xyes ; then
AC_CHECK_HEADERS([ \
unistd.h \
])
fi
AC_CHECK_HEADERS(\
[X11/extensions/XShm.h X11/Xmu/ExtAgent.h],[],[],[
#ifdef HAVE_X11_XLIB_H
#include <X11/Xlib.h>
#endif
])
AC_CHECK_HEADER(string.h,, [ AC_DEFINE(NO_STRING_H,1,Define to 1 if you do not have <string.h>.)])
# Checks for typedefs, structures, and compiler characteristics.
if test "x$WATCOM_C" != xyes ; then
AC_C_BIGENDIAN
fi
AC_C_CHAR_UNSIGNED
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_C_STRINGIZE
AC_C_PROTOTYPES
AC_STRUCT_TM
if test "x$DMC" != xyes ; then
AC_TYPE_SIZE_T
fi
if test "x$POCC" != xyes ; then
AC_TYPE_OFF_T
AC_TYPE_PID_T
fi
dnl keyword "volatile" check
AC_CACHE_CHECK(volatile declaration,timidity_cv_type_volatile,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [[volatile int x]])],[timidity_cv_type_volatile=yes],[timidity_cv_type_volatile=no]))
if test $timidity_cv_type_volatile = no; then
AC_DEFINE(NO_VOLATILE,1,Define to 1 if you cannot use volatile keyword)
fi
dnl union usenum check
AC_CACHE_CHECK(union semun declaration,timidity_cv_type_union_semun,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
]], [[union semun x]])],[timidity_cv_type_union_semun=yes],[timidity_cv_type_union_semun=no]))
if test $timidity_cv_type_union_semun = yes; then
AC_DEFINE(HAVE_UNION_SEMUN,1,Define to 1 if you use semun keyword)
fi
dnl Cygnus and Mingw memory struct optiontest
if test "x$MSYS" = xyes ; then
case "x${CC}" in
"xgcc"*)
msnative_struct=''
AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
if test -z "$ac_cv_prog_CC"; then
our_gcc="$CC"
else
our_gcc="$ac_cv_prog_CC"
fi
case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
2.)
if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
msnative_struct='-fnative-struct'
fi
;;
*)
if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
msnative_struct='-mms-bitfields'
fi
;;
esac
if test x"$msnative_struct" = x ; then
AC_MSG_RESULT([no way])
AC_MSG_WARN([produced binary will be incompatible with windows' GUI ])
else
CFLAGS="$CFLAGS $msnative_struct"
CPPFLAGS="$CPPFLAGS $msnative_struct"
AC_MSG_RESULT([${msnative_struct}])
fi
;;
*)
;;
esac
fi
dnl Cygnus Mingw32 mmsystem check
if test "x$MSYS" = xyes ; then
AC_CACHE_CHECK(Cygwin new mmsystem,timidity_cv_header_new_mmsystem,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <windows.h>
#include <mmsystem.h>
]], [[return WOM_OPEN != 0x3BB]])],[timidity_cv_header_new_mmsystem=yes],[timidity_cv_header_new_mmsystem=no]))
if test $timidity_cv_header_new_mmsystem = yes; then
AC_DEFINE(HAVE_NEW_MMSYSTEM,1,Define to 1 if you have <mmsystem.h> file)
fi
fi
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
if test "x$DMC" != xyes ; then
AC_FUNC_FORK
fi
AC_FUNC_MEMCMP
if test "x$DMC" != xyes ; then
AC_FUNC_MMAP
fi
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
if test "x$VCPP" != xyes && test "x$BORLANDC" != xyes && test "x$WATCOM_C" != "xyes" && test "x$POCC" != "xyes"; then
AC_FUNC_VPRINTF
fi
AC_CHECK_FUNCS( \
[alarm \
dup2 \
floor \
getcwd \
gethostbyname \
getopt \
getpid \
gettimeofday \
getwd \
isatty \
memchr \
memmove \
memset \
mkstemp \
modf \
munmap \
popen \
pow \
select \
signal \
socket \
sleep \
vsnprintf \
snprintf \
sqrt \
strchr \
strdup \
strstr \
strerror \
strcasecmp \
strncasecmp \
strrchr \
strstr \
strtol \
strlcat \
strlcpy \
usleep])
if test "x$VCPP" = xyes; then
AC_DEFINE(RETSIGTYPE,int)
AC_DEFINE(HAVE_GETCWD,1)
fi
if test "x$POCC" = xyes; then
AC_DEFINE(HAVE_GETCWD,1)
AC_DEFINE(HAVE_GETHOSTBYNAME,1)
AC_DEFINE(HAVE_POPEN,1)
AC_DEFINE(HAVE_SELECT,1)
AC_DEFINE(HAVE_SNPRINTF,1)
AC_DEFINE(HAVE_STRDUP,1)
AC_DEFINE(HAVE_STRERROR,1)
AC_DEFINE(HAVE_STRCASECMP,1)
AC_DEFINE(HAVE_STRSTR,1)
AC_DEFINE(HAVE_SOCKET,1)
AC_DEFINE(HAVE_VSNPRINTF,1)
AC_DEFINE(HAVE_GETOPT,1)
AC_DEFINE(TIMID_VERSION,[$(PACKAGE_VERSION)],[for windows gui])
fi
if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes || test "x$WATCOM_C" = xyes; then
AC_DEFINE(HAVE_GETHOSTBYNAME,1)
AC_DEFINE(HAVE_POPEN,1)
AC_DEFINE(popen,_popen,[for VC])
AC_DEFINE(pclose,_pclose,[for VC])
AC_DEFINE(HAVE_SELECT,1)
AC_DEFINE(HAVE_SNPRINTF,1)
AC_DEFINE(HAVE_STRDUP,1)
AC_DEFINE(HAVE_STRERROR,1)
AC_DEFINE(HAVE_STRNCASECMP,1)
AC_DEFINE(HAVE_STRSTR,1)
AC_DEFINE(snprintf,_snprintf,[for VC])
AC_DEFINE(HAVE_SOCKET,1)
AC_DEFINE(HAVE_VSNPRINTF,1)
dnl AC_DEFINE(vsnprintf,_vsnprintf,[for VC])
AC_DEFINE(TIMID_VERSION,[$(PACKAGE_VERSION)],[for windows gui])
fi
AC_CHECK_FUNC(getopt_long,
AC_DEFINE([HAVE_GETOPT_LONG],1,[Define to 1 if you have `getopt_long' function])
tm_cv_needgetopt="no",
tm_cv_needgetopt="yes")
AM_CONDITIONAL([NEEDGETOPT], test "x$tm_cv_needgetopt" = "xyes")
AC_CHECK_FUNC(open_memstream, [
AC_DEFINE([HAVE_OPEN_MEMSTREAM],1,[Define to 1 if you have `open_memstream' function])
])
dnl ***
dnl *** va_copy checks (from GLIB)
dnl ***
AC_CACHE_CHECK([for an implementation of va_copy()],lib_cv_va_copy,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdarg.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
va_copy (args2, args1);
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
exit (1);
va_end (args1); va_end (args2);
}
int main() {
f (0, 42);
return 0;
}]])],
[lib_cv_va_copy=yes],
[lib_cv_va_copy=no],[])
])
AC_CACHE_CHECK([for an implementation of __va_copy()],lib_cv___va_copy,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdarg.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
__va_copy (args2, args1);
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
exit (1);
va_end (args1); va_end (args2);
}
int main() {
f (0, 42);
return 0;
}]])],
[lib_cv___va_copy=yes],
[lib_cv___va_copy=no],[])
])
if test "x$lib_cv_va_copy" = "xyes"; then
va_copy_func=va_copy
else if test "x$lib_cv___va_copy" = "xyes"; then
va_copy_func=__va_copy
fi
fi
if test -n "$va_copy_func"; then
AC_DEFINE_UNQUOTED(VA_COPY,$va_copy_func,[A 'va_copy' style function])
fi
AC_CACHE_CHECK([whether va_lists can be copied by value],lib_cv_va_val_copy,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdarg.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
args2 = args1;
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
exit (1);
va_end (args1); va_end (args2);
}
int main() {
f (0, 42);
return 0;
}]])],
[lib_cv_va_val_copy=yes],
[lib_cv_va_val_copy=no],[])
])
if test "x$lib_cv_va_val_copy" = "xno"; then
AC_DEFINE(VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
fi
# Checks on cygnus and MSYS
if test "x$MSYS" = xyes ; then
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
*yes*)
AC_CHECK_FUNC(opendir,,
[ EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
W32READDIR=yes ])
;;
*)EXTRADEFS="$EXTRADEFS -D__W32READDIR__"
W32READDIR=yes
;;
esac
if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes || test "x$WATCOM_C" = xyes || test "x$DMC" = xyes || test "x$POCC" = xyes; then
EXTRALIBS="$EXTRALIBS ws2_32.lib"
EXTRADEFS="$EXTRADEFS -DWINSOCK"
else
AC_CHECK_FUNC(socket,,
WAPI_CHECK_LIB(ws2_32,WSAStartup,
[#include <winsock.h>],
[WSAStartup(0,0);],
[ EXTRALIBS="$EXTRALIBS -lws2_32"
EXTRADEFS="$EXTRADEFS -DWINSOCK" ]
)
)
fi
fi
# Checks on extra paths
dnl tcltk paths
AC_ARG_WITH(tcl-includes,
[ --with-tcl-includes=DIR Tcl include file path ],
[ if test ! -d $withval; then
AC_MSG_WARN($withval is not found.)
fi
tcl_include_dir="-I$withval"
])
AC_ARG_WITH(tcl-libs,
[ --with-tcl-libs=DIR Tcl library file path ],
[ if test ! -d $withval; then
AC_MSG_WARN($withval is not found.)
fi
tcl_libdir="-L$withval" ])
AC_ARG_WITH(tk-includes,
[ --with-tk-includes=DIR Tk include file path ],
[ if test ! -d $withval; then
AC_MSG_WARN($withval is not found.)
fi
tk_includes="-I$withval" ])
AC_ARG_WITH(tk-libs,
[ --with-tk-libs=DIR Tk library file path ],
[ if test ! -d $withval; then
AC_MSG_WARN($withval is not found.)
fi
tk_libdir="-L$withval" ])
dnl offix paths
AC_ARG_WITH(offix-includes,
[ --with-offix-includes=DIR Offix include file path ],
[ if test ! -d $withval; then
AC_MSG_WARN($withval is not found.)
fi
offix_include_dir="-I$withval" ])
AC_ARG_WITH(offix-libs,
[ --with-offix-libs=DIR Offix include file path ],
[ if test ! -d $withval; then
AC_MSG_WARN($withval is not found.)
fi
offix_lib_dir="-L$withval" ])
#
# audio section
#
dnl default(d): auto selection
dnl oss(d): OSS /dev/dsp
dnl alsa(d): ALSA pcm device
dnl sun(d): SunOS /dev/audio
dnl hpux(d): HPUX /dev/audio
dnl irix(d): IRIX audio
dnl mme(d): OSF/1 MME
dnl sb_dsp(d): BSD/OS 2.0 /dev/sb_dsp
dnl w32(d): Windows MMS
dnl darwin(d): Mac OS X pcm device
dnl alsa(s): ALSA pcm device
dnl alib(A): HPUX network audio (Alib)
dnl nas(n): Network Audio System
dnl arts(R): aRts
dnl esd(e): EsounD
dnl portaudio(p) PortAudio
dnl npipe(N) Windows named pipe;
dnl vorbis(v): Ogg Vorbis
dnl flac(F): FLAC / OggFLAC
dnl speex(S): Ogg Speex
dnl gogo(g): MP3 GOGO
dnl jack(j): JACK
dnl ao(O): Libao
audio_targets='default oss alsa sun hpux irix mme sb_dsp w32 alib nas arts esd vorbis flac gogo portaudio npipe jack ao'
AC_ARG_WITH(nas-library,
[ --with-nas-library=library NAS absolute library path(Don't use -laudio)])
AC_ARG_WITH(nas-includes,
[ --with-nas-includes=DIR NAS include files are in dir])
AC_ARG_ENABLE(audio,
[ --enable-audio[=mode_list] Enable audio (Specify comma separated mode list):
default: Automatically select audio device.
oss: OSS /dev/dsp
sun: SunOS /dev/audio
hpux: HPUX /dev/audio
irix: IRIX audio library
mme: OSF/1 MME
sb_dsp: BSD/OS 2.0 /dev/sb_dsp
w32: Windows MMS
darwin: Darwin CoreAudio
alsa: ALSA pcm device
alib: HPUX network audio (Alib)
nas: NAS - Network Audio System
arts: aRts
esd: EsounD - Enlightened Sound Daemon
portaudio: PortAudio
npipe: Named Pipe(windows)
jack: JACK
ao: Libao
vorbis: Ogg Vorbis
flac: FLAC / OggFLAC
speex: Ogg Speex
gogo: MP3 GOGO (Only Windows is supported)],
[ enable_audio=$enableval
have_audio_opt=yes ],
[ enable_audio=yes
have_audio_opt=no ])
dnl yes -> default
test "x$enable_audio" = xyes && enable_audio=default
if test "x$enable_audio" != xno; then
for i in `echo $enable_audio | sed 's/,/ /g'`; do
eval "au_enable_$i=yes"
done
fi
dnl Turn on default output mode
DEFAULT_PLAYMODE=
AC_ARG_WITH(default-output,
[ --with-default-output=<mode> Specify default output mode (optional):
(default|alsa|alib|arts|nas|
esd|wav|au|aiff|list|vorbis|flac|speex|
gogo|portaudio|npipe|jack|ao)],
[ if test "$enable_audio" != no; then
DEFAULT_PLAYMODE=$withval
eval "au_enable_$DEFAULT_PLAYMODE=yes"
else
AC_MSG_WARN(--with-default-output=$withval: audio is not enabled)
fi])
dnl compatibility matters.
dnl AC_ARG_ENABLE(esd,
dnl [ --enable-esd EsounD (Obsoleted. Use --enable-audio=esd)],
dnl [ au_enable_esd=$enableval ])
dnl AC_ARG_ENABLE(nas,
dnl [ --enable-nas NAS (Obsoleted. Use --enable-audio=nas)],
dnl [ au_enable_nas=$enableval ])
dnl AC_ARG_ENABLE(alsa,
dnl [ --enable-alsa ALSA (Obsoleted. Use --enable-audio=alsa)],
dnl [ au_enable_alsa=$enableval ])
dnl target-specific defaults
if test "x$au_enable_default" = xyes; then
case "$target" in
*-*-linux*|*-*-freebsd*)
au_enable_oss=yes
;;
*-*-bsdi2.0)
au_enable_sb_dsp=yes
;;
*-*-bsdi2.1|*-*-bsdi3.?|*-*-bsdi4.?)
au_enable_oss=yes
;;
*-*-hpux*)
au_enable_hpux=yes
;;
*-dec-*)
au_enable_mme=yes
;;
*irix*)
au_enable_irix=yes
;;
*-*-sunos4*)
au_enable_sun=yes
;;
*-*-solaris*)
au_enable_sun=yes
;;
*-*-netbsd*)
au_enable_sun=yes
;;
*-*-openbsd*)
au_enable_sun=yes
;;
*-*-cygwin*)
au_enable_w32=yes
;;
*-*-mingw*)
au_enable_w32=yes
;;
*-*-darwin*)
au_enable_darwin=yes
;;
*)
AC_MSG_WARN(No --enable-audio=default audio for $target)
;;
esac
fi
# Each audio mode's configurations
dnl oss
AC_MSG_CHECKING(enable_audio=oss)
if test "x$au_enable_oss" = xyes; then
EXTRADEFS="$EXTRADEFS -DAU_OSS"
SYSEXTRAS="$SYSEXTRAS oss_a.c"
if test "x$ac_cv_header_sys_soundcard_h" = xyes; then
AC_MSG_RESULT(yes - <sys/soundcard.h>)
else
case "$target" in
*linux*|*freebsd*)
dnl <linux/soundcard.h> or <machine/soundcard.h>
AC_MSG_RESULT(yes)
;;
*)
if test "x$ac_cv_header_soundcard_h" = xyes; then
AC_MSG_RESULT(yes - <soundcard.h>)
else
AC_MSG_WARN(<sys/soundcard.h> is not found)
fi
;;
esac
fi
AC_CHECK_LIB(ossaudio,open)
dnl Why OpenBSD use /dev/audio instead of /dev/dsp for OSS
case "$target" in