Salome HOME
8849337c387421d0f8a65afdd6df5de29b8fdeea
[modules/geom.git] / configure.ac
1 # Copyright (C) 2007-2011  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 GEOM module], [6.3.1], [webmaster.salome@opencascade.com], [SalomeGEOM])
28 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
29 AC_CANONICAL_HOST
30 AC_CANONICAL_TARGET
31 AM_INIT_AUTOMAKE([tar-pax -Wno-portability])
32
33
34 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
35 AC_SUBST(XVERSION)
36
37 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
38 MODULE_NAME=geom
39 AC_SUBST(MODULE_NAME)
40
41 echo
42 echo ---------------------------------------------
43 echo Initialize source and build root directories
44 echo ---------------------------------------------
45 echo
46
47 dnl
48 dnl Initialize source and build root directories
49 dnl
50
51 ROOT_BUILDDIR=`pwd`
52 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
53 cd $ROOT_SRCDIR
54 ROOT_SRCDIR=`pwd`
55 cd $ROOT_BUILDDIR
56
57 AC_SUBST(ROOT_SRCDIR)
58 AC_SUBST(ROOT_BUILDDIR)
59
60 echo
61 echo Source root directory : $ROOT_SRCDIR
62 echo Build  root directory : $ROOT_BUILDDIR
63 echo
64 echo
65
66 if test -z "$AR"; then
67    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
68 fi
69 AC_SUBST(AR)
70
71 dnl Export the AR macro so that it will be placed in the libtool file
72 dnl correctly.
73 export AR
74
75 echo
76 echo ---------------------------------------------
77 echo testing make
78 echo ---------------------------------------------
79 echo
80
81 AC_PROG_MAKE_SET
82 AC_PROG_INSTALL
83 AC_LOCAL_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 Configuring 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}'/adm_local/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 dnl Library libdl :
131 AC_CHECK_LIB(dl,dlopen)
132
133 dnl add library libm :
134 AC_CHECK_LIB(m,ceil)
135
136 dnl
137 dnl Well we use sstream which is not in gcc pre-2.95.3
138 dnl We must test if it exists. If not, add it in include !
139 dnl
140
141 AC_CXX_HAVE_SSTREAM
142
143 dnl
144 dnl ---------------------------------------------
145 dnl testing MPICH
146 dnl ---------------------------------------------
147 dnl
148
149 dnl CHECK_MPICH
150
151 echo
152 echo ---------------------------------------------
153 echo testing MPI
154 echo ---------------------------------------------
155 echo
156
157 CHECK_MPI
158
159 echo
160 echo ---------------------------------------------
161 echo testing LEX \& YACC
162 echo ---------------------------------------------
163 echo
164
165 lex_yacc_ok=no
166 AC_PROG_YACC
167 AC_PROG_LEX
168 lex_yacc_ok=yes
169
170 echo
171 echo ---------------------------------------------
172 echo testing python
173 echo ---------------------------------------------
174 echo
175
176 CHECK_PYTHON
177
178 dnl echo
179 dnl echo ---------------------------------------------
180 dnl echo testing java
181 dnl echo ---------------------------------------------
182 dnl echo
183
184 dnl CHECK_JAVA
185
186 echo
187 echo ---------------------------------------------
188 echo testing swig
189 echo ---------------------------------------------
190 echo
191
192 AM_PATH_PYTHON(2.3)
193 CHECK_SWIG
194
195 echo
196 echo ---------------------------------------------
197 echo testing threads
198 echo ---------------------------------------------
199 echo
200
201 ENABLE_PTHREADS
202
203 if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
204 echo
205 echo ---------------------------------------------
206 echo testing omniORB
207 echo ---------------------------------------------
208 echo
209
210 CHECK_OMNIORB
211
212 dnl echo
213 dnl echo ---------------------------------------------
214 dnl echo testing mico
215 dnl echo ---------------------------------------------
216 dnl echo
217
218 dnl CHECK_MICO
219
220 echo
221 echo ---------------------------------------------
222 echo default ORB : omniORB
223 echo ---------------------------------------------
224 echo
225
226 DEFAULT_ORB=omniORB
227
228 echo
229 echo ---------------------------------------------
230 echo testing Corba
231 echo ---------------------------------------------
232 echo
233
234 CHECK_CORBA
235
236 AC_SUBST_FILE(CORBA)
237 corba=make_$ORB
238 CORBA=adm_local/unix/$corba
239
240 fi
241
242 echo
243 echo ---------------------------------------------
244 echo Testing GUI
245 echo ---------------------------------------------
246 echo
247
248 CHECK_GUI_MODULE
249
250 gui_ok=no
251 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then 
252   gui_ok=yes
253 fi
254
255 AM_CONDITIONAL(GEOM_ENABLE_GUI, [test "${gui_ok}" = "yes"])
256
257 if test "${SalomeGUI_need}" == "yes"; then
258   if test "${FullGUI_ok}" != "yes"; then
259     AC_MSG_WARN(For configure GEOM module necessary full GUI!)
260   fi
261 elif test "${SalomeGUI_need}" == "auto"; then
262   if test "${FullGUI_ok}" != "yes"; then
263     AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
264   fi
265 elif test "${SalomeGUI_need}" == "no"; then
266   echo Build without GUI option has been chosen
267 fi
268
269 if test "${gui_ok}" = "yes"; then
270     echo
271     echo ---------------------------------------------
272     echo testing openGL
273     echo ---------------------------------------------
274     echo
275
276     CHECK_OPENGL
277
278     echo
279     echo ---------------------------------------------
280     echo testing QT
281     echo ---------------------------------------------
282     echo
283
284     CHECK_QT
285 fi
286
287 echo
288 echo ---------------------------------------------
289 echo testing VTK
290 echo ---------------------------------------------
291 echo
292
293 CHECK_VTK
294
295 echo
296 echo ---------------------------------------------
297 echo testing HDF5
298 echo ---------------------------------------------
299 echo
300
301 CHECK_HDF5
302
303 echo
304 echo ---------------------------------------------
305 echo BOOST Library
306 echo ---------------------------------------------
307 echo
308
309 CHECK_BOOST
310
311 echo
312 echo ---------------------------------------------
313 echo Testing OpenCascade
314 echo ---------------------------------------------
315 echo
316
317 CHECK_CAS
318
319 echo
320 echo ---------------------------------------------
321 echo Testing html generators
322 echo ---------------------------------------------
323 echo
324
325 CHECK_HTML_GENERATORS
326
327 echo
328 echo ---------------------------------------------
329 echo testing sphinx
330 echo ---------------------------------------------
331 echo
332 CHECK_SPHINX
333
334 echo
335 echo ---------------------------------------------
336 echo testing Opencv
337 echo ---------------------------------------------
338 echo
339 CHECK_OPENCV
340 AC_DEFINE_UNQUOTED(WITH_OPENCV,${WITH_OPENCV})
341
342 echo
343 echo ---------------------------------------------
344 echo Testing Kernel
345 echo ---------------------------------------------
346 echo
347
348 CHECK_KERNEL
349
350 echo
351 echo ---------------------------------------------
352 echo Summary
353 echo ---------------------------------------------
354 echo
355
356 echo Configure
357
358 if test "${gui_ok}" = "yes"; then
359   variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok sphinx_ok opencv_ok Kernel_ok gui_ok"
360 elif test "${SalomeGUI_need}" != "no"; then
361   variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok opencv_ok Kernel_ok gui_ok"
362 else
363   variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok opencv_ok Kernel_ok"
364 fi
365
366 for var in $variables
367 do
368    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
369    eval echo \$$var
370 done
371
372 echo
373 echo "Default ORB   : $DEFAULT_ORB"
374 echo
375
376 dnl We don t need to say when we re entering directories if we re using
377 dnl GNU make because make does it for us.
378 if test "X$GMAKE" = "Xyes"; then
379    AC_SUBST(SETX) SETX=":"
380 else
381    AC_SUBST(SETX) SETX="set -x"
382 fi
383
384 echo
385 echo ---------------------------------------------
386 echo generating Makefiles and configure files
387 echo ---------------------------------------------
388 echo
389
390 #AC_OUTPUT_COMMANDS([ \
391 #  chmod +x ./bin/*; \
392 #])
393
394 AC_HACK_LIBTOOL
395 AC_CONFIG_COMMANDS([hack_libtool],[
396 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
397   $(pwd)/hack_libtool \1 \"\$[@]\" \n\
398 }\n\
399 CC=\"hack_libtool\"%g" libtool
400 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
401 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
402 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
403 ],[])
404
405 # This list is initiated using autoscan and must be updated manually
406 # when adding a new file <filename>.in to manage. When you execute
407 # autoscan, the Makefile list is generated in the output file configure.scan.
408 # This could be helpfull to update de configuration.
409 AC_OUTPUT([ \
410   adm_local/Makefile \
411   adm_local/cmake_files/Makefile \
412   adm_local/unix/Makefile \
413   adm_local/unix/config_files/Makefile \
414   bin/VERSION \
415   bin/Makefile \
416   GEOM_version.h \
417   doc/Makefile \
418   doc/docutils/Makefile \
419   doc/docutils/conf.py \
420   doc/salome/Makefile \
421   doc/salome/gui/Makefile \
422   doc/salome/gui/GEOM/Makefile \
423   doc/salome/gui/GEOM/doxyfile \
424   doc/salome/gui/GEOM/doxyfile_py \
425   doc/salome/gui/GEOM/doxyfile_tui \
426   doc/salome/gui/GEOM/static/header.html \
427   doc/salome/gui/GEOM/static/header_py.html \
428   doc/salome/tui/Makefile \
429   doc/salome/tui/doxyfile \
430   doc/salome/tui/static/header.html \
431   src/Makefile \
432   src/AdvancedGUI/Makefile \
433   src/ARCHIMEDE/Makefile \
434   src/BREPExport/Makefile \
435   src/BREPImport/Makefile \
436   src/BasicGUI/Makefile \
437   src/BlocksGUI/Makefile \
438   src/BooleanGUI/Makefile \
439   src/BuildGUI/Makefile \
440   src/DisplayGUI/Makefile \
441   src/DlgRef/Makefile \
442   src/EntityGUI/Makefile \
443   src/GEOM/Makefile \
444   src/GEOMAlgo/Makefile \
445   src/GEOMBase/Makefile \
446   src/GEOMClient/Makefile \
447   src/GEOMFiltersSelection/Makefile \
448   src/GEOMGUI/Makefile \
449   src/GEOMImpl/Makefile \
450   src/GEOMToolsGUI/Makefile \
451   src/GEOM_I/Makefile \
452   src/GEOM_I_Superv/Makefile \
453   src/GEOM_SWIG/Makefile \
454   src/GEOM_SWIG_WITHIHM/Makefile \
455   src/GEOM_PY/Makefile \
456   src/GEOM_PY/structelem/Makefile \
457   src/GenerationGUI/Makefile \
458   src/GroupGUI/Makefile \
459   src/IGESExport/Makefile \
460   src/IGESImport/Makefile \
461   src/MeasureGUI/Makefile \
462   src/NMTDS/Makefile \
463   src/NMTTools/Makefile \
464   src/OBJECT/Makefile \
465   src/OCC2VTK/Makefile \
466   src/OperationGUI/Makefile \
467   src/PrimitiveGUI/Makefile \
468   src/RepairGUI/Makefile \
469   src/SKETCHER/Makefile \
470   src/STEPExport/Makefile \
471   src/STEPImport/Makefile \
472   src/STLExport/Makefile \
473   src/ShHealOper/Makefile \
474   src/ShapeRecognition/Makefile \
475   src/TransformationGUI/Makefile \
476   src/VTKExport/Makefile \
477   resources/Makefile \
478   resources/GEOMCatalog.xml \
479   resources/SalomeApp.xml \
480   resources/Plugin \
481   idl/Makefile \
482   Makefile \
483 ])