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