]> SALOME platform Git repositories - modules/kernel.git/blob - configure.ac
Salome HOME
Compatibility between MEDCouplingCorabaServant.idl and MED.idl.
[modules/kernel.git] / configure.ac
1 #  Copyright (C) 2007-2010  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
23 # ================================================================
24 # Process this file with autoconf to produce a configure script
25 # ================================================================
26 #AC_PREREQ(2.59)
27 #
28 AC_INIT([Salome2 Project], [5.1.4], [paul.rascle@edf.fr], [SalomeKERNEL])
29
30 # AC_CONFIG_AUX_DIR defines an alternative directory where to find the auxiliary
31 # scripts such as config.guess, install-sh, ...
32 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
33 AC_CANONICAL_HOST
34 AC_CANONICAL_TARGET
35 AM_INIT_AUTOMAKE([tar-pax -Wno-portability])
36 #AC_CONFIG_HEADER([config.h])
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=kernel
43 AC_SUBST(MODULE_NAME)
44
45 echo
46 echo ---------------------------------------------
47 echo Initialize source and build root directories
48 echo ---------------------------------------------
49 echo
50
51 #
52 # This function return on stdout the absolute path of the filename in
53 # argument. Exemple:
54 # $ filename="../KERNEL_SRC/configure
55 # $ absfilename=`absolute_path $filename`
56 function absolute_path {
57     filename=$1
58     here=`pwd`
59     apath=`dirname $filename`
60     cd $apath
61     apath=`pwd`
62     cd $here
63     echo $apath
64 }
65
66 # Build directory, where the configure script is executed.
67 ROOT_BUILDDIR=`pwd`
68 # Source directory, where the configure script is located.
69 ROOT_SRCDIR=`absolute_path $0`
70
71 AC_SUBST(ROOT_SRCDIR)
72 AC_SUBST(ROOT_BUILDDIR)
73
74 echo
75 echo Source root directory : $ROOT_SRCDIR
76 echo Build  root directory : $ROOT_BUILDDIR
77
78 # ----------------------------------------------------------------------------
79 # --- test options
80
81 AC_ARG_ENABLE(corba_gen,
82   [AC_HELP_STRING([--enable-corba-gen],[Generate CORBA stuff [default=yes]])],
83   [case "${enableval}" in
84      yes) corba_gen=true ;;
85      no)  corba_gen=false ;;
86      *) AC_MSG_ERROR(bad value ${enableval} for --enable-corba-gen) ;;
87   esac],[corba_gen=true])
88 AM_CONDITIONAL(CORBA_GEN, test x$corba_gen = xtrue)
89
90 # ---- option to build only launcher and resources manager
91 AC_ARG_WITH(onlylauncher,
92         [AC_HELP_STRING([--with-onlylauncher],[Build only launcher and resources manager [default=no]])],
93         [],
94         [with_onlylauncher="no"])
95 AM_CONDITIONAL(WITHONLYLAUNCHER, test x$with_onlylauncher = xyes)
96 if test "$with_onlylauncher" != "yes"; then
97   AC_DEFINE([HAVE_SALOME_CONFIG], [], [True if SALOMEconfig.h file is used])
98 fi
99
100 # ----------------------------------------------------------------------------
101
102 echo
103 echo
104 echo ============================================================
105 echo testing general mandatory products - for all configurations
106 echo ============================================================
107 echo
108
109 dnl Modification B. Secher portage sur osf
110 AC_CHECK_PROG(SHELL,sh)
111 AC_SUBST(SHELL)
112
113 if test -z "$AR"; then
114    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
115 fi
116 AC_SUBST(AR)
117
118 echo
119 echo ---------------------------------------------
120 echo testing make
121 echo ---------------------------------------------
122 echo
123 AC_PROG_MAKE_SET
124 AC_PROG_INSTALL
125 AC_LOCAL_INSTALL
126
127 echo
128 echo ---------------------------------------------
129 echo Configuring production
130 echo ---------------------------------------------
131 echo
132 # production.m4
133 AC_ENABLE_DEBUG(no)
134 AC_ENABLE_PRODUCTION(no)
135 AC_ENABLE_MPI_SEQ_CONTAINER(no)
136
137 echo
138 echo ---------------------------------------------
139 echo testing libtool
140 echo ---------------------------------------------
141 echo
142
143 dnl first, we set static to no!
144 dnl if we want it, use --enable-static
145 AC_ENABLE_STATIC(no)
146 AC_LIBTOOL_DLOPEN
147 AC_PROG_LIBTOOL
148
149 echo
150 echo ---------------------------------------------
151 echo testing C/C++
152 echo ---------------------------------------------
153 echo
154
155 cc_ok=no
156 AC_PROG_CC
157 AC_PROG_CXX
158 AC_LANG(C++)
159 AC_CXX_WARNINGS
160 AC_CXX_TEMPLATE_OPTIONS
161 AC_DEPEND_FLAG
162 # AC_CC_WARNINGS([ansi])
163 cc_ok=yes
164
165 dnl Library libdl :
166 AC_CHECK_LIB(dl,dlopen)
167
168 dnl Library librt : for alpha/osf
169 AC_CHECK_LIB(rt,nanosleep)
170
171 dnl add library libm :
172 AC_CHECK_LIB(m,ceil)
173
174 # _CS_gbo We should add all dependent libraries
175
176 AC_CXX_USE_STD_IOSTREAM
177
178 AC_CXX_HAVE_SSTREAM
179
180 # Testing linker
181 AC_LINKER_OPTIONS
182
183 echo
184 echo ---------------------------------------------
185 echo testing Fortran INTEGER size for CALCIUM 
186 echo ---------------------------------------------
187 echo
188
189 CHECK_CALCIUM
190
191 echo
192 echo ---------------------------------------------
193 echo testing threads
194 echo ---------------------------------------------
195 echo
196
197 ENABLE_PTHREADS
198
199 echo
200 echo ---------------------------------------------
201 echo testing python
202 echo ---------------------------------------------
203 echo
204
205 CHECK_PYTHON
206
207 echo
208 echo ---------------------------------------------
209 echo testing swig
210 echo ---------------------------------------------
211 echo
212
213 dnl _CS_gbo We should use here a variable given from the CHECK_PYTHON
214 AM_PATH_PYTHON(2.3)
215 CHECK_SWIG
216
217 echo
218 echo ---------------------------------------------
219 echo Testing libxml2
220 echo ---------------------------------------------
221 echo
222
223 CHECK_LIBXML
224
225 if test x$with_onlylauncher = xno; then
226 echo
227 echo ---------------------------------------------
228 echo testing HDF5
229 echo ---------------------------------------------
230 echo
231
232 CHECK_HDF5
233
234 # ----------------------------------------------------------------------------
235 # --- test corba
236
237 if test x$corba_gen = xtrue; then
238
239 echo
240 echo ============================================================
241 echo testing mandatory products for CORBA configurations
242 echo ============================================================
243 echo
244
245 dnl
246 dnl ---------------------------------------------
247 dnl testing sockets
248 dnl ---------------------------------------------
249 dnl
250
251 CHECK_SOCKETS
252
253 echo
254 echo ---------------------------------------------
255 echo Configuration of the ORB
256 echo ---------------------------------------------
257 echo
258
259 echo Testing OMNIORB ...
260 CHECK_OMNIORB
261
262 echo Selecting the default ORB
263 DEFAULT_ORB=omniORB
264 echo DEFAULT_ORB : $DEFAULT_ORB
265 CHECK_CORBA
266
267 CORBA=salome_adm/unix/make_$ORB
268 AC_SUBST_FILE(CORBA)
269
270 # _CS_gbo:
271 # The CORBA variable defines the file name that
272 # implements the building rules to be included by Makefile to process
273 # idl files and CORBA specific dependencies (ex: the file
274 # salome_adm/unix/make_omniorb is the default for SALOME). The value
275 # of ORB is defined by CHECK_CORBA.
276
277 # Note that this checking process is no longer relevant for SALOME
278 # because the possibility of changing the ORB as a plugin is probably
279 # deprecated. The software configuration is clearly omniorb for CORBA
280 # communication. This could be simplify in a near futur.
281
282 echo
283 echo ---------------------------------------------
284 echo BOOST Library
285 echo ---------------------------------------------
286 echo
287
288 CHECK_BOOST
289
290 fi 
291 # --- end test corba
292 # ----------------------------------------------------------------------------
293
294 fi 
295 # --- end test ONLYLAUNCHER
296 # ----------------------------------------------------------------------------
297
298 echo
299 echo ============================================================
300 echo testing parallel products
301 echo ============================================================
302 echo
303
304 echo
305 echo ---------------------------------------------
306 echo checking if MPI is requested by user
307 echo ---------------------------------------------
308 echo
309
310 CHECK_MPI
311
312 echo
313 echo ---------------------------------------------
314 echo checking if PaCO++ is requested by user
315 echo ---------------------------------------------
316 echo
317
318 CHECK_PACO
319
320 echo
321 echo ------------------------------------------------------------
322 echo checking if parallel kernel extensions are requested by user
323 echo ------------------------------------------------------------
324 echo
325
326 AC_MSG_CHECKING(whether to enable parallel kernel extension)
327 AC_ARG_ENABLE(parallel_extension, 
328               AC_HELP_STRING([--enable-parallel_extension], [parallel kernel extension = [no/yes] (default is no)]),
329               parallel_extension_ok=$enableval,                
330               parallel_extension_ok=no)
331 if test "x$parallel_extension_ok" = "xyes"
332 then
333   if test "x$PaCO_ok" = "xno"
334   then
335     parallel_extension_ok=no
336   fi
337 fi
338
339 if test "x$parallel_extension_ok" = "xyes"
340 then
341   AC_MSG_RESULT([yes])
342 else
343   AC_MSG_RESULT([no])
344 fi
345
346 AM_CONDITIONAL([WITH_PACO_PARALLEL], [test "x$parallel_extension_ok" = "xyes"])
347
348 echo
349 echo ============================================================
350 echo testing optionnal products
351 echo ============================================================
352 echo
353
354 echo
355 echo ----------------------------------------------
356 echo testing CPPUNIT only required for unit testing
357 echo ----------------------------------------------
358 echo
359 CHECK_CPPUNIT
360
361 echo
362 echo --------------------------------------------------------------
363 echo Testing libBatch only required for batch functions in Launcher
364 echo --------------------------------------------------------------
365 echo
366
367 CHECK_LIBBATCH
368 AM_CONDITIONAL(WITH_LIBBATCH, [test x"$libbatch_ok" = xyes])
369
370 echo
371 echo ============================================================
372 echo testing products required only for documentation generation
373 echo ============================================================
374 echo
375
376 echo
377 echo ---------------------------------------------
378 echo Testing html generators
379 echo ---------------------------------------------
380 echo
381
382 CHECK_HTML_GENERATORS
383
384 # Additional conditional to avoid compilation of non-portable code
385 AM_CONDITIONAL(WINDOWS, [ test ])
386
387 echo
388 echo ============================================================
389 echo Summary
390 echo ============================================================
391 echo
392
393 # This function displays the values of each variable given in arguments 
394 function summary {
395   variables=$*
396   for var in $variables
397   do
398     eval toto=\$$var
399     if test x$toto != "x"; then
400       printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
401       eval echo \$$var
402     fi
403   done
404 }
405
406 # --------------------------------------
407
408 function check_fatal_error {
409   variables=$*
410   for var in $variables
411   do
412     eval toto=\$$var
413     if test x$toto != "xyes"; then
414         echo "FATAL ERROR: some mandatory products are missing."
415         echo "Installing the missing products is required before running the configure script".
416         exit 1
417     fi
418   done  
419 }
420
421 # --------------------------------------
422
423 if test x$with_onlylauncher = xno; then
424   if test x$corba_gen = xtrue; then
425     basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok libxml_ok"
426   else
427     basic_mandatory_products="cc_ok threads_ok hdf5_ok libxml_ok"
428   fi
429 else
430   basic_mandatory_products="cc_ok threads_ok libxml_ok"
431 fi
432
433 echo --- General mandatory products - Light configuration:
434 summary $basic_mandatory_products
435 check_fatal_error $basic_mandatory_products
436 echo
437
438 if test x$with_onlylauncher = xno; then
439   corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok"
440   if test x$corba_gen = xtrue; then
441     echo --- CORBA mandatory products - default configuration:
442     summary $corba_mandatory_products
443     check_fatal_error $corba_mandatory_products
444   else
445     echo --- CORBA products not required - option --disable-corba-gen
446   fi
447 fi
448 echo
449
450 parallel_products="mpi_ok PaCO_ok parallel_extension_ok"
451 echo --- Kernel parallel extensions:
452 summary $parallel_products
453 echo
454
455 optional_products="cppunit_ok numpy_ok libbatch_ok"
456 echo --- Optional products:
457 echo ["    These products are optional because the KERNEL functions"]
458 echo ["    using them are built only if the products are detected."]
459 summary $optional_products
460 echo
461 if test x$libbatch_ok = xno; then
462   echo ["    Warning: Batch functions will not be available in"]
463   echo ["    Salome Launcher because they require libBatch."]
464   echo
465 fi
466
467 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok"
468
469 echo --- Html documentation products: only required for doc production
470 summary $htmldoc_products
471 echo
472
473 if test x$with_onlylauncher = xno; then
474 echo
475 echo "Default ORB   : $DEFAULT_ORB"
476 echo
477 fi
478
479 dnl generals files which could be included in every makefile
480
481 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
482 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
483 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
484
485 dnl les dependences
486 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
487
488 dnl We don t need to say when we re entering directories if we re using
489 dnl GNU make becuase make does it for us.
490 if test "X$GMAKE" = "Xyes"; then
491    AC_SUBST(SETX) SETX=":"
492 else
493    AC_SUBST(SETX) SETX="set -x"
494 fi
495
496 echo
497 echo ---------------------------------------------
498 echo generating Makefiles and configure files
499 echo ---------------------------------------------
500 echo
501
502 # This list is initiated using autoscan and must be updated manually
503 # when adding a new file <filename>.in to manage. When you execute
504 # autoscan, the Makefile list is generated in the output file configure.scan.
505 # This could be helpfull to update de configuration.
506 AC_OUTPUT([ \
507   KERNEL_version.h \
508   salome_adm/unix/SALOMEconfig.ref \
509   salome_adm/Makefile \
510   salome_adm/cmake_files/Makefile \
511   salome_adm/unix/Makefile \
512   salome_adm/unix/config_files/Makefile \
513   Makefile \
514   bin/Makefile \
515   bin/VERSION \
516   doc/Makefile \
517   doc/salome/Makefile \
518   doc/salome/tui/Makefile \
519   doc/salome/tui/doxyfile \
520   doc/salome/tui/static/header.html \
521   doc/salome/gui/Makefile \
522   doc/salome/gui/doxyfile \
523   doc/salome/gui/static/header.html \
524   idl/Makefile \
525   idl/Calcium_Ports.idl \
526   resources/Makefile \
527   resources/KERNELCatalog.xml \
528   resources/CatalogResources.xml \
529   src/Makefile \
530   src/Basics/Makefile \
531   src/Basics/Test/Makefile \
532   src/Communication/Makefile \
533   src/Communication_SWIG/Makefile \
534   src/Container/Makefile \
535   src/ParallelContainer/Makefile \
536   src/DF/Makefile \
537   src/DSC/Makefile \
538   src/DSC/DSC_Basic/Makefile \
539   src/DSC/DSC_User/Makefile \
540   src/DSC/DSC_User/Basic/Makefile \
541   src/DSC/DSC_User/Datastream/Makefile \
542   src/DSC/DSC_User/Datastream/Palm/Makefile \
543   src/DSC/DSC_User/Datastream/Calcium/Makefile \
544   src/DSC/DSC_User/Datastream/Calcium/calcium_integer_port_uses.hxx \
545   src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.hxx \
546   src/DSC/DSC_User/Datastream/Calcium/CalciumFortranInt.h \
547   src/DSC/ParallelDSC/Makefile \
548   src/DSC/DSC_Python/Makefile \
549   src/GenericObj/Makefile \
550   src/HDFPersist/Makefile \
551   src/KERNEL_PY/Makefile \
552   src/Launcher/Makefile \
553   src/LifeCycleCORBA/Makefile \
554   src/LifeCycleCORBA/Test/Makefile \
555   src/LifeCycleCORBA_SWIG/Makefile \
556   src/LifeCycleCORBA_SWIG/Test/Makefile \
557   src/Logger/Makefile \
558   src/Logger/Test/Makefile \
559   src/ModuleCatalog/Makefile \
560   src/ModuleGenerator/Makefile \
561   src/ModuleGenerator/testIDLparser \
562   src/MPIContainer/Makefile \
563   src/NamingService/Makefile \
564   src/NamingService/Test/Makefile \
565   src/Notification/Makefile \
566   src/NOTIFICATION_SWIG/Makefile \
567   src/Registry/Makefile \
568   src/ResourcesManager/Makefile \
569   src/SALOMEDS/Makefile \
570   src/SALOMEDS/Test/Makefile \
571   src/SALOMEDSClient/Makefile \
572   src/SALOMEDSImpl/Makefile \
573   src/SALOMEDSImpl/Test/Makefile \
574   src/SALOMELocalTrace/Makefile \
575   src/SALOMELocalTrace/Test/Makefile \
576   src/SALOMETraceCollector/Makefile \
577   src/SALOMETraceCollector/Test/Makefile \
578   src/TestContainer/Makefile \
579   src/TestMPIContainer/Makefile \
580   src/TOOLSDS/Makefile \
581   src/UnitTests/Makefile \
582   src/Utils/Makefile \
583   src/Utils/Test/Makefile \
584 ])
585