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