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