~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-07-16 18:37:41 UTC
  • Revision ID: james.westby@ubuntu.com-20090716183741-oww9kcxqrk991i1n
Tags: upstream-0.8.2237
ImportĀ upstreamĀ versionĀ 0.8.2237

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl                                               -*- Autoconf -*-
 
2
dnl Process this file with autoconf to produce a configure script.
 
3
 
 
4
dnl Init stuff
 
5
dnl **************************************************************************
 
6
dnl release version number info
 
7
m4_define([FREECAD_MAJOR], [0])
 
8
m4_define([FREECAD_MINOR], [8])
 
9
m4_define([FREECAD_MICRO], [2237])
 
10
 
 
11
AC_INIT(FreeCAD,[FREECAD_MAJOR.FREECAD_MINOR.FREECAD_MICRO],[wmayer@users.sourceforge.net], FreeCAD)
 
12
AM_INIT_AUTOMAKE([tar-ustar foreign])
 
13
AM_CONFIG_HEADER([config.h])
 
14
AC_LANG_CPLUSPLUS
 
15
 
 
16
dnl Default install directory is your home directory
 
17
dnl **************************************************************************
 
18
AC_PREFIX_DEFAULT($HOME/FreeCAD)
 
19
 
 
20
dnl Version number
 
21
dnl **************************************************************************
 
22
dnl Shared library versioning
 
23
dnl GENERIC_LIBRARY_VERSION=1:2:0
 
24
dnl                         | | |
 
25
dnl                  +------+ | +---+
 
26
dnl                  |        |     |
 
27
dnl               current:revision:age
 
28
dnl                  |        |     |
 
29
dnl                  |        |     +- increment if interfaces have been added
 
30
dnl                  |        |        set to zero if interfaces have been removed
 
31
dnl                  |        |        or changed
 
32
dnl                  |        +- increment if source code has changed
 
33
dnl                  |           set to zero if current is incremented
 
34
dnl                  +- increment if interfaces have been added, removed or changed
 
35
 
 
36
LIB_CURRENT=2
 
37
LIB_REVISION=0
 
38
LIB_AGE=0
 
39
AC_SUBST(LIB_CURRENT)
 
40
AC_SUBST(LIB_REVISION)
 
41
AC_SUBST(LIB_AGE)
 
42
 
 
43
dnl Required headers
 
44
dnl (mainly for OpenCASCADE 5.2, we need also config.h for cfg's)
 
45
dnl **************************************************************************
 
46
AC_LANG([C++])
 
47
AC_MSG_CHECKING([ for C++ header files ])
 
48
AC_CHECK_HEADERS(istream ostream istream fstream ios iomanip iostream)
 
49
AC_CHECK_HEADERS(iomanip.h limits.h values.h float.h)
 
50
AC_CHECK_HEADERS(siginfo.h bits/sigset.h bstring.h sys/types.h sys/select.h)
 
51
AC_CHECK_HEADERS(sys/filio.h sys/mman.h libc.h)
 
52
AC_CHECK_HEADERS([sstream],,[AC_MSG_ERROR([This header is needed. Bye.])])
 
53
 
 
54
AC_CXX_HAVE_STD_IOSTREAM
 
55
 
 
56
dnl Checking for programs
 
57
dnl **************************************************************************
 
58
AC_PROG_CXX
 
59
AC_PROG_CC
 
60
AC_ENABLE_SHARED(yes)
 
61
AC_ENABLE_STATIC(no)
 
62
AC_LIBTOOL_DLOPEN
 
63
AC_PROG_LIBTOOL
 
64
AC_PROG_LN_S
 
65
 
 
66
AC_PATH_PROG(SWIG, swig, false)
 
67
if test "$SWIG" = false ; then
 
68
   AC_MSG_WARN([Can't find SWIG installation])
 
69
   HAVE_SWIG=0
 
70
   AM_CONDITIONAL(HAVE_SWIG_FOUND, false)
 
71
else
 
72
   HAVE_SWIG=1
 
73
   AM_CONDITIONAL(HAVE_SWIG_FOUND, true)
 
74
fi
 
75
AC_SUBST(HAVE_SWIG)
 
76
 
 
77
dnl Defines in config.h
 
78
dnl **************************************************************************
 
79
AC_DEFINE_UNQUOTED(HAVE_GETENVIRONMENTVARIABLE, 1, [Define to use GetEnvironmentVariable() instead of getenv()])
 
80
AC_DEFINE_UNQUOTED(HAVE_GL_GL_H, 1, [define if the GL header should be included as GL/gl.h])
 
81
AC_DEFINE_UNQUOTED(HAVE_QGLFORMAT_EQ_OP, 1, [Define this to 1 if operator==(QGLFormat&, QGLFormat&) is available])
 
82
AC_DEFINE_UNQUOTED(HAVE_QGLFORMAT_SETOVERLAY, 1, [Define this to 1 if QGLFormat::setOverlay() is available])
 
83
AC_DEFINE_UNQUOTED(HAVE_QGLWIDGET_SETAUTOBUFFERSWAP, 1, [Define this to 1 if QGLWidget::setAutoBufferSwap() is available])
 
84
AC_DEFINE_UNQUOTED(HAVE_QT_KEYPAD_DEFINE, 1, [Define this if Qt::Keypad is available])
 
85
AC_DEFINE_UNQUOTED(HAVE_QWIDGET_SHOWFULLSCREEN, 1, [Define this if QWidget::showFullScreen() is available])
 
86
AC_DEFINE_UNQUOTED(HAVE_SYS_TYPES_H, 1, [Define to 1 if you have the <sys/types.h> header file.])
 
87
AC_DEFINE_UNQUOTED(USE_STD_IOSTREAM, 1, [Define to 1 to build zipios++ sources with iostream.])
 
88
 
 
89
dnl Check if you want to use GUI, or not (currently disabled)
 
90
dnl **************************************************************************
 
91
dnl
 
92
#AC_ARG_ENABLE([gui],
 
93
#  AC_HELP_STRING([--enable-gui], [Enable GUI (you can disable this feature to use FreeCAD in server mode)]),
 
94
#  [case $enableval in
 
95
#    no | false) fc_set_gui=false ;;
 
96
#    *)          fc_set_gui=true ;;
 
97
#  esac],
 
98
#  [fc_set_gui=true])
 
99
#
 
100
#if $fc_set_gui; then
 
101
#       echo "not yet done"
 
102
#fi
 
103
#
 
104
#if test "x$use_glx" = "xyes"; then
 
105
#  AM_CONDITIONAL(FREECAD_BUILD_GUI, true)
 
106
#else
 
107
#  AM_CONDITIONAL(FREECAD_BUILD_GUI, false)
 
108
#fi
 
109
#if FREECAD_BUILD_GUI
 
110
# ... in Makefile.am
 
111
#endif
 
112
 
 
113
## DEFAULT INCLUDE/LIB PATHS
 
114
#all_includes="$all_includes -I/usr/include -I/usr/local/include"
 
115
#all_libraries="$all_libraries -L/usr/lib -L/usr/local/lib"
 
116
 
 
117
dnl *************************************************************************
 
118
dnl
 
119
dnl Checking for libraries.
 
120
dnl
 
121
dnl *************************************************************************
 
122
 
 
123
dnl checking for zlib
 
124
dnl **************************************************************************
 
125
AC_CHECK_LIB(z, inflate, [cv_libz=yes], [cv_libz=no])
 
126
 
 
127
if test "$cv_libz" != "yes"; then
 
128
  AC_MSG_ERROR([
 
129
  **** Cannot find the zlib library. ****
 
130
  ])
 
131
fi
 
132
 
 
133
dnl checking for Python
 
134
dnl **************************************************************************
 
135
dnl AC_MSG_CHECKING([for Python])
 
136
dnl fc_py_ver=`python -c "import sys; print sys.version[[:3]]"`;
 
137
dnl if test x$fc_py_ver = x; then
 
138
dnl     AC_MSG_ERROR([
 
139
dnl     **** Cannot find Python interpreter. ****
 
140
dnl   ])
 
141
dnl fi;
 
142
dnl AC_MSG_RESULT([yes])
 
143
dnl 
 
144
dnl dnl Additional test to force version number of >= 2.5
 
145
dnl AC_MSG_CHECKING([for Python version >= 2.5])
 
146
dnl prog="import sys
 
147
dnl s=0x02050000
 
148
dnl sys.exit(sys.hexversion < s)"
 
149
dnl AS_IF([AM_RUN_LOG([python -c "$prog"])],
 
150
dnl       [AC_MSG_RESULT([yes])], 
 
151
dnl       [AC_MSG_ERROR([
 
152
dnl     **** Install Python version 2.5 or later ****
 
153
dnl       ])])
 
154
 
 
155
dnl At least version 2.5 required
 
156
AM_PATH_PYTHON(2.5)
 
157
 
 
158
 
 
159
AC_ARG_WITH(python-include,
 
160
        AC_HELP_STRING([--with-python-include=DIR], [Path to the Python header files]),
 
161
        [fc_py_incs=$withval],
 
162
        [fc_py_incs=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc()"`])
 
163
 
 
164
AC_ARG_WITH(python-lib,
 
165
        AC_HELP_STRING([--with-python-lib=DIR], [Path to the Python library files]),
 
166
        [fc_py_libs=$withval],
 
167
        [fc_py_libs=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBDIR')"`])
 
168
 
 
169
fc_py_ac_save_cppflags=$CPPFLAGS
 
170
fc_py_ac_save_ldflags=$LDFLAGS
 
171
fc_py_ac_save_libs=$LIBS
 
172
CPPFLAGS="$CPPFLAGS -I$fc_py_incs"
 
173
LDFLAGS="$LDFLAGS -L$fc_py_libs"
 
174
LIBS="-lpython$PYTHON_VERSION"
 
175
 
 
176
dnl Small test program that only works with Python 2.5 and higher
 
177
fc_cv_lib_py_avail=no
 
178
AC_CHECK_HEADER(Python.h,[
 
179
AC_MSG_CHECKING([for libpython$PYTHON_VERSION])
 
180
AC_TRY_LINK([#include "Python.h"],
 
181
        [Py_Initialize(); 
 
182
         const char* sys = "sys"; 
 
183
         PyImport_AddModule(sys);
 
184
         Py_Finalize();],
 
185
        [fc_cv_lib_py_avail=yes
 
186
        AC_MSG_RESULT(yes)],
 
187
        AC_MSG_RESULT(no))])
 
188
 
 
189
CPPFLAGS=$fc_py_ac_save_cppflags
 
190
LDFLAGS=$fc_py_ac_save_ldflags
 
191
LIBS=$fc_py_ac_save_libs
 
192
 
 
193
if test x"$fc_cv_lib_py_avail" = xyes; then
 
194
        all_includes="$all_includes -I$fc_py_incs"
 
195
        all_libraries="$all_libraries -L$fc_py_libs"
 
196
 
 
197
        AC_SUBST([PYTHON_LIB], [python$PYTHON_VERSION])
 
198
else
 
199
        AC_MSG_ERROR([
 
200
        **** Cannot find Python$PYTHON_VERSION devel files. ****
 
201
        ])
 
202
fi
 
203
 
 
204
 
 
205
dnl checking for xerces-c
 
206
dnl **************************************************************************
 
207
AC_MSG_CHECKING([for xerces-c])
 
208
AC_ARG_WITH(xercesc-include,
 
209
        AC_HELP_STRING([--with-xercesc-include=DIR], [Path to the xerces-c header files]),
 
210
        [fc_xer_incs=$withval],
 
211
        [fc_xer_incs=/usr/include])
 
212
 
 
213
AC_CHECK_FILE($fc_xer_incs/xercesc,,
 
214
        [AC_CHECK_FILE(/usr/local/include/xercesc,[fc_xer_incs=/usr/local/include])])
 
215
 
 
216
AC_ARG_WITH(xercesc-lib,
 
217
        AC_HELP_STRING([--with-xercesc-lib=DIR], [Path to the xerces-c library files]),
 
218
        [fc_xer_libs=$withval],
 
219
        [fc_xer_libs=/usr/lib])
 
220
 
 
221
fc_xer_ac_save_cppflags=$CPPFLAGS
 
222
fc_xer_ac_save_ldflags=$LDFLAGS
 
223
fc_xer_ac_save_libs=$LIBS
 
224
CPPFLAGS="$CPPFLAGS -I$fc_xer_incs"
 
225
LDFLAGS="$LDFLAGS -L$fc_xer_libs"
 
226
LIBS="-lxerces-c"
 
227
 
 
228
fc_cv_lib_xer_avail=no
 
229
AC_CHECK_HEADER(xercesc/framework/XMLBuffer.hpp,[
 
230
AC_MSG_CHECKING([whether xerces lib is available])
 
231
AC_TRY_LINK([#include <xercesc/framework/XMLBuffer.hpp>],
 
232
        [XERCES_CPP_NAMESPACE_USE
 
233
         XMLBuffer buf;],
 
234
        [fc_cv_lib_xer_avail=yes
 
235
        AC_MSG_RESULT(yes)],
 
236
        AC_MSG_RESULT(no))])
 
237
 
 
238
CPPFLAGS=$fc_xer_ac_save_cppflags
 
239
LDFLAGS=$fc_xer_ac_save_ldflags
 
240
LIBS=$fc_xer_ac_save_libs
 
241
 
 
242
if test x"$fc_cv_lib_xer_avail" = xyes; then
 
243
        all_includes="$all_includes -I$fc_xer_incs"
 
244
        all_libraries="$all_libraries -L$fc_xer_libs"
 
245
else
 
246
        AC_MSG_ERROR([
 
247
        **** Cannot find xerces devel files. ****
 
248
   ])
 
249
fi
 
250
 
 
251
 
 
252
dnl checking for boost
 
253
dnl ******************
 
254
 
 
255
FREECAD_AC_HAVE_BOOST
 
256
 
 
257
 
 
258
dnl checking for Qt
 
259
dnl ***************
 
260
 
 
261
FREECAD_AC_HAVE_QT(4.1)
 
262
 
 
263
 
 
264
dnl checking for Coin
 
265
dnl **************************************************************************
 
266
 
 
267
SIM_AC_HAVE_COIN_IFELSE(,AC_MSG_ERROR([
 
268
        **** Cannot find Coin devel files. ****
 
269
   ]))
 
270
 
 
271
AC_SUBST([sim_ac_coin_includedir])
 
272
AC_SUBST([sim_ac_coin_cppflags])
 
273
AC_SUBST([sim_ac_coin_ldflags])
 
274
AC_SUBST([sim_ac_coin_libs])
 
275
 
 
276
dnl checking for SoQt
 
277
dnl **************************************************************************
 
278
 
 
279
SIM_AC_HAVE_SOQT_IFELSE(,AC_MSG_ERROR([
 
280
        **** Cannot find SoQt devel files. ****
 
281
   ]))
 
282
 
 
283
AC_SUBST([sim_ac_soqt_includedir])
 
284
AC_SUBST([sim_ac_soqt_cppflags])
 
285
AC_SUBST([sim_ac_soqt_ldflags])
 
286
AC_SUBST([sim_ac_soqt_libs])
 
287
 
 
288
dnl **************************************************************************
 
289
dnl checking for optional libraies
 
290
dnl **************************************************************************
 
291
 
 
292
dnl checking for OpenGL libs
 
293
dnl **************************************************************************
 
294
case $host_os in
 
295
  mingw32*)
 
296
    GL_LIBS="-lopengl32 -lglu32"
 
297
    ;;
 
298
  darwin*)
 
299
    GL_LIBS="-Wl,-F/System/Library/Frameworks -Wl,-framework,OpenGL"
 
300
    ;;
 
301
  linux*)
 
302
    GL_LIBS="-lGL -lGLU"
 
303
    ;;
 
304
esac
 
305
AC_SUBST(GL_LIBS)
 
306
 
 
307
dnl checking for OpenCascade
 
308
dnl **************************************************************************
 
309
dnl Check if CASROOT is set and estimate where the include and libs could be
 
310
if test x"$CASROOT" != x; then
 
311
  fc_occ_incs_test="$CASROOT/inc"
 
312
  fc_occ_libs_test="$CASROOT/Linux/lib"
 
313
else
 
314
  fc_occ_incs_test=/usr/include/opencascade
 
315
  fc_occ_libs_test=/usr/lib
 
316
fi
 
317
 
 
318
AC_CHECKING([OpenCascade])
 
319
AC_ARG_WITH(occ-include,
 
320
        AC_HELP_STRING([--with-occ-include=DIR], [Path to the OpenCascade header files]),
 
321
        [fc_occ_incs=$withval],
 
322
        [fc_occ_incs=$fc_occ_incs_test])
 
323
 
 
324
AC_ARG_WITH(occ-lib,
 
325
        AC_HELP_STRING([--with-occ-lib=DIR], [Path to the OpenCascade library files]),
 
326
        [fc_occ_libs=$withval],
 
327
        [fc_occ_libs=$fc_occ_libs_test])
 
328
 
 
329
fc_occ_ac_save_cppflags=$CPPFLAGS
 
330
fc_occ_ac_save_ldflags=$LDFLAGS
 
331
fc_occ_ac_save_libs=$LIBS
 
332
CPPFLAGS="$CPPFLAGS -I$fc_occ_incs"
 
333
LDFLAGS="$LDFLAGS -L$fc_occ_libs"
 
334
LIBS="-ldl -lTKernel"
 
335
 
 
336
fc_cv_lib_occ_avail=no
 
337
AC_CHECK_HEADER(Standard.hxx,[
 
338
AC_MSG_CHECKING([whether OCC libs are available])
 
339
AC_TRY_LINK([#define HAVE_IOSTREAM 1
 
340
        #include <gp_Pnt.hxx>],
 
341
        [gp_Pnt pt(0,0,0);],
 
342
        [fc_cv_lib_occ_avail=yes
 
343
        AC_MSG_RESULT(yes)],
 
344
        AC_MSG_RESULT(no))])
 
345
 
 
346
# Checking for version >= 6.1
 
347
LIBS="-ldl -lTKernel -lTKMesh -lTKG2d -lTKG3d -lTKTopAlgo -lTKMath -lTKBRep -lTKGeomBase -lTKGeomAlgo"
 
348
fc_cv_lib_occ_ver_6=no
 
349
if test x"$fc_cv_lib_occ_avail" = xyes; then
 
350
        AC_CHECK_HEADER(Standard.hxx,[
 
351
        AC_MSG_CHECKING([whether OCC is >= 6.1])
 
352
        AC_TRY_LINK([#define HAVE_IOSTREAM 1
 
353
                #include <gp_Pnt.hxx>],
 
354
                [gp_Pnt pt(0,0,0);],
 
355
                [fc_cv_lib_occ_ver_6=yes
 
356
                AC_MSG_RESULT(yes)],
 
357
                AC_MSG_RESULT(no))])
 
358
fi
 
359
 
 
360
CPPFLAGS=$fc_occ_ac_save_cppflags
 
361
LDFLAGS=$fc_occ_ac_save_ldflags
 
362
LIBS=$fc_occ_ac_save_libs
 
363
 
 
364
if test x"$fc_cv_lib_occ_avail" = xyes; then
 
365
        AC_SUBST([OCC_INC], [$fc_occ_incs])
 
366
        AC_SUBST([OCC_LIB], [$fc_occ_libs])
 
367
else
 
368
        AC_MSG_WARN([
 
369
        **** Cannot find OpenCASCADE devel files.
 
370
        Modules that depend on this library cannot be built. ****
 
371
  ])
 
372
fi
 
373
 
 
374
AM_CONDITIONAL(HAVE_OPENCASCADE, test x"$fc_cv_lib_occ_avail" = xyes)
 
375
AM_CONDITIONAL(OCC_VERSION6, test x"$fc_cv_lib_occ_ver_6" = xyes)
 
376
 
 
377
#---------------------------------------------------------------------
 
378
#
 
379
# Check if 64-bit platform
 
380
#  
 
381
#---------------------------------------------------------------------
 
382
AC_MSG_CHECKING([if platform is 64-bit (-D_OCC64)])
 
383
AC_TRY_COMPILE( [], 
 
384
 [int array[((int)sizeof(void*))-6];],
 
385
 [AC_MSG_RESULT([yes]); CPPFLAGS="$CPPFLAGS -D_OCC64"; case $platform in Linux*) CPPFLAGS="$CPPFLAGS -m64";; esac],
 
386
 [AC_MSG_RESULT([no])] )
 
387
 
 
388
#AC_MSG_CHECKING([if platform is 64-bit (-D_OCC64)]) 
 
389
#AC_TRY_COMPILE([],[int array[6-(int)sizeof(void*)];],[AC_MSG_RESULT(no)], 
 
390
#               [AC_MSG_RESULT(yes); OCC_INC_FLAG="$OCC_INC_FLAG -D_OCC64"])
 
391
 
 
392
dnl checking for WildMagic3
 
393
dnl **************************************************************************
 
394
dnl AC_CHECKING([WildMagic3])
 
395
dnl AC_ARG_WITH(wm3-include,
 
396
dnl     AC_HELP_STRING([--with-wm3-include=DIR], [Path to the WildMagic3 header files]),
 
397
dnl     [fc_wm3_incs=$withval],
 
398
dnl     [fc_wm3_incs=/usr/include/WildMagic3/Include])
 
399
dnl 
 
400
dnl AC_ARG_WITH(wm3-lib,
 
401
dnl     AC_HELP_STRING([--with-wm3-lib=DIR], [Path to the WildMagic3 library files]),
 
402
dnl     [fc_wm3_libs=$withval],
 
403
dnl     [fc_wm3_libs=/usr/lib])
 
404
dnl 
 
405
dnl AC_CHECK_FILE($fc_wm3_incs/Wm3Query.h,fc_wm3_ver=340,fc_wm3_ver=330)
 
406
dnl 
 
407
dnl Set the appropriate library name
 
408
dnl if test x"$fc_wm3_ver" = x"330"; then
 
409
dnl     fc_wm3_lib="WildMagic3"
 
410
dnl     fc_wm3_txt="Version <= 3.3.0"
 
411
dnl else
 
412
dnl     fc_wm3_lib="Wm3Foundation"
 
413
dnl     fc_wm3_txt="Version >= 3.4.0"
 
414
dnl fi
 
415
dnl 
 
416
dnl fc_wm3_ac_save_cppflags=$CPPFLAGS
 
417
dnl fc_wm3_ac_save_ldflags=$LDFLAGS
 
418
dnl fc_wm3_ac_save_libs=$LIBS
 
419
dnl CPPFLAGS="$CPPFLAGS -I$fc_wm3_incs"
 
420
dnl LDFLAGS="$LDFLAGS -L$fc_wm3_libs"
 
421
dnl LIBS="-l$fc_wm3_lib"
 
422
dnl 
 
423
dnl fc_cv_lib_wm3_avail=no
 
424
dnl AC_CHECK_HEADER(Wm3Math.h,[
 
425
dnl AC_MSG_CHECKING([whether WildMagic lib is available])
 
426
dnl AC_TRY_LINK([#include <Wm3Math.h>],
 
427
dnl     [double val = Wm3::Math<double>::Cos(0.0);],
 
428
dnl     [fc_cv_lib_wm3_avail=yes
 
429
dnl     AC_MSG_RESULT(yes)],
 
430
dnl     AC_MSG_RESULT(no))])
 
431
dnl 
 
432
dnl CPPFLAGS=$fc_wm3_ac_save_cppflags
 
433
dnl LDFLAGS=$fc_wm3_ac_save_ldflags
 
434
dnl LIBS=$fc_wm3_ac_save_libs
 
435
dnl 
 
436
dnl if test x"$fc_cv_lib_wm3_avail" = xyes; then
 
437
dnl     AC_SUBST([WM3_CFLAGS], [-I$fc_wm3_incs])
 
438
dnl     AC_SUBST([WM3_LDFLAGS], [-L$fc_wm3_libs])
 
439
dnl     AC_SUBST([WM3_LIBS], [-l$fc_wm3_lib])
 
440
dnl     AC_SUBST([WM3_VERSION], [$fc_wm3_ver])
 
441
dnl else
 
442
dnl     AC_MSG_WARN([
 
443
dnl     **** Cannot find WildMagic devel files.
 
444
dnl     Modules that depend on this library cannot be built. ****
 
445
dnl   ])
 
446
dnl fi
 
447
dnl 
 
448
dnl AM_CONDITIONAL(WM3_LIBRARY_FILES, test x"$fc_cv_lib_wm3_avail" = xyes)
 
449
 
 
450
dnl checking for GTS
 
451
dnl **************************************************************************
 
452
 
 
453
AC_PATH_PROG(GTSCONFIG, gts-config, false, $PATH)
 
454
if test x"$GTSCONFIG" != xfalse; then
 
455
        fc_gts_incs=`gts-config --cflags`
 
456
        fc_gts_libs=`gts-config --libs`
 
457
 
 
458
        AC_SUBST([GTS_CFLAGS], [$fc_gts_incs])
 
459
        AC_SUBST([GTS_LIBS], [$fc_gts_libs])
 
460
else
 
461
        AC_MSG_WARN([
 
462
        **** Cannot find GTS library files.
 
463
        Modules that depend on this library cannot be built. ****
 
464
  ])
 
465
fi
 
466
 
 
467
AM_CONDITIONAL(HAVE_GTS, test x"$GTSCONFIG" != xfalse)
 
468
 
 
469
dnl checking for OpenCV
 
470
dnl **************************************************************************
 
471
 
 
472
HAVE_OPENCV=false
 
473
PKG_CHECK_MODULES(opencv, opencv, [HAVE_OPENCV=true], [true])
 
474
if test x$HAVE_OPENCV = xfalse; then
 
475
        AC_MSG_WARN([
 
476
        **** Cannot find OpenCV library files.
 
477
        Modules that depend on this library cannot be built. ****
 
478
  ])
 
479
fi
 
480
 
 
481
AM_CONDITIONAL([HAVE_OPENCV], [test x$HAVE_OPENCV = xtrue])
 
482
 
 
483
dnl **************************************************************************
 
484
 
 
485
AC_SUBST(all_includes)
 
486
AC_SUBST(all_libraries)
 
487
 
 
488
dnl Check if you want to have log info, or not
 
489
dnl **************************************************************************
 
490
 
 
491
AC_ARG_ENABLE([loginfo],
 
492
  AC_HELP_STRING([--enable-loginfo], [Enable log information (disabled by default)]),
 
493
  [case $enableval in
 
494
    no | false) fc_set_loginfo=false ;;
 
495
    *)          fc_set_loginfo=true ;;
 
496
  esac],
 
497
  [fc_set_loginfo=false])
 
498
 
 
499
if $fc_set_loginfo; then
 
500
        CPPFLAGS="$CPPFLAGS -DFC_DEBUG"
 
501
fi
 
502
 
 
503
dnl Check if you want debug information enabled, or not
 
504
dnl **************************************************************************
 
505
 
 
506
AC_ARG_ENABLE([debug],
 
507
  AC_HELP_STRING([--enable-debug], [Enable debug information (enabled by default)]),
 
508
  [case $enableval in
 
509
    no | false) fc_set_debug=false ;;
 
510
    *)          fc_set_debug=true ;;
 
511
  esac],
 
512
  [fc_set_debug=true])
 
513
if $fc_set_debug; then
 
514
        CPPFLAGS="$CPPFLAGS -g -D_DEBUG"
 
515
else
 
516
        CPPFLAGS="$CPPFLAGS -O2 -DNDEBUG"
 
517
fi
 
518
 
 
519
dnl Check if you want thread support, or not (currently disabled, thread support is forced)
 
520
dnl **************************************************************************
 
521
 
 
522
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
 
523
LDFLAGS="$LDFLAGS -lpthread"
 
524
fc_set_thread=true
 
525
 
 
526
#AC_ARG_ENABLE([thread],
 
527
#  AC_HELP_STRING([--enable-thread], [Enable thread support]),
 
528
#  [case $enableval in
 
529
#    no | false) fc_set_thread=false ;;
 
530
#    *)          fc_set_thread=true ;;
 
531
#  esac],
 
532
#  [fc_set_thread=true])
 
533
#if $fc_set_thread; then
 
534
#       AC_CHECK_HEADER([pthread.h])
 
535
#       AC_CHECK_LIB([pthread],[pthread_create])
 
536
#       if test "$ac_cv_header_pthread_h" != yes -o \
 
537
#               "$ac_cv_lib_pthread_pthread_create" != yes; then
 
538
#               AC_MSG_ERROR([POSIX threads (pthreads) not working. Bye.])
 
539
#       else
 
540
##              this is apparently needed for some versions of autoconf/automake
 
541
##              LIBS="-lpthread $LIBS"
 
542
##              CXXFLAGS="$CXXFLAGS -D_REENTRANT"
 
543
#               CPPFLAGS="$CPPFLAGS -D_REENTRANT"
 
544
#               LDFLAGS="-lpthread"
 
545
#       fi
 
546
#else
 
547
#       CPPFLAGS="$CPPFLAGS -DNO_FC_THREAD"
 
548
#fi
 
549
 
 
550
dnl Check if you want compiler warnings enabled, or not
 
551
dnl **************************************************************************
 
552
 
 
553
AC_ARG_ENABLE([warnings],
 
554
  AC_HELP_STRING([--enable-warnings], [Enable compiler warnings (enabled by default)]),
 
555
  [case $enableval in
 
556
    no | false) fc_set_warn=false ;;
 
557
    *)          fc_set_warn=true ;;
 
558
  esac],
 
559
  [fc_set_warn=true])
 
560
if $fc_set_warn; then
 
561
#       CPPFLAGS="$CPPFLAGS -Wall -W"
 
562
        CPPFLAGS="$CPPFLAGS -Wall"
 
563
else
 
564
        CPPFLAGS="$CPPFLAGS -w"
 
565
fi
 
566
 
 
567
dnl Check if you want precompiled headers (PCH) enabled, or not
 
568
dnl ***********************************************************
 
569
dnl 
 
570
dnl enableval=no
 
571
dnl AC_MSG_CHECKING([whether to use precompiled headers])
 
572
dnl AC_ARG_ENABLE(pch,
 
573
dnl   AC_HELP_STRING([--enable-pch],
 
574
dnl     [use precompiled headers, if available]))
 
575
dnl case "${enableval}" in
 
576
dnl yes)
 
577
dnl   AC_MSG_RESULT(yes)
 
578
dnl   COMP_FLAGS="$COMP_FLAGS -Winvalid-pch"
 
579
dnl   ;;
 
580
dnl no)
 
581
dnl   AC_MSG_RESULT(no)
 
582
dnl   ;;
 
583
dnl *)
 
584
dnl   AC_MSG_ERROR([bad value ${enableval} for --enable-pch, needs yes or no])
 
585
dnl   ;;
 
586
dnl esac
 
587
dnl AM_CONDITIONAL(USE_PRECOMPILED_HEADERS, test x"$enableval" = xyes)
 
588
dnl 
 
589
dnl CFLAGS="$COMP_FLAGS $OPT_FLAGS"
 
590
dnl CXXFLAGS="$COMP_FLAGS $OPT_FLAGS"
 
591
dnl **************************************************************************
 
592
dnl Use this Makefile.am
 
593
dnl if USE_PRECOMPILED_HEADERS
 
594
dnl PreCompiled.h.gch: PreCompiled.h
 
595
dnl     $(CXXCOMPILE) -xc++-header -o $@ $<
 
596
dnl 
 
597
dnl PRECOMPILED = PreCompiled.h.gch
 
598
dnl else
 
599
dnl PRECOMPILED =
 
600
dnl endif
 
601
dnl 
 
602
dnl BUILT_SOURCES=\
 
603
dnl             $(PRECOMPILED)
 
604
dnl **************************************************************************
 
605
 
 
606
dnl Define DISTCHECK_CONFIGURE_FLAGS
 
607
dnl **************************************************************************
 
608
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS CXXFLAGS=\"-fno-strict-aliasing\" LDFLAGS=\"-Wl,-z,defs\" --with-occ-include=$fc_occ_incs --with-occ-lib=$fc_occ_libs"
 
609
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
 
610
 
 
611
CXX=g++
 
612
CXXFLAGS="$CXXFLAGS -Wno-deprecated -frtti"
 
613
 
 
614
AC_CONFIG_FILES([Makefile 
 
615
src/Makefile 
 
616
src/3rdParty/Makefile 
 
617
src/Base/Makefile 
 
618
src/App/Makefile 
 
619
src/Gui/Makefile 
 
620
src/Gui/Icons/Makefile 
 
621
src/Gui/Language/Makefile 
 
622
src/Gui/propertyeditor/Makefile 
 
623
src/Gui/iisTaskPanel/Makefile 
 
624
src/Gui/TaskView/Makefile 
 
625
src/Main/Makefile
 
626
src/Mod/Makefile
 
627
src/Mod/Part/Makefile
 
628
src/Mod/Part/App/Makefile
 
629
src/Mod/Part/Gui/Makefile
 
630
src/Mod/Raytracing/Makefile
 
631
src/Mod/Raytracing/App/Makefile
 
632
src/Mod/Raytracing/Gui/Makefile
 
633
src/Mod/Mesh/Makefile
 
634
src/Mod/Mesh/App/Makefile
 
635
src/Mod/Mesh/Gui/Makefile
 
636
src/Mod/MeshPart/Makefile
 
637
src/Mod/MeshPart/App/Makefile
 
638
src/Mod/MeshPart/Gui/Makefile
 
639
src/Mod/MeshPart/Gui/Resources/Makefile
 
640
src/Mod/PartDesign/Makefile
 
641
src/Mod/PartDesign/App/Makefile
 
642
src/Mod/PartDesign/Gui/Makefile
 
643
src/Mod/PartDesign/Gui/Resources/Makefile
 
644
src/Mod/Sketcher/Makefile
 
645
src/Mod/Sketcher/App/Makefile
 
646
src/Mod/Sketcher/Gui/Makefile
 
647
src/Mod/Sketcher/Gui/Resources/Makefile
 
648
src/Mod/Points/Makefile
 
649
src/Mod/Points/App/Makefile
 
650
src/Mod/Points/Gui/Makefile
 
651
src/Mod/Image/Makefile
 
652
src/Mod/Image/App/Makefile
 
653
src/Mod/Image/Gui/Makefile
 
654
src/Mod/Drawing/Makefile
 
655
src/Mod/Drawing/App/Makefile
 
656
src/Mod/Drawing/Gui/Makefile
 
657
src/Mod/Drawing/Gui/Resources/Makefile
 
658
src/Mod/Drawing/Templates/Makefile
 
659
src/Mod/ReverseEngineering/Makefile
 
660
src/Mod/ReverseEngineering/App/Makefile
 
661
src/Mod/ReverseEngineering/Gui/Makefile
 
662
src/Mod/ReverseEngineering/Gui/Resources/Makefile
 
663
src/Mod/Complete/Makefile
 
664
src/Mod/Complete/App/Makefile
 
665
src/Mod/Complete/Gui/Makefile
 
666
src/Mod/Complete/Gui/Resources/Makefile
 
667
src/Mod/Draft/Makefile
 
668
src/Mod/Test/Makefile
 
669
src/Mod/Test/Gui/Makefile
 
670
src/Mod/TemplatePyMod/Makefile
 
671
src/Tools/Makefile
 
672
src/Tools/_TEMPLATE_/Makefile
 
673
src/Tools/_TEMPLATE_/App/Makefile
 
674
src/Tools/_TEMPLATE_/Gui/Makefile
 
675
])
 
676
#src/3rdParty/Pivy/Makefile 
 
677
#src/Mod/Sandbox/Makefile
 
678
#src/Mod/Sandbox/App/Makefile
 
679
#src/Mod/Sandbox/Gui/Makefile
 
680
 
 
681
AC_OUTPUT
 
682
 
 
683
dnl Show a configuration report
 
684
dnl **************************************************************************
 
685
 
 
686
AC_MSG_NOTICE([
 
687
 
 
688
  **************************************************************************
 
689
 
 
690
  FreeCAD configuration settings:
 
691
 
 
692
  C++ compiler:              $CXX
 
693
  Python version:            $PYTHON_VERSION
 
694
  Log info enabled:          $fc_set_loginfo
 
695
  Debug info enabled:        $fc_set_debug
 
696
  Thread enabled (forced):   $fc_set_thread
 
697
  RTTI enabled (forced):     true
 
698
  Compiler warnings enabled: $fc_set_warn
 
699
  installation prefix:       $prefix
 
700
 
 
701
  Now, run 'make' to build FreeCAD.
 
702
 
 
703
  **************************************************************************
 
704
])
 
705
 
 
706
dnl **************************************************************************
 
707