Salome HOME
BUG: HexoticPlugin/SizeMaps: The shape location wasn'takebn into account when buildin...
[plugins/hexoticplugin.git] / configure.ac
1 #!/bin/bash
2 # Copyright (C) 2007-2013  CEA/DEN, EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20
21 # ---
22 # File   : configure.ac
23 # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
24 # ---
25 #
26 AC_INIT([Salome2 Project HexoticPLUGIN module], [7.2.0], [webmaster.salome@opencascade.com], [SalomeHexoticPLUGIN])
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 VERSION_DEV=0
35 AC_SUBST(VERSION_DEV)
36
37 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
38 MODULE_NAME=hexoticplugin
39 AC_SUBST(MODULE_NAME)
40
41 dnl
42 dnl Initialize source and build root directories
43 dnl
44
45 ROOT_BUILDDIR=`pwd`
46 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
47 cd $ROOT_SRCDIR
48 ROOT_SRCDIR=`pwd`
49 cd $ROOT_BUILDDIR
50
51 AC_SUBST(ROOT_SRCDIR)
52 AC_SUBST(ROOT_BUILDDIR)
53
54 echo
55 echo Source root directory : $ROOT_SRCDIR
56 echo Build  root directory : $ROOT_BUILDDIR
57 echo
58 echo
59
60 if test -z "$AR"; then
61    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
62 fi
63 AC_SUBST(AR)
64
65 dnl Export the AR macro so that it will be placed in the libtool file
66 dnl correctly.
67 export AR
68
69 echo
70 echo ---------------------------------------------
71 echo testing make
72 echo ---------------------------------------------
73 echo
74
75 AC_PROG_MAKE_SET
76 AC_PROG_INSTALL
77 dnl 
78 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
79
80 AC_ENABLE_DEBUG(yes)
81 AC_DISABLE_PRODUCTION
82
83 echo ---------------------------------------------
84 echo testing libtool
85 echo ---------------------------------------------
86
87 dnl first, we set static to no!
88 dnl if we want it, use --enable-static
89 AC_ENABLE_STATIC(no)
90
91 AC_LIBTOOL_DLOPEN
92 AC_PROG_LIBTOOL
93
94 dnl Fix up the INSTALL macro if it s a relative path. We want the
95 dnl full-path to the binary instead.
96 case "$INSTALL" in
97    *install-sh*)
98       INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
99       ;;
100 esac
101
102 echo
103 echo ---------------------------------------------
104 echo testing C/C++
105 echo ---------------------------------------------
106 echo
107
108 cc_ok=no
109 dnl inutil car libtool
110 dnl AC_PROG_CC
111 AC_PROG_CXX
112 AC_DEPEND_FLAG
113 # AC_CC_WARNINGS([ansi])
114 cc_ok=yes
115
116 echo
117 echo ---------------------------------------------
118 echo testing Fortran
119 echo ---------------------------------------------
120 echo
121
122 fortran_ok=no
123 AC_PROG_F77
124 AC_F77_LIBRARY_LDFLAGS
125 AC_PROG_FC
126 AC_FC_LIBRARY_LDFLAGS
127 if test "X$FC" != "X" ; then
128    fortran_ok=yes
129 fi
130
131 dnl Library libdl :
132 AC_CHECK_LIB(dl,dlopen)
133
134 dnl add library libm :
135 AC_CHECK_LIB(m,ceil)
136
137 dnl 
138 dnl Well we use sstream which is not in gcc pre-2.95.3
139 dnl We must test if it exists. If not, add it in include !
140 dnl
141
142 AC_CXX_HAVE_SSTREAM
143
144 echo
145 echo ---------------------------------------------
146 echo BOOST Library
147 echo ---------------------------------------------
148 echo
149
150 CHECK_BOOST
151
152 dnl
153 dnl ---------------------------------------------
154 dnl testing MPICH
155 dnl ---------------------------------------------
156 dnl
157
158 dnl CHECK_MPICH
159
160 echo
161 echo ---------------------------------------------
162 echo testing MPI
163 echo ---------------------------------------------
164 echo
165
166 CHECK_MPI
167
168 echo
169 echo ---------------------------------------------
170 echo testing LEX \& YACC
171 echo ---------------------------------------------
172 echo
173
174 lex_yacc_ok=no
175 AC_PROG_YACC
176 AC_PROG_LEX
177 lex_yacc_ok=yes
178
179 echo
180 echo ---------------------------------------------
181 echo testing python
182 echo ---------------------------------------------
183 echo
184
185 CHECK_PYTHON
186
187 AM_PATH_PYTHON(2.3)
188
189 dnl echo
190 dnl echo ---------------------------------------------
191 dnl echo testing java
192 dnl echo ---------------------------------------------
193 dnl echo
194
195 dnl CHECK_JAVA
196
197 echo
198 echo ---------------------------------------------
199 echo testing swig
200 echo ---------------------------------------------
201 echo
202
203 CHECK_SWIG
204
205 echo
206 echo ---------------------------------------------
207 echo testing threads
208 echo ---------------------------------------------
209 echo
210
211 ENABLE_PTHREADS
212
213 echo
214 echo ---------------------------------------------
215 echo testing omniORB
216 echo ---------------------------------------------
217 echo
218
219 CHECK_OMNIORB
220
221 dnl echo
222 dnl echo ---------------------------------------------
223 dnl echo testing mico
224 dnl echo ---------------------------------------------
225 dnl echo
226
227 dnl CHECK_MICO
228
229 echo
230 echo ---------------------------------------------
231 echo default ORB : omniORB
232 echo ---------------------------------------------
233 echo
234
235 DEFAULT_ORB=omniORB
236 CHECK_CORBA
237
238 AC_SUBST_FILE(CORBA)
239 corba=make_$ORB
240 CORBA=adm_local/unix/$corba
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(HEXOTICPLUGIN_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 HexoticPLUGIN 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 Testing OpenCascade
306 echo ---------------------------------------------
307 echo
308
309 CHECK_CAS
310
311 echo
312 echo ---------------------------------------------
313 echo Testing html generators
314 echo ---------------------------------------------
315 echo
316
317 CHECK_HTML_GENERATORS
318
319 echo
320 echo ---------------------------------------------
321 echo Testing Kernel
322 echo ---------------------------------------------
323 echo
324
325 CHECK_KERNEL
326
327 echo
328 echo ---------------------------------------------
329 echo Testing Geom
330 echo ---------------------------------------------
331 echo
332
333 CHECK_GEOM
334
335 echo
336 echo ---------------------------------------------
337 echo Testing SMesh
338 echo ---------------------------------------------
339 echo
340
341 CHECK_SMESH
342
343 echo
344 echo ---------------------------------------------
345 echo Testing BLSURFPlugin
346 echo ---------------------------------------------
347 echo
348
349 CHECK_BLSURFPLUGIN
350 if test "${BLSURFplugin_ok}" = "yes"; then
351   AC_DEFINE(WITH_BLSURFPLUGIN)
352 fi
353 AM_CONDITIONAL(HEXOTICPLUGIN_ENABLE_BLSURFPLUGIN, [test "${BLSURFplugin_ok}" = "yes"])
354
355 echo
356 echo ---------------------------------------------
357 echo Summary
358 echo ---------------------------------------------
359 echo
360
361 #AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"])
362
363 if test "${gui_ok}" = "yes"; then
364   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 doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok gui_ok"
365   opt_variables="Hexotic_ok BLSURFplugin_ok"
366 elif test "${SalomeGUI_need}" != "no"; then
367   variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok gui_ok"
368   opt_variables="Hexotic_ok BLSURFplugin_ok"
369 else
370   variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok"
371   opt_variables="Hexotic_ok BLSURFplugin_ok"
372 fi
373
374 echo
375 echo --- Mandatory products :
376 echo
377
378 for var in $variables
379 do
380    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
381    eval echo \$$var
382 done
383
384 echo
385 echo --- Optional products :
386 echo
387
388 for var in $opt_variables
389 do
390    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
391    eval echo \$$var
392 done
393
394
395 echo
396 echo "Default ORB   : $DEFAULT_ORB"
397 echo
398
399 dnl We don t need to say when we re entering directories if we re using
400 dnl GNU make becuase make does it for us.
401 if test "X$GMAKE" = "Xyes"; then
402    AC_SUBST(SETX) SETX=":"
403 else
404    AC_SUBST(SETX) SETX="set -x"
405 fi
406
407 dnl Build with SMESH cancel compute feature
408 AC_DEFINE(WITH_SMESH_CANCEL_COMPUTE)
409
410 dnl copy shells and utilities contained in the bin directory
411 dnl excluding .in files (treated in AC-OUTPUT below) and CVS
412 dnl directory
413
414 echo
415 echo ---------------------------------------------
416 echo generating Makefiles and configure files
417 echo ---------------------------------------------
418 echo
419
420 #AC_OUTPUT_COMMANDS([ \
421 #  chmod +x ./bin/*; \
422 #  chmod +x ./bin/salome/*;
423 #])
424
425 AC_HACK_LIBTOOL
426 AC_CONFIG_COMMANDS([hack_libtool],[
427 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
428   $(pwd)/hack_libtool \1 \"\$[@]\" \n\
429 }\n\
430 CC=\"hack_libtool\"%g" libtool
431 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
432 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
433 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
434 ],[])
435
436 # This list is initiated using autoscan and must be updated manually
437 # when adding a new file <filename>.in to manage. When you execute
438 # autoscan, the Makefile list is generated in the output file configure.scan.
439 # This could be helpfull to update de configuration.
440 AC_OUTPUT([ \
441   adm_local/Makefile \
442   adm_local/unix/Makefile \
443   adm_local/unix/config_files/Makefile \
444   bin/VERSION \
445   bin/Makefile \
446   idl/Makefile \
447   resources/Makefile \
448   src/Makefile \
449   src/HexoticPlugin/Makefile \
450   src/GUI/Makefile \
451   src/GUI/resources/Makefile \
452   HexoticPLUGIN_version.h \
453   doc/Makefile \
454   doc/salome/Makefile \
455   doc/salome/examples/Makefile \
456   doc/salome/gui/Makefile \
457   doc/salome/gui/HexoticPLUGIN/Makefile \
458   doc/salome/gui/HexoticPLUGIN/doxyfile \
459   doc/salome/gui/HexoticPLUGIN/doxyfile_py \
460   doc/salome/gui/HexoticPLUGIN/static/header.html \
461   doc/salome/gui/HexoticPLUGIN/static/header_py.html \
462   Makefile \
463 ])