Salome HOME
Integrate patches for win32 version
[plugins/blsurfplugin.git] / configure.ac
1 #!/bin/bash
2 # Copyright (C) 2007-2011  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], [6.3.1], [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 dnl CHECK_MPICH
158
159 echo
160 echo ---------------------------------------------
161 echo testing MPI
162 echo ---------------------------------------------
163 echo
164
165 CHECK_MPI
166
167 echo
168 echo ---------------------------------------------
169 echo testing LEX \& YACC
170 echo ---------------------------------------------
171 echo
172
173 lex_yacc_ok=no
174 AC_PROG_YACC
175 AC_PROG_LEX
176 lex_yacc_ok=yes
177
178 echo
179 echo ---------------------------------------------
180 echo testing python
181 echo ---------------------------------------------
182 echo
183
184 CHECK_PYTHON
185
186 AM_PATH_PYTHON(2.3)
187
188 dnl echo
189 dnl echo ---------------------------------------------
190 dnl echo testing java
191 dnl echo ---------------------------------------------
192 dnl echo
193
194 dnl CHECK_JAVA
195
196 echo
197 echo ---------------------------------------------
198 echo testing swig
199 echo ---------------------------------------------
200 echo
201
202 CHECK_SWIG
203
204 echo
205 echo ---------------------------------------------
206 echo testing threads
207 echo ---------------------------------------------
208 echo
209
210 ENABLE_PTHREADS
211
212 echo
213 echo ---------------------------------------------
214 echo testing omniORB
215 echo ---------------------------------------------
216 echo
217
218 CHECK_OMNIORB
219
220 dnl echo
221 dnl echo ---------------------------------------------
222 dnl echo testing mico
223 dnl echo ---------------------------------------------
224 dnl echo
225
226 dnl CHECK_MICO
227
228 echo
229 echo ---------------------------------------------
230 echo default ORB : omniORB
231 echo ---------------------------------------------
232 echo
233
234 DEFAULT_ORB=omniORB
235 CHECK_CORBA
236
237 AC_SUBST_FILE(CORBA)
238 corba=make_$ORB
239 CORBA=adm_local/unix/$corba
240
241 echo
242 echo ---------------------------------------------
243 echo Testing GUI
244 echo ---------------------------------------------
245 echo
246
247 CHECK_GUI_MODULE
248
249 gui_ok=no
250 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then 
251   gui_ok=yes
252 fi
253
254 AM_CONDITIONAL(BLSURFPLUGIN_ENABLE_GUI, [test "${gui_ok}" = "yes"])
255
256 if test "${SalomeGUI_need}" == "yes"; then
257   if test "${FullGUI_ok}" != "yes"; then
258     AC_MSG_WARN(For configure BLSURFPLUGIN module necessary full GUI!)
259   fi
260 elif test "${SalomeGUI_need}" == "auto"; then
261   if test "${FullGUI_ok}" != "yes"; then
262     AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
263   fi
264 elif test "${SalomeGUI_need}" == "no"; then
265   echo Build without GUI option has been chosen
266 fi
267
268 if test "${gui_ok}" = "yes"; then
269     echo
270     echo ---------------------------------------------
271     echo testing openGL
272     echo ---------------------------------------------
273     echo
274
275     CHECK_OPENGL
276
277     echo
278     echo ---------------------------------------------
279     echo testing QT
280     echo ---------------------------------------------
281     echo
282
283     CHECK_QT
284 fi
285
286 echo
287 echo ---------------------------------------------
288 echo testing VTK
289 echo ---------------------------------------------
290 echo
291
292 CHECK_VTK
293
294 echo
295 echo ---------------------------------------------
296 echo testing HDF5
297 echo ---------------------------------------------
298 echo
299
300 CHECK_HDF5
301
302 echo
303 echo ---------------------------------------------
304 echo Testing OpenCascade
305 echo ---------------------------------------------
306 echo
307
308 CHECK_CAS
309
310 echo
311 echo ---------------------------------------------
312 echo Testing html generators
313 echo ---------------------------------------------
314 echo
315
316 CHECK_HTML_GENERATORS
317
318 echo
319 echo ---------------------------------------------
320 echo Testing BLSURF
321 echo ---------------------------------------------
322 echo
323
324 CHECK_BLSURF
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 SMesh
353 echo ---------------------------------------------
354 echo
355
356 CHECK_SMESH
357
358 echo
359 echo ---------------------------------------------
360 echo Summary
361 echo ---------------------------------------------
362 echo
363
364 #AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"])
365
366 echo Configure
367
368 if test "${gui_ok}" = "yes"; then
369   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"
370 elif test "${SalomeGUI_need}" != "no"; then
371   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 Med_ok SMesh_ok gui_ok BLSURF_ok"
372 else
373   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 Med_ok SMesh_ok BLSURF_ok"
374 fi
375
376 for var in $variables
377 do
378    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
379    eval echo \$$var
380 done
381
382 echo
383 echo "Default ORB   : $DEFAULT_ORB"
384 echo
385
386 dnl We don t need to say when we re entering directories if we re using
387 dnl GNU make becuase make does it for us.
388 if test "X$GMAKE" = "Xyes"; then
389    AC_SUBST(SETX) SETX=":"
390 else
391    AC_SUBST(SETX) SETX="set -x"
392 fi
393
394 dnl Build with SMESH cancel compute feature
395 AC_DEFINE(WITH_SMESH_CANCEL_COMPUTE)
396
397 dnl copy shells and utilities contained in the bin directory
398 dnl excluding .in files (treated in AC-OUTPUT below) and CVS
399 dnl directory
400
401 echo
402 echo ---------------------------------------------
403 echo generating Makefiles and configure files
404 echo ---------------------------------------------
405 echo
406
407 #AC_OUTPUT_COMMANDS([ \
408 #  chmod +x ./bin/*; \
409 #  chmod +x ./bin/salome/*;
410 #])
411
412 AC_HACK_LIBTOOL
413 AC_CONFIG_COMMANDS([hack_libtool],[
414 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
415   $(pwd)/hack_libtool \1 \"\$[@]\" \n\
416 }\n\
417 CC=\"hack_libtool\"%g" libtool
418 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
419 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
420 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
421 ],[])
422
423 # This list is initiated using autoscan and must be updated manually
424 # when adding a new file <filename>.in to manage. When you execute
425 # autoscan, the Makefile list is generated in the output file configure.scan.
426 # This could be helpfull to update de configuration.
427 AC_OUTPUT([ \
428   adm_local/Makefile \
429   adm_local/unix/Makefile \
430   adm_local/unix/config_files/Makefile \
431   adm_local/cmake_files/Makefile \
432   doc/Makefile \
433   doc/salome/Makefile \
434   doc/salome/gui/Makefile \
435   doc/salome/gui/doxyfile \
436   doc/salome/tui/Makefile \
437   doc/salome/tui/doxyfile \
438   bin/VERSION \
439   bin/Makefile \
440   idl/Makefile \
441   resources/Makefile \
442   src/Makefile \
443   src/BLSURFPlugin/Makefile \
444   src/GUI/Makefile \
445   BLSURFPLUGIN_version.h \
446   Makefile \
447 ])