Salome HOME
Activate WITH_SMESH_CANCEL_COMPUTE with automake
[plugins/netgenplugin.git] / configure.ac
1 #  Copyright (C) 2007-2010  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 #  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 # 13/03/2007: Alexander BORODIN - OCN
29 # Reorganization for usage of autotools
30 # Created from configure.in.base
31 #
32 AC_INIT([Salome2 Project NETGENPLUGIN module], [6.2.0], [webmaster.salome@opencascade.com], [SalomeNETGENPLUGIN])
33 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
34 AC_CANONICAL_HOST
35 AC_CANONICAL_TARGET
36 AM_INIT_AUTOMAKE([-Wno-portability])
37
38 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
39 AC_SUBST(XVERSION)
40
41 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
42 MODULE_NAME=netgenplugin
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 if test -z "$AR"; then
65    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
66 fi
67 AC_SUBST(AR)
68
69 dnl Export the AR macro so that it will be placed in the libtool file
70 dnl correctly.
71 export AR
72
73 echo
74 echo ---------------------------------------------
75 echo testing make
76 echo ---------------------------------------------
77 echo
78
79 AC_PROG_MAKE_SET
80 AC_PROG_INSTALL
81 AC_LOCAL_INSTALL
82 dnl 
83 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
84
85 AC_ENABLE_DEBUG(yes)
86 AC_DISABLE_PRODUCTION
87
88 echo ---------------------------------------------
89 echo testing libtool
90 echo ---------------------------------------------
91
92 dnl first, we set static to no!
93 dnl if we want it, use --enable-static
94 AC_ENABLE_STATIC(no)
95
96 AC_LIBTOOL_DLOPEN
97 AC_PROG_LIBTOOL
98
99 dnl Fix up the INSTALL macro if it s a relative path. We want the
100 dnl full-path to the binary instead.
101 case "$INSTALL" in
102    *install-sh*)
103       INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
104       ;;
105 esac
106
107 echo
108 echo ---------------------------------------------
109 echo testing C/C++
110 echo ---------------------------------------------
111 echo
112
113 cc_ok=no
114 dnl inutil car libtool
115 dnl AC_PROG_CC
116 AC_PROG_CXX
117 AC_DEPEND_FLAG
118 # AC_CC_WARNINGS([ansi])
119 cc_ok=yes
120
121 echo
122 echo ---------------------------------------------
123 echo testing Fortran
124 echo ---------------------------------------------
125 echo
126
127 fortran_ok=no
128 AC_PROG_F77
129 AC_F77_LIBRARY_LDFLAGS
130 AC_PROG_FC
131 AC_FC_LIBRARY_LDFLAGS
132 if test "X$FC" != "X" ; then
133    fortran_ok=yes
134 fi
135
136 dnl Library libdl :
137 AC_CHECK_LIB(dl,dlopen)
138
139 dnl add library libm :
140 AC_CHECK_LIB(m,ceil)
141
142 dnl 
143 dnl Well we use sstream which is not in gcc pre-2.95.3
144 dnl We must test if it exists. If not, add it in include !
145 dnl
146
147 AC_CXX_HAVE_SSTREAM
148
149 echo
150 echo ---------------------------------------------
151 echo BOOST Library
152 echo ---------------------------------------------
153 echo
154
155 CHECK_BOOST
156
157 dnl
158 dnl ---------------------------------------------
159 dnl testing MPICH
160 dnl ---------------------------------------------
161 dnl
162
163 dnl CHECK_MPICH
164
165 echo
166 echo ---------------------------------------------
167 echo testing MPI
168 echo ---------------------------------------------
169 echo
170
171 CHECK_MPI
172
173 echo
174 echo ---------------------------------------------
175 echo testing LEX \& YACC
176 echo ---------------------------------------------
177 echo
178
179 lex_yacc_ok=no
180 AC_PROG_YACC
181 AC_PROG_LEX
182 lex_yacc_ok=yes
183
184 echo
185 echo ---------------------------------------------
186 echo testing python
187 echo ---------------------------------------------
188 echo
189
190 CHECK_PYTHON
191
192 AM_PATH_PYTHON(2.3)
193
194 dnl echo
195 dnl echo ---------------------------------------------
196 dnl echo testing java
197 dnl echo ---------------------------------------------
198 dnl echo
199
200 dnl CHECK_JAVA
201
202 echo
203 echo ---------------------------------------------
204 echo testing swig
205 echo ---------------------------------------------
206 echo
207
208 CHECK_SWIG
209
210 echo
211 echo ---------------------------------------------
212 echo testing threads
213 echo ---------------------------------------------
214 echo
215
216 ENABLE_PTHREADS
217
218 echo
219 echo ---------------------------------------------
220 echo testing omniORB
221 echo ---------------------------------------------
222 echo
223
224 CHECK_OMNIORB
225
226 dnl echo
227 dnl echo ---------------------------------------------
228 dnl echo testing mico
229 dnl echo ---------------------------------------------
230 dnl echo
231
232 dnl CHECK_MICO
233
234 echo
235 echo ---------------------------------------------
236 echo default ORB : omniORB
237 echo ---------------------------------------------
238 echo
239
240 DEFAULT_ORB=omniORB
241 CHECK_CORBA
242
243 AC_SUBST_FILE(CORBA)
244 corba=make_$ORB
245 CORBA=adm_local/unix/$corba
246
247 echo
248 echo ---------------------------------------------
249 echo Testing GUI
250 echo ---------------------------------------------
251 echo
252
253 CHECK_GUI_MODULE
254
255 gui_ok=no
256 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then 
257   gui_ok=yes
258 fi
259
260 AM_CONDITIONAL(NETGENPLUGIN_ENABLE_GUI, [test "${gui_ok}" = "yes"])
261
262 if test "${SalomeGUI_need}" == "yes"; then
263   if test "${FullGUI_ok}" != "yes"; then
264     AC_MSG_WARN(For configure NETGENPLUGIN module necessary full GUI!)
265   fi
266 elif test "${SalomeGUI_need}" == "auto"; then
267   if test "${FullGUI_ok}" != "yes"; then
268     AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
269   fi
270 elif test "${SalomeGUI_need}" == "no"; then
271   echo Build without GUI option has been chosen
272 fi
273
274 if test "${gui_ok}" = "yes"; then
275     echo
276     echo ---------------------------------------------
277     echo testing openGL
278     echo ---------------------------------------------
279     echo
280
281     CHECK_OPENGL
282
283     echo
284     echo ---------------------------------------------
285     echo testing QT
286     echo ---------------------------------------------
287     echo
288
289     CHECK_QT
290 fi
291
292 echo
293 echo ---------------------------------------------
294 echo testing VTK
295 echo ---------------------------------------------
296 echo
297
298 CHECK_VTK
299
300 echo
301 echo ---------------------------------------------
302 echo testing HDF5
303 echo ---------------------------------------------
304 echo
305
306 CHECK_HDF5
307
308 echo
309 echo ---------------------------------------------
310 echo Testing OpenCascade
311 echo ---------------------------------------------
312 echo
313
314 CHECK_CAS
315
316 echo
317 echo ---------------------------------------------
318 echo Testing html generators
319 echo ---------------------------------------------
320 echo
321
322 CHECK_HTML_GENERATORS
323
324 echo
325 echo ---------------------------------------------
326 echo Testing Kernel
327 echo ---------------------------------------------
328 echo
329
330 CHECK_KERNEL
331
332 echo
333 echo ---------------------------------------------
334 echo Testing Geom
335 echo ---------------------------------------------
336 echo
337
338 CHECK_GEOM
339
340  echo
341  echo ---------------------------------------------
342  echo Testing Med
343  echo ---------------------------------------------
344  echo
345  
346 CHECK_MED
347
348 echo
349 echo ---------------------------------------------
350 echo Testing Netgen
351 echo ---------------------------------------------
352 echo
353
354 CHECK_NETGEN
355  
356 echo
357 echo ---------------------------------------------
358 echo Testing SMesh
359 echo ---------------------------------------------
360 echo
361
362 CHECK_SMESH
363
364 echo
365 echo ---------------------------------------------
366 echo Summary
367 echo ---------------------------------------------
368 echo
369
370 AM_CONDITIONAL(CMAKE_BUILD, false)
371 #AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"])
372
373 echo Configure
374
375 if test "${gui_ok}" = "yes"; then
376   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 gui_ok Geom_ok SMesh_ok Netgen_ok"
377 elif test "${SalomeGUI_need}" != "no"; then
378   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 gui_ok Geom_ok SMesh_ok Netgen_ok"
379 else
380   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 Netgen_ok"
381 fi
382
383 for var in $variables
384 do
385    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
386    eval echo \$$var
387 done
388
389 echo
390 echo "Default ORB   : $DEFAULT_ORB"
391 echo
392
393 dnl We don t need to say when we re entering directories if we re using
394 dnl GNU make becuase make does it for us.
395 if test "X$GMAKE" = "Xyes"; then
396    AC_SUBST(SETX) SETX=":"
397 else
398    AC_SUBST(SETX) SETX="set -x"
399 fi
400
401 dnl Build with SMESH cancel compute feature
402 AC_DEFINE(WITH_SMESH_CANCEL_COMPUTE)
403
404 dnl copy shells and utilities contained in the bin directory
405 dnl excluding .in files (treated in AC-OUTPUT below) and CVS
406 dnl directory
407
408 echo
409 echo ---------------------------------------------
410 echo generating Makefiles and configure files
411 echo ---------------------------------------------
412 echo
413
414 #AC_OUTPUT_COMMANDS([ \
415 #  chmod +x ./bin/*; \
416 #  chmod +x ./bin/salome/*;
417 #])
418
419 AC_HACK_LIBTOOL
420 AC_CONFIG_COMMANDS([hack_libtool],[
421 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
422   $(pwd)/hack_libtool \1 \"\$[@]\" \n\
423 }\n\
424 CC=\"hack_libtool\"%g" libtool
425 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
426 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
427 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
428 ],[])
429
430 # This list is initiated using autoscan and must be updated manually
431 # when adding a new file <filename>.in to manage. When you execute
432 # autoscan, the Makefile list is generated in the output file configure.scan.
433 # This could be helpfull to update de configuration.
434 AC_OUTPUT([ \
435   adm_local/Makefile \
436   adm_local/unix/Makefile \
437   adm_local/unix/config_files/Makefile \
438   bin/VERSION \
439   bin/Makefile \
440   NETGENPLUGIN_version.h \
441   src/Makefile \
442   src/GUI/Makefile \
443   src/NETGEN/Makefile \
444   src/NETGENPlugin/Makefile \
445   resources/Makefile \
446   idl/Makefile \
447   Makefile \
448 ])