]> SALOME platform Git repositories - plugins/ghs3dprlplugin.git/blob - configure.ac
Salome HOME
Merge from BR_V5_DEV 16Feb09
[plugins/ghs3dprlplugin.git] / configure.ac
1 #!/bin/bash
2
3 # Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18 #
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #
21 # ---
22 #
23 # File   : configure.ac
24 # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
25 #
26 # ---
27
28 AC_INIT([Salome2 Project GHS3DPRLPLUGIN module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeGHS3DPRLPLUGIN])
29 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
30 AC_CANONICAL_HOST
31 AC_CANONICAL_TARGET
32 AM_INIT_AUTOMAKE
33
34 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
35 AC_SUBST(XVERSION)
36
37 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
38 MODULE_NAME=ghs3dprlplugin
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}'/salome_adm/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 CHECK_MPICH
159
160 echo
161 echo ---------------------------------------------
162 echo testing LEX \& YACC
163 echo ---------------------------------------------
164 echo
165
166 lex_yacc_ok=no
167 AC_PROG_YACC
168 AC_PROG_LEX
169 lex_yacc_ok=yes
170
171 echo
172 echo ---------------------------------------------
173 echo testing python
174 echo ---------------------------------------------
175 echo
176
177 CHECK_PYTHON
178
179 AM_PATH_PYTHON(2.3)
180
181 dnl echo
182 dnl echo ---------------------------------------------
183 dnl echo testing java
184 dnl echo ---------------------------------------------
185 dnl echo
186
187 dnl CHECK_JAVA
188
189 echo
190 echo ---------------------------------------------
191 echo testing swig
192 echo ---------------------------------------------
193 echo
194
195 CHECK_SWIG
196
197 echo
198 echo ---------------------------------------------
199 echo testing threads
200 echo ---------------------------------------------
201 echo
202
203 ENABLE_PTHREADS
204
205 echo
206 echo ---------------------------------------------
207 echo testing omniORB
208 echo ---------------------------------------------
209 echo
210
211 CHECK_OMNIORB
212
213 dnl echo
214 dnl echo ---------------------------------------------
215 dnl echo testing mico
216 dnl echo ---------------------------------------------
217 dnl echo
218
219 dnl CHECK_MICO
220
221 echo
222 echo ---------------------------------------------
223 echo default ORB : omniORB
224 echo ---------------------------------------------
225 echo
226
227 DEFAULT_ORB=omniORB
228 CHECK_CORBA
229
230 AC_SUBST_FILE(CORBA)
231 corba=make_$ORB
232 CORBA=adm_local/unix/$corba
233
234 GHS3DPRLPLUGIN_WITH_GUI=yes
235
236 AM_CONDITIONAL(GHS3DPRLPLUGIN_ENABLE_GUI, [test "${GHS3DPRLPLUGIN_WITH_GUI}" = "yes"])
237
238 if test "${GHS3DPRLPLUGIN_WITH_GUI}" = "yes"; then
239     echo
240     echo ---------------------------------------------
241     echo testing openGL
242     echo ---------------------------------------------
243     echo
244
245     CHECK_OPENGL
246
247     echo
248     echo ---------------------------------------------
249     echo testing QT
250     echo ---------------------------------------------
251     echo
252
253     CHECK_QT
254
255     echo
256     echo ---------------------------------------------
257     echo testing VTK
258     echo ---------------------------------------------
259     echo
260
261     CHECK_VTK
262
263     echo
264     echo ---------------------------------------------
265     echo Testing GUI
266     echo ---------------------------------------------
267     echo
268
269     CHECK_SALOME_GUI
270
271     echo
272     echo ---------------------------------------------
273     echo Testing full GUI
274     echo ---------------------------------------------
275     echo
276
277     CHECK_CORBA_IN_GUI
278     if test "x${CORBA_IN_GUI}" != "xyes"; then
279       echo "failed : For configure GHS3DPRLPLUGIN module necessary full GUI !"
280       exit
281     fi
282 fi
283
284 echo
285 echo ---------------------------------------------
286 echo testing HDF5
287 echo ---------------------------------------------
288 echo
289
290 CHECK_HDF5
291
292 echo
293 echo ---------------------------------------------
294 echo Testing OpenCascade
295 echo ---------------------------------------------
296 echo
297
298 CHECK_CAS
299
300 echo
301 echo ---------------------------------------------
302 echo Testing html generators
303 echo ---------------------------------------------
304 echo
305
306 CHECK_HTML_GENERATORS
307
308 echo
309 echo ---------------------------------------------
310 echo Testing GHS3DPRL
311 echo ---------------------------------------------
312 echo
313
314 CHECK_GHS3DPRL
315
316 echo
317 echo ---------------------------------------------
318 echo Testing Kernel
319 echo ---------------------------------------------
320 echo
321
322 CHECK_KERNEL
323
324 echo
325 echo ---------------------------------------------
326 echo Testing Geom
327 echo ---------------------------------------------
328 echo
329
330 CHECK_GEOM
331
332 echo
333 echo ---------------------------------------------
334 echo Testing Med
335 echo ---------------------------------------------
336 echo
337  
338 CHECK_MED
339
340 echo
341 echo ---------------------------------------------
342 echo Testing SMesh
343 echo ---------------------------------------------
344 echo
345
346 CHECK_SMESH
347
348
349 echo
350 echo ---------------------------------------------
351 echo testing LIBXML2
352 echo ---------------------------------------------
353 echo libxml_ok=no
354 CHECK_LIBXML
355 dnl libxml_ok is set to yes by CHECK_LIBXML
356
357 echo
358 echo ---------------------------------------------
359 echo Summary
360 echo ---------------------------------------------
361 echo
362
363 #AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"])
364
365 if test "${GHS3DPRLPLUGIN_WITH_GUI}" = "yes"; then
366 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 Med_ok SMesh_ok SalomeGUI_ok libxml_ok"
367 opt_variables="GHS3DPRL_ok"
368 fi
369 if test "${GHS3DPRLPLUGIN_WITH_GUI}" = "no"; then
370 variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok Med_ok SMesh_ok libxml_ok"
371 opt_variables="GHS3DPRL_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 copy shells and utilities contained in the bin directory
408 dnl excluding .in files (treated in AC-OUTPUT below) and CVS
409 dnl directory
410
411 echo
412 echo ---------------------------------------------
413 echo generating Makefiles and configure files
414 echo ---------------------------------------------
415 echo
416
417 #AC_OUTPUT_COMMANDS([ \
418 #  chmod +x ./bin/*; \
419 #  chmod +x ./bin/salome/*;
420 #])
421
422 # This list is initiated using autoscan and must be updated manually
423 # when adding a new file <filename>.in to manage. When you execute
424 # autoscan, the Makefile list is generated in the output file configure.scan.
425 # This could be helpfull to update de configuration.
426 AC_OUTPUT([ \
427   ./salome_adm/unix/SALOMEconfig.h \
428   ./adm_local/Makefile \
429   ./adm_local/unix/Makefile \
430   ./adm_local/unix/config_files/Makefile \
431   ./bin/VERSION \
432   ./bin/Makefile \
433   ./idl/Makefile \
434   ./resources/Makefile \
435   ./src/Makefile \
436   ./src/GHS3DPRLPlugin/Makefile \
437   ./src/gui/Makefile \
438   ./src/tepal2med/Makefile \
439   ./GHS3DPRLPLUGIN_version.h \
440   Makefile \
441 ])