File: configure.in

package info (click to toggle)
whitedune 0.30.10-2.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 42,004 kB
  • ctags: 27,321
  • sloc: cpp: 116,017; ansic: 79,688; java: 20,101; sh: 3,248; yacc: 2,902; makefile: 1,718; lex: 848; awk: 363; perl: 270; objc: 143; lisp: 112; python: 22
file content (1593 lines) | stat: -rw-r--r-- 50,162 bytes parent folder | download | duplicates (4)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
dnl Process this file with autoconf to produce a configure script.
dnl This autoconf script is free software; the Free Software Foundation
dnl gives unlimited permission to copy, distribute and modify it.

AC_INIT(src/Scene.h)
AC_CONFIG_HEADER(src/config.h)

OS=`uname`

dnl fix unix filepermissions first
echo fix unix filepermissions
sh batch/fixpermissions.sh

OLD_CFLAGS="$CFLAGS"
OLD_CXXFLAGS="$CXXFLAGS"

dnl Check for compiler programs

AC_PROG_CC
AC_PROG_CXX
AC_PROG_CXXCPP

dnl fix wrong "-g -O2" flags settings by some autoconf versions when
dnl detecting gcc/g++

if test "$CFLAGS" != "$OLD_CFLAGS"; then
 CFLAGS="$OLD_CFLAGS"
 echo reseting CFLAGS to $CFLAGS
fi
if test "$CXXFLAGS" != "OLD_CXXFLAGS"; then
 CXXFLAGS="$OLD_CXXFLAGS"
 echo reseting CXXFLAGS to $CXXFLAGS
fi


dnl Warn about defect compilers

if test "X_$OS" = "X_Linux" ; then
 echo xxxxxxxxx Warning xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 echo problems with the buggy Redhat/SuSE Linux \"gcc 2.96\" compiler '?' Use
 echo  
 echo  rm -f config.cache
 echo  sh ./configure --with-kgcc
 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
fi

dnl Checks for special options.

AC_ARG_WITH(oldmotif,--with-oldmotif           used for compatibility with old motif/lesstif versions,
            AC_DEFINE(HAVE_OLD_MOTIF))

AC_ARG_WITH(olpc,--with-olpc               used for compatibility with the one laptop per child computer,
            HAVE_OLPC=1;CPPFLAGS="$CPPFLAGS -I/usr/local/include/freetype2";export CPPFLAGS;EXTRA_LIBS="-lselinux -lpthread";export EXTRA_LIBS;OPTIM="$OPTIM -O3 -mmmx -m3dnow -ffast-math";export OPTIM;AC_DEFINE(HAVE_OLPC))

if test "X_$OPTIM" = "X_" ;then
   OPTIM=-g
fi
AC_ARG_WITH(optimization,--with-optimization       optimize for speed,
            OPTIM=-O2;export OPTIM)

LIBS="$LIBS $EXTRA_LIBS"
export LIBS

AC_ARG_WITH(iconscale2,--with-iconscale2         used to scale major icons by factor 2,
            AC_DEFINE(HAVE_ICON_SCALE_2))

AC_ARG_WITH(devil,--without-devil 	  do not use DevIL library to load textureimages ,
            DEVIL=no)

AC_ARG_WITH(png_handle_unknown,--without-png_handle_unknown  use if link fails cause of png_handle_unknown,
            AC_DEFINE(HAVE_NO_PNG_HANDLE_UNKNOWN))

AC_ARG_WITH(sdljoystick,--without-sdljoystick 	  do not use SDL joystick code,
            SDL_JOYSTICK=no)

AC_ARG_WITH(helpurl,--with-helpurl=\"helpurl\"  URL of the \"docs\" directory,
            HELPURL="$withval";export HELPURL)
if test "X_$HELPURL" != "X_" ; then
   AC_DEFINE_UNQUOTED(HAVE_HELP_URL,"${HELPURL}")
else 
   if test -d docs ; then
      AC_DEFINE_UNQUOTED(HAVE_HELP_URL,"${PWD}/docs")
   fi
fi

AC_ARG_WITH(vrmlnodesurl,--with-vrmlnodesurl=\"vrmlnodesurl\" URL of ISO standard vrml97 node list e.g. downloaded version of  http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/nodesRef.html,
            VRMLNODESURL="$withval";export VRMLNODESURL)
if test "X_$VRMLNODESURL" != "X_" ; then
   AC_DEFINE_UNQUOTED(HAVE_VRML_NODES_URL,"${VRMLNODESURL}")
fi

AC_ARG_WITH(x3durl,--with-x3durl=\"x3durl\" URL of ISO standard X3D e.g. downloaded version of http://www.web3d.org/x3d/specifications/ISO-IEC-19775-1.2-X3D-AbstractSpecification/,
            X3DURL="$withval";export X3DURL)
if test "X_$X3DURL" != "X_" ; then
   AC_DEFINE_UNQUOTED(HAVE_X3D_URL,"${X3DURL}")
fi

AC_ARG_WITH(protobaseurl, --with-protobaseurl=\"url\" URL of base directory of PROTOs for needed EXTERNPROTO statements,
            PROTO_BASE_URL="$withval";export PROTO_BASE_URL)

VRML97_AMENDMENT1=vrml97Amendment1
X3D=x3d
SCRIPTED_NODES=scripted_Nodes
COVER_NODES=coverNodes
EXPORT_CONTAINER=exportContainers

for i in VRML97_AMENDMENT1 X3D SCRIPTED_NODES COVER_NODES EXPORT_CONTAINER; do
   x=`eval echo '$'"$i"`
   if test "X_$PROTO_BASE_URL" != "X_"; then
      url=HAVE_''$i''_PROTO_URL
      AC_DEFINE_UNQUOTED($url,"$PROTO_BASE_URL/$x")
   else
      if test -d docs/$x ; then
         url=HAVE_''$i''_PROTO_URL
         AC_DEFINE_UNQUOTED($url,"${PWD}/docs/$x")
      fi
   fi
done

AC_ARG_WITH(coverwave,--with-coverwave          allow creation of deprecated cover node Wave,
            AC_DEFINE(HAVE_COVER_WAVE))

AC_ARG_WITH(covertuimap,--with-covertuimap        allow creation of incomplete cover node TUIMap,
            AC_DEFINE(HAVE_COVER_TUI_MAP))

AC_ARG_WITH(wwwbrowser,--with-wwwbrowser=wwwbrowser  webbrowser eg. netscape firefox mozilla...,
            WWWBROWSER="$withval";export WWWBROWSER)

AC_ARG_WITH(vrmlbrowser,--with-vrmlbrowser=vrmlbrowser  VRML browser eg. netscape freewrl lookat...,
            VRMLBROWSER="$withval";export VRMLBROWSER)

KNOWN_IMAGE_EDITORS="gimp imgworks krita kolourpaint xpaint gpaint"
AC_ARG_WITH(imageeditor,--with-imageeditor=imageeditor  object editor for bitmap (.jpg/.png/.gif) files eg. gimp krita xpaint imgworks...,
            IMAGEEDITOR="$withval";export IMAGEEDITOR)

KNOWN_IMAGE_EDITORS_4KIDS="imgworks kolourpaint gpaint krita xpaint gimp"
AC_ARG_WITH(imageeditor4kids,--with-imageeditor4kids=imageeditor  simple object editor for bitmap (.jpg/.png/.gif) files usefull for kids eg. kolourpaint gpaint...,
            IMAGEEDITOR4KIDS="$withval";export IMAGEEDITOR4KIDS)

KNOWN_SOUND_EDITORS="audacity rezound wavesurfer gnusound sweep soundeditor"
AC_ARG_WITH(soundeditor,--with-soundeditor=soundeditor  object editor for sound (.wav) files eg. audacity rezound wavesurfer gnusound sweep soundeditor...,
            SOUNDEDITOR="$withval";export SOUNDEDITOR)

KNOWN_MOVIE_EDITORS="cinelerra avidemux2 avidemux moviemaker"
AC_ARG_WITH(movieeditor,--with-movieeditor=movieeditor  object editor for movie (.mpeg) files eg. cinelerra avidemux2 avidemux moviemaker...,
            MOVIEEDITOR="$withval";export MOVIEEDITOR)

AC_ARG_WITH(checkincommand,--with-checkincommand=checkincommand  default check in command of a revision control system,
            CHECK_IN_COMMAND="$withval";export CHECK_IN_COMMAND)

KNOWN_IMAGE_CONVERTERS="convert"
AC_ARG_WITH(imageconverter,--with-imageconverter=imageconverter  converter for bitmap (.jpg/.png/.gif) files to bmp files for ac3d export...,
            IMAGECONVERTER="$withval";export IMAGECONVERTER)

AC_ARG_WITH(usrlocalinclude,--without-usrlocalinclude  use when the compiler refuse -I/usr/local/include ,
            USRLOCALINCLUDE=no)

AC_ARG_WITH(kgcc,--with-kgcc 	 	  use to avoid the buggy Redhat/SuSE Linux \"gcc 2.96\",
            CC=kgcc;export CC)

AC_ARG_WITH(eulerrotation,--with-eulerrotation      use for euler angles instead of VRML like rotations,
            AC_DEFINE(HAVE_EULER_ROT))

AC_ARG_WITH(routeatend,--with-routeatend         write route statement at end into file,
            AC_DEFINE(HAVE_ROUTE_AT_END))

AC_ARG_WITH(uninstallcomment, --with-uninstallcomment=\"uninstallcomment\"  use to document a uninstall command,
            UNINSTALL_COMMENT="$withval";export UNINSTALL_COMMENT)
if test "X_$UNINSTALL_COMMENT" != "X_" ; then
   AC_DEFINE_UNQUOTED(HAVE_UNINSTALL_COMMENT,"${UNINSTALL_COMMENT}")
else
   AC_DEFINE_UNQUOTED(HAVE_UNINSTALL_COMMENT,"no information how to uninstall white_dune: possibly it has been installed from source")
fi

AC_ARG_WITH(xj3drigidbodyphysicscomponent,--with-xj3drigidbodyphysicscomponent  use special component name xj3d_RigidBodyPhysics,
            AC_DEFINE(HAVE_XJ3D_RIGID_BODY_PHYSICS_COMPONENT))


AC_ARG_WITH(dontreplacevrmlscript,--with-dontreplacevrmlscript  do not replace vrmlscript: with javascript:,
            AC_DEFINE(HAVE_DONT_REPLACE_VRMLSCRIPT))

AC_ARG_WITH(stereo,--without-stereo 	  use if you do not have shutterglases,
            AC_DEFINE(HAVE_NO_STEREO))

AC_ARG_WITH(stereocommand,--with-stereocommand=\"stereocommand\"   how to switch to stereomode (e.g. \"/usr/gfx/setmon -n 1024x768_96s\" on some SGI IRIX systems),
            STEREOCOMMAND="$withval";export STEREOCOMMAND)
if test "X_$STEREOCOMMAND" != "X_" ;then
   AC_DEFINE_UNQUOTED(HAVE_STEREOCOMMAND,"${STEREOCOMMAND}")
fi

AC_ARG_WITH(updatedebug,--with-updatedebug        use debug messages for updates between views,
            AC_DEFINE(HAVE_UPDATE_DEBUG))

AC_ARG_WITH(aflockdebug,--with-aflockdebug        use debug messages for Ascention Flock of birds,
            AC_DEFINE(HAVE_AFLOCK_DEBUG))

AC_ARG_WITH(coredump,--with-coredump 	  switch off emergencysave signalhandling,
            AC_DEFINE(HAVE_WANT_CORE))

unset TEST_FPU_INTERRUPTS
AC_ARG_WITH(fpuinterrupts,--with-fpuinterrupts      switch on interrupts on invalid fpu operations,
            export TEST_FPU_INTERRUPTS="yes")
if test "X_$TEST_FPU_INTERRUPTS" != "X_" ; then
   AC_MSG_CHECKING(for _FPU_SETCW)
   AC_TRY_COMPILE(
                  [
                    #include "fpu_control.h"
                  ],
                  [
                    unsigned int cw;_FPU_SETCW(cw);
                  ],
                  echo yes;AC_DEFINE(HAVE_FPU_SETCW),echo no
                 )
  AC_CHECK_LIB(fpe,handle_sigfpes)
  AC_CHECK_FUNCS(handle_sigfpes)
fi

AC_ARG_WITH(efence,--with-efence 	          use the efence malloc debugging routines,
            HAVE_WANT_EFENCE="yes")

AC_ARG_WITH(duma,--with-duma               use the duma malloc debugging routines,
            HAVE_WANT_DUMA="yes")

AC_ARG_WITH(gif,--without-gif             avoid code to render gif textures,
            HAVE_WANT_GIF=no)

if test "X_$HAVE_WANT_GIF" != "X_no" ; then
  GIF=gif.o
  AC_SUBST(GIF)
  AC_DEFINE(HAVE_GIF)
fi

AC_ARG_WITH(usb,--without-usb             avoid code to use libusb/NXT inputdevice,
            HAVE_WANT_USB=no)

AC_ARG_WITH(teachermenu,--with-teachermenu        add a extra submenu useful for teaching things,
            AC_DEFINE(HAVE_TEACHER_MENU))

AC_ARG_WITH(testinmenu,--with-testinmenu         insert a extra menupoint for testing of developers,
            AC_DEFINE(HAVE_TEST_IN_MENU))

AC_ARG_WITH(cut,--with-cut                currently you better use copy/paste/delete instead...,
            AC_DEFINE(HAVE_CUT))

AC_ARG_WITH(textedit,--without-textedit        disable file -> textedit cause it would do not return,
            AC_DEFINE(HAVE_NO_TEXTEDIT))

AC_ARG_WITH(nebula,--with-nebula 	          use if you want to convert to The Nebula Device,
            NEBULA=nebula/ExportNebula.o;export NEBULA;AC_DEFINE(HAVE_SAND))
AC_SUBST(NEBULA)

AC_ARG_WITH(textureimagemode,--with-textureimagemode   use nonstandard mode field in TextureImage node,
            AC_DEFINE(HAVE_TEXTUREIMAGE_MODE))

AC_ARG_WITH(optbigfiles,--without-optbigfiles     do not optimize compiling of big files ,
            OPT_BIG_FILES=no)
if test "X_$OPT_BIG_FILES" = "X_no" ;then
    OPTIM=-O2
    OPTBIG=-g
else
    OPTBIG=$OPTIM        
fi
AC_SUBST(OPTIM)
AC_SUBST(OPTBIG)

AC_ARG_WITH(gprof,--with-gprof              compile with support for the gprof analyser,
            OPTIM="-pg -DNDEBUG=1";export OPTIM;AC_DEFINE(HAVE_WANT_CORE))
AC_SUBST(OPTIM)

if test "X_$STATIC" = "X_" ;then
   STATIC=""
fi

OBJS='$(OBJS)'
AC_ARG_WITH(archives,--with-archives           link via archives,
            OBJS='$(ARCHIVES)')
export OBJS
AC_SUBST(OBJS)

AC_ARG_WITH(static,--with-static             link with the -static option,
            STATIC=-static;export STATIC)
AC_SUBST(STATIC)

AC_ARG_WITH(ranlib,--without-ranlib          avoid the usage of the ranlib command,
            AVOID_RANLIB="yes")

AC_ARG_WITH(ode,--with-ode                check for ODE library (code is in early development),
            WITH_ODE="yes")

AC_ARG_WITH(osmesa,--with-osmesa 	          use mesa off screen rendering (avoid with real OpenGL),
            HAVE_WANT_OSMESA="yes")

dnl Checks for programs.

AC_PROG_AWK
AC_PROG_YACC
if test "X_$YACC" = "X_yacc" ; then
    WARNING_YACC="Warning: not all versions of yacc will work, you better use bison instead"
    echo $WARNING_YACC 1>&2    
fi
AC_PROG_LEX
if test "X_$LEX" = "X_lex" ; then
    WARNING_LEX="Warning: not all versions of lex will work, you better use flex instead"
    echo $WARNING_LEX 1>&2    
fi
RC_YACC=$YACC
export RC_YACC
AC_SUBST(RC_YACC)

dnl use --nounistd when $LEX is flex
NOUNISTD=""
if test "X_$LEX" = "X_flex" ; then
   AC_MSG_CHECKING(for flex --nounistd option)
   if flex --help 2>&1 | grep '\--nounistd' > /dev/null ; then
       echo yes
       NOUNISTD="--nounistd"
   else
       echo no
   fi
fi
export NOUNISTD
AC_SUBST(NOUNISTD)

dnl test for egrep compatibility problems when filtering flex/lex output
EGREP_PROBLEMS="yes" 
AC_MSG_CHECKING(for specific egrep pattern compatibility)
ONE=`echo '#include <unistd.h>' | egrep '#include *.unistd\.h.' | wc -l`
if test "X_$ONE" = "X_1" ; then
   echo yes
   EGREP_PROBLEMS="no"
else
   echo no
fi
export EGREP_PROBLEMS
AC_SUBST(EGREP_PROBLEMS)

dnl check for webbrowsers
if test "X_$WWWBROWSER" = "X_" ; then
   AC_PATH_PROGS(WWWBROWSER,[x-www-browser iceweasel firefox phoenix galeon firebird opera mozilla seamonkey lynx links netscape])
fi

if test "X_$WWWBROWSER" = "X_" ; then
   WWWBROWSER=firefox
else 
  dnl handle commandline browsers

  dnl add your favorite xterm replacement here...
  AC_PATH_PROGS(XTERM,[xterm rxvt eterm])
  
  if test "X_$XTERM" != "X_" ; then
      XTERM="$XTERM -e"
   fi

  if test "X_`basename \"$WWWBROWSER\"`" = "X_lynx" ; then
     WWWBROWSER="$XTERM $WWWBROWSER" 
  else 
     if test "X_`basename \"$WWWBROWSER\"`" = "X_links" ; then
        WWWBROWSER="$XTERM $WWWBROWSER" 
     fi
  fi
fi

dnl check for object editors
if test "X_$IMAGEEDITOR" = "X_" ; then
   AC_PATH_PROGS(IMAGEEDITOR,[$KNOWN_IMAGE_EDITORS])
fi
AC_DEFINE_UNQUOTED(HAVE_IMAGE_EDITOR,"${IMAGEEDITOR}")

dnl check for object editors
if test "X_$IMAGEEDITOR4KIDS" = "X_" ; then
   AC_PATH_PROGS(IMAGEEDITOR4KIDS,[$KNOWN_IMAGE_EDITORS_4KIDS])
fi
AC_DEFINE_UNQUOTED(HAVE_IMAGE_EDITOR4KIDS,"${IMAGEEDITOR4KIDS}")


if test "X_$SOUNDEDITOR" = "X_" ; then
   AC_PATH_PROGS(SOUNDEDITOR,[$KNOWN_SOUND_EDITORS])
fi
AC_DEFINE_UNQUOTED(HAVE_SOUND_EDITOR,"${SOUNDEDITOR}")

if test "X_$MOVIEEDITOR" = "X_" ; then
   AC_PATH_PROGS(MOVIEEDITOR,[$KNOWN_MOVIE_EDITORS])
fi
AC_DEFINE_UNQUOTED(HAVE_MOVIE_EDITOR,"${MOVIEEDITOR}")

if test "X_$CHECK_IN_COMMAND" = "X_" ; then
   AC_PATH_PROGS(CHECK_IN_COMMAND,[ci])
fi
if test "X_$CHECK_IN_COMMAND" != "X_" ; then
   if test "X_`basename $CHECK_IN_COMMAND`" = "X_ci" ; then
      CHECK_IN_COMMAND="ci -l -q -f %s < /dev/null"
      echo using ${CHECK_IN_COMMAND} as revision control checkin command
   fi
   AC_DEFINE_UNQUOTED(HAVE_CHECK_IN_COMMAND, "${CHECK_IN_COMMAND}")
fi

if test "X_$IMAGECONVERTER" = "X_" ; then
   AC_PATH_PROGS(IMAGECONVERTER,[$KNOWN_IMAGE_CONVERTERS])
fi
AC_DEFINE_UNQUOTED(HAVE_IMAGE_CONVERTER,"${IMAGECONVERTER}")

AC_DEFINE_UNQUOTED(HAVE_X3DV_TO_X3D_COMMAND, "")

SDL_JOYSTICK_BSD="no"
SDL_JOYSTICK_LINUX="no"
SDL_JOYSTICK_MACOSX="yes"

dnl check for operation system dependend things
AC_PATH_XTRA

LD_OPTIONS=
COMMONFLAGS=
PARSER_CPP_CFLAG=
export PARSER_CPP_CFLAG
if test "X_$OS" = "X_Linux" ; then
    CPPFLAGS="$CPPFLAGS $X_CFLAGS -I/usr/X11R6/include/ -I/usr/X11R6/LessTif/Motif1.2/include"
    LIBS="$LIBS -L/usr/local/lib $X_LIBS -L/usr/X11R6/LessTif/Motif1.2/lib"
    SDL_JOYSTICK_LINUX="yes"
elif test "X_$OS" = "X_IRIX" ; then
    LD_OPTIONS="-n32"
    CPPFLAGS="$CPPFLAGS -I/usr/freeware/include $X_CFLAGS"
    LIBS="$LIBS -L/usr/local/lib32 -L/usr/freeware/lib32 -L/usr/lib32 $X_LIBS"

    dnl check for cosmoplayer
    if test -f "/var/netscape/communicator/plugins/libcosmoplayer.so" ; then
       VRMLBROWSER=netscape
       echo using netscape as default VRML browser on SGI IRIX
    fi
    if test -f "/var/netscape/communicator/plugins32/libcosmoplayer.so" ; then
       VRMLBROWSER=netscape
       echo using netscape as default VRML browser on SGI IRIX
    fi
elif test "X_$OS" = "X_IRIX64" ; then
    if test "`echo $CC | grep 64`" = "" ; then
       CPPFLAGS="$CPPFLAGS -I/usr/freeware/include $X_CFLAGS"
       LIBS="$LIBS -L/usr/local/lib32 -L/usr/freeware/lib32 -L/usr/lib32 $X_LIBS"
    else
       CPPFLAGS="$CPPFLAGS -I/usr/freeware/include $X_CFLAGS"
       LIBS="$LIBS -L/usr/local/lib64 -L/usr/freeware/lib64 -L/usr/lib64 $X_LIBS"
    fi

    if test "X_$VRMLBROWSER" = "X_" ; then
       dnl check for cosmoplayer
       if test -f "/var/netscape/communicator/plugins/libcosmoplayer.so" ; then
          VRMLBROWSER=netscape
       fi
       if test -f "/var/netscape/communicator/plugins32/libcosmoplayer.so" ; then
          VRMLBROWSER=netscape
       fi
    fi
elif test "X_$OS" = "X_SunOS" ; then
    LIBS="$LDFLAGS $LIBS $X_LIBS"
    export LIBS
    PARSER_CPP_CFLAG=-U__GNUC_MINOR__
    export PARSER_CPP_CFLAG
    # some solaris sfw bison crash on src/swt/rcparser.y 
    RC_YACC=yacc
    export RC_YACC
    AC_SUBST(RC_YACC)
elif test "X_$OS" = "X_Darwin" ; then
    MACOSX=`sw_vers | awk '/ProductVersion:/ {split($2,a,".");print a[[1]] "." a[[2]]}'`
    MACSDK=MacOSX""$MACOSX""u.sdk
    if test "X_$MACOSX" = "X_10.6" ; then
        dnl yet another workaround for MacOSX 10.6 "snowleopard"
        FAT_COMMONFLAGS="-I/usr/include -arch i386 -arch ppc -arch x86_64"
        FAT_LIBS=" -flat_namespace -Wl,-syslibroot,/Developer/SDKs/$MACSDK -arch ppc -arch i386 -arch x86_64 -Wl,-multiply_defined,warning"
        CPPFLAGS="$CPPFLAGS $X_CFLAGS -I/usr/X11R6/include -DMACOSX=1"
        LIBS="$FAT_LIBS $LIBS $X_LIBS -L/usr/X11R6/lib -multiply_defined warning -lXft -lXrender -lfontconfig"
        COMMONFLAGS="$FAT_COMMONFLAGS"
    else
        CPPFLAGS="$CPPFLAGS $X_CFLAGS -I/usr/X11R6/include -DMACOSX=1"
        dnl fat binaries options
        dnl
        if test "X_$MACOSX" = "X_10.5" ; then
            FAT_COMMONFLAGS="-arch i386 -arch ppc"
        else
            FAT_COMMONFLAGS="-isysroot /Developer/SDKs/$MACSDK -arch i386 -arch ppc"
        fi
        FAT_LIBS=" -flat_namespace -Wl,-syslibroot,/Developer/SDKs/$MACSDK -arch ppc -arch i386 -Wl,-multiply_defined,warning"
        dnl
        COMMONFLAGS="$FAT_COMMONFLAGS"
        dnl -force_flat_namespace as workaround for defect XFree86 4.2 compile
        dnl LIBS="$FAT_LIBS $LIBS $X_LIBS -force_flat_namespace -lXft"
        dnl known to work in MacOSX 10.4.2 "tiger"
        LIBS="$FAT_LIBS $LIBS $X_LIBS -multiply_defined warning -lXft -lXrender -lfontconfig"
        if test "X_$MACOSX" = "X_10.5" ; then
           dnl yet another workaround for MacOSX 10.5 "leopard"
           LIBS="$LIBS -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
        fi
        LIBS="-L/usr/X11R6/lib $LIBS "
    fi
    dnl check for Firefox or Internet explorer (cortona VRML browser)
    if test -d "/Applications/Firefox.app" ; then
       WWWBROWSER="/usr/bin/open -a \\\"/Applications/Firefox.app\\\""
       VRMLBROWSER="/usr/bin/open -a \\\"/Applications/Firefox.app\\\""
    else
       if test -d "/Applications/Internet Explorer.app" ; then
          if test "X_$WWWBROWSER" = "X_" ; then
             WWWBROWSER="/usr/bin/open -a \\\"/Applications/Internet Explorer.app\\\""
          fi
          if test "X_$VRMLBROWSER" = "X_" ; then
             VRMLBROWSER="/usr/bin/open -a \\\"/Applications/Internet Explorer.app\\\""
          fi
       fi
    fi
    (DUNE=$PWD/bin/dune && cd desktop/macosx/white_dune.app/Contents/MacOS && rm -f dune && ln -s $DUNE .) 
    if test -d "/Applications/X11.app" ; then    
       if test -x "/usr/bin/open" ; then    
          AC_DEFINE_UNQUOTED(HAVE_X11STARTCOMMAND,"/usr/bin/open -a /Applications/X11.app/Contents/MacOS/X11")
       else
          AC_DEFINE_UNQUOTED(HAVE_X11STARTCOMMAND,"/Applications/X11.app/Contents/MacOS/X11")
       fi
    else 
       if test -d "/Applications/Utilities/X11.app" ; then
          if test -x "/usr/bin/open" ; then    
             AC_DEFINE_UNQUOTED(HAVE_X11STARTCOMMAND,"/usr/bin/open -a /Applications/Utilities/X11.app/Contents/MacOS/X11")
          else
             AC_DEFINE_UNQUOTED(HAVE_X11STARTCOMMAND,"/Applications/Utilities/X11.app/Contents/MacOS/X11")
          fi
       else 
          if test -f "/usr/X11R6/bin/X" ; then
             AC_DEFINE_UNQUOTED(HAVE_X11STARTCOMMAND,"/usr/X11R6/bin/X")
          else
             AC_DEFINE_UNQUOTED(HAVE_X11STARTCOMMAND,"X")
          fi
       fi
    fi     
    if test "X_$SDL_JOYSTICK_MACOSX" = "X_yes" ; then
       if test "X_$MACOSX" = "X_10.6" ; then
          dnl yet another workaround for MacOSX 10.6 "snowleopard"
          SYSTEM_LIBS="$SYSTEM_LIBS -lIOKit"   
       else
          SYSTEM_LIBS="$SYSTEM_LIBS -framework IOKit"   
       fi
       LIBS="$LIBS $SYSTEM_LIBS"
       SDL_JOYSTICK_SUBDIR="darwin"
       SDL_JOYSTICK_LIBS="SDLjoystick/libSDLjoystick.a"
    fi   
elif test "X_$OS" = "X_NetBSD" ; then
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
    LIBS="$LIBS $X_LIBS"
    SDL_JOYSTICK_BSD="yes"
elif test "X_$OS" = "X_OpenBSD" ; then
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
    LIBS="$LIBS $X_LIBS"
    SDL_JOYSTICK_BSD="yes"
    CPPFLAGS="$CPPFLAGS -I/usr/local/include/libpng"
elif test "X_$OS" = "X_FreeBSD" ; then
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
    LIBS="$LIBS $X_LIBS -lXft"
    SDL_JOYSTICK_BSD="yes"
elif test "X_$OS" = "X_AIX" ; then
    CPPFLAGS="$CPPFLAGS -DAIX=1"
    export CPPFLAGS
elif test "X_$OS" = "X_HP-UX" ; then
    CPPFLAGS="$CPPFLAGS -I/usr/contrib/X11R6/include -I/opt/graphics/OpenGL/include -I/usr/include/Motif2.1"
    export CPPFLAGS
    LDFLAGS="$LDFLAGS -L/opt/graphics/OpenGL/lib -L/usr/lib/Motif2.1 -L/usr/contrib/X11R6/lib"
    export LDFLAGS
elif test "X_$OS" = "X_OSF1"; then
    LDFLAGS="$LDFLAGS -lrt"
fi
export LD_OPTIONS
AC_SUBST(LD_OPTIONS)
export PARSER_CPP_FLAG
AC_SUBST(PARSER_CPP_CFLAG)
export CPPFLAGS
AC_SUBST(CPPFLAGS)
export COMMONFLAGS
AC_SUBST(COMMONFLAGS)
export CFLAGS
AC_SUBST(CFLAGS)
export CXXFLAGS
AC_SUBST(CXXFLAGS)

if test "X_$CC" != "X_" ; then
    AC_MSG_CHECKING($CC support -I/usr/local/include)
    cat > /tmp/_white_dune_test_$$.c << EOF
    int main(int argc, char** argv)
        {
        return 0;
        }
EOF
    if test "X_$USRLOCALINCLUDE" != "X_no" ;then 
        if $CC -I/usr/local/include -c -o /tmp/_white_dune_test_$$.o /tmp/_white_dune_test_$$.c ; then
           CPPFLAGS="$CPPFLAGS -I/usr/local/include"
           LDFLAGS="$LDFLAGS -L/usr/local/lib"
           echo yes
        else 
           echo no
        fi
        rm -f /tmp/_white_dune_test_$$.c
        rm -f /tmp/_white_dune_test_$$.o
    fi
fi

if test "X_$VRMLBROWSER" = "X_" ;then
   dnl check for known vrmlbrowsers
   AC_PATH_PROGS(VRMLBROWSER,[/opt/instantReality/bin/InstantPlayer /Applications/FreeWRL/FreeWRL.app/Contents/MacOS/FreeWRL freewrl cc3dglut xj3d vrwave lookat])
fi

if test "X_$VRMLBROWSER" = "X_" ;then
   if test "X_$WWWBROWSER" != "X_" ;then
      VRMLBROWSER=$WWWBROWSER
   fi 
fi

NETSCAPE_OPENURL=FALSE
if test  "`basename \"$WWWBROWSER\"`" = "netscape" ; then
   NETSCAPE_OPENURL=TRUE
fi
if test  "`basename \"$WWWBROWSER\"`" = "mozilla" ; then
   NETSCAPE_OPENURL=TRUE
fi
if test  "`basename \"$WWWBROWSER\"`" = "firefox" ; then
   NETSCAPE_OPENURL=TRUE
fi
if test  "`basename \"$WWWBROWSER\"`" = "seamonkey" ; then
   NETSCAPE_OPENURL=TRUE
fi
if test  "`basename \"$WWWBROWSER\"`" = "galeon" ; then
   NETSCAPE_OPENURL=TRUE
fi

if test  "X_$NETSCAPE_OPENURL" = "X_TRUE" ; then
   VRMLREMOTEBROWSER="$WWWBROWSER -remote OpenURL\\\\(%s\\\\)"
else
   if test "X_$VRMLBROWSER" != "X_" ;then
      VRMLREMOTEBROWSER="$VRMLBROWSER %s"
   fi
fi
AC_DEFINE_UNQUOTED(HAVE_VRML_REMOTE_BROWSER,"${VRMLREMOTEBROWSER}")

if test "X_$VRMLBROWSER" != "X_" ;then
   AC_DEFINE_UNQUOTED(HAVE_VRML_BROWSER,"${VRMLBROWSER} %s")
fi

NETSCAPE_OPENURL=FALSE
if test  "`basename \"$WWWBROWSER\"`" = "netscape" ; then
   NETSCAPE_OPENURL=TRUE
fi
if test  "`basename \"$WWWBROWSER\"`" = "mozilla" ; then
   NETSCAPE_OPENURL=TRUE
fi
if test  "`basename \"$WWWBROWSER\"`" = "phoenix" ; then
   NETSCAPE_OPENURL=TRUE
fi
if test  "`basename \"$WWWBROWSER\"`" = "galeon" ; then
   NETSCAPE_OPENURL=TRUE
fi

if test  "X_$NETSCAPE_OPENURL" = "X_TRUE" ; then
   WWWREMOTEBROWSER="$WWWBROWSER -remote OpenURL\\\\(%s\\\\)"
else
   if test "X_$WWWBROWSER" != "X_" ;then
      WWWREMOTEBROWSER="$WWWBROWSER %s &"
   fi
fi
AC_DEFINE_UNQUOTED(HAVE_WWW_BROWSER,"${WWWREMOTEBROWSER}")

if test "X_$AVOID_RANLIB" = "X_yes" ; then
   RANLIB=echo
   export RANLIB 
else
   AC_PATH_PROGS(RANLIB,ranlib,echo)
fi

if test "X_$SDL_JOYSTICK" != "X_no" ; then

   if test "X_$SDL_JOYSTICK_LINUX" = "X_yes" ; then
      dnl from configure.in of SDL for joystick
      dnl Check for Linux 2.4 unified input event interface support
      AC_ARG_ENABLE(input-events,
           [  --enable-input-events   use Linux 2.4 unified input interface [default=yes]],
                     , enable_input_events=yes)
       if true; then
           AC_MSG_CHECKING(for Linux 2.4 unified input interface)
           use_input_events=no
           AC_TRY_COMPILE([
             #include <linux/input.h>
           ],[
             #ifndef EVIOCGNAME
             #error EVIOCGNAME() ioctl not available
             #endif
           ],[
           use_input_events=yes
           ])
           AC_MSG_RESULT($use_input_events)
           if test x$use_input_events = xyes; then
               SDLCFLAGS="-DUSE_INPUT_EVENTS"
               SDL_JOYSTICK_SUBDIR="linux"
               SDL_JOYSTICK_LIBS="SDLjoystick/libSDLjoystick.a"
           fi
       fi
   fi
   
   if test "X_$SDL_JOYSTICK_BSD" = "X_yes" ; then
      dnl from configure.in of SDL for joystick
      dnl Check for the usbhid(3) library on *BSD
      if true ; then
           have_libusbhid=no
           have_libusb=no
           AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
           AC_CHECK_LIB(usb, hid_init, have_libusb=yes)
           if test x$have_libusbhid = xyes; then
               SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
           fi
           if test x$have_libusb = xyes; then
               SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
           fi
   
           AC_CHECK_HEADER(usb.h, have_usb_h=yes)
           AC_CHECK_HEADER(usbhid.h, have_usbhid_h=yes)
           AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
           AC_CHECK_HEADER(libusbhid.h, have_libusbhid_h=yes)
           if test x$have_usb_h = xyes; then
               SDLCFLAGS="$SDLCFLAGS -DHAVE_USB_H"
               LIBS="$LIBS $SYSTEM_LIBS"
               SDL_JOYSTICK_SUBDIR="bsd"
               SDL_JOYSTICK_LIBS="SDLjoystick/libSDLjoystick.a"
           fi
           if test x$have_usbhid_h = xyes; then
               SDLCFLAGS="$SDLCFLAGS -DHAVE_USBHID_H"
               LIBS="$LIBS $SYSTEM_LIBS"
               SDL_JOYSTICK_SUBDIR="bsd"
               SDL_JOYSTICK_LIBS="SDLjoystick/libSDLjoystick.a"
           fi
           if test x$have_libusb_h = xyes; then
               SDLCFLAGS="$SDLCFLAGS -DHAVE_LIBUSB_H"
               LIBS="$LIBS $SYSTEM_LIBS"
               SDL_JOYSTICK_SUBDIR="bsd"
               SDL_JOYSTICK_LIBS="SDLjoystick/libSDLjoystick.a"
           fi
           if test x$have_libusbhid_h = xyes; then
               SDLCFLAGS="$SDLCFLAGS -DHAVE_LIBUSBHID_H"
               LIBS="$LIBS $SYSTEM_LIBS"
               SDL_JOYSTICK_SUBDIR="bsd"
               SDL_JOYSTICK_LIBS="SDLjoystick/libSDLjoystick.a"
           fi
   
           AC_MSG_CHECKING(for usbhid)
           have_usbhid=no
           AC_TRY_COMPILE([
             #include <sys/types.h>
             #if defined(HAVE_USB_H)
             #include <usb.h>
             #endif
             #include <dev/usb/usb.h>
             #include <dev/usb/usbhid.h>
             #if defined(HAVE_USBHID_H)
             #include <usbhid.h>
             #elif defined(HAVE_LIBUSB_H)
             #include <libusb.h>
             #elif defined(HAVE_LIBUSBHID_H)
             #include <libusbhid.h>
             #endif
           ],[
             struct report_desc *repdesc;
             struct usb_ctl_report *repbuf;
             hid_kind_t hidkind;
           ],[
           have_usbhid=yes
           ])
           AC_MSG_RESULT($have_usbhid)
   
           if test x$have_usbhid = xyes; then
               AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
               have_usbhid_ucr_data=no
               AC_TRY_COMPILE([
                 #include <sys/types.h>
                 #if defined(HAVE_USB_H)
                 #include <usb.h>
                 #endif
                 #include <dev/usb/usb.h>
                 #include <dev/usb/usbhid.h>
                 #if defined(HAVE_USBHID_H)
                 #include <usbhid.h>
                 #elif defined(HAVE_LIBUSB_H)
                 #include <libusb.h>
                 #elif defined(HAVE_LIBUSBHID_H)
                 #include <libusbhid.h>
                 #endif
               ],[
                 struct usb_ctl_report buf;
                 if (buf.ucr_data) { }
               ],[
               have_usbhid_ucr_data=yes
               ])
               if test x$have_usbhid_ucr_data = xyes; then
                   SDLCFLAGS="$SDLCFLAGS -DUSBHID_UCR_DATA"
                   LIBS="$LIBS $SYSTEM_LIBS"
                   SDL_JOYSTICK_SUBDIR="bsd"
                   SDL_JOYSTICK_LIBS="SDLjoystick/libSDLjoystick.a"
               fi
               AC_MSG_RESULT($have_usbhid_ucr_data)
               
   	    AC_MSG_CHECKING(for new usbhid API)
               have_usbhid_new=no
               AC_TRY_COMPILE([
                 #include <sys/types.h>
                 #if defined(HAVE_USB_H)
                 #include <usb.h>
                 #endif
                 #include <dev/usb/usb.h>
                 #include <dev/usb/usbhid.h>
                 #if defined(HAVE_USBHID_H)
                 #include <usbhid.h>
                 #elif defined(HAVE_LIBUSB_H)
                 #include <libusb.h>
                 #elif defined(HAVE_LIBUSBHID_H)
                 #include <libusbhid.h>
                 #endif
               ],[
                 report_desc_t d;
   	      hid_start_parse(d, 1, 1);
               ],[
               have_usbhid_new=yes
               ])
               if test x$have_usbhid_new = xyes; then
                   SDLCFLAGS="$SDLCFLAGS -DUSBHID_NEW"
                   LIBS="$LIBS $SYSTEM_LIBS"
                   SDL_JOYSTICK_SUBDIR="bsd"
                   SDL_JOYSTICK_LIBS="SDLjoystick/libSDLjoystick.a"
               fi
               AC_MSG_RESULT($have_usbhid_new)
           fi
       fi
   fi
   
   AC_SUBST(SDLCFLAGS)
   AC_SUBST(SDL_JOYSTICK_SUBDIR)
   AC_SUBST(SDL_JOYSTICK_LIBS)
   
   if test "X_$SDL_JOYSTICK_SUBDIR" != "X_" ; then
      AC_DEFINE(HAVE_SDL_JOYSTICK)    
   fi
fi

LDFLAGS="$LDFLAGS $OPTIM"
export LDFLAGS

dnl extend CC with $CPPFLAGS for tests 

OLD_CC=$CC
CC="$CC $CPPFLAGS"
export CC


dnl Checks for header files.

AC_HEADER_STDC
AC_CHECK_HEADER(stdarg.h, AC_DEFINE(HAVE_STDARG_H))
AC_CHECK_HEADER(varargs.h, AC_DEFINE(HAVE_VARARGS_H))

AC_CHECK_HEADER(Xm/Xm.h, , MOTIF_ERROR=1)

if test "X_$MOTIF_ERROR" = "X_1" ; then
[ 
cat 1>&2 << EOF

 *** couldn't find Motif/Lesstif develop file ***

 This package will not compile without a Motif/Lesstif devel package.  
 If Motif is not available, or too bloody expensive, you can use LessTif, 
 which is available open source from:

	http://www.lesstif.org/download.html

EOF
 exit 1
]
fi

AC_CHECK_HEADER(X11/Xlib.h,,X11_ERROR=1)
AC_CHECK_HEADER(X11/keysym.h,,X11_ERROR=1)
AC_CHECK_HEADER(X11/cursorfont.h,,X11_ERROR=1)
AC_CHECK_HEADER(X11/Intrinsic.h,,X11_ERROR=1)
AC_CHECK_HEADER(X11/IntrinsicP.h,,X11_ERROR=1)

if test "X_$X11_ERROR" = "X_1" ; then
[
 cat 1>&2 << EOF

 *** couldn't find basic X11 develop file ***

 This package will not compile without serveral X11 library headers

EOF
 exit 1
]
fi

dnl Checks for libraries.
AC_HAVE_LIBRARY(dl)
if test "X_$NEBULA" != "X_" ;then
   AC_HAVE_LIBRARY(stlport_gcc)
fi
AC_CHECK_FUNCS(atexit)
AC_CHECK_FUNCS(_exit)
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(gettimeofday)
AC_CHECK_LIB(m, sin)
AC_CHECK_FUNCS(powf)
AC_CHECK_FUNCS(powl)
AC_CHECK_FUNCS(rint)
if test "X_$WITH_ODE" = "X_yes" ; then
   AC_CHECK_LIB(ode, dWorldCreate)
fi
AC_CHECK_LIB(X11, XCreateWindow)
AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
AC_CHECK_LIB(Xt, XtCreateWidget)
AC_CHECK_LIB(Xext, XShmQueryVersion)

dnl http://bugs.debian.org/623652
dnl AC_HAVE_LIBRARY(Xp)

AC_CHECK_LIB(Xm, XmCreateMainWindow , , MOTIF_ERROR=1)
if test "X_$MOTIF_ERROR" = "X_1" ; then
[ 
cat 1>&2 << EOF

 *** couldn't find a working Motif/Lesstif development system ***
 
 This package will not compile without a working Motif/Lesstif development 
 system.
 
 Inspect the config.log file to find out, what part of the Motif/Lesstif X11 
 development system is not available/working.

 If Motif or OpenMotif is not available, or too expensive, you can use LessTif, 
 which is available open source from:

	http://www.lesstif.org/download.html

EOF
 exit 1
]
fi
if test "X_$OS" = "X_SunOS" ; then
 dnl Warn about known problematic LessTif implementations
 if (pkginfo | grep LessTif) ; then
  echo xxxxxxxxx Warning xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  echo Solaris can deliver a doubtfull version of LessTif in /opt/sfw/LessTif 
  echo e.g. 0.92.26
  echo  
  echo if you click to a icon, but get no reaction, temporary deinstall 
  echo the LessTif package and install a modern version of LessTif 
  echo or use:
  echo 
  echo rm -f config.cache
  echo  sh ./configure --with-buginlesstif 
  echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 fi
fi
AC_CHECK_HEADER(X11/extensions/XInput.h, AC_DEFINE(HAVE_XINPUT))
AC_CHECK_LIB(Xi, XOpenDevice)

AC_CHECK_HEADER(GL/gl.h,,GL_ERROR=1)
AC_CHECK_HEADER(GL/glu.h,,GLU_ERROR=1)

if test "X_$GLU_ERROR" = "X_1" ; then
   echo "GLU Library header (part of OpenGL/Mesa) not found"
   GL_ERROR=1
fi

if test "X_$GL_ERROR" = "X_1" ; then
[
 cat 1>&2 << EOF

 *** couldn't find OpenGL develop file ***

 This package will not compile without OpenGL.  If your OS does not
 support it natively you can use Mesa, the open source OpenGL workalike.
 Mesa is available for download from:

	http://www.mesa3d.org/download.html

EOF
 exit 1
]
fi

AC_CHECK_LIB(GL, glBegin , , GL_ERROR=1)
if test "X_$GL_ERROR" = "X_1" ; then
   AC_CHECK_LIB(MesaGL, glBegin , GL_ERROR=0)
fi
AC_CHECK_FUNCS(glVertex3f)
AC_CHECK_FUNCS(glDeleteTextures)
AC_CHECK_FUNCS(glGenTextures)
AC_CHECK_FUNCS(glBindTexture)
AC_CHECK_LIB(GLU, gluProject , , GLU_ERROR=1)
if test "X_$GLU_ERROR" = "X_1" ; then
   AC_CHECK_LIB(MesaGLU, gluProject , GLU_ERROR=0)
fi

if test "X_$GLU_ERROR" = "X_1" ; then
   echo "GLU library (part of OpenGL/Mesa) problem"
   GL_ERROR=1
fi

if test "X_$GL_ERROR" = "X_1" ; then
[
 cat 1>&2 << EOF

 *** OpenGL library problem ***

 This package will not compile without a working OpenGL development system.  

 Inspect the config.log file to find out, what part of the OpenGL
 development system is not available/working.

 If your OS does not support it natively you can use Mesa, the open source 
 OpenGL workalike. 
 Mesa is available for download from:

	http://www.mesa3d.org/download.html

EOF
 exit 1
]
fi

AC_CHECK_FUNCS(gluNewTess)

AC_MSG_CHECKING(for _GLUfuncptr)
AC_TRY_LINK(
            [
              #include "GL/gl.h"
              #include "GL/glu.h"
              static void Callback(GLenum type, void *data)
                 {}
              void test_GLUfuncptr(void) {
                   GLUtesselator *tess=0;
                   gluTessCallback(tess, GLU_TESS_BEGIN_DATA, 
		                   (_GLUfuncptr)0);
					   
                   }
            ],
            [
             /* dummy */
            ],
            echo  yes;AC_DEFINE(HAVE_GLU_FUNC_PTR),
            echo  no
           )

dnl check for Mesa Off Screen rendering

if test "X_$HAVE_WANT_OSMESA" = "yes" ; then
   AC_CHECK_LIB(OSMesa,OSMesaMakeCurrent)
   AC_CHECK_FUNCS(OSMesaCreateContext)
   AC_CHECK_FUNCS(OSMesaCreateContextExt)
fi

dnl use prefined libraries for libexpat
AC_CHECK_LIB(expat, XML_ParserCreate, ,EXPAT_ERROR=1)
if test "X_$EXPAT_ERROR" = "X_1" ; then
   cat 1>&2 << EOF

*** couldn't find matching libexpat version, libexpat 2.0.1 would work ***

Couldn't find libexpat, the XML parsing C library.
This is not a fatal error; the package will be simply built without
the possiblity to read XML encoded X3D files (ISO/IEC 19776-1).  
It is recommended to add it, download and install it from:

	http://expat.sourceforge.net

and re-run configure.

EOF
   EXPAT_WARNING="no usable expat library: no parsing of XML encoded X3D (ISO/IEC 19776-1)"
fi


dnl use prefined libraries for libz, libpng, libjpeg 
if test "X_$LIBS_Z_PNG_JPEG" != "X_" ; then
   AC_DEFINE(HAVE_LIBPNG)
   AC_DEFINE(HAVE_LIBZ)
   AC_DEFINE(HAVE_LIBJPEG)
   LIBS="$LIBS_Z_PNG_JPEG $LIBS"    
else
   AC_CHECK_LIB(z, gzopen, , ZLIB_ERROR=1)
   if test "X_$ZLIB_ERROR" = "X_1" ; then
      cat 1>&2 << EOF

*** couldn't find working zlib (==libz) version, zlib 1.1.3 would work ***

Couldn't find zlib(==libz) develop package.
zlib/libz is a library for lossless data-compression.
This is not a fatal error; the package will be simply built without
support to open gz compressed VRML files. Some versions of the png library 
also need zlib for linking.
It is recommended to add it, download and install it from:

	http://www.gzip.org/zlib/

and re-run configure.

EOF
      ZLIB_WARNING="no usable zlib (==libz) library: no reading of compressed VRML files, possibly no rendering of png textures"
   fi

   if test "X_$HAVE_OLPC" = "X_1" ; then
      AC_CHECK_LIB(expat, XML_ExpatVersion)
      AC_CHECK_LIB(freetype, FT_Library_Version)
      AC_CHECK_LIB(fontconfig, FcGetVersion)
      AC_CHECK_LIB(Xrender, XRenderQueryVersion)
      AC_CHECK_LIB(Xft, XftGetVersion)
   fi

   if test "X_$DEVIL" != "X_no" ; then
 
      AC_CHECK_LIB(IL, ilInit , , HAVE_IL=no)

      if test "X_$HAVE_IL" != "X_no" ; then
         AC_CHECK_LIB(ILU, iluInit , , HAVE_ILU=no)
         if test "X_$HAVE_ILU" != "X_no" ; then
            HAVE_ILU=yes
         fi
      fi
   fi

   if test "X_$HAVE_ILU" != "X_yes" ; then

      AC_CHECK_LIB(jpeg, jpeg_start_decompress, ,JPEG_ERROR=1)
      if test "X_$JPEG_ERROR" = "X_1" ; then
         cat 1>&2 << EOF

*** couldn't find matching libjpeg version, libjpeg-6b would work ***

Couldn't find libjpeg, the Indepedent JPEG group's jpeg library.
This is not a fatal error; the package will be simply built without
jpeg support.  It is recommended to add it, download and install it from:

	http://www.ijg.org/
	ftp://ftp.uu.net/graphics/jpeg/

and re-run configure.

EOF
         JPEG_WARNING="no usable jpeg library: no rendering of jpg textures"
      fi

      AC_CHECK_LIB(png, png_get_IHDR, ,PNG_ERROR=1)
      if test "X_$PNG_ERROR" = "X_1" ; then
         cat 1>&2 << EOF

*** couldn't find matching libpng version, libpng-1.06 would work ***

Couldn't find libpng, the Portable Network Graphics library.
This is not a fatal error; the package will be simply built without
png support.  It is recommended to add it, download and install it from:

	http://www.libpng.org/pub/png/

and re-run configure.

EOF
         PNG_WARNING="no usable libpng library: no rendering of png textures"
      fi
   fi
fi

AC_MSG_CHECKING(for png_handle_unknown linking)
AC_TRY_LINK(
            [
              #include "png.h"
              #include <setjmp.h>
              void png_handle_unknown PNGARG((png_structp png_ptr,
                    png_infop info_ptr, png_uint_32 length)) 
                    { longjmp(NULL, 0); }
            ],
            [
             /* dummy */
            ],
            echo  yes,
            echo  no;AC_DEFINE(HAVE_NO_PNG_HANDLE_UNKNOWN)
           )

AC_CHECK_HEADER(linux/joystick.h,AC_DEFINE(LINUX_JOYSTICK))
AC_CHECK_HEADER(sball.h, SBALL_HEADER=yes;export SBALL_HEADER)
if test "X_$SBALL_HEADER" = "X_yes" ; then
 AC_CHECK_LIB(sball, sball_open)
fi
if test "X_$HAVE_WANT_USB" != "X_no" ; then
 AC_CHECK_LIB(usb, usb_init)
fi

if test "X_$HAVE_WANT_EFENCE" = "X_yes" ; then
   AC_CHECK_LIB(efence, Page_AllowAccess)
fi

if test "X_$HAVE_WANT_DUMA" = "X_yes" ; then
   // duma usually use the pthread library
   AC_CHECK_LIB(pthread, pthread_start_thread)
   AC_CHECK_LIB(duma, Page_AllowAccess)
fi

dnl check for signal_handler(int);

AC_MSG_CHECKING(for signal_handler(int))
cat > /tmp/test_$$.cpp << EOT
#include <signal.h>
   void signal_fatal_handler(int sign){}
   int main(int argc,char** argv) {signal(1,&signal_fatal_handler);return 0;}
EOT
$CXX -o /tmp/a_$$.out /tmp/test_$$.cpp 2>/dev/null > /dev/null
RET=$?
if test "X_$RET" = "X_0" ;then
  AC_DEFINE(HAVE_SIGNAL_INT)
  echo yes
else
  echo no
fi
rm -f /tmp/a_$$.out /tmp/test_$$.cpp

dnl check for typename 

AC_MSG_CHECKING(for typename)
cat > /tmp/test_$$.cpp << EOT
template <class c> class a { typedef typename c::d e;};
EOT
$CXX -c -o /tmp/a_$$.out /tmp/test_$$.cpp 2>/dev/null > /dev/null
RET=$?
if test "X_$RET" = "X_0" ;then
  AC_DEFINE(HAVE_TYPENAME)
  echo yes
else
  echo no
fi
rm -f /tmp/a_$$.out /tmp/test_$$.cpp

dnl check if -fpermissive is needed for g++
if test "X_"`echo $CXX|awk '{print $1}'` = "X_g++" ; then

   AC_MSG_CHECKING(for g++ -fpermissive)
   cat > /tmp/test_$$.cpp << EOT
   #include <stddef.h>

   class test {};

   test *ptr = NULL;
EOT
   $CXX -c -o /tmp/a_$$.out /tmp/test_$$.cpp 2>/dev/null > /dev/null
   RET=$?
   if test "X_$RET" = "X_0" ;then
      echo not needed
   else
      echo yes
      CXXFLAGS="$CXXFLAGS -fpermissive"
   fi
   rm -f /tmp/a_$$.out /tmp/test_$$.cpp
fi

AC_MSG_CHECKING(for -std=c99)
cat > /tmp/test_$$.c << EOT
int main(int argc, char** argv) {return 0;}
EOT
$CC -std=c99 -c -o /tmp/test_$$.o /tmp/test_$$.c 2>/dev/null > /dev/null
RET=$?
if test "X_$RET" = "X_0" ;then
  C99="-std=c99"
  AC_SUBST(C99)
  echo yes
else
  echo no
fi
rm -f /tmp/test_$$.o /tmp/test_$$.c

AC_MSG_CHECKING(for fpclassify)
AC_TRY_LINK(
               [
                 #include "math.h"
               ],
               [
                 int result = fpclassify(1);
               ],
               echo yes;AC_DEFINE(HAVE_FPCLASSIFY),echo no;TEST_XOPEN_SOURCE=yes
               )

if test "$TEST_XOPEN_SOURCE" = yes ; then
   AC_MSG_CHECKING(for _XOPEN_SOURCE 600 for fpclassify)
   AC_TRY_LINK(
               [
                 #define _XOPEN_SOURCE 600
                 #include "math.h"
               ],
               [
                 int result = fpclassify(1);
               ],
               echo yes;AC_DEFINE(HAVE_XOPEN_SOURCE_4_FPCLASSIFY),echo no
               )
fi

AC_MSG_CHECKING(for isless)
AC_TRY_LINK(
               [
                 #include "math.h"
               ],
               [
                 int result = isless(0.0,1.1);
               ],
               echo yes;AC_DEFINE(HAVE_ISLESS),echo no
               )

AC_MSG_CHECKING(for termios.c_ospeed)
cat > /tmp/test_$$.cpp << EOT
#include <termios.h>
   void test(void) {struct termios t;t.c_ospeed=B19200}
EOT
$CXX -o /tmp/a_$$.out /tmp/test_$$.cpp 2>/dev/null > /dev/null
RET=$?
if test "X_$RET" = "X_0" ;then
  AC_DEFINE(HAVE_C_OSPEED)
  echo yes
else
  echo no
fi
rm -f /tmp/a_$$.out /tmp/test_$$.cpp

dnl check for libefence.a

ARXSTRDUP_O="echo no way to extract strdup efence may fail in strdup"
STRDUP_O=

LIBEFENCE_A=
EFENCE_EXTRA_LIBS=
AC_MSG_CHECKING(for libefence.a location)
for i in /usr/lib32 /usr/lib /usr/local/lib32 /usr/local/lib ; do
   if test -f $i/libefence.a ; then 
       LIBEFENCE_A=$i/libefence.a
       export LIBEFENCE_A

       EFENCE_EXTRA_LIBS=-lpthread
       export EFENCE_EXTRA_LIBS
   fi
done
if test "X_$LIBEFENCE_A" != "X_" ; then 
    echo $LIBEFENCE_A
    AC_MSG_CHECKING(for strdup extraction)
    CURRENT_DIR=$PWD
    cd /tmp && 
        if ar x /usr/lib/libc.a strdup.o ;then 
           echo yes

           ARXSTRDUP_O="(cd /tmp && ar x /usr/lib/libc.a strdup.o)"
           export ARXSTRDUP_O

           STRDUP_O=/tmp/strdup.o
           export STRDUP_O

           rm -f $STRDUP_O
        else
           echo no
        fi
    cd $CURRENT_DIR
else
    echo none 
fi
AC_SUBST(LIBEFENCE_A)
AC_SUBST(EFENCE_EXTRA_LIBS)    

LIBDUMA_A=
DUMA_EXTRA_LIBS=
AC_MSG_CHECKING(for libduma.a location)
for i in /usr/lib32 /usr/lib /usr/local/lib32 /usr/local/lib ; do
   if test -f $i/libduma.a ; then 
       LIBDUMA_A=$i/libduma.a
       export LIBDUMA_A

       DUMA_EXTRA_LIBS=-lpthread
       export DUMA_EXTRA_LIBS
   fi
done
if test "X_$LIBDUMA_A" != "X_" ; then 
    echo $LIBDUMA_A
    AC_MSG_CHECKING(for strdup extraction)
    CURRENT_DIR=$PWD
    cd /tmp && 
        if ar x /usr/lib/libc.a strdup.o ;then 
           echo yes

           ARXSTRDUP_O="(cd /tmp && ar x /usr/lib/libc.a strdup.o)"
           export ARXSTRDUP_O

           STRDUP_O=/tmp/strdup.o
           export STRDUP_O

           rm -f $STRDUP_O
        else
           echo no
        fi
    cd $CURRENT_DIR    
else
    echo none 
fi
AC_SUBST(LIBDUMA_A)
AC_SUBST(DUMA_EXTRA_LIBS)    

AC_SUBST(ARXSTRDUP_O)
AC_SUBST(STRDUP_O)

dnl build version number

DUNE_VERSION="white_dune `batch/getversion.sh`"
AC_DEFINE_UNQUOTED(HAVE_DUNE_VERSION,"${DUNE_VERSION}")

dnl automatic generate functions/lists for VRML types (e.g. SFBool <=> SFBOOL)

sh batch/mkSFMFTypes.sh

dnl CC="$OLD_CC"
dnl export CC

AC_LANG_CPLUSPLUS

AC_MSG_CHECKING(for new handler)
AC_TRY_COMPILE(
                  [
                    #include <new.h>
                  ],
                  [
                    void handler(void);
                    set_new_handler(handler);
                  ],
                  echo yes;AC_DEFINE(HAVE_NEW_HANDLER),echo no
                 )

AC_MSG_CHECKING(for new new handler)
AC_TRY_COMPILE(
                  [
                    #include <new>
                    void handler(void);
                  ],
                  [
                    std::set_new_handler(handler);
                  ],
                  echo yes;AC_DEFINE(HAVE_NEW_NEW_HANDLER),echo no
                 )

CC="$OLD_CC"
export CC

dnl generate command to generate dune.rc file from dune.*.rc files
RCFILE_FIRST=dune.english.rc
RCFILE_REST=`cd src && ls dune.*.rc | grep -v $RCFILE_FIRST | xargs echo` 
RESOURCE_FILES="$RCFILE_FIRST $RCFILE_REST"
AC_SUBST(RESOURCE_FILES)

dnl generate command to test icon size
AC_PATH_PROGS(BMPTOPNM,[bmptopnm])
if test "X_$BMPTOPNM" = "X_" ; then
   echo "unable to test for icon size without bmptopnm (harmless)" 1>&2
   TESTICONSIZE="@echo no bmptopnm: can not compare iconsize of "
   TESTICONSIZE2="@echo no bmptopnm: can not compare iconsize of "
else
   TESTICONSIZE="../batch/testiconsize.sh $BMPTOPNM"
   TESTICONSIZE2="../batch/testiconsize2.sh $BMPTOPNM"
fi
AC_SUBST(TESTICONSIZE)
AC_SUBST(TESTICONSIZE2)

AC_PATH_PROGS(IMAGECONVERTER,[convert])
if test "X_$IMAGECONVERTER" = "X_" ; then
   echo "unable to convert textures to bmp for ac3d export" 1>&2
fi
AC_SUBST(IMAGECONVERTER)

AC_PATH_PROGS(JAVAC,javac,echo)
AC_SUBST(JAVAC)
if test "X_$JAVAC" = "X_" ; then
    JAVA="echo"
else
    AC_PATH_PROGS(JAVA,java,echo)
fi
AC_SUBST(JAVA)

LIBS="$LIBS $EXTRA_LIBS"

AC_OUTPUT(src/Makefile src/swt/motif/Makefile \
          src/swt/tests/Makefile src/swt/rc/Makefile\
          src/SDLjoystick/Makefile test/Makefile \
          docs/export_example_c/Makefile \
          docs/export_example_c++/Makefile \
          docs/export_example_java/Makefile )

(cd src && make resource.h)

(cd src/swt/motif && make $DUNEMAKEFLAGS depend)
(cd src && make $DUNEMAKEFLAGS depend)

if test "X_" != "X_$SDL_JOYSTICK_SUBDIR" ; then
   (cd src/SDLjoystick && make $DUNEMAKEFLAGS depend)
fi

(cd src/SDLjoystick && touch SDL_error.h)   
(cd src/SDLjoystick && touch SDL_joystick_c.h)

dnl repeat warnings at end

if test "X_$WARNING_LEX" != "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo " " $WARNING_LEX 1>&2
else
    touch src/lexer.l src/swt/rc/rclex.l
fi

if test "X_$WARNING_YACC" != "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo " " $WARNING_YACC 1>&2
else
    touch src/parser.y src/swt/rc/rcparse.y
fi

if test "X_$XLSFONTS_WARNING" != "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo " " $XLSFONTS_WARNING 1>&2
fi

if test "X_$GLUT_WARNING" != "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo " " $GLUT_WARNING 1>&2
fi

if test "X_$ZLIB_WARNING" != "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo " " $ZLIB_WARNING 1>&2
fi

if test "X_$PNG_WARNING" != "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo " " $PNG_WARNING 1>&2
fi

if test "X_$JPEG_WARNING" != "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo " " $JPEG_WARNING 1>&2
fi

if test "X_$EXPAT_WARNING" != "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo " " $EXPAT_WARNING 1>&2
fi

if test "X_$IMAGEEDITOR" = "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo "  no known program to change jpeg (.jpg) and png (.png) files" 1>&2
    echo "  if you have such a program, you should" 1>&2
    echo "  restart configure with the --with-imageeditor= option" 1>&2
fi

if test "X_$SOUNDEDITOR" = "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo "  no known program to change wave (.wav) files" 1>&2
    echo "  if you have such a program, you should" 1>&2
    echo "  restart configure with the --with-soundeditor= option" 1>&2
fi

if test "X_$MOVIEEDITOR" = "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo "  no known program to change mpeg1 (.mpeg) files" 1>&2
    echo "  if you have such a program, you should" 1>&2
    echo "  restart configure with the --with-movieeditor= option" 1>&2
fi

if test "X_$IMAGECONVERTER" = "X_" ; then
    echo " " 1>&2
    echo "Warning:" 1>&2
    echo "  no known program to convert bitmap files (.jpg, .png) to bmp files for ac3d export" 1>&2
    echo "  if you have such a program, you should" 1>&2
    echo "  restart configure with the --with-imageconverter= option" 1>&2
fi

if test "X_$AVOID_RANLIB" = "X_yes" ; then
    if test "X_$OS" = "X_Darwin" ; then
        echo " " 1>&2
        echo "Warning:" 1>&2
        echo "  the usage of the --without-ranlib option may be not wise of MacOSX" 1>&2
        echo "  a lot of MacOSX versions require the usage of the ranlib command" 1>&2
    fi
fi