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