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