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