]> SALOME platform Git repositories - modules/kernel.git/blob - configure.ac
Salome HOME
Fixed the fix for make distcheck
[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 AC_PROG_MKDIR_P
119 AC_SUBST(MKDIR_P)
120
121 echo
122 echo ---------------------------------------------
123 echo testing make
124 echo ---------------------------------------------
125 echo
126 AC_PROG_MAKE_SET
127 AC_PROG_INSTALL
128 AC_LOCAL_INSTALL
129
130 echo
131 echo ---------------------------------------------
132 echo Configuring production
133 echo ---------------------------------------------
134 echo
135 # production.m4
136 AC_ENABLE_DEBUG(no)
137 AC_ENABLE_PRODUCTION(no)
138 AC_ENABLE_MPI_SEQ_CONTAINER(no)
139
140 # _GBO_SALOME_PYTHON_PACKAGING_
141 if test "X$enable_debug" = "Xyes"; then
142   PYLOGLEVEL=DEBUG
143 else
144   PYLOGLEVEL=WARNING
145 fi
146 AC_SUBST(PYLOGLEVEL)
147
148 echo
149 echo ---------------------------------------------
150 echo testing libtool
151 echo ---------------------------------------------
152 echo
153
154 dnl first, we set static to no!
155 dnl if we want it, use --enable-static
156 AC_ENABLE_STATIC(no)
157 AC_LIBTOOL_DLOPEN
158 AC_PROG_LIBTOOL
159
160 echo
161 echo ---------------------------------------------
162 echo testing C/C++
163 echo ---------------------------------------------
164 echo
165
166 cc_ok=no
167 AC_PROG_CC
168 AC_PROG_CXX
169 AC_LANG(C++)
170 AC_CXX_WARNINGS
171 AC_CXX_TEMPLATE_OPTIONS
172 AC_DEPEND_FLAG
173 # AC_CC_WARNINGS([ansi])
174 cc_ok=yes
175
176 dnl Library libdl :
177 AC_CHECK_LIB(dl,dlopen)
178
179 dnl Library librt : for alpha/osf
180 AC_CHECK_LIB(rt,nanosleep)
181
182 dnl add library libm :
183 AC_CHECK_LIB(m,ceil)
184
185 AC_CXX_USE_STD_IOSTREAM
186
187 AC_CXX_HAVE_SSTREAM
188
189 # Testing linker
190 AC_LINKER_OPTIONS
191
192 echo
193 echo ---------------------------------------------
194 echo testing Fortran INTEGER size for CALCIUM 
195 echo ---------------------------------------------
196 echo
197
198 CHECK_CALCIUM
199
200 echo
201 echo ---------------------------------------------
202 echo testing threads
203 echo ---------------------------------------------
204 echo
205
206 ENABLE_PTHREADS
207
208 echo
209 echo ---------------------------------------------
210 echo testing python
211 echo ---------------------------------------------
212 echo
213
214 CHECK_PYTHON
215
216 echo
217 echo ---------------------------------------------
218 echo testing swig
219 echo ---------------------------------------------
220 echo
221
222 # _GBO_ This definition is required. Without this definition, the pythondir
223 # would not be defined. The version doesn't matter.
224 AM_PATH_PYTHON(2.4)
225 CHECK_SWIG
226
227 echo
228 echo ---------------------------------------------
229 echo Testing libxml2
230 echo ---------------------------------------------
231 echo
232
233 CHECK_LIBXML
234
235 if test x$with_onlylauncher = xno; then
236 echo
237 echo ---------------------------------------------
238 echo testing HDF5
239 echo ---------------------------------------------
240 echo
241
242 CHECK_HDF5
243
244 # ----------------------------------------------------------------------------
245 # --- test corba
246
247 if test x$corba_gen = xtrue; then
248
249 echo
250 echo ============================================================
251 echo testing mandatory products for CORBA configurations
252 echo ============================================================
253 echo
254
255 dnl
256 dnl ---------------------------------------------
257 dnl testing sockets
258 dnl ---------------------------------------------
259 dnl
260
261 CHECK_SOCKETS
262
263 echo
264 echo ---------------------------------------------
265 echo Configuration of the ORB
266 echo ---------------------------------------------
267 echo
268
269 echo Testing OMNIORB ...
270 CHECK_OMNIORB
271
272 echo Selecting the default ORB
273 DEFAULT_ORB=omniORB
274 echo DEFAULT_ORB : $DEFAULT_ORB
275 CHECK_CORBA
276
277 CORBA=salome_adm/unix/make_$ORB
278 AC_SUBST_FILE(CORBA)
279
280 # _CS_gbo:
281 # The CORBA variable defines the file name that
282 # implements the building rules to be included by Makefile to process
283 # idl files and CORBA specific dependencies (ex: the file
284 # salome_adm/unix/make_omniorb is the default for SALOME). The value
285 # of ORB is defined by CHECK_CORBA.
286
287 # Note that this checking process is no longer relevant for SALOME
288 # because the possibility of changing the ORB as a plugin is probably
289 # deprecated. The software configuration is clearly omniorb for CORBA
290 # communication. This could be simplify in a near futur.
291
292 echo
293 echo ---------------------------------------------
294 echo BOOST Library
295 echo ---------------------------------------------
296 echo
297
298 CHECK_BOOST
299
300 fi 
301 # --- end test corba
302 # ----------------------------------------------------------------------------
303
304 fi 
305 # --- end test ONLYLAUNCHER
306 # ----------------------------------------------------------------------------
307
308 echo
309 echo ============================================================
310 echo testing parallel products
311 echo ============================================================
312 echo
313
314 echo
315 echo ---------------------------------------------
316 echo checking if MPI is requested by user
317 echo ---------------------------------------------
318 echo
319
320 CHECK_MPI
321
322 echo
323 echo ---------------------------------------------
324 echo checking if PaCO++ is requested by user
325 echo ---------------------------------------------
326 echo
327
328 CHECK_PACO
329
330 echo
331 echo ------------------------------------------------------------
332 echo checking if parallel kernel extensions are requested by user
333 echo ------------------------------------------------------------
334 echo
335
336 AC_MSG_CHECKING(whether to enable parallel kernel extension)
337 AC_ARG_ENABLE(parallel_extension, 
338               AC_HELP_STRING([--enable-parallel_extension], [parallel kernel extension = [no/yes] (default is no)]),
339               parallel_extension_ok=$enableval,                
340               parallel_extension_ok=no)
341 if test "x$parallel_extension_ok" = "xyes"
342 then
343   if test "x$PaCO_ok" = "xno"
344   then
345     parallel_extension_ok=no
346   fi
347 fi
348
349 if test "x$parallel_extension_ok" = "xyes"
350 then
351   AC_MSG_RESULT([yes])
352 else
353   AC_MSG_RESULT([no])
354 fi
355
356 AM_CONDITIONAL([WITH_PACO_PARALLEL], [test "x$parallel_extension_ok" = "xyes"])
357
358 echo
359 echo ============================================================
360 echo testing optionnal products
361 echo ============================================================
362 echo
363
364 echo
365 echo ----------------------------------------------
366 echo testing CPPUNIT only required for unit testing
367 echo ----------------------------------------------
368 echo
369 CHECK_CPPUNIT
370
371 echo
372 echo --------------------------------------------------------------
373 echo Testing libBatch only required for batch functions in Launcher
374 echo --------------------------------------------------------------
375 echo
376
377 CHECK_LIBBATCH
378 AM_CONDITIONAL(WITH_LIBBATCH, [test x"$libbatch_ok" = xyes])
379
380 echo
381 echo ============================================================
382 echo testing products required only for documentation generation
383 echo ============================================================
384 echo
385
386 echo
387 echo ---------------------------------------------
388 echo Testing html generators
389 echo ---------------------------------------------
390 echo
391
392 CHECK_HTML_GENERATORS
393
394 # Additional conditional to avoid compilation of non-portable code
395 AM_CONDITIONAL(WINDOWS, [ test ])
396
397 echo
398 echo ---------------------------------------------
399 echo testing sphinx
400 echo ---------------------------------------------
401 echo
402 CHECK_SPHINX
403
404 echo
405 echo ============================================================
406 echo Summary
407 echo ============================================================
408 echo
409
410 # This function displays the values of each variable given in arguments 
411 function summary {
412   variables=$*
413   for var in $variables
414   do
415     eval toto=\$$var
416     if test x$toto != "x"; then
417       printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
418       eval echo \$$var
419     fi
420   done
421 }
422
423 # --------------------------------------
424
425 function check_fatal_error {
426   variables=$*
427   for var in $variables
428   do
429     eval toto=\$$var
430     if test x$toto != "xyes"; then
431         echo "FATAL ERROR: some mandatory products are missing."
432         echo "Installing the missing products is required before running the configure script".
433         exit 1
434     fi
435   done  
436 }
437
438 # --------------------------------------
439
440 if test x$with_onlylauncher = xno; then
441   if test x$corba_gen = xtrue; then
442     basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok libxml_ok"
443   else
444     basic_mandatory_products="cc_ok threads_ok hdf5_ok libxml_ok"
445   fi
446 else
447   basic_mandatory_products="cc_ok threads_ok libxml_ok"
448 fi
449
450 echo --- General mandatory products - Light configuration:
451 summary $basic_mandatory_products
452 check_fatal_error $basic_mandatory_products
453 echo
454
455 if test x$with_onlylauncher = xno; then
456   corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok"
457   if test x$corba_gen = xtrue; then
458     echo --- CORBA mandatory products - default configuration:
459     summary $corba_mandatory_products
460     check_fatal_error $corba_mandatory_products
461   else
462     echo --- CORBA products not required - option --disable-corba-gen
463   fi
464 fi
465 echo
466
467 parallel_products="mpi_ok PaCO_ok parallel_extension_ok"
468 echo --- Kernel parallel extensions:
469 summary $parallel_products
470 echo
471
472 optional_products="cppunit_ok numpy_ok libbatch_ok"
473 echo --- Optional products:
474 echo ["    These products are optional because the KERNEL functions"]
475 echo ["    using them are built only if the products are detected."]
476 summary $optional_products
477 echo
478 if test x$libbatch_ok = xno; then
479   echo ["    Warning: Batch functions will not be available in"]
480   echo ["    Salome Launcher because they require libBatch."]
481   echo
482 fi
483
484 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok sphinx_ok"
485
486 echo --- Html documentation products: only required for doc production
487 summary $htmldoc_products
488 echo
489
490 if test x$with_onlylauncher = xno; then
491 echo
492 echo "Default ORB   : $DEFAULT_ORB"
493 echo
494 fi
495
496 dnl generals files which could be included in every makefile
497
498 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
499 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
500 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
501
502 dnl les dependences
503 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
504
505 dnl We don t need to say when we re entering directories if we re using
506 dnl GNU make becuase make does it for us.
507 if test "X$GMAKE" = "Xyes"; then
508    AC_SUBST(SETX) SETX=":"
509 else
510    AC_SUBST(SETX) SETX="set -x"
511 fi
512
513 echo
514 echo ---------------------------------------------
515 echo generating Makefiles and configure files
516 echo ---------------------------------------------
517 echo
518
519 # This list is initiated using autoscan and must be updated manually
520 # when adding a new file <filename>.in to manage. When you execute
521 # autoscan, the Makefile list is generated in the output file configure.scan.
522 # This could be helpfull to update de configuration.
523 AC_OUTPUT([ \
524   KERNEL_version.h \
525   salome_adm/unix/SALOMEconfig.ref \
526   salome_adm/Makefile \
527   salome_adm/cmake_files/Makefile \
528   salome_adm/unix/Makefile \
529   salome_adm/unix/config_files/Makefile \
530   Makefile \
531   bin/Makefile \
532   bin/VERSION \
533   doc/Makefile \
534   doc/salome/Makefile \
535   doc/salome/tui/Makefile \
536   doc/salome/tui/doxyfile \
537   doc/salome/tui/static/header.html \
538   doc/salome/gui/Makefile \
539   doc/salome/gui/doxyfile \
540   doc/salome/gui/static/header.html \
541   doc/docutils/Makefile \
542   idl/Makefile \
543   idl/Calcium_Ports.idl \
544   resources/Makefile \
545   resources/KERNELCatalog.xml \
546   resources/CatalogResources.xml \
547   src/Makefile \
548   src/Basics/Makefile \
549   src/Basics/Test/Makefile \
550   src/Communication/Makefile \
551   src/Communication_SWIG/Makefile \
552   src/Container/Makefile \
553   src/ParallelContainer/Makefile \
554   src/DF/Makefile \
555   src/DSC/Makefile \
556   src/DSC/DSC_Basic/Makefile \
557   src/DSC/DSC_User/Makefile \
558   src/DSC/DSC_User/Basic/Makefile \
559   src/DSC/DSC_User/Datastream/Makefile \
560   src/DSC/DSC_User/Datastream/Palm/Makefile \
561   src/DSC/DSC_User/Datastream/Calcium/Makefile \
562   src/DSC/DSC_User/Datastream/Calcium/calcium_integer_port_uses.hxx \
563   src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.hxx \
564   src/DSC/DSC_User/Datastream/Calcium/CalciumFortranInt.h \
565   src/DSC/ParallelDSC/Makefile \
566   src/DSC/DSC_Python/Makefile \
567   src/GenericObj/Makefile \
568   src/HDFPersist/Makefile \
569   src/KERNEL_PY/Makefile \
570   src/KERNEL_PY/kernel/Makefile \
571   src/KERNEL_PY/kernel/logconfig.py \
572   src/Launcher/Makefile \
573   src/LifeCycleCORBA/Makefile \
574   src/LifeCycleCORBA/Test/Makefile \
575   src/LifeCycleCORBA_SWIG/Makefile \
576   src/LifeCycleCORBA_SWIG/Test/Makefile \
577   src/Logger/Makefile \
578   src/Logger/Test/Makefile \
579   src/ModuleCatalog/Makefile \
580   src/ModuleGenerator/Makefile \
581   src/ModuleGenerator/testIDLparser \
582   src/MPIContainer/Makefile \
583   src/NamingService/Makefile \
584   src/NamingService/Test/Makefile \
585   src/Notification/Makefile \
586   src/NOTIFICATION_SWIG/Makefile \
587   src/Registry/Makefile \
588   src/ResourcesManager/Makefile \
589   src/SALOMEDS/Makefile \
590   src/SALOMEDS/Test/Makefile \
591   src/SALOMEDSClient/Makefile \
592   src/SALOMEDSImpl/Makefile \
593   src/SALOMEDSImpl/Test/Makefile \
594   src/SALOMELocalTrace/Makefile \
595   src/SALOMELocalTrace/Test/Makefile \
596   src/SALOMETraceCollector/Makefile \
597   src/SALOMETraceCollector/Test/Makefile \
598   src/TestContainer/Makefile \
599   src/TestMPIContainer/Makefile \
600   src/TOOLSDS/Makefile \
601   src/UnitTests/Makefile \
602   src/Utils/Makefile \
603   src/Utils/Test/Makefile \
604 ])
605
606 AC_HACK_LIBTOOL