forked from coin3d/coin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
2661 lines (2291 loc) · 86.3 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
# **************************************************************************
# FIXME: try to fix all problems with spaces in directory names;
# whether it's the src dir, the install/build dir or directories with
# dependent libraries. Alternatively, we should at least detect and
# warn/exit. Ditto goes for all our other software modules aswell, of
# course. 20020519 mortene.
# FIXME: need to figure out when libstdc++ is necessary to link. GCC
# 3.2 on Solaris seems to demand it, or we'll get unresolved symbols.
# 20021128 mortene.
# **************************************************************************
# release version number info
m4_define([COIN_MAJOR], [4])
m4_define([COIN_MINOR], [0])
m4_define([COIN_MICRO], [1])
m4_define([COIN_BETA], [])
# This is probably a more correct setup, but will be harder to keep if
# we want major and minor to grow slowly (but is that any point?)
# 20010807 larsa
m4_define([COIN_ABI_CURRENT], [m4_eval((COIN_MAJOR*20)+COIN_MINOR)])
m4_define([COIN_ABI_REVISION], [COIN_MICRO])
m4_define([COIN_ABI_AGE], [COIN_MINOR])
# only used on Linux for debian packages
m4_define([SO_NUMBER], [m4_eval(COIN_MAJOR*20)])
# For Mac OS X Compiler Frameworks:
m4_define([MAC_FRAMEWORK_NAME_DEFAULT], [Inventor])
m4_define([MAC_FRAMEWORK_PREFIX_DEFAULT], [/Library/Frameworks])
m4_define([MAC_FRAMEWORK_VERSION_DEFAULT], [D])
# **************************************************************************
AC_PREREQ(2.50)
AC_INIT([Coin], [COIN_MAJOR.COIN_MINOR.COIN_MICRO[]COIN_BETA],
AC_CONFIG_AUX_DIR(cfg)
AC_CONFIG_SRCDIR(src/misc/SoDB.cpp)
# FIXME: detect and exit upon this problem (as seen reported on
# coin-bugs): the install prefix is set to the same directory as the
# build directory (or also as the srccode dir). 20020129 mortene.
AH_TOP([
#ifndef COIN_INTERNAL
#error this is a private header file
#endif
#include <unconfig.h>
#include <setup.h>
])
AC_CANONICAL_SYSTEM
# For include/Inventor/system/inttypes.h.
AC_DEFINE_UNQUOTED(COIN_CONFIGURE_BUILD, SIM_AS_TR_CPP([$build]), [Build system.])
AC_DEFINE_UNQUOTED(COIN_CONFIGURE_HOST, SIM_AS_TR_CPP([$host]), [Build host system.])
AC_DEFINE_UNQUOTED(COIN_CONFIGURE_TARGET, SIM_AS_TR_CPP([$target]), [Build target system.])
# date used by debian setup
SIM_AC_DATE_RFC822([RFC822_DATE])
AC_SUBST([RFC822_DATE])
# date used by redhat setup
SIM_AC_ISO8601_DATE([coin_configure_date])
AC_SUBST([coin_configure_date])
SIM_AC_MSVC_DSP_ENABLE_OPTION
# If the Microsoft Visual C++ cl.exe compiler is available, set us up for
# compiling with it and to generate an MSWindows .dll file.
SIM_AC_SETUP_MSVCPP_IFELSE
# **************************************************************************
# Mac OS X: gcc
# old-compat
AC_ARG_WITH([framework],
[ --without-framework (deprecated: use --disable-framework)],
[case "$withval" in
no | false ) enable_framework=false ;;
* ) ;;
esac])
sim_ac_framework_name="MAC_FRAMEWORK_NAME_DEFAULT"
AC_ARG_ENABLE([framework],
[AC_HELP_STRING([--disable-framework],
[Do 'UNIX-style' installation on Mac OS X])],
[case $enableval in
no | false ) sim_ac_framework=false ;;
* ) sim_ac_framework=true ;;
esac],
[case $host_os in
darwin* ) sim_ac_framework=true ;;
* ) sim_ac_framework=false ;;
esac])
AC_ARG_WITH([framework-prefix],
[ --with-framework-prefix=<path> (default: "MAC_FRAMEWORK_PREFIX_DEFAULT")],
[sim_ac_framework_prefix="$withval"
if test x"$sim_ac_framework_prefix" = x""; then
sim_ac_framework_prefix=\${prefix}
fi],
[sim_ac_framework_prefix="MAC_FRAMEWORK_PREFIX_DEFAULT"])
sim_ac_framework_version="MAC_FRAMEWORK_VERSION_DEFAULT"
AC_SUBST([MAC_FRAMEWORK], [$sim_ac_framework])
AC_SUBST([MAC_FRAMEWORK_NAME], [$sim_ac_framework_name])
AC_SUBST([MAC_FRAMEWORK_PREFIX], [$sim_ac_framework_prefix])
AC_SUBST([MAC_FRAMEWORK_VERSION], [$sim_ac_framework_version])
AC_SUBST([nop], [])
frameworkdir=
if $sim_ac_framework; then
frameworkdir="${sim_ac_framework_prefix}/${sim_ac_framework_name}.framework"
includedir="$frameworkdir/Resources/include"
fi
ivincludedir=$includedir
AC_SUBST([ivincludedir])
AC_SUBST([frameworkdir])
# **************************************************************************
ac_build_year=$(date +%Y)
AC_SUBST([COIN_BUILD_YEAR], $ac_build_year)
AC_SUBST([COIN_MAJOR_VERSION], [COIN_MAJOR])
AC_SUBST([COIN_MINOR_VERSION], [COIN_MINOR])
AC_SUBST([COIN_MICRO_VERSION], [COIN_MICRO])
AC_SUBST([COIN_BETA_VERSION], [COIN_BETA])
AC_SUBST([COIN_VERSION], [$COIN_MAJOR_VERSION.$COIN_MINOR_VERSION.$COIN_MICRO_VERSION$COIN_BETA_VERSION])
VERSION=$COIN_VERSION
SIM_AC_CONFIGURATION_SETTING([Library version], [$COIN_VERSION])
# Libtool versioning
AC_SUBST([LT_CURRENT], [COIN_ABI_CURRENT])
AC_SUBST([LT_REVISION], [COIN_ABI_REVISION])
AC_SUBST([LT_AGE], [COIN_ABI_AGE])
AC_SUBST([COIN_SO_VERSION], [SO_NUMBER])
# These are for include/Inventor/C/basic.h.
AC_DEFINE_UNQUOTED([COIN_MAJOR_VERSION], [$COIN_MAJOR_VERSION],
[define this to the libCoin major version number])
AC_DEFINE_UNQUOTED([COIN_MINOR_VERSION], [$COIN_MINOR_VERSION],
[define this to the libCoin minor version number])
AC_DEFINE_UNQUOTED([COIN_MICRO_VERSION], [$COIN_MICRO_VERSION],
[define this to the libCoin release version number])
AC_DEFINE_UNQUOTED([COIN_VERSION], ["$COIN_VERSION"],
[define this to the full libCoin major.minor.micro version number])
if test x"$COIN_BETA_VERSION" = x""; then :; else
AC_DEFINE_UNQUOTED([COIN_BETA_VERSION], [$COIN_BETA_VERSION],
[define this to the libCoin beta version letter])
fi
# *******************************************************************
# Miscellaneous options and initializations.
coin_build_dir=`pwd`
coin_src_dir=`cd "$srcdir"; pwd`
coin_w32_build_dir=`cygpath -w "$coin_build_dir" 2>/dev/null || echo "$coin_build_dir"`
coin_w32_src_dir=`cygpath -w "$coin_src_dir" 2>/dev/null || echo "$coin_src_dir"`
SIM_AC_RELATIVE_SRC_DIR
# *******************************************************************
# set up configure options for "make distcheck" mode - we want to
# ensure that all options that can be turned on works...
AC_MSG_CHECKING([for distcheck mode])
case "$prefix:$coin_build_dir" in
*/=inst:*/=build )
enable_threads=yes
enable_threadsafe=yes
enable_html=yes
enable_man=yes
enable_3ds_import=yes
enable_debug=no
AC_MSG_RESULT([yes])
;;
* )
AC_MSG_RESULT([no])
;;
esac
# **************************************************************************
# Locate C++ compiler and set C++ as the default language to use
# in tests. The configure script will automatically terminate if
# it doesn't find a C++ compiler.
AC_PROG_CC
# AC_OBJEXT
# AC_EXEEXT
# **************************************************************************
# NOTE: if we touch CFLAGS/CXXFLAGS before AC_PROG_CC is invoked, the -g
# flag will be lost 20020104 larsa
if $BUILD_WITH_MSVC; then
SIM_AC_SETUP_MSVCRT([
CPPFLAGS="$CPPFLAGS $sim_ac_msvcrt_CPPFLAGS"
CFLAGS="$CFLAGS $sim_ac_msvcrt_CFLAGS"
CXXFLAGS="$CXXFLAGS $sim_ac_msvcrt_CXXFLAGS"
LDFLAGS="$LDFLAGS $sim_ac_msvcrt_LDFLAGS"
LIBS="$LIBS $sim_ac_msvcrt_LIBS"
# sim_ac_msvcrt_LIBLIBS is set up at the end
# sim_ac_msvcrt_LIBLDFLAGS is set up at the end
])
fi
AC_SUBST([COIN_MSVC_LIBC], [$sim_ac_msvcrt])
AC_SUBST([BUILD_WITH_MSVC])
# **************************************************************************
# Universal Binary support (Mac OS X)
SIM_AC_UNIVERSAL_BINARIES
# **************************************************************************
AM_INIT_AUTOMAKE(Coin, $VERSION)
# Default to not building a static library.
# Can be overridden by the user with --enable-static.
AM_DISABLE_STATIC
# Turn off default maintainer make-rules -- use ./bootstrap instead.
AM_MAINTAINER_MODE
if $BUILD_WITH_MSVC; then
RANLIB=:
export RANLIB
fi
# **************************************************************************
# Locate C++ compiler and set C++ as the default language to use
# in tests. The configure script will automatically terminate if
# it doesn't find a C++ compiler.
#
# Note that due to bugs in the libtool.m4 set of checks (of libtool v1.4.2)
# that makes AC_PROG_LIBTOOL dependent on the current compiler being a C
# compiler, we don't activate the C++ compiler until _after_ running
# AC_PROG_LIBTOOL.
#
# (The specific checks we know not to work are the checks for "-c -o"
# compatibility, where only CFLAGS is set up (and not CXXFLAGS) before the
# check is run).
AC_PROG_CXX
AC_PROG_CXXCPP
# Since the plan is to not compile pure C anymore, we can simplify by always
# setting C++ mode in Coin's configure script.
AC_LANG([C++])
if $BUILD_WITH_MSVC; then
SIM_AC_MSC_VERSION
case "$sim_ac_msc_major_version" in
8 | 9) CPPFLAGS="$CPPFLAGS -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS" ;;
*)
esac
fi
SIM_AC_STRIP_EXIT_DECLARATION
# **************************************************************************
SIM_AC_MACOS10_DEPLOYMENT_TARGET
if test x"$sim_ac_macos10_deployment_target_major_version" = x"10"; then
# AC_DEFINE() COIN_MACOS_10_# as needed here...
sim_ac_macosx=true
sim_ac_macosx_10_2ff=false
sim_ac_macosx_10_3ff=false
AC_DEFINE([COIN_MACOS_10], 1, [Define for Mac OS X builds])
if test 1 -le $sim_ac_macos10_deployment_target_minor_version; then
AC_DEFINE([COIN_MACOS_10_1], 1, [Define for Mac OS 10.1 builds])
sim_ac_macosx_10_2ff=false
sim_ac_macosx_10_3ff=false
fi
if test 2 -le $sim_ac_macos10_deployment_target_minor_version; then
AC_DEFINE([COIN_MACOS_10_2], 1, [Define for Mac OS 10.2 builds])
sim_ac_macosx_10_2ff=true
sim_ac_macosx_10_3ff=false
sim_ac_macosx_name="Jaguar"
fi
if test 3 -le $sim_ac_macos10_deployment_target_minor_version; then
#AC_DEFINE([COIN_MACOS_10_3], 1, [Define for Mac OS 10.3 builds])
sim_ac_macosx_10_2ff=true
sim_ac_macosx_10_3ff=true
sim_ac_macosx_name="Panther"
fi
if test 4 -le $sim_ac_macos10_deployment_target_minor_version; then
#AC_DEFINE([COIN_MACOS_10_4], 1, [Define for Mac OS 10.4 builds])
sim_ac_macosx_10_2ff=true
sim_ac_macosx_10_3ff=true
sim_ac_macosx_name="Tiger"
fi
if test 5 -le $sim_ac_macos10_deployment_target_minor_version; then
#AC_DEFINE([COIN_MACOS_10_5], 1, [Define for Mac OS 10.5 builds])
sim_ac_macosx_10_2ff=true
sim_ac_macosx_10_3ff=true
sim_ac_macosx_name="Leopard"
fi
else
sim_ac_macosx=false
sim_ac_macosx_10_2ff=false
sim_ac_macosx_10_3ff=false
sim_ac_macosx_name=""
fi
AM_CONDITIONAL([MAC_FRAMEWORK], [$sim_ac_framework])
if $sim_ac_framework; then
AC_DEFINE([COIN_MACOSX_FRAMEWORK], 1, [Define when building Mac OS X framework])
fi
AM_CONDITIONAL([MACOSX_10_2FF], [$sim_ac_macosx_10_2ff])
AM_CONDITIONAL([MACOSX_10_3FF], [$sim_ac_macosx_10_3ff])
AM_CONDITIONAL([MACOSX], [$sim_ac_macosx])
AC_SUBST([MACOSX_10_2FF], [$sim_ac_macosx_10_2ff])
AC_SUBST([MACOSX_NAME], [$sim_ac_macosx_name])
# **************************************************************************
# Initialize libtool
#
# FIXME: this must be done even when we're not using libtool (as when
# building with MSVC++), because that's where at least the enable_static
# and enable_shared flags are set up. 20030324 mortene.
AC_PROG_LIBTOOL
# **************************************************************************
# These are used for constructing the coin-config file.
AC_SUBST([COIN_EXTRA_CPPFLAGS], [$CPPFLAGS])
AC_SUBST([COIN_EXTRA_CFLAGS], [$CFLAGS])
AC_SUBST([COIN_EXTRA_CXXFLAGS], [$CXXFLAGS])
AC_SUBST([COIN_EXTRA_LDFLAGS], [$LDFLAGS])
AC_SUBST([COIN_EXTRA_LIBS], [$LIBS])
# *******************************************************************
# Compiler checking.
## Make it possible for the user to turn off optimization flags for
## the compiler before running the fatal error checks below.
SIM_AC_COMPILER_OPTIMIZATION
## Smoke out some known defunct compilers.
SIM_AC_COMPILER_CPLUSPLUS_FATAL_ERRORS
## See which way the compiler knows the name of the current function. ####
SIM_AC_CHECK_VAR_FUNCTIONNAME
SIM_AC_MAC_CPP_ADJUSTMENTS
if test x"$prefix" = x"NONE"; then
prefix=/usr/local
fi
#
# *******************************************************************
# Enable/disable separate Coin modules
sim_ac_enable_java_wrapper=false
AC_ARG_ENABLE(
[java-wrapper],
AC_HELP_STRING([--enable-java-wrapper], [enable building java wrapper]), [
case $enableval in
yes | true) sim_ac_enable_java_wrapper=true ;;
no | false) sim_ac_enable_java_wrapper=false ;;
*) ;;
esac])
AM_CONDITIONAL([BUILD_JAVA_WRAPPER], [$sim_ac_enable_java_wrapper])
if $sim_ac_enable_java_wrapper; then
AC_DEFINE([HAVE_JAVA_WRAPPER], 1, [Define this if you build the Java wrapper])
SIM_AC_CONFIGURATION_SETTING([Generate Java wrapper], [Yes (not really)])
else
SIM_AC_CONFIGURATION_SETTING([Generate Java wrapper], [No (default)])
fi
# *******************************************************************
# See if we should build with 3ds import capabilities.
sim_ac_enable_3ds_import=false
AC_ARG_ENABLE(
[3ds-import],
AC_HELP_STRING([--enable-3ds-import], [enable 3ds import capabilities]), [
case $enableval in
yes | true) sim_ac_enable_3ds_import=true ;;
no | false) sim_ac_enable_3ds_import=false ;;
*) ;;
esac])
HAVE_3DS_IMPORT_CAPABILITIES=1
if $sim_ac_enable_3ds_import ; then
AC_DEFINE([HAVE_3DS_IMPORT_CAPABILITIES],, [for setup.h])
SIM_AC_CONFIGURATION_SETTING([3ds import capabilities], [Yes (warning: experimental)])
else
HAVE_3DS_IMPORT_CAPABILITIES=0
SIM_AC_CONFIGURATION_SETTING([3ds import capabilities], [No (enable with --enable-3ds-import)])
fi
AC_SUBST(HAVE_3DS_IMPORT_CAPABILITIES)
AM_CONDITIONAL([BUILD_3DS_CAPABILITIES], [$sim_ac_enable_3ds_import])
# *******************************************************************
# Enable/disable system expat
sim_ac_enable_system_expat=false
AC_ARG_ENABLE(
[system-expat],
AC_HELP_STRING([--enable-system-expat], [enable use of system-expat]), [
case $enableval in
yes | true) sim_ac_enable_system_expat=true ;;
no | false) sim_ac_enable_system_expat=false ;;
*) ;;
esac])
AM_CONDITIONAL([USE_SYSTEM_EXPAT], [$sim_ac_enable_system_expat])
if $sim_ac_enable_system_expat; then
sim_ac_save_LIBS=$LIBS
LIBS="$LIBS -lexpat"
AC_MSG_CHECKING([for system installation of expat])
AC_TRY_LINK(
[#include <expat.h>],
[(void)XML_ParserCreate(0);],
[AC_DEFINE([HAVE_SYSTEM_EXPAT], 1, [Define this if you want to use the system installation of Expat])
COIN_EXTRA_LIBS="$COIN_EXTRA_LIBS -lexpat"
AC_MSG_RESULT([available])],
[AC_MSG_ERROR([expat library not found. (If you do not want to enable using the system installation of Expat library in Coin, do not specify the "--enable-system-expat" option to the configure script.)])
LIBS=$sim_ac_save_LIBS])
SIM_AC_CONFIGURATION_SETTING([Use system expat], [Yes])
else
SIM_AC_CONFIGURATION_SETTING([Use system expat], [No (default)])
fi
# *******************************************************************
# See if we should build with javascript capabilities.
sim_ac_enable_javascript=true
AC_ARG_ENABLE(
[javascript-api],
AC_HELP_STRING([--disable-javascript-api], [disable javascript capabilities]), [
case $enableval in
yes | true) sim_ac_enable_javascript=true ;;
no | false) sim_ac_enable_javascript=false ;;
*) ;;
esac])
HAVE_JAVASCRIPT=1
if $sim_ac_enable_javascript ; then
AC_DEFINE([COIN_HAVE_JAVASCRIPT],, [for setup.h])
SIM_AC_CONFIGURATION_SETTING([javascript capabilities], [Yes])
else
HAVE_JAVASCRIPT=0
SIM_AC_CONFIGURATION_SETTING([javascript capabilities], [No (enable with --enable-javascript-api)])
fi
AC_SUBST(HAVE_JAVASCRIPT)
# *******************************************************************
# Query enabling/disabling various subsystems
sim_ac_enable_nodekits=true
AC_ARG_ENABLE(
[nodekits],
AC_HELP_STRING([--disable-nodekits], [disable nodekit support]), [
case $enableval in
yes | true) sim_ac_enable_nodekits=true ;;
no | false) sim_ac_enable_nodekits=false ;;
*) ;;
esac])
sim_ac_enable_draggers=true
AC_ARG_ENABLE(
[draggers],
AC_HELP_STRING([--disable-draggers], [disable dragger support]), [
case $enableval in
yes | true) sim_ac_enable_draggers=true ;;
no | false) sim_ac_enable_draggers=false ;;
*) ;;
esac])
sim_ac_enable_manipulators=true
AC_ARG_ENABLE(
[manipulators],
AC_HELP_STRING([--disable-manipulators], [disable manipulator support]), [
case $enableval in
yes | true) sim_ac_enable_manipulators=true ;;
no | false) sim_ac_enable_manipulators=false ;;
*) ;;
esac])
HAVE_NODEKITS=1
HAVE_DRAGGERS=1
HAVE_MANIPULATORS=1
if $sim_ac_enable_nodekits; then
AC_DEFINE([HAVE_NODEKITS],, [for setup.h])
SIM_AC_CONFIGURATION_SETTING([nodekit support], [Yes])
else
HAVE_NODEKITS=0
HAVE_DRAGGERS=0
HAVE_MANIPULATORS=0
SIM_AC_CONFIGURATION_SETTING([nodekit support], [No (this severely cripples Coin)])
fi
if $sim_ac_enable_draggers && test x"$HAVE_NODEKITS" = x"1"; then
AC_DEFINE([HAVE_DRAGGERS],, [for setup.h])
SIM_AC_CONFIGURATION_SETTING([dragger support], [Yes])
else
HAVE_DRAGGERS=0
HAVE_MANIPULATORS=0
SIM_AC_CONFIGURATION_SETTING([dragger support], [No (this severely cripples Coin)])
fi
if $sim_ac_enable_manipulators && test x"$HAVE_DRAGGERS" = x"1"; then
AC_DEFINE([HAVE_MANIPULATORS],, [for setup.h])
SIM_AC_CONFIGURATION_SETTING([manipulator support], [Yes])
else
HAVE_MANIPULATORS=0
SIM_AC_CONFIGURATION_SETTING([manipulator support], [No (this severely cripples Coin)])
fi
AC_SUBST(HAVE_NODEKITS)
AC_SUBST(HAVE_DRAGGERS)
AC_SUBST(HAVE_MANIPULATORS)
# *******************************************************************
sim_ac_enable_vrml97=true
AC_ARG_ENABLE(
[vrml97],
AC_HELP_STRING([--disable-vrml97], [disable VRML97 support]), [
case $enableval in
yes | true) sim_ac_enable_vrml97=true ;;
no | false) sim_ac_enable_vrml97=false ;;
*) ;;
esac])
HAVE_VRML97=1
if $sim_ac_enable_vrml97 ; then
AC_DEFINE([HAVE_VRML97],, [for setup.h])
SIM_AC_CONFIGURATION_SETTING([VRML97 support], [Yes])
else
HAVE_VRML97=0
SIM_AC_CONFIGURATION_SETTING([VRML97 support], [No (enable with --enable-vrml97)])
fi
AC_SUBST(HAVE_VRML97)
# *******************************************************************
# Search for the "local GLU" extension
enable_superglu=false
if test -x ${srcdir}/src/extensions/superglu/configure; then
enable_superglu=true
AC_DEFINE(HAVE_SUPERGLU,1, [*EXPERIMENTAL* to use the GLU we've "appropriated" from SGI])
HAVE_SUPERGLU=1
AC_CONFIG_SUBDIRS([src/extensions/superglu])
CPPFLAGS="-I$coin_build_dir/src/extensions/superglu/include -I$coin_src_dir/src/extensions/superglu/include $CPPFLAGS"
else
enable_superglu=false
HAVE_SUPERGLU=0
fi
AC_SUBST([HAVE_SUPERGLU])
AC_SUBST([SUPERGLUPREFIX], [Super])
export SUPERGLUPREFIX
AM_CONDITIONAL(BUILD_WITH_SUPERGLU, $enable_superglu)
# *******************************************************************
AC_ARG_ENABLE([threads],
[AC_HELP_STRING([--disable-threads], [disable platform-independent multithreading abstraction classes])],
[case $enableval in
yes | true ) sim_ac_enable_threads=true ;;
no | false ) sim_ac_enable_threads=false ;;
*) AC_MSG_ERROR([invalid arg "$enableval" for --enable-threads option]) ;;
esac],
[sim_ac_enable_threads=true])
HAVE_THREADS=0
if $sim_ac_enable_threads; then
sim_ac_threads_api="none"
# Make it possible to explicitly turn off Win32 threads, to for instance
# use POSIX threads instead under Win32.
AC_ARG_ENABLE([w32threads],
[AC_HELP_STRING([--disable-w32threads], [never use Win32 threads, even when available])],
[case $enableval in
yes | true ) sim_ac_w32_enable_threads=true ;;
no | false ) sim_ac_w32_enable_threads=false ;;
*) AC_MSG_ERROR([invalid arg "$enableval" for --disable-w32threads option]) ;;
esac],
[sim_ac_w32_enable_threads=true])
sim_ac_win32_threads_available=false
# Check for platform-native Win32 thread API first.
if $sim_ac_w32_enable_threads; then
AC_MSG_CHECKING([for Win32 threads])
AC_TRY_LINK(
[#include <windows.h>],
[HANDLE h = CreateThread(NULL, 0, NULL, NULL, 0, NULL);
(void)SetThreadPriority(h, 0);
ExitThread(0);],
[sim_ac_win32_threads_available=true
sim_ac_threads_api="native Win32"
AC_DEFINE([USE_W32THREAD], , [define to use the Win32 threads API])
AC_DEFINE([COIN_THREADID_TYPE], DWORD, [System dependent thread ID type])])
# (we just ignore failure, as we fall through to POSIX threads)
AC_MSG_RESULT($sim_ac_win32_threads_available)
fi
if ! $sim_ac_win32_threads_available; then
SIM_AC_CHECK_PTHREAD([
AC_DEFINE([USE_PTHREAD], , [define to use the POSIX threads API])
AC_DEFINE([COIN_THREADID_TYPE], pthread_t, [System dependent thread ID type])
sim_ac_threads_api="POSIX"
COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_pthread_cppflags"
COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_pthread_ldflags"
COIN_EXTRA_LIBS="$sim_ac_pthread_libs $COIN_EXTRA_LIBS"
])
fi
if test "$sim_ac_threads_api" = "none"; then
AC_MSG_ERROR([Could not find any usable native thread-handling API/library/devkit! (If you do not want to enable the platform-independent thread-handling classes in Coin, specify the "--disable-threads" option to the configure script.)])
fi
HAVE_THREADS=1
AC_DEFINE([HAVE_THREADS],, [to use the platform-independent thread-handling abstractions])
else
sim_ac_threads_api="Disabled (enable with --enable-threads)"
fi
AC_SUBST([HAVE_THREADS])
SIM_AC_CONFIGURATION_SETTING([System threads API], [$sim_ac_threads_api])
AM_CONDITIONAL([BUILD_WITH_THREADS], [$sim_ac_enable_threads])
# *******************************************************************
# Thread safe library
AC_ARG_ENABLE([threadsafe],
AC_HELP_STRING([--enable-threadsafe], [enable thread safe traversals]),
[case $enableval in
yes | true ) sim_ac_enable_threadsafe=true ;;
no | false ) sim_ac_enable_threadsafe=false ;;
*) AC_MSG_ERROR([invalid arg "$enableval" for --enable-threadsafe option]) ;;
esac],
[sim_ac_enable_threadsafe=false])
HAVE_THREADSAFE=0
if $sim_ac_enable_threadsafe; then
if test "$HAVE_THREADS" = "0"; then
AC_MSG_ERROR([You can not enable thread safe action traversals while at the same time disabling the portable thread-handling abstractions. You must use "--enable-threadsafe" with "--enable-threads".])
fi
HAVE_THREADSAFE=1
AC_DEFINE([COIN_THREADSAFE], 1, [for setup.h])
SIM_AC_CONFIGURATION_SETTING([Thread safe traversals], [Yes (in development)])
else
SIM_AC_CONFIGURATION_SETTING([Thread safe traversals], [No (enable with --enable-threadsafe)])
fi
# for coin.cfg
AC_SUBST([HAVE_THREADSAFE])
# *******************************************************************
# Headers we might want to use
# We expect these to include their dependencies.
#
# A non-empty last argument indicates to Autoconf that we would like to heed
# the result from compilation, not just pre-processing. (A space is enough
# to indicate non-emptiness.)
AC_CHECK_HEADERS(
[unistd.h sys/types.h inttypes.h stdint.h sys/param.h sys/time.h sys/timeb.h time.h io.h windows.h libgen.h direct.h strings.h ieeefp.h],
[], [], [])
AC_MSG_CHECKING([for flex file adjustments])
if test x"$ac_cv_header_unistd_h" != x"yes"; then
AC_MSG_RESULT([-DYY_NO_UNISTD_H])
CPPFLAGS="$CPPFLAGS -DYY_NO_UNISTD_H"
else
AC_MSG_RESULT([none])
fi
SIM_AC_CHECK_HEADER_TLHELP32_H
SIM_AC_CHECK_FUNC__SPLITPATH
SIM_AC_CHECK_WIN32_API
# Various systems (like MKS NuTCracker) needs explicit gdi32 linkage.
if $sim_ac_have_win32_api; then
LIBS="$LIBS -lgdi32"
COIN_EXTRA_LIBS="$COIN_EXTRA_LIBS -lgdi32"
fi
# A non-empty last argument indicates to Autoconf that we would like to heed
# the result from compilation, not just pre-processing. (A space is enough
# to indicate non-emptiness.)
AC_CHECK_HEADERS(
[sys/unistd.h],
[sim_ac_have_sys_unistd_h=true],
[sim_ac_have_sys_unistd_h=false],
[ ])
if $sim_ac_have_sys_unistd_h; then
AC_MSG_CHECKING([for IN_PATH define conflict])
AC_TRY_COMPILE(
[#include <sys/unistd.h>],
[void * v; v = (void*) IN_PATH;],
[sim_ac_in_path_defined=true],
[sim_ac_in_path_defined=false])
if $sim_ac_in_path_defined; then
AC_MSG_RESULT([yes])
AC_DEFINE([COIN_UNDEF_IN_PATH_HACK],1,
[define to "remove" conflicting IN_PATH define from <sys/unistd.h>])
else
AC_MSG_RESULT([no])
fi
fi
# According to Coin user Ralf Corsepius, at least SunOS4 needs
# to include sys/types.h before netinet/in.h. There have also
# been a problem report for FreeBSD which seems to indicate
# the same dependency on that platform aswell.
#
# FIXME: should we make this into a general macro
# SIM_AC_CHECK_DEPENDENT_HEADER(HEADER, DEPENDONHEADERS..)? 20001025 mortene.
#
# FIXME2: is this really necessary? AC _CHECK_HEADER(S) tests by using the
# preprocessor, not by doing a compile, so we could probably just
# include netinet/in.h in the above list to AC _CHECK_HEADERS. We wouldn't
# catch problems quiet so early on, though. 20001025 mortene.
AC_CACHE_CHECK([for netinet/in.h], sim_cv_netinet_in_h, [
AC_TRY_CPP([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#include <netinet/in.h>],
[sim_cv_netinet_in_h=true], [sim_cv_netinet_in_h=false])])
if $sim_cv_netinet_in_h; then
AC_DEFINE_UNQUOTED([HAVE_NETINET_IN_H], [1],
[Define if you have the <netinet/in.h> header file.])
fi
# For Inventor/system/inttypes.h.in.
#
# Note: this assumes AC_CHECK_HEADERS(sys/types.h stdint.h) has been done.
#
# FIXME: the header file checking should be AC_REQUIREd, if possible.
# 20010711 mortene.
SIM_AC_DEFINE_BYTESIZE_TYPES
# *******************************************************************
AC_MSG_CHECKING([for fstat() function])
AC_TRY_LINK(
[#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif],
[struct stat sb;
int result = fstat(0, &sb);],
[AC_DEFINE(HAVE_FSTAT, 1, [define if fstat() is available])
AC_MSG_RESULT([available])],
[AC_MSG_RESULT([not available])])
# *******************************************************************
# We want to use BSD 4.3's isinf(), isnan(), finite() if they are
# available.
AC_MSG_CHECKING([for BSD 4.3 isinf() function])
AC_TRY_LINK(
[#include <math.h>],
[int result = isinf(42.0);],
[AC_DEFINE(HAVE_ISINF, 1, [define if isinf() is available])
AC_MSG_RESULT([available])],
[AC_MSG_RESULT([not available])])
AC_MSG_CHECKING([for BSD 4.3 isnan() function])
AC_TRY_LINK(
[#include <math.h>],
[int result = isnan(42.0);],
[AC_DEFINE(HAVE_ISNAN, 1, [whether or not isnan() is available])
AC_MSG_RESULT([available])],
[AC_MSG_RESULT([not available])
AC_MSG_CHECKING([for _isnan() function])
AC_TRY_LINK(
[#include <math.h>],
[int result = _isnan(42.0);],
[AC_DEFINE(HAVE__ISNAN, 1, [whether or not _isnan() is available])
AC_MSG_RESULT([available])],
[AC_MSG_RESULT([not available])])
])
AC_MSG_CHECKING([for BSD 4.3 finite() function])
AC_TRY_LINK(
[#include <math.h>],
[int result = finite(42.0);],
[AC_DEFINE(HAVE_FINITE, 1, [whether or not finite() is available])
AC_MSG_RESULT([available])],
[AC_MSG_RESULT([not available])
AC_MSG_CHECKING([for _finite() function])
AC_TRY_LINK(
[#include <math.h>],
[int result = _finite(42.0);],
[AC_DEFINE(HAVE__FINITE, 1, [whether or not _finite() is available])
AC_MSG_RESULT([available])],
[AC_MSG_RESULT([not available])])
])
AC_MSG_CHECKING([for fpclass() function])
AC_TRY_LINK(
[#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif],
[int result = fpclass(42.0);],
[AC_DEFINE(HAVE_FPCLASS, 1, [whether or not fpclass() is available])
AC_MSG_RESULT([available])],
[AC_MSG_RESULT([not available])])
AC_MSG_CHECKING([for _fpclass() function])
AC_TRY_LINK(
[#include <math.h>],
[int result = _fpclass(42.0);],
[AC_DEFINE(HAVE__FPCLASS, 1, [whether or not _fpclass() is available])
AC_MSG_RESULT([available])],
[AC_MSG_RESULT([not available])])
SIM_AC_CHECK_TYPEOF_STRUCT_MEMBER([
#include <sys/types.h>
#ifdef HAVE_TIME_H
#include <time.h> // struct timeval (Linux)
#endif // HAVE_TIME_H
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> // struct timeval (IRIX)
#endif // HAVE_SYS_TIME_H
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif // HAVE_WINDOWS_H
], [timeval], [tv_sec], [SIM_TIMEVAL_TV_SEC_T], [])
SIM_AC_CHECK_TYPEOF_STRUCT_MEMBER([
#include <sys/types.h>
#ifdef HAVE_TIME_H
#include <time.h> // struct timeval (Linux)
#endif // HAVE_TIME_H
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> // struct timeval (IRIX)
#endif // HAVE_SYS_TIME_H
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif // HAVE_WINDOWS_H
], [timeval], [tv_usec], [SIM_TIMEVAL_TV_USEC_T], [])
# *******************************************************************
sim_ac_build_library=true
AC_ARG_ENABLE(
[build],
[AC_HELP_STRING([--disable-build], [disable configuration for library build])],
[case $enableval in
no | false)
sim_ac_build_library=false
SIM_AC_CONFIGURATION_SETTING([Coin build type], [build disabled])
;;
esac])
AM_CONDITIONAL(BUILD_LIBRARY, $sim_ac_build_library)
# *******************************************************************
# * Do we want to build the documentation?
# *******************************************************************
AC_ARG_ENABLE(html,
AC_HELP_STRING([--enable-html], [build and install Coin HTML documentation]),
[case $enableval in
yes | true) want_html=yes ;;
*) want_html=no ;;
esac],
[want_html=no])
case $htmldir in
/*)
# do nothing - absolute path
;;
*)
# expand $docdir and append /html
htmldir=`eval echo ${docdir}`/html
;;
esac
AC_SUBST(htmldir)
AC_ARG_ENABLE(man,
AC_HELP_STRING([--enable-man], [build and install Coin man pages]),
[case $enableval in
yes | true) want_man=yes ;;
*) want_man=no ;;
esac],
[want_man=no])
# Used in the Doxygen parameter file.
AC_SUBST([COIN_DOC_HTML], [`echo $want_html | tr '[a-z]' '[A-Z]'`])
AC_SUBST([coin_html_dir], [`pwd`/html])
AC_SUBST([COIN_DOC_MAN], [`echo $want_man | tr '[a-z]' '[A-Z]'`])
AC_SUBST([coin_man_dir], [`pwd`/man])
AM_CONDITIONAL(BUILD_MANPAGES, test x"$want_man" = x"yes")
AM_CONDITIONAL(BUILD_HTMLPAGES, test x"$want_html" = x"yes")
if test x"$want_man" = x"yes"; then
SIM_AC_CONFIGURATION_SETTING([manpage installation], [$mandir])
fi
if test x"$want_html" = x"yes"; then
SIM_AC_CONFIGURATION_SETTING([HTML installation], [$htmldir])
fi
# Perl is used for the Doxygen-based doc generation, plus when making
# NSIS installation packages.
AC_PATH_PROG(sim_ac_perl_exe, perl, false, $PATH)
if test x"$want_html" != xno -o x"$want_man" != xno; then
SIM_AC_DOXYGEN_TOOL([], [SIM_AC_ERROR([no-doxygen])])
if test x"$sim_ac_perl_exe" = xfalse; then
AC_MSG_ERROR([Could not find the Perl executable, which is needed for Doxygen doc generation.])
fi
fi
# path_tag is used to identify paths in docs/coin.doxygen that needs to be
# transformed using cygpath under cygwin.
case $host in
*-cygwin) path_tag="<PATH>" ;;
*) path_tag= ;;
esac
AC_SUBST(path_tag)
#Get all the doxygen source files
. ${coin_src_dir}/docs/coin_doxygenfiles.inc
#The AC_SUBST command will not accept multiline strings, so trick this
#into a singleline string
DOXYGEN_INPUT=$(echo ${DOXYGEN_INPUT})
AC_SUBST(DOXYGEN_INPUT)
sim_ac_makensis_exe=false
case $host in
*-cygwin)
AC_PATH_PROG([sim_ac_makensis_exe], [makensis], [false], [$PATH])
;;
esac
AC_PATH_PROG([sim_ac_dpkg_buildpackage_exe],
[dpkg-buildpackage], [false], [$PATH])
sim_ac_windows_packagable=true
if test x"$sim_ac_perl_exe" = xfalse || test x"$sim_ac_makensis_exe" = xfalse; then
sim_ac_windows_packageable=false
fi