Salome HOME
Fix for the 21451: EDF 1831 VISU: "Set default" in CutPlanes is not taken into accoun...
[modules/visu.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 : Mikhail Ponikarov (OCN)
25 #
26 AC_INIT([Salome2 Project VISU module], [6.4.0], [webmaster.salome@opencascade.com], [SalomeVISU])
27 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
28 AC_CANONICAL_HOST
29 AC_CANONICAL_TARGET
30 AM_INIT_AUTOMAKE([-Wno-portability])
31
32 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
33 AC_SUBST(XVERSION)
34
35 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
36 MODULE_NAME=visu
37 AC_SUBST(MODULE_NAME)
38
39 dnl
40 dnl Initialize source and build root directories
41 dnl
42
43 ROOT_BUILDDIR=`pwd`
44 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
45 cd $ROOT_SRCDIR
46 ROOT_SRCDIR=`pwd`
47 cd $ROOT_BUILDDIR
48
49 AC_SUBST(ROOT_SRCDIR)
50 AC_SUBST(ROOT_BUILDDIR)
51
52 echo
53 echo Source root directory : $ROOT_SRCDIR
54 echo Build  root directory : $ROOT_BUILDDIR
55 echo
56 echo
57
58 if test -z "$AR"; then
59    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
60 fi
61 AC_SUBST(AR)
62
63 dnl Export the AR macro so that it will be placed in the libtool file
64 dnl correctly.
65 export AR
66
67 echo
68 echo ---------------------------------------------
69 echo testing make
70 echo ---------------------------------------------
71 echo
72
73 AC_PROG_MAKE_SET
74 AC_PROG_INSTALL
75 AC_LOCAL_INSTALL
76 dnl 
77 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
78
79 AC_ENABLE_DEBUG(yes)
80 AC_DISABLE_PRODUCTION
81
82 echo ---------------------------------------------
83 echo testing libtool
84 echo ---------------------------------------------
85
86 dnl first, we set static to no!
87 dnl if we want it, use --enable-static
88 AC_ENABLE_STATIC(no)
89
90 AC_LIBTOOL_DLOPEN
91 AC_PROG_LIBTOOL
92
93 dnl Fix up the INSTALL macro if it s a relative path. We want the
94 dnl full-path to the binary instead.
95 case "$INSTALL" in
96    *install-sh*)
97       INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
98       ;;
99 esac
100
101 echo
102 echo ---------------------------------------------
103 echo testing C/C++
104 echo ---------------------------------------------
105 echo
106
107 cc_ok=no
108 dnl inutil car libtool
109 dnl AC_PROG_CC
110 AC_PROG_CXX
111 AC_DEPEND_FLAG
112 # AC_CC_WARNINGS([ansi])
113 cc_ok=yes
114
115 dnl Library libdl :
116 AC_CHECK_LIB(dl,dlopen)
117
118 dnl add library libm :
119 AC_CHECK_LIB(m,ceil)
120
121 dnl 
122 dnl Well we use sstream which is not in gcc pre-2.95.3
123 dnl We must test if it exists. If not, add it in include !
124 dnl
125
126 AC_CXX_USE_STD_IOSTREAM
127 AC_CXX_HAVE_SSTREAM
128
129
130
131 dnl
132 dnl ---------------------------------------------
133 dnl testing MPICH
134 dnl ---------------------------------------------
135 dnl
136
137 dnl CHECK_MPICH
138
139 echo
140 echo ---------------------------------------------
141 echo testing MPI
142 echo ---------------------------------------------
143 echo
144
145 CHECK_MPI
146
147 echo
148 echo ---------------------------------------------
149 echo testing LEX \& YACC
150 echo ---------------------------------------------
151 echo
152
153 lex_yacc_ok=no
154 AC_PROG_YACC
155 AC_PROG_LEX
156 lex_yacc_ok=yes
157
158 echo
159 echo ---------------------------------------------
160 echo testing python
161 echo ---------------------------------------------
162 echo
163
164 CHECK_PYTHON
165
166 dnl echo
167 dnl echo ---------------------------------------------
168 dnl echo testing java
169 dnl echo ---------------------------------------------
170 dnl echo
171
172 dnl CHECK_JAVA
173
174 echo
175 echo ---------------------------------------------
176 echo testing swig
177 echo ---------------------------------------------
178 echo
179
180 AM_PATH_PYTHON(2.3)
181 CHECK_SWIG
182
183 echo
184 echo ---------------------------------------------
185 echo testing threads
186 echo ---------------------------------------------
187 echo
188
189 ENABLE_PTHREADS
190
191 echo
192 echo ---------------------------------------------
193 echo testing omniORB
194 echo ---------------------------------------------
195 echo
196
197 CHECK_OMNIORB
198
199 dnl echo
200 dnl echo ---------------------------------------------
201 dnl echo testing mico
202 dnl echo ---------------------------------------------
203 dnl echo
204
205 dnl CHECK_MICO
206
207 echo
208 echo ---------------------------------------------
209 echo default ORB : omniORB
210 echo ---------------------------------------------
211 echo
212
213 DEFAULT_ORB=omniORB
214 CHECK_CORBA
215
216 AC_SUBST_FILE(CORBA)
217 corba=make_$ORB
218 CORBA=adm_local/unix/$corba
219
220 echo
221 echo ---------------------------------------------
222 echo testing openGL
223 echo ---------------------------------------------
224 echo
225
226 CHECK_OPENGL
227
228 echo
229 echo ---------------------------------------------
230 echo testing QT
231 echo ---------------------------------------------
232 echo
233
234 CHECK_QT
235
236 dnl echo
237 dnl echo ---------------------------------------------
238 dnl echo testing msg2qm
239 dnl echo ---------------------------------------------
240 dnl echo
241
242 dnl CHECK_MSG2QM
243
244 echo
245 echo ---------------------------------------------
246 echo testing VTK
247 echo ---------------------------------------------
248 echo
249
250 CHECK_VTK
251
252 echo
253 echo ---------------------------------------------
254 echo testing HDF5
255 echo ---------------------------------------------
256 echo
257
258 CHECK_HDF5
259
260 echo
261 echo ---------------------------------------------
262 echo BOOST Library
263 echo ---------------------------------------------
264 echo
265
266 CHECK_BOOST
267
268 echo
269 echo ---------------------------------------------
270 echo Testing OpenCascade
271 echo ---------------------------------------------
272 echo
273
274 CHECK_CAS
275
276 echo
277 echo ---------------------------------------------
278 echo Testing qwt
279 echo ---------------------------------------------
280 echo
281
282 CHECK_QWT
283
284 echo
285 echo ---------------------------------------------
286 echo Testing html generators
287 echo ---------------------------------------------
288 echo
289
290 CHECK_HTML_GENERATORS
291
292 echo
293 echo ---------------------------------------------
294 echo Testing GUI
295 echo ---------------------------------------------
296 echo
297
298 CHECK_SALOME_GUI
299
300 echo
301 echo ---------------------------------------------
302 echo Testing full GUI
303 echo ---------------------------------------------
304 echo
305
306 CHECK_CORBA_IN_GUI
307 if test "x${CORBA_IN_GUI}" != "xyes"; then
308   echo "failed : For configure VISU module necessary full GUI !"
309   exit
310 fi
311
312 echo
313 echo ---------------------------------------------
314 echo Testing Kernel
315 echo ---------------------------------------------
316 echo
317
318 CHECK_KERNEL
319
320 echo
321 echo ---------------------------------------------
322 echo Testing Med
323 echo ---------------------------------------------
324 echo
325
326 CHECK_MED
327
328 AM_CONDITIONAL(MED_ENABLE_MULTIPR, [test "$ENABLE_MULTIPR" = yes])
329
330 echo
331 echo ---------------------------------------------
332 echo Summary
333 echo ---------------------------------------------
334 echo
335
336 echo Configure
337 variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok Med_ok SalomeGUI_ok"
338
339 for var in $variables
340 do
341    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
342    eval echo \$$var
343 done
344
345 echo
346 echo "Default ORB   : $DEFAULT_ORB"
347 echo
348
349 dnl We don t need to say when we re entering directories if we re using
350 dnl GNU make becuase make does it for us.
351 if test "X$GMAKE" = "Xyes"; then
352    AC_SUBST(SETX) SETX=":"
353 else
354    AC_SUBST(SETX) SETX="set -x"
355 fi
356
357 echo
358 echo ---------------------------------------------
359 echo generating Makefiles and configure files
360 echo ---------------------------------------------
361 echo
362
363 AC_OUTPUT_COMMANDS([ \
364   chmod +x ./bin/*; \
365 ])
366
367 AC_HACK_LIBTOOL
368 AC_CONFIG_COMMANDS([hack_libtool],[
369 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
370   $(pwd)/hack_libtool \1 \"\$[@]\" \n\
371 }\n\
372 CC=\"hack_libtool\"%g" libtool
373 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
374 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
375 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
376 ],[])
377
378 # This list is initiated using autoscan and must be updated manually
379 # when adding a new file <filename>.in to manage. When you execute
380 # autoscan, the Makefile list is generated in the output file configure.scan.
381 # This could be helpfull to update de configuration.
382 AC_OUTPUT([ \
383         Makefile \
384         VISU_version.h \
385         adm_local/Makefile \
386         adm_local/cmake_files/Makefile \
387         adm_local/unix/Makefile \
388         adm_local/unix/config_files/Makefile \
389         bin/Makefile \
390         bin/VERSION \
391         doc/Makefile \
392         doc/salome/Makefile \
393         doc/salome/gui/Makefile \
394         doc/salome/gui/VISU/Makefile \
395         doc/salome/gui/VISU/doxyfile \
396         doc/salome/gui/VISU/doxyfile_idl \
397         doc/salome/gui/VISU/static/header.html \
398         doc/salome/gui/VISU/static/header_py.html \
399         doc/salome/tui/Makefile \
400         doc/salome/tui/doxyfile \
401         doc/salome/tui/static/header.html \
402         idl/Makefile \
403         resources/VISUCatalog.xml \
404         resources/SalomeApp.xml \
405         resources/Makefile \
406         src/Makefile \
407         src/CONVERTOR/Makefile \
408         src/PIPELINE/Makefile \
409         src/OBJECT/Makefile \
410         src/VISU_I/Makefile \
411         src/VISUGUI/Makefile \
412         src/VISU_SWIG/Makefile \
413         src/ENGINE/Makefile
414 ])