forked from FreeCAD/FreeCAD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1113 lines (974 loc) · 34.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 -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
dnl Init stuff
dnl **************************************************************************
dnl release version number info
m4_include([revision.m4])
AC_INIT(FreeCAD,[FREECAD_MAJOR.FREECAD_MINOR.FREECAD_MICRO],[[email protected]], FreeCAD)
AC_CONFIG_AUX_DIR([m4])
AM_INIT_AUTOMAKE([tar-ustar foreign])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_LANG_CPLUSPLUS
dnl Default install directory is your home directory
dnl **************************************************************************
AC_PREFIX_DEFAULT($HOME/FreeCAD)
dnl Version number
dnl **************************************************************************
dnl Shared library versioning
dnl GENERIC_LIBRARY_VERSION=1:2:0
dnl | | |
dnl +------+ | +---+
dnl | | |
dnl current:revision:age
dnl | | |
dnl | | +- increment if interfaces have been added
dnl | | set to zero if interfaces have been removed
dnl | | or changed
dnl | +- increment if source code has changed
dnl | set to zero if current is incremented
dnl +- increment if interfaces have been added, removed or changed
LIB_CURRENT=2
LIB_REVISION=0
LIB_AGE=0
AC_SUBST(LIB_CURRENT)
AC_SUBST(LIB_REVISION)
AC_SUBST(LIB_AGE)
dnl Required headers
dnl (mainly for OpenCASCADE 5.2, we need also config.h for cfg's)
dnl **************************************************************************
AC_LANG([C++])
AC_MSG_CHECKING([ for C++ header files ])
AC_CHECK_HEADERS(istream ostream istream fstream ios iomanip iostream)
AC_CHECK_HEADERS(iomanip.h limits.h values.h float.h)
AC_CHECK_HEADERS(siginfo.h bits/sigset.h bstring.h sys/types.h sys/select.h)
AC_CHECK_HEADERS(sys/filio.h sys/mman.h libc.h)
AC_CHECK_HEADERS([sstream],,[AC_MSG_ERROR([This header is needed. Bye.])])
AC_CXX_HAVE_STD_IOSTREAM
dnl Checking for C/C++ compiler
dnl **************************************************************************
AC_PROG_CXX
AC_PROG_CC
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
dnl Checking for Fortran compiler
dnl **************************************************************************
AC_PROG_F77()
AC_FC_SRCEXT(f)
AC_FC_LIBRARY_LDFLAGS
AC_FC_WRAPPERS
dnl Checking for programs
dnl **************************************************************************
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_PROG_LN_S
#AC_PROG_YACC
#AM_PROG_LEX
AC_PATH_PROG(SWIG, swig, false)
if test "$SWIG" = false ; then
AC_MSG_WARN([Can't find SWIG installation])
HAVE_SWIG=0
AM_CONDITIONAL(HAVE_SWIG_FOUND, false)
else
HAVE_SWIG=1
AM_CONDITIONAL(HAVE_SWIG_FOUND, true)
fi
AC_SUBST(HAVE_SWIG)
dnl Defines in config.h
dnl **************************************************************************
AC_DEFINE_UNQUOTED(HAVE_GETENVIRONMENTVARIABLE, 1, [Define to use GetEnvironmentVariable() instead of getenv()])
AC_DEFINE_UNQUOTED(HAVE_GL_GL_H, 1, [define if the GL header should be included as GL/gl.h])
AC_DEFINE_UNQUOTED(HAVE_QGLFORMAT_EQ_OP, 1, [Define this to 1 if operator==(QGLFormat&, QGLFormat&) is available])
AC_DEFINE_UNQUOTED(HAVE_QGLFORMAT_SETOVERLAY, 1, [Define this to 1 if QGLFormat::setOverlay() is available])
AC_DEFINE_UNQUOTED(HAVE_QGLWIDGET_SETAUTOBUFFERSWAP, 1, [Define this to 1 if QGLWidget::setAutoBufferSwap() is available])
AC_DEFINE_UNQUOTED(HAVE_QT_KEYPAD_DEFINE, 1, [Define this if Qt::Keypad is available])
AC_DEFINE_UNQUOTED(HAVE_QWIDGET_SHOWFULLSCREEN, 1, [Define this if QWidget::showFullScreen() is available])
AC_DEFINE_UNQUOTED(HAVE_SYS_TYPES_H, 1, [Define to 1 if you have the <sys/types.h> header file.])
AC_DEFINE_UNQUOTED(USE_STD_IOSTREAM, 1, [Define to 1 to build zipios++ sources with iostream.])
AC_DEFINE_UNQUOTED(OCE_HAVE_CLIMITS, 1, [Define to 1 to build with OCE instead of OCC.])
AC_DEFINE_UNQUOTED(OCE_HAVE_IOSTREAM, 1, [Define to 1 to build with OCE instead of OCC.])
AC_DEFINE_UNQUOTED(OCE_HAVE_IOMANIP, 1, [Define to 1 to build with OCE instead of OCC.])
dnl Check if you want to use GUI, or not (currently disabled)
dnl **************************************************************************
dnl
#AC_ARG_ENABLE([gui],
# AC_HELP_STRING([--enable-gui], [Enable GUI (you can disable this feature to use FreeCAD in server mode)]),
# [case $enableval in
# no | false) fc_set_gui=false ;;
# *) fc_set_gui=true ;;
# esac],
# [fc_set_gui=true])
#
#if $fc_set_gui; then
# echo "not yet done"
#fi
#
#if test "x$use_glx" = "xyes"; then
# AM_CONDITIONAL(FREECAD_BUILD_GUI, true)
#else
# AM_CONDITIONAL(FREECAD_BUILD_GUI, false)
#fi
#if FREECAD_BUILD_GUI
# ... in Makefile.am
#endif
## DEFAULT INCLUDE/LIB PATHS
#all_includes="$all_includes -I/usr/include -I/usr/local/include"
#all_libraries="$all_libraries -L/usr/lib -L/usr/local/lib"
dnl *************************************************************************
dnl
dnl Checking for libraries.
dnl
dnl *************************************************************************
dnl checking for zlib
dnl **************************************************************************
AC_CHECK_LIB(z, inflate, [cv_libz=yes], [cv_libz=no])
if test "$cv_libz" != "yes"; then
AC_MSG_ERROR([
**** Cannot find the zlib library. ****
])
fi
dnl checking for Python
dnl **************************************************************************
dnl AC_MSG_CHECKING([for Python])
dnl fc_py_ver=`python -c "import sys; print sys.version[[:3]]"`;
dnl if test x$fc_py_ver = x; then
dnl AC_MSG_ERROR([
dnl **** Cannot find Python interpreter. ****
dnl ])
dnl fi;
dnl AC_MSG_RESULT([yes])
dnl
dnl dnl Additional test to force version number of >= 2.5
dnl AC_MSG_CHECKING([for Python version >= 2.5])
dnl prog="import sys
dnl s=0x02050000
dnl sys.exit(sys.hexversion < s)"
dnl AS_IF([AM_RUN_LOG([python -c "$prog"])],
dnl [AC_MSG_RESULT([yes])],
dnl [AC_MSG_ERROR([
dnl **** Install Python version 2.5 or later ****
dnl ])])
AC_ARG_WITH(python-version,
AC_HELP_STRING([--with-python-version=VER], [Choose the required Python version]),
[fc_py_ver=$withval],
[fc_py_ver=2.5])
dnl At least version 2.5 required
AM_PATH_PYTHON($fc_py_ver)
AC_ARG_WITH(python-include,
AC_HELP_STRING([--with-python-include=DIR], [Path to the Python header files]),
[fc_py_incs=$withval],
[fc_py_incs=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc()"`])
AC_ARG_WITH(python-lib,
AC_HELP_STRING([--with-python-lib=DIR], [Path to the Python library files]),
[fc_py_libs=$withval],
[fc_py_libs=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBDIR')"`])
fc_py_ac_save_cppflags=$CPPFLAGS
fc_py_ac_save_ldflags=$LDFLAGS
fc_py_ac_save_libs=$LIBS
CPPFLAGS="$CPPFLAGS -I$fc_py_incs"
LDFLAGS="$LDFLAGS -L$fc_py_libs"
LIBS="-lpython$PYTHON_VERSION -lpthread -ldl -lutil -lm"
dnl Small test program that only works with Python 2.5 and higher
fc_cv_lib_py_avail=no
AC_CHECK_HEADER(Python.h,[
AC_MSG_CHECKING([for libpython$PYTHON_VERSION])
AC_TRY_LINK([#include "Python.h"],
[Py_Initialize();
const char* sys = "sys";
PyImport_AddModule(sys);
Py_Finalize();],
[fc_cv_lib_py_avail=yes
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))])
CPPFLAGS=$fc_py_ac_save_cppflags
LDFLAGS=$fc_py_ac_save_ldflags
LIBS=$fc_py_ac_save_libs
if test x"$fc_cv_lib_py_avail" = xyes; then
all_includes="$all_includes -I$fc_py_incs"
all_libraries="$all_libraries -L$fc_py_libs"
AC_SUBST([PYTHON_LIB], [python$PYTHON_VERSION])
else
AC_MSG_ERROR([
**** Cannot find Python$PYTHON_VERSION devel files. ****
])
fi
dnl checking for PyQt4 utilities
dnl **************************************************************************
#AC_PATH_PROG(PYUIC4, pyuic4, false)
#if test "$PYUIC4" = false ; then
# AC_MSG_ERROR([Can't find pyuic4 utility])
#fi
#AC_PATH_PROG(PYRCC4, pyrcc4, true)
#if test "$PYRCC4" = false ; then
# AC_MSG_ERROR([Can't find pyrcc4 utility])
#fi
#AC_SUBST(PYUIC4)
#AC_SUBST(PYRCC4)
dnl checking for PyCXX & zipios++
dnl **************************************************************************
fc_make_no_dfsg_package=yes
AC_ARG_ENABLE(no-dfsg-tarball,
AC_HELP_STRING([--enable-no-dfsg-tarball], [Use local sources of PyCXX & zipios++ packages [[default=yes]]]),
[fc_make_no_dfsg_package=$enableval],[fc_make_no_dfsg_package=yes])
# check if local versions of PyCXX & zipios++ are part of these sources
if test x"$fc_make_no_dfsg_package" = xyes; then
fc_py_ac_save_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$srcdir -I$srcdir/src"
AC_TRY_COMPILE([#include "src/CXX/Version.hxx"], [],
[], [fc_make_no_dfsg_package=no])
CPPFLAGS=$fc_py_ac_save_cppflags
fi
AM_CONDITIONAL(MAKE_NO_DFSG_PACKAGE, test x"$fc_make_no_dfsg_package" = xyes)
AC_MSG_RESULT(Use local sources of PyCXX & zipios++... $fc_make_no_dfsg_package)
dnl checking for existence of (system-wide) PyCXX & zipios++ headers
dnl **************************************************************************
ZIPIOS_LIB=""
if test x"$fc_make_no_dfsg_package" != xyes; then
fc_py_ac_save_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$fc_py_incs"
ZIPIOS_LIB="-lzipios"
AC_MSG_CHECKING(for PyCXX headers)
AC_TRY_COMPILE([#include <CXX/Version.hxx>], [],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no);AC_MSG_ERROR(Cannot find the PyCXX headers)])
AC_MSG_CHECKING(for zipios++ headers)
AC_TRY_COMPILE([#include <zipios++/zipios_defs.h>], [],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no);AC_MSG_ERROR(Cannot find the zipios++ headers)])
CPPFLAGS=$fc_py_ac_save_cppflags
fi
AC_SUBST(ZIPIOS_LIB)
dnl checking for xerces-c
dnl **************************************************************************
AC_MSG_CHECKING([for xerces-c])
AC_ARG_WITH(xercesc-include,
AC_HELP_STRING([--with-xercesc-include=DIR], [Path to the xerces-c header files]),
[fc_xer_incs=$withval],
[fc_xer_incs=/usr/include])
AC_CHECK_FILE($fc_xer_incs/xercesc,,
[AC_CHECK_FILE(/usr/local/include/xercesc,[fc_xer_incs=/usr/local/include])])
AC_ARG_WITH(xercesc-lib,
AC_HELP_STRING([--with-xercesc-lib=DIR], [Path to the xerces-c library files]),
[fc_xer_libs=$withval],
[fc_xer_libs=/usr/lib])
fc_xer_ac_save_cppflags=$CPPFLAGS
fc_xer_ac_save_ldflags=$LDFLAGS
fc_xer_ac_save_libs=$LIBS
CPPFLAGS="$CPPFLAGS -I$fc_xer_incs"
LDFLAGS="$LDFLAGS -L$fc_xer_libs"
LIBS="-lxerces-c"
fc_cv_lib_xer_avail=no
AC_CHECK_HEADER(xercesc/framework/XMLBuffer.hpp,[
AC_MSG_CHECKING([whether xerces lib is available])
AC_TRY_LINK([#include <xercesc/framework/XMLBuffer.hpp>],
[XERCES_CPP_NAMESPACE_USE
XMLBuffer buf;],
[fc_cv_lib_xer_avail=yes
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))])
CPPFLAGS=$fc_xer_ac_save_cppflags
LDFLAGS=$fc_xer_ac_save_ldflags
LIBS=$fc_xer_ac_save_libs
if test x"$fc_cv_lib_xer_avail" = xyes; then
all_includes="$all_includes -I$fc_xer_incs"
all_libraries="$all_libraries -L$fc_xer_libs"
else
AC_MSG_ERROR([
**** Cannot find xerces devel files. ****
])
fi
dnl checking for ANN
dnl **************************************************************************
dnl AC_MSG_CHECKING([for ANN])
dnl AC_ARG_WITH(ann-include,
dnl AC_HELP_STRING([--with-ann-include=DIR], [Path to the ANN header files]),
dnl [fc_ann_incs=$withval],
dnl [fc_ann_incs=/usr/include])
dnl
dnl AC_CHECK_FILE($fc_ann_incs/ANN,,
dnl [AC_CHECK_FILE(/usr/local/include/ANN,[fc_ann_incs=/usr/local/include])])
dnl
dnl AC_ARG_WITH(ann-lib,
dnl AC_HELP_STRING([--with-ann-lib=DIR], [Path to the ANN library files]),
dnl [fc_ann_libs=$withval],
dnl [fc_ann_libs=/usr/lib])
dnl
dnl fc_ann_ac_save_cppflags=$CPPFLAGS
dnl fc_ann_ac_save_ldflags=$LDFLAGS
dnl fc_ann_ac_save_libs=$LIBS
dnl CPPFLAGS="$CPPFLAGS -I$fc_ann_incs"
dnl LDFLAGS="$LDFLAGS -L$fc_ann_libs"
dnl LIBS="-lann"
dnl
dnl fc_cv_lib_ann_avail=no
dnl AC_CHECK_HEADER(ANN/ANN.h,[
dnl AC_MSG_CHECKING([whether ANN lib is available])
dnl AC_TRY_LINK([#include <ANN/ANN.h>],
dnl [ANNkd_tree ann;],
dnl [fc_cv_lib_ann_avail=yes
dnl AC_MSG_RESULT(yes)],
dnl AC_MSG_RESULT(no))])
dnl
dnl CPPFLAGS=$fc_ann_ac_save_cppflags
dnl LDFLAGS=$fc_ann_ac_save_ldflags
dnl LIBS=$fc_ann_ac_save_libs
dnl
dnl if test x"$fc_cv_lib_ann_avail" = xyes; then
dnl all_includes="$all_includes -I$fc_ann_incs"
dnl all_libraries="$all_libraries -L$fc_ann_libs"
dnl else
dnl AC_MSG_ERROR([
dnl **** Cannot find ANN devel files. ****
dnl ])
dnl fi
dnl checking for eigen2
dnl **************************************************************************
dnl AC_MSG_CHECKING([for eigen2])
dnl AC_ARG_WITH(eigen2-include,
dnl AC_HELP_STRING([--with-eigen2-include=DIR], [Path to the eigen2 header files]),
dnl [fc_eig_incs=$withval],
dnl [fc_eig_incs=/usr/include/eigen2])
dnl
dnl AC_CHECK_FILE($fc_eig_incs/Eigen,,
dnl [AC_CHECK_FILE(/usr/local/include/eigen2,[fc_eig_incs=/usr/local/include/eigen2])])
dnl
dnl fc_eig_ac_save_cppflags=$CPPFLAGS
dnl CPPFLAGS="$CPPFLAGS -I$fc_eig_incs"
dnl
dnl # Check a file which is present in Eigen2 but not in Eigen3
dnl fc_cv_lib_eig_avail=no
dnl AC_CHECK_HEADER(Eigen/NewStdVector,
dnl fc_cv_lib_eig_avail=yes,)
dnl
dnl CPPFLAGS=$fc_eig_ac_save_cppflags
dnl
dnl if test x"$fc_cv_lib_eig_avail" = xyes; then
dnl AC_SUBST([EIGEN2_INC], [$fc_eig_incs])
dnl else
dnl AC_MSG_WARN([
dnl **** Cannot find eigen2 devel files.
dnl Modules that depend on this library cannot be built. ****
dnl ])
dnl fi
dnl AM_CONDITIONAL(HAVE_EIGEN2, test x"$fc_cv_lib_eig_avail" = xyes)
dnl checking for eigen3
dnl **************************************************************************
AC_MSG_CHECKING([for eigen3])
AC_ARG_WITH(eigen3-include,
AC_HELP_STRING([--with-eigen3-include=DIR], [Path to the eigen3 header files]),
[fc_eig_incs=$withval],
[fc_eig_incs=/usr/include/eigen3])
AC_CHECK_FILE($fc_eig_incs/Eigen,,
[AC_CHECK_FILE(/usr/local/include/eigen3,[fc_eig_incs=/usr/local/include/eigen3])])
fc_eig_ac_save_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$fc_eig_incs"
# Check a file which is present in Eigen3 but not in Eigen2
fc_cv_lib_eig_avail=no
AC_CHECK_HEADER(Eigen/Eigenvalues,
fc_cv_lib_eig_avail=yes,)
CPPFLAGS=$fc_eig_ac_save_cppflags
if test x"$fc_cv_lib_eig_avail" = xyes; then
AC_SUBST([EIGEN3_INC], [$fc_eig_incs])
else
AC_MSG_WARN([
**** Cannot find eigen3 devel files.
Modules that depend on this library cannot be built. ****
])
fi
AM_CONDITIONAL(HAVE_EIGEN3, test x"$fc_cv_lib_eig_avail" = xyes)
dnl checking for boost
dnl ******************
FREECAD_AC_HAVE_BOOST
dnl checking for Qt
dnl ***************
FREECAD_AC_HAVE_QT(4.3)
dnl checking for Coin
dnl **************************************************************************
SIM_AC_HAVE_COIN_IFELSE(,AC_MSG_ERROR([
**** Cannot find Coin devel files. ****
]))
AC_SUBST([sim_ac_coin_includedir])
AC_SUBST([sim_ac_coin_cppflags])
AC_SUBST([sim_ac_coin_ldflags])
AC_SUBST([sim_ac_coin_libs])
dnl checking for SoQt
dnl **************************************************************************
SIM_AC_HAVE_SOQT_IFELSE(,AC_MSG_ERROR([
**** Cannot find SoQt devel files. ****
]))
AC_SUBST([sim_ac_soqt_includedir])
AC_SUBST([sim_ac_soqt_cppflags])
AC_SUBST([sim_ac_soqt_ldflags])
AC_SUBST([sim_ac_soqt_libs])
dnl **************************************************************************
dnl checking for optional libraies
dnl **************************************************************************
dnl checking for OpenGL libs
dnl **************************************************************************
case $host_os in
mingw32*)
GL_LIBS="-lopengl32 -lglu32"
;;
darwin*)
GL_LIBS="-Wl,-F/System/Library/Frameworks -Wl,-framework,OpenGL"
;;
linux*|kfreebsd*-gnu*)
GL_LIBS="-lGL -lGLU"
;;
esac
AC_SUBST(GL_LIBS)
dnl checking for OpenCascade
dnl **************************************************************************
dnl Check if CASROOT is set and estimate where the include and libs could be
if test x"$CASROOT" != x; then
fc_occ_incs_test="$CASROOT/inc"
fc_occ_libs_test="$CASROOT/Linux/lib"
else
fc_occ_incs_test=/usr/include/opencascade
fc_occ_libs_test=/usr/lib
fi
AC_CHECKING([OpenCascade])
AC_ARG_WITH(occ-include,
AC_HELP_STRING([--with-occ-include=DIR], [Path to the OpenCascade header files]),
[fc_occ_incs=$withval],
[fc_occ_incs=$fc_occ_incs_test])
AC_ARG_WITH(occ-lib,
AC_HELP_STRING([--with-occ-lib=DIR], [Path to the OpenCascade library files]),
[fc_occ_libs=$withval],
[fc_occ_libs=$fc_occ_libs_test])
fc_occ_ac_save_cppflags=$CPPFLAGS
fc_occ_ac_save_ldflags=$LDFLAGS
fc_occ_ac_save_libs=$LIBS
CPPFLAGS="$CPPFLAGS -I$fc_occ_incs"
LDFLAGS="$LDFLAGS -L$fc_occ_libs"
LIBS="-ldl -lTKernel"
fc_cv_lib_occ_avail=no
AC_CHECK_HEADER(Standard.hxx,[
AC_MSG_CHECKING([whether OCC libs are available])
AC_TRY_LINK([#define HAVE_IOSTREAM 1
#include <gp_Pnt.hxx>],
[gp_Pnt pt(0,0,0);],
[fc_cv_lib_occ_avail=yes
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))])
# Checking for version >= 6.1
LIBS="-ldl -lTKernel -lTKMesh -lTKG2d -lTKG3d -lTKTopAlgo -lTKMath -lTKBRep -lTKGeomBase -lTKGeomAlgo"
fc_cv_lib_occ_ver_6=no
if test x"$fc_cv_lib_occ_avail" = xyes; then
AC_CHECK_HEADER(Standard.hxx,[
AC_MSG_CHECKING([whether OCC is >= 6.1])
AC_TRY_LINK([#define HAVE_IOSTREAM 1
#include <gp_Pnt.hxx>],
[gp_Pnt pt(0,0,0);],
[fc_cv_lib_occ_ver_6=yes
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))])
fi
CPPFLAGS=$fc_occ_ac_save_cppflags
LDFLAGS=$fc_occ_ac_save_ldflags
LIBS=$fc_occ_ac_save_libs
if test x"$fc_cv_lib_occ_avail" = xyes; then
AC_SUBST([OCC_INC], [$fc_occ_incs])
AC_SUBST([OCC_LIB], [$fc_occ_libs])
else
AC_MSG_WARN([
**** Cannot find OpenCASCADE devel files.
Modules that depend on this library cannot be built. ****
])
fi
AM_CONDITIONAL(HAVE_OPENCASCADE, test x"$fc_cv_lib_occ_avail" = xyes)
AM_CONDITIONAL(OCC_VERSION6, test x"$fc_cv_lib_occ_ver_6" = xyes)
dnl checking for Salome SMESH
dnl **************************************************************************
#AC_MSG_CHECKING([for Salome SMESH])
#AC_ARG_WITH(smesh-include,
# AC_HELP_STRING([--with-smesh-include=DIR], [Path to the Salome SMESH header files]),
# [fc_smesh_incs=$withval],
# [fc_smesh_incs=/usr/include])
#
#AC_CHECK_FILE($fc_smesh_incs/SMESH_Gen.hxx,,
# [AC_CHECK_FILE(/usr/local/include/smesh,[fc_smesh_incs=/usr/local/include])])
#
#AC_ARG_WITH(smesh-lib,
# AC_HELP_STRING([--with-smesh-lib=DIR], [Path to the Salome SMESH library files]),
# [fc_smesh_libs=$withval],
# [fc_smesh_libs=/usr/lib])
#
#fc_smesh_ac_save_cppflags=$CPPFLAGS
#fc_smesh_ac_save_ldflags=$LDFLAGS
#fc_smesh_ac_save_libs=$LIBS
#CPPFLAGS="$CPPFLAGS -I$fc_smesh_incs -I$OCC_INC"
#LDFLAGS="$LDFLAGS -L$fc_smesh_libs"
#LIBS="-lSMESH"
#
#fc_cv_lib_smesh_avail=no
#AC_CHECK_HEADER(SMESH_Gen.hxx,[
#AC_MSG_CHECKING([whether SMESH lib is available])
#AC_TRY_LINK([#include <SMESH_Gen.hxx>],
# [SMESH_Gen meshgen;],
# [fc_cv_lib_smesh_avail=yes
# AC_MSG_RESULT(yes)],
# AC_MSG_RESULT(no))])
#
#CPPFLAGS=$fc_smesh_ac_save_cppflags
#LDFLAGS=$fc_smesh_ac_save_ldflags
#LIBS=$fc_smesh_ac_save_libs
#
#if test x"$fc_cv_lib_smesh_avail" = xyes; then
# AC_SUBST([SMESH_INCLUDE], [$fc_smesh_incs])
# AC_SUBST([SMESH_LIBRARY], [$fc_smesh_libs])
#else
# AC_MSG_WARN([
# **** Cannot find Salome SMESH devel files. ****
# ])
#fi
#
#AM_CONDITIONAL(HAVE_SALOMESMESH, test x"$fc_cv_lib_smesh_avail" = xyes)
# check whether netgen support has to be enabled
AC_ARG_ENABLE(netgen,[--enable-netgen use netgen [default=no]],enable_netgen=$enableval,enable_netgen=no)
if test "$enable_netgen" = "yes"; then
AC_CHECK_HEADERS([nglib.h])
fi
AM_CONDITIONAL(NETGEN, test "$enable_netgen" = "yes")
AC_TRY_COMPILE( [],
[int array[((int)sizeof(void*))-6];],
[enable_stdmeshers_64bit="yes"],
[enable_stdmeshers_64bit="no"] )
AM_CONDITIONAL(STDMESHERS64BIT, test "$enable_stdmeshers_64bit" = "yes")
dnl checking for spnav library (for 3d mouse support)
dnl **************************************************************************
AC_MSG_CHECKING([for spnav])
AC_ARG_WITH(spnav-include,
AC_HELP_STRING([--with-spnav-include=DIR], [Path to the spnav header files]),
[fc_spnav_incs=$withval],
[fc_spnav_incs=/usr/include])
fc_spnav_ac_save_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$fc_spnav_incs"
fc_cv_lib_spnav_avail=no
AC_CHECK_HEADER(spnav.h,
fc_cv_lib_spnav_avail=yes,)
CPPFLAGS=$fc_spnav_ac_save_cppflags
if test x"$fc_cv_lib_spnav_avail" = xyes; then
AC_SUBST([SPNAV_INC], [$fc_spnav_incs])
else
AC_MSG_WARN([
**** Cannot find spnav devel files.
No support for 3D SpaceNavigator. ****
])
fi
AM_CONDITIONAL(HAVE_SPNAV_FOUND, test x"$fc_cv_lib_spnav_avail" = xyes)
dnl checking for matplotlib
dnl **************************************************************************
fc_matplotlib_avail=no
AC_MSG_CHECKING([for matplotlib])
fc_matplotlib_ver=`python -c "import matplotlib as m; print m.__version__;"`;
if test x$fc_py_ver = x; then
AC_MSG_WARN([
**** Cannot find matplotlib Python module.
Plot Module will not available until matplotlib is installed ****
])
else
fc_matplotlib_avail=yes
fi;
AC_MSG_RESULT([yes])
AM_CONDITIONAL(HAVE_MATPLOTLIB, test x"$fc_matplotlib_avail" = xyes)
#---------------------------------------------------------------------
#
# Check if 64-bit platform
#
#---------------------------------------------------------------------
AC_MSG_CHECKING([if platform is 64-bit (-D_OCC64)])
AC_TRY_COMPILE( [],
[int array[((int)sizeof(void*))-6];],
[AC_MSG_RESULT([yes]); CPPFLAGS="$CPPFLAGS -D_OCC64"; case $platform in Linux*) CPPFLAGS="$CPPFLAGS -m64";; esac],
[AC_MSG_RESULT([no])] )
#AC_MSG_CHECKING([if platform is 64-bit (-D_OCC64)])
#AC_TRY_COMPILE([],[int array[6-(int)sizeof(void*)];],[AC_MSG_RESULT(no)],
# [AC_MSG_RESULT(yes); OCC_INC_FLAG="$OCC_INC_FLAG -D_OCC64"])
dnl checking for WildMagic3
dnl **************************************************************************
dnl AC_CHECKING([WildMagic3])
dnl AC_ARG_WITH(wm3-include,
dnl AC_HELP_STRING([--with-wm3-include=DIR], [Path to the WildMagic3 header files]),
dnl [fc_wm3_incs=$withval],
dnl [fc_wm3_incs=/usr/include/WildMagic3/Include])
dnl
dnl AC_ARG_WITH(wm3-lib,
dnl AC_HELP_STRING([--with-wm3-lib=DIR], [Path to the WildMagic3 library files]),
dnl [fc_wm3_libs=$withval],
dnl [fc_wm3_libs=/usr/lib])
dnl
dnl AC_CHECK_FILE($fc_wm3_incs/Wm3Query.h,fc_wm3_ver=340,fc_wm3_ver=330)
dnl
dnl Set the appropriate library name
dnl if test x"$fc_wm3_ver" = x"330"; then
dnl fc_wm3_lib="WildMagic3"
dnl fc_wm3_txt="Version <= 3.3.0"
dnl else
dnl fc_wm3_lib="Wm3Foundation"
dnl fc_wm3_txt="Version >= 3.4.0"
dnl fi
dnl
dnl fc_wm3_ac_save_cppflags=$CPPFLAGS
dnl fc_wm3_ac_save_ldflags=$LDFLAGS
dnl fc_wm3_ac_save_libs=$LIBS
dnl CPPFLAGS="$CPPFLAGS -I$fc_wm3_incs"
dnl LDFLAGS="$LDFLAGS -L$fc_wm3_libs"
dnl LIBS="-l$fc_wm3_lib"
dnl
dnl fc_cv_lib_wm3_avail=no
dnl AC_CHECK_HEADER(Wm3Math.h,[
dnl AC_MSG_CHECKING([whether WildMagic lib is available])
dnl AC_TRY_LINK([#include <Wm3Math.h>],
dnl [double val = Wm3::Math<double>::Cos(0.0);],
dnl [fc_cv_lib_wm3_avail=yes
dnl AC_MSG_RESULT(yes)],
dnl AC_MSG_RESULT(no))])
dnl
dnl CPPFLAGS=$fc_wm3_ac_save_cppflags
dnl LDFLAGS=$fc_wm3_ac_save_ldflags
dnl LIBS=$fc_wm3_ac_save_libs
dnl
dnl if test x"$fc_cv_lib_wm3_avail" = xyes; then
dnl AC_SUBST([WM3_CFLAGS], [-I$fc_wm3_incs])
dnl AC_SUBST([WM3_LDFLAGS], [-L$fc_wm3_libs])
dnl AC_SUBST([WM3_LIBS], [-l$fc_wm3_lib])
dnl AC_SUBST([WM3_VERSION], [$fc_wm3_ver])
dnl else
dnl AC_MSG_WARN([
dnl **** Cannot find WildMagic devel files.
dnl Modules that depend on this library cannot be built. ****
dnl ])
dnl fi
dnl
dnl AM_CONDITIONAL(WM3_LIBRARY_FILES, test x"$fc_cv_lib_wm3_avail" = xyes)
dnl checking for GTS
dnl **************************************************************************
dnl
dnl AC_PATH_PROG(GTSCONFIG, gts-config, false, $PATH)
dnl if test x"$GTSCONFIG" != xfalse; then
dnl fc_gts_incs=`gts-config --cflags`
dnl fc_gts_libs=`gts-config --libs`
dnl
dnl AC_SUBST([GTS_CFLAGS], [$fc_gts_incs])
dnl AC_SUBST([GTS_LIBS], [$fc_gts_libs])
dnl else
dnl AC_MSG_WARN([
dnl **** Cannot find GTS library files.
dnl Modules that depend on this library cannot be built. ****
dnl ])
dnl fi
dnl
dnl AM_CONDITIONAL(HAVE_GTS, test x"$GTSCONFIG" != xfalse)
dnl checking for OpenCV
dnl **************************************************************************
dnl HAVE_OPENCV=false
dnl PKG_CHECK_MODULES(opencv, opencv, [HAVE_OPENCV=true], [true])
dnl if test x$HAVE_OPENCV = xfalse; then
dnl AC_MSG_WARN([
dnl **** Cannot find OpenCV library files.
dnl Modules that depend on this library cannot be built. ****
dnl ])
dnl fi
dnl
dnl AM_CONDITIONAL([HAVE_OPENCV], [test x$HAVE_OPENCV = xtrue])
dnl **************************************************************************
AC_SUBST(all_includes)
AC_SUBST(all_libraries)
dnl Check if you want to have log info, or not
dnl **************************************************************************
AC_ARG_ENABLE([loginfo],
AC_HELP_STRING([--enable-loginfo], [Enable log information (disabled by default)]),
[case $enableval in
no | false) fc_set_loginfo=false ;;
*) fc_set_loginfo=true ;;
esac],
[fc_set_loginfo=false])
if $fc_set_loginfo; then
CPPFLAGS="$CPPFLAGS -DFC_DEBUG"
fi
AC_ARG_ENABLE([template],
AC_HELP_STRING([--enable-template], [Enable the build of the _TEMPLATE_ module (disabled by default)]),
[case $enableval in
no | false) fc_set_template=false ;;
*) fc_set_template=true ;;
esac],
[fc_set_template=false])
AM_CONDITIONAL(BUILD_TEMPLATE, test x"$fc_set_template" = xtrue)
AC_ARG_ENABLE([sandbox],
AC_HELP_STRING([--enable-sandbox], [Enable the build of the Sandbox module (disabled by default)]),
[case $enableval in
no | false) fc_set_sandbox=false ;;
*) fc_set_sandbox=true ;;
esac],
[fc_set_sandbox=false])
AM_CONDITIONAL(BUILD_SANDBOX, test x"$fc_set_sandbox" = xtrue)
AC_ARG_ENABLE([assembly],
AC_HELP_STRING([--enable-assembly], [Enable the build of the Assembly module (disabled by default)]),
[case $enableval in
no | false) fc_set_assembly=false ;;
*) fc_set_assembly=true ;;
esac],
[fc_set_assembly=false])
AM_CONDITIONAL(BUILD_ASSEMBLY, test x"$fc_set_assembly" = xtrue)
AC_ARG_ENABLE([cam],
AC_HELP_STRING([--enable-cam], [Enable the build of the Cam module (disabled by default)]),
[case $enableval in
no | false) fc_set_cam=false ;;
*) fc_set_cam=true ;;
esac],
[fc_set_cam=false])
AM_CONDITIONAL(BUILD_CAM, test x"$fc_set_cam" = xtrue)
dnl Check if you want debug information enabled, or not
dnl **************************************************************************
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug], [Enable debug information (enabled by default)]),
[case $enableval in
no | false) fc_set_debug=false ;;
*) fc_set_debug=true ;;
esac],
[fc_set_debug=true])
if $fc_set_debug; then
CPPFLAGS="$CPPFLAGS -g -D_DEBUG"
else
CPPFLAGS="$CPPFLAGS -O2 -DNDEBUG"
fi
dnl Check if you want thread support, or not (currently disabled, thread support is forced)
dnl **************************************************************************
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
LDFLAGS="$LDFLAGS -lpthread"
fc_set_thread=true
#AC_ARG_ENABLE([thread],
# AC_HELP_STRING([--enable-thread], [Enable thread support]),
# [case $enableval in
# no | false) fc_set_thread=false ;;
# *) fc_set_thread=true ;;
# esac],
# [fc_set_thread=true])
#if $fc_set_thread; then
# AC_CHECK_HEADER([pthread.h])
# AC_CHECK_LIB([pthread],[pthread_create])
# if test "$ac_cv_header_pthread_h" != yes -o \
# "$ac_cv_lib_pthread_pthread_create" != yes; then
# AC_MSG_ERROR([POSIX threads (pthreads) not working. Bye.])
# else
## this is apparently needed for some versions of autoconf/automake
## LIBS="-lpthread $LIBS"
## CXXFLAGS="$CXXFLAGS -D_REENTRANT"
# CPPFLAGS="$CPPFLAGS -D_REENTRANT"
# LDFLAGS="-lpthread"
# fi
#else
# CPPFLAGS="$CPPFLAGS -DNO_FC_THREAD"
#fi
dnl Check if you want compiler warnings enabled, or not
dnl **************************************************************************
AC_ARG_ENABLE([warnings],
AC_HELP_STRING([--enable-warnings], [Enable compiler warnings (enabled by default)]),
[case $enableval in
no | false) fc_set_warn=false ;;
*) fc_set_warn=true ;;
esac],
[fc_set_warn=true])
if $fc_set_warn; then
# CPPFLAGS="$CPPFLAGS -Wall -W"
CPPFLAGS="$CPPFLAGS -Wall"
else
CPPFLAGS="$CPPFLAGS -w"
fi
dnl Check if you want precompiled headers (PCH) enabled, or not
dnl ***********************************************************
dnl
dnl enableval=no
dnl AC_MSG_CHECKING([whether to use precompiled headers])
dnl AC_ARG_ENABLE(pch,
dnl AC_HELP_STRING([--enable-pch],
dnl [use precompiled headers, if available]))
dnl case "${enableval}" in
dnl yes)
dnl AC_MSG_RESULT(yes)
dnl COMP_FLAGS="$COMP_FLAGS -Winvalid-pch"
dnl ;;
dnl no)
dnl AC_MSG_RESULT(no)
dnl ;;
dnl *)
dnl AC_MSG_ERROR([bad value ${enableval} for --enable-pch, needs yes or no])
dnl ;;
dnl esac
dnl AM_CONDITIONAL(USE_PRECOMPILED_HEADERS, test x"$enableval" = xyes)
dnl
dnl CFLAGS="$COMP_FLAGS $OPT_FLAGS"
dnl CXXFLAGS="$COMP_FLAGS $OPT_FLAGS"
dnl **************************************************************************
dnl Use this Makefile.am
dnl if USE_PRECOMPILED_HEADERS
dnl PreCompiled.h.gch: PreCompiled.h
dnl $(CXXCOMPILE) -xc++-header -o $@ $<
dnl
dnl PRECOMPILED = PreCompiled.h.gch
dnl else
dnl PRECOMPILED =
dnl endif
dnl
dnl BUILT_SOURCES=\
dnl $(PRECOMPILED)
dnl **************************************************************************
dnl Define DISTCHECK_CONFIGURE_FLAGS
dnl **************************************************************************
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS CXXFLAGS=\"-fno-strict-aliasing -Wno-write-strings\" LDFLAGS=\"-Wl,-z,defs\""
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
CXX=g++
CXXFLAGS="$CXXFLAGS -Wno-deprecated -frtti"
dnl doxygen
dnl **************************************************************************
AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN)
if test $HAVE_DOXYGEN = "false"; then
AC_MSG_WARN([doxygen not found])
fi
DOXYGEN_OUTPUT_DIR="."
AC_SUBST(DOXYGEN_OUTPUT_DIR)
DOXYGEN_INPUT_LIST="$srcdir/src/CXX $srcdir/src/zipios++ $srcdir/src/3rdParty $srcdir/src/Build $srcdir/src/Base $srcdir/src/App $srcdir/src/Gui $srcdir/src/Mod $srcdir/src/Main $srcdir/src/Doc"
AC_SUBST(DOXYGEN_INPUT_LIST)
DOXYGEN_EXCLUDE_LIST="$srcdir/src/Tools $srcdir/src/3rdParty/CxImage $srcdir/src/3rdParty/Pivy $srcdir/src/3rdParty/Pivy-0.5"
AC_SUBST(DOXYGEN_EXCLUDE_LIST)
DOXYGEN_IMAGE_PATH="$srcdir/src/Gui/Icons"
AC_SUBST(DOXYGEN_IMAGE_PATH)
DOXYGEN_INCLUDE_PATH="$srcdir/src/Doc/doxygen-headers"
AC_SUBST(DOXYGEN_INCLUDE_PATH)
#AC_CONFIG_FILES([src/Doc/doxygen-headers/Inventor/fields/SoSubField.h:$sim_ac_coin_includedir/Inventor/fields/SoSubField.h])
dnl **************************************************************************
AC_CONFIG_FILES([Makefile
data/Makefile
data/examples/Makefile
src/Makefile
src/Build/Makefile
src/3rdParty/Makefile
src/3rdParty/salomesmesh/Makefile
src/Base/Makefile
src/App/Makefile
src/Gui/Makefile
src/Gui/Icons/Makefile
src/Gui/Language/Makefile
src/Gui/propertyeditor/Makefile
src/Gui/iisTaskPanel/Makefile
src/Gui/TaskView/Makefile
src/Main/Makefile
src/Doc/Makefile
src/Doc/BuildDevDoc.cfg
src/Mod/Makefile
src/Mod/Assembly/App/Makefile
src/Mod/Assembly/Gui/Resources/Makefile
src/Mod/Assembly/Gui/Makefile
src/Mod/Assembly/Makefile
src/Mod/Cam/App/Makefile
src/Mod/Cam/Gui/Makefile
src/Mod/Cam/Makefile
src/Mod/Part/Makefile
src/Mod/Part/App/Makefile