-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
2335 lines (2176 loc) · 68.5 KB
/
configure.ac
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 <mo@goice.co.jp>
dnl Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>
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 <root@mput.dip.jp> 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 TCLSH - tclsh
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.71])
AC_INIT([TiMidity++],[2.15.0],[timidity-talk@lists.sourceforge.net],[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"}
TCLSH=${TCLSH-"tclsh"}
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,
AS_HELP_STRING([--enable-debug], [Build a debugging version.]),
[timidity_cv_debug="yes"], [timidity_cv_debug="no"])
AS_IF([test "x$timidity_cv_debug" = "xyes"],[
AC_DEFINE(DEBUG,1,Define to 1 if you are in debug mode)
CFLAGS=${CFLAGS-"-g"}
])
AS_IF([test "x$timidity_cv_debug" = "xno"],[
AC_DEFINE(NDEBUG,1,Define to 1 if you are NOT in debug mode)
])
AC_MSG_RESULT($timidity_cv_debug)
AS_IF([test "x$CFLAGS" = "x"],[
NOCFLAGS="yes"
])
dnl --with-x turns on if `--with-x' is NOT specified.
AS_IF([test "x$with_x" = x], [
with_x=yes
],[
x_config_flag=yes
])
# 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.
AS_IF([test "x$prefix" != xNONE -a "x$prefix" != "x$ac_default_prefix" -a "x$prefix" != "x/usr"],[
LDFLAGS="-L$prefix/lib $LDFLAGS"
SHLDFLAGS="-L$prefix/lib $SHLDFLAGS"
CPPFLAGS="-I$prefix/include $CPPFLAGS"
])
dnl add --with-includes, --with-libraries
AC_ARG_WITH(includes,
AS_HELP_STRING([--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,
AS_HELP_STRING([--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,
AS_HELP_STRING([--with-default-path=DIR], [Where timidity.cfg is (PREFIX/share/timidity)]),
[pkgdatadir=$withval],
[
AS_IF([test "x$prefix" != "xNONE"], [
pkgdatadir='${prefix}/share/timidity'
], [
pkgdatadir='/usr/local/share/timidity'
])
])
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,
AS_HELP_STRING([--with-module-dir=DIR], [Where to install interfaces (PREFIX/lib/timidity)]),
[pkglibdir=$withval],
[
AS_IF([test "x$prefix" != "xNONE"],[
pkglibdir='${prefix}/lib/timidity'
], [
pkglibdir='/usr/local/lib/timidity'
])
])
tmplibdir="`eval \"echo ${pkglibdir}\"`"
AC_DEFINE_UNQUOTED(PKGLIBDIR,"$tmplibdir",place to install modules)
AC_ARG_WITH(xaw-resource-prefix,
AS_HELP_STRING([--with-xaw-resource-prefix=DIR], [What prefix to install X resource files to (optional, used by Xaw/Motif interfaces)]),
[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)
AS_IF([test "x$NOCFLAGS" = "xyes"], [
AS_IF([test "x$GCC" = "xyes"], [
CFLAGS="-O2"
], [
CFLAGS=""
])
])
# Checks for target dependencies
AC_ARG_WITH(elf,
AS_HELP_STRING([--with-elf], [create ELF shared object instead of AOUT]),
[ ELFFORMAT=$withval ], [ ELFFORMAT="yes" ])
# AC_ARG_WITH(simd,
# AS_HELP_STRING([--with-simd], [create SIMD friendly binary (default is no) ]),
# [ SIMD=$withval ], [ SIMD="no" ])
case "$target" in
*-*-hpux*)
EXTRADEFS="-DHPUX"
AS_IF([! test -n "$SHLD" ], [ SHLD="ld -b" ])
so="sl"
;;
*-sgi-irix*)
dnl IRIX cc needs -signed option
case ".$CC" in .cc*) EXTRACFLAGS="-signed";; esac
AS_IF([! test -n "$SHLD" ], [ SHLD="cc -shared -all" ])
so="so"
;;
*-*-netbsd*)
AS_IF([! test -n "$SHLD" ], [ SHLD="$CC -shared -nostartfiles" ])
so="so"
;;
*-*-freebsd2*)
dnl EXTRALIBS="$EXTRALIBS -lxpg4"
AS_IF([! test -n "$SHLD" ], [ SHLD="ld -Bshareable" ])
so="so"
;;
*-*-freebsd*)
AS_IF([test "$ELFFORMAT" = yes],[
AS_IF([! test -n "$SHLD" ], [ SHLD="ld -Bshareable" ])
], [
SHCFLAGS=-aou
SHLDFLAGS="-L/usr/X11R6/lib/aout $SHLDFLAGS"
AS_IF([! test -n "$SHLD" ], [ SHLD="env OBJFORMAT=aout ld -shared" ])
])
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"
AS_IF([! 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)
AS_IF([! 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)
AS_IF([! 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)
AS_IF([! 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*)
AS_IF([! test -n "$SHLD" ], [ SHLD="gcc -mdll" ]);
MINGWGCC=yes
;;
*)
AS_IF([! test -n "$SHLD" ], [ SHLD="unknown" ])
;;
esac
so="dll"
MSYS=yes
lib_user32_test=-luser32
;;
*-dec-*)
EXTRADEFS="-DDEC"
AS_IF([! test -n "$SHLD" ], [ SHLD="ld -Bdynamic -G" ])
so="so"
;;
*-*-solaris*)
EXTRADEFS="-DSOLARIS"
AS_IF([! test -n "$SHLD" ], [ SHLD="/usr/ccs/bin/ld -G" ])
so="so"
;;
*-*-nextstep*)
AS_IF([! test -n "$SHLD" ], [ SHLD="/usr/ccs/bin/ld -G" ])
so="so"
;;
*-*-darwin*)
AS_IF([test "x$SIMD" = "xyes"],[
AC_DEFINE(USE_ALTIVEC,1,Define to 1 if you use altivec)
# EXTRACFLAGS="$EXTRACFLAGS -faltivec -mabi=altivec -maltivec" # for GCC3.
EXTRACFLAGS="$EXTRACFLAGS -faltivec"
],[
AC_DEFINE(USE_ALTIVEC,0,Define to 1 if you use altivec)
])
CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
LDOPTS="-dynamic -undefined suppress -flat_namespace $LDOPTS"
AS_IF([! test -n "$SHLD" ], [ SHLD="$CC -dynamic -bundle -undefined suppress -flat_namespace $LDFLAGS" ])
so="bundle"
;;
*)
AS_IF([! test -n "$SHLD"],[
AS_IF([test "x$GCC" = xyes],[
SHLD="$CC -shared"
],[
SHLD="ld -Bdynamic -G"
])
])
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.
AS_IF([test "x$VCPP" != "xyes" && test "x$BORLANDC" != "xyes" && test "x$WATCOM_C" != "xyes" && test "x$POCC" != "xyes"],[
AC_CHECK_LIB(xpg4,setlocale) # Mac OS X (and maybe NetBSD) need this.
])
AC_CHECK_FUNCS(gethostbyname,,[ AC_CHECK_LIB(nsl,gethostbyname) ])
AC_PATH_XTRA
dnl Xft for trace window
AC_ARG_ENABLE(xft,
AS_HELP_STRING([--enable-xft], [Enable use of Xft in X trace mode]))
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: libXaw
xaw3d: Xaw3d
neXtaw: neXtaw
XawPlus: XawPlus
default is --with-xawlib=xaw3d,xaw],
[ with_xawlib="$withval" ], [ with_xawlib="xaw3d,xaw" ])
# Checks for X
AS_IF([test "x$with_x" = xyes], [
AS_IF([test "x$have_x" = xno], [
AS_IF([test "x$x_config_flag" = xyes], [
AC_MSG_ERROR(Could not configure X)
], [
AC_MSG_WARN(Could not configure X)
])
])
])
AS_IF([test "x$with_x" = xyes -a "x$have_x" = xyes], [
AS_IF([test "x$x_libraries" != x], [
ldflags_x_opt="-L$x_libraries"
LDFLAGS="$LDFLAGS $ldflags_x_opt"
SHLDFLAGS="$SHLDFLAGS $ldflags_x_opt"
], [
ldflags_x_opt=
])
AS_IF([test "x$x_includes" != x], [
CPPFLAGS="$CPPFLAGS -I$x_includes"
])
AC_CHECK_LIB(X11,XOpenDisplay,
AC_DEFINE(HAVE_LIBX11,1,Define to 1 if you have the ``X11'' library (-lX11).))
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]))
AS_IF([test "$timidity_cv_x11_version_6" = "yes"], [
AC_MSG_RESULT(6 or newer)
dnl AC_DEFINE(HAVE_X11R6)
], [
AC_MSG_RESULT(before 6)
])
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)
AS_IF([test "x$enable_xft" = "xyes"], [
AC_CHECK_LIB(Xft,XftInit,
AC_DEFINE(HAVE_LIBXFT,1,Define to 1 if you have the ``Xft'' library.),
enable_xft=no)
])
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
AS_IF([test "x$have_xaw" != "xno"],[break;])
done
AC_CHECK_LIB(Xm,XmCreateForm,have_xm=yes,have_xm=no)
AC_CHECK_FUNCS(XShmCreatePixmap)
LIBS=$KEEPLIBS
])
dnl End of X configure
# Checks for header files.
AC_CHECK_INCLUDES_DEFAULT
AC_PROG_EGREP
#AC_HEADER_STDBOOL
AC_HEADER_SYS_WAIT
AS_IF([test "x$WATCOM_C" != xyes], [
AC_CHECK_HEADERS_ONCE([sys/time.h])
])
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])
AS_IF([test "x$DMC" != xyes], [
AC_CHECK_HEADERS([ \
unistd.h \
])
])
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.
AS_IF([test "x$WATCOM_C" != xyes],[
AC_C_BIGENDIAN
])
AC_C_CHAR_UNSIGNED
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_C_STRINGIZE
AC_C_PROTOTYPES
AC_STRUCT_TM
AS_IF([test "x$DMC" != xyes], [
AC_TYPE_SIZE_T
])
AS_IF([test "x$POCC" != xyes], [
AC_TYPE_OFF_T
AC_TYPE_PID_T
])
# Older versions of MinGW do not define ssize_t in sys/types
AC_MSG_CHECKING([for ssize_t])
AC_CACHE_VAL(ac_cv_type_$1,
[AC_EGREP_CPP([ssize_t@<:@^a-zA-Z_0-9@:>@],
[#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif], [ac_cv_type_ssize_t=yes], [ac_cv_type_ssize_t=no])])
AC_MSG_RESULT([$ac_cv_type_ssize_t])
AS_IF([test $ac_cv_type_ssize_t = yes], [
AC_DEFINE(HAVE_SSIZE_T, 1,
[Define to 1 if the system has the type ``ssize_t''.])
])
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]))
AS_IF([test $timidity_cv_type_volatile = no], [
AC_DEFINE(NO_VOLATILE,1,Define to 1 if you cannot use volatile keyword)
])
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]))
AS_IF([test $timidity_cv_type_union_semun = yes], [
AC_DEFINE(HAVE_UNION_SEMUN,1,Define to 1 if you use semun keyword)
])
dnl Cygnus and Mingw memory struct optiontest
AS_IF([test "x$MSYS" = xyes], [
case "x${CC}" in
"xgcc"*)
msnative_struct=''
AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
AS_IF([test -z "$ac_cv_prog_CC"], [
our_gcc="$CC"
], [
our_gcc="$ac_cv_prog_CC"
])
case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
2.)
AS_IF([$our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null], [
msnative_struct='-fnative-struct'
])
;;
*)
AS_IF([$our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null], [
msnative_struct='-mms-bitfields'
])
;;
esac
AS_IF([test x"$msnative_struct" = x], [
AC_MSG_RESULT([no way])
AC_MSG_WARN([produced binary will be incompatible with windows' GUI ])
], [
CFLAGS="$CFLAGS $msnative_struct"
CPPFLAGS="$CPPFLAGS $msnative_struct"
AC_MSG_RESULT([${msnative_struct}])
])
;;
*)
;;
esac
])
dnl Cygnus Mingw32 mmsystem check
AS_IF([test "x$MSYS" = xyes], [
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]))
AS_IF([test $timidity_cv_header_new_mmsystem = yes], [
AC_DEFINE(HAVE_NEW_MMSYSTEM,1,Define to 1 if you have <mmsystem.h> file)
])
])
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AS_IF([test "x$DMC" != xyes], [
AC_FUNC_FORK
])
AC_FUNC_MEMCMP
AS_IF([test "x$DMC" != xyes], [
AC_FUNC_MMAP
])
AS_IF([test "x$VCPP" != xyes && test "x$BORLANDC" != xyes && test "x$WATCOM_C" != "xyes" && test "x$POCC" != "xyes"], [
AC_FUNC_VPRINTF
])
AC_CHECK_FUNCS( \
[alarm \
dup2 \
floor \
getcwd \
gethostbyname \
getopt \
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])
AS_IF([test "x$VCPP" = xyes], [
AC_DEFINE(HAVE_GETCWD,1)
])
AS_IF([test "x$POCC" = xyes], [
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])
])
AS_IF([test "x$VCPP" = xyes || test "x$BORLANDC" = xyes || test "x$WATCOM_C" = xyes], [
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])
])
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],[])
])
AS_IF([test "x$lib_cv_va_copy" = "xyes"], [
va_copy_func=va_copy
], [test "x$lib_cv___va_copy" = "xyes"], [
va_copy_func=__va_copy
])
AS_IF([test -n "$va_copy_func"], [
AC_DEFINE_UNQUOTED(VA_COPY,$va_copy_func,[A 'va_copy' style function])
])
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],[])
])
AS_IF([test "x$lib_cv_va_val_copy" = "xno"], [
AC_DEFINE(VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
])
# Checks on cygnus and MSYS
AS_IF([test "x$MSYS" = xyes], [
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
AS_IF([test "x$VCPP" = xyes || test "x$BORLANDC" = xyes || test "x$WATCOM_C" = xyes || test "x$DMC" = xyes || test "x$POCC" = xyes], [
EXTRALIBS="$EXTRALIBS ws2_32.lib"
EXTRADEFS="$EXTRADEFS -DWINSOCK"
], [
AC_CHECK_FUNC(socket,,
WAPI_CHECK_LIB(ws2_32,WSAStartup,
[#include <winsock.h>],
[WSAStartup(0,0);],
[ EXTRALIBS="$EXTRALIBS -lws2_32"
EXTRADEFS="$EXTRADEFS -DWINSOCK" ]
)
)
])
])
# Checks on extra paths
dnl tcltk paths
AC_ARG_WITH(tcl-includes,
AS_HELP_STRING([--with-tcl-includes=DIR], [Tcl include file path]),
[ AS_IF([test ! -d $withval], [
AC_MSG_WARN($withval is not found.)
])
tcl_include_dir="-I$withval"
])
AC_ARG_WITH(tcl-libs,
AS_HELP_STRING([--with-tcl-libs=DIR], [Tcl library file path]),
[ AS_IF([test ! -d $withval], [
AC_MSG_WARN($withval is not found.)
])
tcl_libdir="-L$withval" ])
AC_ARG_WITH(tk-includes,
AS_HELP_STRING([--with-tk-includes=DIR], [Tk include file path]),
[ AS_IF([test ! -d $withval], [
AC_MSG_WARN($withval is not found.)
])
tk_includes="-I$withval" ])
AC_ARG_WITH(tk-libs,
AS_HELP_STRING([--with-tk-libs=DIR], [Tk library file path]),
[ AS_IF([test ! -d $withval], [
AC_MSG_WARN($withval is not found.)
])
tk_libdir="-L$withval" ])
dnl offix paths
AC_ARG_WITH(offix-includes,
AS_HELP_STRING([--with-offix-includes=DIR], [Offix include file path]),
[ AS_IF([test ! -d $withval], [
AC_MSG_WARN($withval is not found.)
])
offix_include_dir="-I$withval" ])
AC_ARG_WITH(offix-libs,
AS_HELP_STRING([--with-offix-libs=DIR], [Offix include file path]),
[ AS_IF([test ! -d $withval], [
AC_MSG_WARN($withval is not found.)
])
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,
AS_HELP_STRING([--with-nas-library=library], [NAS absolute library path(Don''t use -laudio)]))
AC_ARG_WITH(nas-includes,
AS_HELP_STRING([--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
AS_IF([test "x$enable_audio" = xyes], [ enable_audio=default ])
AS_IF([test "x$enable_audio" != xno], [
for i in `echo $enable_audio | sed 's/,/ /g'`; do
eval "au_enable_$i=yes"
done
])
dnl Turn on default output mode
DEFAULT_PLAYMODE=
AC_ARG_WITH(default-output,
AS_HELP_STRING([--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)]),
[ AS_IF([test "$enable_audio" != no], [
DEFAULT_PLAYMODE=$withval
eval "au_enable_$DEFAULT_PLAYMODE=yes"
] , [
AC_MSG_WARN([--with-default-output=$withval: audio is not enabled])
])
])
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
AS_IF([test "x$au_enable_default" = xyes], [
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
;;