Salome HOME
Merge from BR_V5_DEV 17Feb09
[samples/component.git] / configure.ac
1 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 #  PLEASE DO NOT MODIFY configure.in FILE
23 #  ALL CHANGES WILL BE DISCARDED BY THE NEXT
24 #  build_configure COMMAND
25 #  CHANGES MUST BE MADE IN configure.in.base FILE
26 # Author : Marc Tajchman (CEA)
27 # Date : 28/06/2001
28 # Modified by : Patrick GOLDBRONN (CEA)
29 # Modified by : Marc Tajchman (CEA)
30 # Created from configure.in.base
31 #
32 AC_INIT([Salome2 Project COMPONENT module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeCOMPONENT])
33 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
34 AC_CANONICAL_HOST
35 AC_CANONICAL_TARGET
36 AM_INIT_AUTOMAKE
37
38 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
39 AC_SUBST(XVERSION)
40
41 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
42 MODULE_NAME=component
43 AC_SUBST(MODULE_NAME)
44
45 dnl
46 dnl Initialize source and build root directories
47 dnl
48
49 ROOT_BUILDDIR=`pwd`
50 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
51 cd $ROOT_SRCDIR
52 ROOT_SRCDIR=`pwd`
53 cd $ROOT_BUILDDIR
54
55 AC_SUBST(ROOT_SRCDIR)
56 AC_SUBST(ROOT_BUILDDIR)
57
58 echo
59 echo Source root directory : $ROOT_SRCDIR
60 echo Build  root directory : $ROOT_BUILDDIR
61 echo
62 echo
63
64 AC_CHECK_PROG(SHELL,sh)
65 AC_SUBST(SHELL)
66
67 if test -z "$AR"; then
68    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
69 fi
70 AC_SUBST(AR)
71
72 dnl Export the AR macro so that it will be placed in the libtool file
73 dnl correctly.
74 export AR
75
76 echo
77 echo ---------------------------------------------
78 echo testing make
79 echo ---------------------------------------------
80 echo
81
82 AC_PROG_MAKE_SET
83 AC_PROG_INSTALL
84 dnl 
85 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
86
87 AC_ENABLE_DEBUG(yes)
88 AC_DISABLE_PRODUCTION
89
90 echo ---------------------------------------------
91 echo testing libtool
92 echo ---------------------------------------------
93
94 dnl first, we set static to no!
95 dnl if we want it, use --enable-static
96 AC_ENABLE_STATIC(no)
97
98 AC_LIBTOOL_DLOPEN
99 AC_PROG_LIBTOOL
100
101 dnl Fix up the INSTALL macro if it s a relative path. We want the
102 dnl full-path to the binary instead.
103 case "$INSTALL" in
104    *install-sh*)
105       INSTALL="${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/install-sh -c"
106       ;;
107 esac
108
109 echo
110 echo ---------------------------------------------
111 echo testing C/C++
112 echo ---------------------------------------------
113 echo
114
115 cc_ok=no
116 dnl inutil car libtool
117 dnl AC_PROG_CC
118 AC_PROG_CXX
119 AC_CXX_WARNINGS
120 AC_CXX_TEMPLATE_OPTIONS
121 AC_DEPEND_FLAG
122 # AC_CC_WARNINGS([ansi])
123 cc_ok=yes
124
125 dnl Library libdl :
126 AC_CHECK_LIB(dl,dlopen)
127
128 dnl Library librt : for alpha/osf
129 AC_CHECK_LIB(rt,nanosleep)
130
131 dnl add library libm :
132 AC_CHECK_LIB(m,ceil)
133
134 AC_CXX_USE_STD_IOSTREAM
135 AC_CXX_HAVE_SSTREAM
136
137 dnl
138 dnl ---------------------------------------------
139 dnl testing linker
140 dnl ---------------------------------------------
141 dnl
142
143 AC_LINKER_OPTIONS
144
145 AC_LINKER_OPTIONS
146
147 echo
148 echo ---------------------------------------------
149 echo testing threads
150 echo ---------------------------------------------
151 echo
152
153 ENABLE_PTHREADS
154
155 dnl
156 dnl ---------------------------------------------
157 dnl testing MPI
158 dnl ---------------------------------------------
159 dnl
160
161 CHECK_MPI
162
163 dnl
164 dnl ---------------------------------------------
165 dnl testing sockets
166 dnl ---------------------------------------------
167 dnl
168
169 CHECK_SOCKETS
170
171 dnl
172 dnl ---------------------------------------------
173 dnl testing OpenPBS
174 dnl ---------------------------------------------
175 dnl
176
177 echo
178 echo ---------------------------------------------
179 echo testing OpenPBS
180 echo ---------------------------------------------
181 echo
182
183 openpbs_ok=no
184 CHECK_OPENPBS
185 dnl openpbs_ok is set to yes by CHECK_OPENPBS
186
187 dnl
188 dnl ---------------------------------------------
189 dnl testing LSF
190 dnl ---------------------------------------------
191 dnl
192
193 echo
194 echo ---------------------------------------------
195 echo testing LSF
196 echo ---------------------------------------------
197 echo
198
199 lsf_ok=no
200 CHECK_LSF
201 dnl lsf_ok is set to yes by CHECK_LSF
202
203 dnl
204 dnl ---------------------------------------------
205 dnl testing Batch
206 dnl ---------------------------------------------
207 dnl
208
209 WITH_BATCH=no
210 test x$openpbs_ok = xyes || test x$lsf_ok = xyes && WITH_BATCH=yes
211 AC_SUBST(WITH_BATCH)
212
213 echo
214 echo ---------------------------------------------
215 echo testing LEX \& YACC
216 echo ---------------------------------------------
217 echo
218
219 lex_yacc_ok=no
220 AC_PROG_YACC
221 AC_PROG_LEX
222 lex_yacc_ok=yes
223
224 echo
225 echo ---------------------------------------------
226 echo testing python
227 echo ---------------------------------------------
228 echo
229
230 CHECK_PYTHON
231
232 AM_PATH_PYTHON(2.3)
233
234 dnl echo
235 dnl echo ---------------------------------------------
236 dnl echo testing java
237 dnl echo ---------------------------------------------
238 dnl echo
239
240 dnl CHECK_JAVA
241
242 echo
243 echo ---------------------------------------------
244 echo testing swig
245 echo ---------------------------------------------
246 echo
247
248 CHECK_SWIG
249
250 echo
251 echo ---------------------------------------------
252 echo testing omniORB
253 echo ---------------------------------------------
254 echo
255
256 CHECK_OMNIORB
257
258 dnl echo
259 dnl echo ---------------------------------------------
260 dnl echo testing mico
261 dnl echo ---------------------------------------------
262 dnl echo
263
264 dnl CHECK_MICO
265
266 echo
267 echo ---------------------------------------------
268 echo default ORB : omniORB
269 echo ---------------------------------------------
270 echo
271
272 DEFAULT_ORB=omniORB
273 CHECK_CORBA
274
275 AC_SUBST_FILE(CORBA)
276 corba=make_$ORB
277 CORBA=adm_local/unix/$corba
278
279 echo
280 echo ---------------------------------------------
281 echo testing HDF5
282 echo ---------------------------------------------
283 echo
284
285 CHECK_HDF5
286
287 echo
288 echo ---------------------------------------------
289 echo testing MED
290 echo ---------------------------------------------
291 echo
292
293 CHECK_MED
294
295 echo
296 echo ---------------------------------------------
297 echo testing MED2
298 echo ---------------------------------------------
299 echo
300
301 CHECK_MED2
302
303 echo
304 echo ---------------------------------------------
305 echo Testing OpenCascade
306 echo ---------------------------------------------
307 echo
308
309 CHECK_CAS
310
311 echo
312 echo ---------------------------------------------
313 echo Testing html generators
314 echo ---------------------------------------------
315 echo
316
317 CHECK_HTML_GENERATORS
318
319 COMPONENT_WITH_GUI=no
320
321 AM_CONDITIONAL(COMPONENT_ENABLE_GUI, [test "${COMPONENT_WITH_GUI}" = "yes"])
322
323 if test "${COMPONENT_WITH_GUI}" = "yes"; then
324     echo
325     echo ---------------------------------------------
326     echo Testing GUI
327     echo ---------------------------------------------
328     echo
329
330     CHECK_SALOME_GUI
331
332     echo
333     echo ---------------------------------------------
334     echo Testing full GUI
335     echo ---------------------------------------------
336     echo
337
338     CHECK_CORBA_IN_GUI
339     if test "x${CORBA_IN_GUI}" != "xyes"; then
340       echo "failed : For configure COMPONENT module necessary full GUI !"
341       exit
342     fi
343 fi
344
345 echo
346 echo ---------------------------------------------
347 echo Testing Kernel
348 echo ---------------------------------------------
349 echo
350
351 CHECK_KERNEL
352
353 echo
354 echo ---------------------------------------------
355 echo Summary
356 echo ---------------------------------------------
357 echo
358
359 echo Configure
360 if test "${COMPONENT_WITH_GUI}" = "yes"; then
361 variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok med2_ok omniORB_ok occ_ok"
362 fi
363 if test "${COMPONENT_WITH_GUI}" = "no"; then
364 variables="cc_ok python_ok swig_ok threads_ok hdf5_ok med2_ok omniORB_ok occ_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 "---Optional:"
374 variables="mpi_ok cppunit_ok openpbs_ok lsf_ok doxygen_ok graphviz_ok"
375  
376 for var in $variables
377 do
378    eval toto=\$$var
379    if test x$toto != "x"; then
380      printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
381      eval echo \$$var
382    fi
383 done
384
385 echo
386 echo "Default ORB   : $DEFAULT_ORB"
387 echo
388
389 dnl We don t need to say when we re entering directories if we re using
390 dnl GNU make becuase make does it for us.
391 if test "X$GMAKE" = "Xyes"; then
392    AC_SUBST(SETX) SETX=":"
393 else
394    AC_SUBST(SETX) SETX="set -x"
395 fi
396 echo
397 echo ---------------------------------------------
398 echo generating Makefiles and configure files
399 echo ---------------------------------------------
400 echo
401
402 AC_OUTPUT_COMMANDS([ \
403       chmod +x ./bin/*; \
404 ])
405
406 # This list is initiated using autoscan and must be updated manually
407 # when adding a new file <filename>.in to manage. When you execute
408 # autoscan, the Makefile list is generated in the output file configure.scan.
409 # This could be helpfull to update de configuration.
410 AC_OUTPUT([ \
411   ./salome_adm/unix/SALOMEconfig.h \
412   ./adm_local/Makefile \
413   ./adm_local/unix/Makefile \
414   ./adm_local/unix/config_files/Makefile \
415   ./bin/VERSION \
416   ./bin/Makefile \
417   ./COMPONENT_version.h \
418   ./src/Makefile \
419   ./src/AddComponent/Makefile \
420   ./src/AdditionComponent/Makefile \
421   ./src/CalculatorComponent/Makefile \
422   ./src/DataStreamComponent/Makefile \
423   ./src/DivComponent/Makefile \
424   ./src/FactorialComponent/Makefile \
425   ./src/MulComponent/Makefile \
426   ./src/SIGNALSComponent/Makefile \
427   ./src/SIGNALSComponent_Swig/Makefile \
428   ./src/SubComponent/Makefile \
429   ./src/SyrComponent/Makefile \
430   ./src/SyrControlComponent/Makefile \
431   ./src/TestFunctions/Makefile \
432   ./src/TypesCheck/Makefile \
433   ./src/UndefinedSymbolComponent/Makefile \
434   ./resources/Makefile \
435   ./resources/COMPONENTCatalog.xml \
436   ./idl/Makefile \
437   Makefile \
438 ])