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