Salome HOME
IPAL21346 After Quadrangle Algorithm failed, visualisation of mesh is bad. Regress...
[modules/smesh.git] / configure.ac
1 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 # Author : Marc Tajchman (CEA)
23 # Date : 28/06/2001
24 # Modified by : Patrick GOLDBRONN (CEA)
25 # Modified by : Marc Tajchman (CEA)
26 # Modified by : Alexander BORODIN (OCN) - autotools usage
27 # Created from configure.in.base
28 #
29 AC_INIT([Salome2 Project SMESH module], [5.1.2], [webmaster.salome@opencascade.com], [SalomeSMESH])
30 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
31 AC_CANONICAL_HOST
32 AC_CANONICAL_TARGET
33 AM_INIT_AUTOMAKE([-Wno-portability])
34
35 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
36 AC_SUBST(XVERSION)
37
38 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
39 MODULE_NAME=smesh
40 AC_SUBST(MODULE_NAME)
41
42 echo
43 echo ---------------------------------------------
44 echo Initialize source and build root directories
45 echo ---------------------------------------------
46 echo
47
48 dnl
49 dnl Initialize source and build root directories
50 dnl
51
52 ROOT_BUILDDIR=`pwd`
53 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
54 cd $ROOT_SRCDIR
55 ROOT_SRCDIR=`pwd`
56 cd $ROOT_BUILDDIR
57
58 AC_SUBST(ROOT_SRCDIR)
59 AC_SUBST(ROOT_BUILDDIR)
60
61 echo
62 echo Source root directory : $ROOT_SRCDIR
63 echo Build  root directory : $ROOT_BUILDDIR
64 echo
65 echo
66
67 if test -z "$AR"; then
68    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
69 fi
70 AC_SUBST(AR)
71
72 dnl Export the AR macro so that it will be placed in the libtool file
73 dnl correctly.
74 export AR
75
76 echo
77 echo ---------------------------------------------
78 echo testing make
79 echo ---------------------------------------------
80 echo
81
82 AC_PROG_MAKE_SET
83 AC_PROG_INSTALL
84 AC_LOCAL_INSTALL
85 dnl
86 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
87
88 echo
89 echo ---------------------------------------------
90 echo Configuring production
91 echo ---------------------------------------------
92 echo
93 AC_ENABLE_DEBUG(yes)
94 AC_DISABLE_PRODUCTION
95
96 echo ---------------------------------------------
97 echo testing libtool
98 echo ---------------------------------------------
99
100 dnl first, we set static to no!
101 dnl if we want it, use --enable-static
102 AC_ENABLE_STATIC(no)
103
104 AC_LIBTOOL_DLOPEN
105 AC_PROG_LIBTOOL
106
107 dnl Fix up the INSTALL macro if it s a relative path. We want the
108 dnl full-path to the binary instead.
109 case "$INSTALL" in
110    *install-sh*)
111       INSTALL='\${ROOT_BUILDDIR}'/adm_local/unix/config_files/install-sh
112       ;;
113 esac
114
115 echo
116 echo ---------------------------------------------
117 echo testing C/C++
118 echo ---------------------------------------------
119 echo
120
121 cc_ok=no
122 dnl inutil car libtool
123 dnl AC_PROG_CC
124 AC_PROG_CXX
125 AC_CXX_WARNINGS
126 AC_CXX_TEMPLATE_OPTIONS
127 AC_DEPEND_FLAG
128 # AC_CC_WARNINGS([ansi])
129 cc_ok=yes
130
131 echo
132 echo ---------------------------------------------
133 echo testing Fortran
134 echo ---------------------------------------------
135 echo
136
137 fortran_ok=no
138 AC_PROG_F77
139 AC_F77_LIBRARY_LDFLAGS
140 AC_PROG_FC
141 AC_FC_LIBRARY_LDFLAGS
142 if test "X$FC" != "X" ; then
143    fortran_ok=yes
144    F77=$FC
145 fi
146
147 dnl AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"])
148
149 echo
150
151 dnl Library libdl :
152 AC_CHECK_LIB(dl,dlopen)
153
154 dnl add library libm :
155 AC_CHECK_LIB(m,ceil)
156
157 dnl
158 dnl Well we use sstream which is not in gcc pre-2.95.3
159 dnl We must test if it exists. If not, add it in include !
160 dnl
161
162 AC_CXX_HAVE_SSTREAM
163
164 dnl
165 dnl ---------------------------------------------
166 dnl testing MPICH
167 dnl ---------------------------------------------
168 dnl
169
170 CHECK_MPICH
171
172 echo
173 echo ---------------------------------------------
174 echo testing LEX \& YACC
175 echo ---------------------------------------------
176 echo
177
178 lex_yacc_ok=no
179 AC_PROG_YACC
180 AC_PROG_LEX
181 lex_yacc_ok=yes
182
183 echo
184 echo ---------------------------------------------
185 echo testing python
186 echo ---------------------------------------------
187 echo
188
189 CHECK_PYTHON
190
191 dnl echo
192 dnl echo ---------------------------------------------
193 dnl echo testing java
194 dnl echo ---------------------------------------------
195 dnl echo
196
197 dnl CHECK_JAVA
198
199 echo
200 echo ---------------------------------------------
201 echo testing swig
202 echo ---------------------------------------------
203 echo
204
205 AM_PATH_PYTHON(2.3)
206 CHECK_SWIG
207
208 echo
209 echo ---------------------------------------------
210 echo testing threads
211 echo ---------------------------------------------
212 echo
213
214 ENABLE_PTHREADS
215
216 if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
217     echo
218     echo ---------------------------------------------
219     echo testing omniORB
220     echo ---------------------------------------------
221     echo
222
223     CHECK_OMNIORB
224
225 dnl echo
226 dnl echo ---------------------------------------------
227 dnl echo testing mico
228 dnl echo ---------------------------------------------
229 dnl echo
230
231 dnl CHECK_MICO
232
233     echo
234     echo ---------------------------------------------
235     echo default ORB : omniORB
236     echo ---------------------------------------------
237     echo
238
239     DEFAULT_ORB=omniORB
240
241     echo
242     echo ---------------------------------------------
243     echo testing Corba
244     echo ---------------------------------------------
245     echo
246
247     CHECK_CORBA
248
249     AC_SUBST_FILE(CORBA)
250     corba=make_$ORB
251     CORBA=adm_local/unix/$corba
252
253 fi
254
255 echo
256 echo ---------------------------------------------
257 echo Testing GUI
258 echo ---------------------------------------------
259 echo
260
261 CHECK_GUI_MODULE
262
263 gui_ok=no
264 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then 
265   gui_ok=yes
266 fi
267
268 AM_CONDITIONAL(SMESH_ENABLE_GUI, [test "${gui_ok}" = "yes"])
269
270 if test "${SalomeGUI_need}" == "yes"; then
271   if test "${FullGUI_ok}" != "yes"; then
272     AC_MSG_WARN(For configure SMESH module necessary full GUI!)
273   fi
274 elif test "${SalomeGUI_need}" == "auto"; then
275   if test "${FullGUI_ok}" != "yes"; then
276     AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
277   fi
278 elif test "${SalomeGUI_need}" == "no"; then
279   echo Build without GUI option has been chosen
280 fi
281
282 if test "${gui_ok}" = "yes"; then
283     echo
284     echo ---------------------------------------------
285     echo testing openGL
286     echo ---------------------------------------------
287     echo
288
289     CHECK_OPENGL
290
291     echo
292     echo ---------------------------------------------
293     echo testing QT
294     echo ---------------------------------------------
295     echo
296
297     CHECK_QT
298
299     echo
300     echo ---------------------------------------------
301     echo testing VTK
302     echo ---------------------------------------------
303     echo
304
305     CHECK_VTK
306 fi
307
308 echo
309 echo ---------------------------------------------
310 echo testing HDF5
311 echo ---------------------------------------------
312 echo
313
314 CHECK_HDF5
315
316 echo
317 echo ---------------------------------------------
318 echo BOOST Library
319 echo ---------------------------------------------
320 echo
321
322 CHECK_BOOST
323
324 echo
325 echo ---------------------------------------------
326 echo Testing OpenCascade
327 echo ---------------------------------------------
328 echo
329
330 CHECK_CAS
331
332 if test "${gui_ok}" = "yes"; then
333
334 echo
335 echo ---------------------------------------------
336 echo Testing qwt
337 echo ---------------------------------------------
338 echo
339
340 CHECK_QWT
341
342 fi
343
344 echo
345 echo ---------------------------------------------
346 echo Testing html generators
347 echo ---------------------------------------------
348 echo
349
350 CHECK_HTML_GENERATORS
351
352 echo
353 echo ---------------------------------------------
354 echo Testing Kernel
355 echo ---------------------------------------------
356 echo
357
358 CHECK_KERNEL
359
360 echo
361 echo ---------------------------------------------
362 echo Testing Geom
363 echo ---------------------------------------------
364 echo
365
366 CHECK_GEOM
367
368 echo
369 echo ---------------------------------------------
370 echo Testing Med
371 echo ---------------------------------------------
372 echo
373
374 CHECK_MED
375
376 CHECK_PLATFORM
377
378 echo
379 echo ---------------------------------------------
380 echo Summary
381 echo ---------------------------------------------
382 echo
383
384 echo Configure
385
386 if test "${gui_ok}" = "yes"; then
387   variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok qwt_ok Kernel_ok Geom_ok Med_ok gui_ok"
388 elif test "${SalomeGUI_need}" != "no"; then
389   variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok Med_ok gui_ok"
390 else
391   variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok Med_ok"
392 fi
393
394 for var in $variables
395 do
396    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
397    eval echo \$$var
398 done
399
400 echo
401 echo "Default ORB   : $DEFAULT_ORB"
402 echo
403
404 dnl We don t need to say when we re entering directories if we re using
405 dnl GNU make becuase make does it for us.
406 if test "X$GMAKE" = "Xyes"; then
407    AC_SUBST(SETX) SETX=":"
408 else
409    AC_SUBST(SETX) SETX="set -x"
410 fi
411
412 dnl AM_CONDITIONAL(GUI_ENABLE_CORBA, [test "$GUI_DISABLE_CORBA" = no])
413 dnl AM_CONDITIONAL(ENABLE_PYCONSOLE, [test "$DISABLE_PYCONSOLE" = no])
414 dnl AM_CONDITIONAL(ENABLE_GLVIEWER, [test "$DISABLE_GLVIEWER" = no])
415 dnl AM_CONDITIONAL(ENABLE_PLOT2DVIEWER, [test "$DISABLE_PLOT2DVIEWER" = no])
416 dnl AM_CONDITIONAL(ENABLE_SUPERVGRAPHVIEWER, [test "$DISABLE_SUPERVGRAPHVIEWER" = no])
417 dnl AM_CONDITIONAL(ENABLE_OCCVIEWER, [test "$DISABLE_OCCVIEWER" = no])
418 dnl AM_CONDITIONAL(ENABLE_VTKVIEWER, [test "$DISABLE_VTKVIEWER" = no])
419 dnl AM_CONDITIONAL(ENABLE_SALOMEOBJECT, [test "$DISABLE_SALOMEOBJECT" = no])
420
421 echo
422 echo ---------------------------------------------
423 echo generating Makefiles and configure files
424 echo ---------------------------------------------
425 echo
426
427 #AC_OUTPUT_COMMANDS([ \
428 #  chmod +x ./bin/*; \
429 #  chmod +x ./bin/salome/*; \
430 #])
431
432 # This list is initiated using autoscan and must be updated manually
433 # when adding a new file <filename>.in to manage. When you execute
434 # autoscan, the Makefile list is generated in the output file configure.scan.
435 # This could be helpfull to update de configuration.
436 AC_OUTPUT([ \
437   adm_local/Makefile \
438   adm_local/cmake_files/Makefile \
439   adm_local/unix/Makefile \
440   adm_local/unix/config_files/Makefile \
441   bin/VERSION \
442   bin/Makefile \
443   SMESH_version.h \
444   doc/Makefile \
445   doc/salome/Makefile \
446   doc/salome/gui/Makefile \
447   doc/salome/gui/SMESH/Makefile \
448   doc/salome/gui/SMESH/doxyfile \
449   doc/salome/gui/SMESH/doxyfile_py \
450   doc/salome/tui/Makefile \
451   doc/salome/tui/doxyfile \
452   src/Makefile \
453   src/Controls/Makefile \
454   src/Driver/Makefile \
455   src/DriverDAT/Makefile \
456   src/DriverMED/Makefile \
457   src/DriverSTL/Makefile \
458   src/DriverUNV/Makefile \
459   src/MEFISTO2/Makefile \
460   src/OBJECT/Makefile \
461   src/SMDS/Makefile \
462   src/SMESH/Makefile \
463   src/SMESHClient/Makefile \
464   src/SMESHDS/Makefile \
465   src/SMESHFiltersSelection/Makefile \
466   src/SMESHGUI/Makefile \
467   src/SMESH_I/Makefile \
468   src/SMESH_SWIG/Makefile \
469   src/SMESH_SWIG_WITHIHM/Makefile \
470   src/StdMeshers/Makefile \
471   src/StdMeshersGUI/Makefile \
472   src/StdMeshers_I/Makefile \
473   resources/Makefile \
474   resources/SMESHCatalog.xml \
475   idl/Makefile \
476   Makefile
477 ])