Salome HOME
184a15510e1b23f76a95b4f1ba298277d858f5d1
[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.1], [webmaster.salome@opencascade.com], [SalomeSMESH])
30 AC_CONFIG_AUX_DIR(salome_adm/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 dnl
85 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
86
87 echo
88 echo ---------------------------------------------
89 echo Coniguring production
90 echo ---------------------------------------------
91 echo
92 AC_ENABLE_DEBUG(yes)
93 AC_DISABLE_PRODUCTION
94
95 echo ---------------------------------------------
96 echo testing libtool
97 echo ---------------------------------------------
98
99 dnl first, we set static to no!
100 dnl if we want it, use --enable-static
101 AC_ENABLE_STATIC(no)
102
103 AC_LIBTOOL_DLOPEN
104 AC_PROG_LIBTOOL
105
106 dnl Fix up the INSTALL macro if it s a relative path. We want the
107 dnl full-path to the binary instead.
108 case "$INSTALL" in
109    *install-sh*)
110       INSTALL='\${ROOT_BUILDDIR}'/salome_adm/unix/config_files/install-sh
111       ;;
112 esac
113
114 echo
115 echo ---------------------------------------------
116 echo testing C/C++
117 echo ---------------------------------------------
118 echo
119
120 cc_ok=no
121 dnl inutil car libtool
122 dnl AC_PROG_CC
123 AC_PROG_CXX
124 AC_CXX_WARNINGS
125 AC_CXX_TEMPLATE_OPTIONS
126 AC_DEPEND_FLAG
127 # AC_CC_WARNINGS([ansi])
128 cc_ok=yes
129
130 echo
131 echo ---------------------------------------------
132 echo testing Fortran
133 echo ---------------------------------------------
134 echo
135
136 fortran_ok=no
137 AC_PROG_F77
138 AC_F77_LIBRARY_LDFLAGS
139 AC_PROG_FC
140 AC_FC_LIBRARY_LDFLAGS
141 if test "X$FC" != "X" ; then
142    fortran_ok=yes
143    F77=$FC
144 fi
145
146 dnl AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"])
147
148 echo
149
150 dnl Library libdl :
151 AC_CHECK_LIB(dl,dlopen)
152
153 dnl add library libm :
154 AC_CHECK_LIB(m,ceil)
155
156 dnl
157 dnl Well we use sstream which is not in gcc pre-2.95.3
158 dnl We must test if it exists. If not, add it in include !
159 dnl
160
161 AC_CXX_HAVE_SSTREAM
162
163 dnl
164 dnl ---------------------------------------------
165 dnl testing MPICH
166 dnl ---------------------------------------------
167 dnl
168
169 CHECK_MPICH
170
171 echo
172 echo ---------------------------------------------
173 echo testing LEX \& YACC
174 echo ---------------------------------------------
175 echo
176
177 lex_yacc_ok=no
178 AC_PROG_YACC
179 AC_PROG_LEX
180 lex_yacc_ok=yes
181
182 echo
183 echo ---------------------------------------------
184 echo testing python
185 echo ---------------------------------------------
186 echo
187
188 CHECK_PYTHON
189
190 dnl echo
191 dnl echo ---------------------------------------------
192 dnl echo testing java
193 dnl echo ---------------------------------------------
194 dnl echo
195
196 dnl CHECK_JAVA
197
198 echo
199 echo ---------------------------------------------
200 echo testing swig
201 echo ---------------------------------------------
202 echo
203
204 AM_PATH_PYTHON(2.3)
205 CHECK_SWIG
206
207 echo
208 echo ---------------------------------------------
209 echo testing threads
210 echo ---------------------------------------------
211 echo
212
213 ENABLE_PTHREADS
214
215 if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
216     echo
217     echo ---------------------------------------------
218     echo testing omniORB
219     echo ---------------------------------------------
220     echo
221
222     CHECK_OMNIORB
223
224 dnl echo
225 dnl echo ---------------------------------------------
226 dnl echo testing mico
227 dnl echo ---------------------------------------------
228 dnl echo
229
230 dnl CHECK_MICO
231
232     echo
233     echo ---------------------------------------------
234     echo default ORB : omniORB
235     echo ---------------------------------------------
236     echo
237
238     DEFAULT_ORB=omniORB
239
240     echo
241     echo ---------------------------------------------
242     echo testing Corba
243     echo ---------------------------------------------
244     echo
245
246     CHECK_CORBA
247
248     AC_SUBST_FILE(CORBA)
249     corba=make_$ORB
250     CORBA=adm_local/unix/$corba
251
252 fi
253
254 echo
255 echo ---------------------------------------------
256 echo Testing GUI
257 echo ---------------------------------------------
258 echo
259
260 CHECK_GUI_MODULE
261
262 gui_ok=no
263 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then 
264   gui_ok=yes
265 fi
266
267 AM_CONDITIONAL(SMESH_ENABLE_GUI, [test "${gui_ok}" = "yes"])
268
269 if test "${SalomeGUI_need}" == "yes"; then
270   if test "${FullGUI_ok}" != "yes"; then
271     AC_MSG_WARN(For configure SMESH module necessary full GUI!)
272   fi
273 elif test "${SalomeGUI_need}" == "auto"; then
274   if test "${FullGUI_ok}" != "yes"; then
275     AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
276   fi
277 elif test "${SalomeGUI_need}" == "no"; then
278   echo Build without GUI option has been chosen
279 fi
280
281 if test "${gui_ok}" = "yes"; then
282     echo
283     echo ---------------------------------------------
284     echo testing openGL
285     echo ---------------------------------------------
286     echo
287
288     CHECK_OPENGL
289
290     echo
291     echo ---------------------------------------------
292     echo testing QT
293     echo ---------------------------------------------
294     echo
295
296     CHECK_QT
297
298     echo
299     echo ---------------------------------------------
300     echo testing VTK
301     echo ---------------------------------------------
302     echo
303
304     CHECK_VTK
305 fi
306
307 echo
308 echo ---------------------------------------------
309 echo testing HDF5
310 echo ---------------------------------------------
311 echo
312
313 CHECK_HDF5
314
315 echo
316 echo ---------------------------------------------
317 echo BOOST Library
318 echo ---------------------------------------------
319 echo
320
321 CHECK_BOOST
322
323 echo
324 echo ---------------------------------------------
325 echo Testing OpenCascade
326 echo ---------------------------------------------
327 echo
328
329 CHECK_CAS
330
331 if test "${gui_ok}" = "yes"; then
332
333 echo
334 echo ---------------------------------------------
335 echo Testing qwt
336 echo ---------------------------------------------
337 echo
338
339 CHECK_QWT
340
341 fi
342
343 echo
344 echo ---------------------------------------------
345 echo Testing html generators
346 echo ---------------------------------------------
347 echo
348
349 CHECK_HTML_GENERATORS
350
351 echo
352 echo ---------------------------------------------
353 echo Testing Kernel
354 echo ---------------------------------------------
355 echo
356
357 CHECK_KERNEL
358
359 echo
360 echo ---------------------------------------------
361 echo Testing Geom
362 echo ---------------------------------------------
363 echo
364
365 CHECK_GEOM
366
367 echo
368 echo ---------------------------------------------
369 echo Testing Med
370 echo ---------------------------------------------
371 echo
372
373 CHECK_MED
374
375 CHECK_PLATFORM
376
377 echo
378 echo ---------------------------------------------
379 echo Summary
380 echo ---------------------------------------------
381 echo
382
383 echo Configure
384
385 if test "${gui_ok}" = "yes"; then
386   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"
387 elif test "${SalomeGUI_need}" != "no"; then
388   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"
389 else
390   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"
391 fi
392
393 for var in $variables
394 do
395    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
396    eval echo \$$var
397 done
398
399 echo
400 echo "Default ORB   : $DEFAULT_ORB"
401 echo
402
403 dnl We don t need to say when we re entering directories if we re using
404 dnl GNU make becuase make does it for us.
405 if test "X$GMAKE" = "Xyes"; then
406    AC_SUBST(SETX) SETX=":"
407 else
408    AC_SUBST(SETX) SETX="set -x"
409 fi
410
411 dnl AM_CONDITIONAL(GUI_ENABLE_CORBA, [test "$GUI_DISABLE_CORBA" = no])
412 dnl AM_CONDITIONAL(ENABLE_PYCONSOLE, [test "$DISABLE_PYCONSOLE" = no])
413 dnl AM_CONDITIONAL(ENABLE_GLVIEWER, [test "$DISABLE_GLVIEWER" = no])
414 dnl AM_CONDITIONAL(ENABLE_PLOT2DVIEWER, [test "$DISABLE_PLOT2DVIEWER" = no])
415 dnl AM_CONDITIONAL(ENABLE_SUPERVGRAPHVIEWER, [test "$DISABLE_SUPERVGRAPHVIEWER" = no])
416 dnl AM_CONDITIONAL(ENABLE_OCCVIEWER, [test "$DISABLE_OCCVIEWER" = no])
417 dnl AM_CONDITIONAL(ENABLE_VTKVIEWER, [test "$DISABLE_VTKVIEWER" = no])
418 dnl AM_CONDITIONAL(ENABLE_SALOMEOBJECT, [test "$DISABLE_SALOMEOBJECT" = no])
419
420 echo
421 echo ---------------------------------------------
422 echo generating Makefiles and configure files
423 echo ---------------------------------------------
424 echo
425
426 #AC_OUTPUT_COMMANDS([ \
427 #  chmod +x ./bin/*; \
428 #  chmod +x ./bin/salome/*; \
429 #])
430
431 # This list is initiated using autoscan and must be updated manually
432 # when adding a new file <filename>.in to manage. When you execute
433 # autoscan, the Makefile list is generated in the output file configure.scan.
434 # This could be helpfull to update de configuration.
435 AC_OUTPUT([ \
436   salome_adm/unix/SALOMEconfig.h \
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 ])