Salome HOME
Fix make distcheck problems
[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.2], [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([-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 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 echo
232 echo ---------------------------------------------
233 echo Testing GUI
234 echo ---------------------------------------------
235 echo
236
237 CHECK_GUI_MODULE
238
239 gui_ok=no
240 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then 
241   gui_ok=yes
242 fi
243
244 AM_CONDITIONAL(BLSURFPLUGIN_ENABLE_GUI, [test "${gui_ok}" = "yes"])
245
246 if test "${SalomeGUI_need}" == "yes"; then
247   if test "${FullGUI_ok}" != "yes"; then
248     AC_MSG_WARN(For configure BLSURFPLUGIN module necessary full GUI!)
249   fi
250 elif test "${SalomeGUI_need}" == "auto"; then
251   if test "${FullGUI_ok}" != "yes"; then
252     AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
253   fi
254 elif test "${SalomeGUI_need}" == "no"; then
255   echo Build without GUI option has been chosen
256 fi
257
258 if test "${gui_ok}" = "yes"; then
259     echo
260     echo ---------------------------------------------
261     echo testing openGL
262     echo ---------------------------------------------
263     echo
264
265     CHECK_OPENGL
266
267     echo
268     echo ---------------------------------------------
269     echo testing QT
270     echo ---------------------------------------------
271     echo
272
273     CHECK_QT
274
275     echo
276     echo ---------------------------------------------
277     echo testing VTK
278     echo ---------------------------------------------
279     echo
280
281     CHECK_VTK
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 BLSURF
311 echo ---------------------------------------------
312 echo
313
314 CHECK_BLSURF
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 echo
349 echo ---------------------------------------------
350 echo Summary
351 echo ---------------------------------------------
352 echo
353
354 #AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"])
355
356 echo Configure
357
358 if test "${gui_ok}" = "yes"; then
359   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"
360 elif test "${SalomeGUI_need}" != "no"; then
361   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"
362 else
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 BLSURF_ok"
364 fi
365
366 for var in $variables
367 do
368    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
369    eval echo \$$var
370 done
371
372 echo
373 echo "Default ORB   : $DEFAULT_ORB"
374 echo
375
376 dnl We don t need to say when we re entering directories if we re using
377 dnl GNU make becuase make does it for us.
378 if test "X$GMAKE" = "Xyes"; then
379    AC_SUBST(SETX) SETX=":"
380 else
381    AC_SUBST(SETX) SETX="set -x"
382 fi
383
384 dnl copy shells and utilities contained in the bin directory
385 dnl excluding .in files (treated in AC-OUTPUT below) and CVS
386 dnl directory
387
388 echo
389 echo ---------------------------------------------
390 echo generating Makefiles and configure files
391 echo ---------------------------------------------
392 echo
393
394 #AC_OUTPUT_COMMANDS([ \
395 #  chmod +x ./bin/*; \
396 #  chmod +x ./bin/salome/*;
397 #])
398
399 # This list is initiated using autoscan and must be updated manually
400 # when adding a new file <filename>.in to manage. When you execute
401 # autoscan, the Makefile list is generated in the output file configure.scan.
402 # This could be helpfull to update de configuration.
403 AC_OUTPUT([ \
404   salome_adm/unix/SALOMEconfig.h \
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/PluginUtils/Makefile \
421   src/BLSURFPlugin/Makefile \
422   src/GUI/Makefile \
423   BLSURFPLUGIN_version.h \
424   Makefile \
425 ])