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