Salome HOME
To see which hdf5 we're using in configure log
[modules/kernel.git] / salome_adm / unix / config_files / production.m4
1 dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 dnl
3 dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 dnl
6 dnl  This library is free software; you can redistribute it and/or
7 dnl  modify it under the terms of the GNU Lesser General Public
8 dnl  License as published by the Free Software Foundation; either
9 dnl  version 2.1 of the License.
10 dnl
11 dnl  This library is distributed in the hope that it will be useful,
12 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 dnl  Lesser General Public License for more details.
15 dnl
16 dnl  You should have received a copy of the GNU Lesser General Public
17 dnl  License along with this library; if not, write to the Free Software
18 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 dnl
20 dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 dnl
22 dnl define macros :
23 dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
24 dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
25 dnl version $Id$
26 dnl author Patrick GOLDBRONN
27 dnl AC_ENABLE_PRODUCTION
28 dnl This macro enables production build : optimized + no debugging information (-g)
29 dnl default = not enabled
30 dnl
31 AC_DEFUN([AC_ENABLE_PRODUCTION],
32 [define([AC_ENABLE_PRODUCTION_DEFAULT], ifelse($1, no, no, yes))dnl
33 AC_ARG_ENABLE([production],
34     [AC_HELP_STRING([--enable-production],
35      [compile in optimized mode @<:@default=]AC_ENABLE_PRODUCTION_DEFAULT[@:>@])],
36     [
37     enable_production=$enableval
38     ],
39     [enable_production=]AC_ENABLE_PRODUCTION_DEFAULT)
40
41 AC_CXX_OPTION(-Wparentheses,CXXFLAGS)
42 AC_CXX_OPTION(-Wreturn-type,CXXFLAGS)
43 AC_CXX_OPTION(-Wmissing-declarations,CXXFLAGS)
44 AC_CXX_OPTION(-fmessage-length=0,CXXFLAGS)
45 AC_CXX_OPTION(-Wunused,CXXFLAGS)
46 AC_CXX_OPTION(-pipe,CXXFLAGS)
47
48 if test "X$enable_production" = "Xyes"; then
49   CFLAGS="$CFLAGS -O"
50   AC_CXX_OPTION(-Wuninitialized,CXXFLAGS)
51   CXXFLAGS="$CXXFLAGS -O "
52 else
53   CFLAGS="$CFLAGS -g"
54   CXXFLAGS="$CXXFLAGS -g"
55 fi
56 ])
57
58 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
59 AC_DEFUN([AC_DISABLE_PRODUCTION], [AC_ENABLE_PRODUCTION(no)])
60
61 dnl AC_ENABLE_DEBUG
62 dnl
63 dnl This macro enables debugging build : debug + trace
64 dnl default = not enabled
65 dnl
66 AC_DEFUN([AC_ENABLE_DEBUG],
67     [define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
68     AC_ARG_ENABLE([debug],
69        [AC_HELP_STRING([--enable-debug],
70              [build with debug and trace information @<:@default=]AC_ENABLE_DEBUG_DEFAULT[@:>@])],
71     [
72     enable_debug=$enableval
73     ],
74     [enable_debug=]AC_ENABLE_DEBUG_DEFAULT)
75
76 if test "X$enable_debug" = "Xyes"; then
77   CFLAGS="$CFLAGS -g -D_DEBUG_ "
78   CXXFLAGS="$CXXFLAGS -g -D_DEBUG_ "
79 fi
80 ])
81
82 # AC_DISABLE_DEBUG - set the default flag to --disable-debug
83 AC_DEFUN([AC_DISABLE_DEBUG], [AC_ENABLE_DEBUG(no)])
84
85 dnl AC_ENABLE_MPI_SEQ_CONTAINER
86 dnl
87 dnl This macro enables mpi into the sequential container
88 dnl default = not enabled
89 dnl
90 AC_DEFUN([AC_ENABLE_MPI_SEQ_CONTAINER],
91     [define([AC_ENABLE_MPI_SEQ_CONTAINER_DEFAULT], ifelse($1, no, no, yes))dnl
92     AC_ARG_ENABLE([mpi-seq-container],
93        [AC_HELP_STRING([--enable-mpi-seq-container],
94              [enable mpi into seq container @<:@default=]AC_ENABLE_MPI_SEQ_CONTAINER_DEFAULT[@:>@])],
95     [
96     enable_mpi_seq_container=$enableval
97     ],
98     [enable_mpi_seq_container=]AC_ENABLE_MPI_SEQ_CONTAINER_DEFAULT)
99
100 if test "X$enable_mpi_seq_container" = "Xyes"; then
101   CFLAGS="$CFLAGS -D_MPI_SEQ_CONTAINER_ "
102   CXXFLAGS="$CXXFLAGS -D_MPI_SEQ_CONTAINER_ "
103 fi
104 AM_CONDITIONAL([WITH_MPI_SEQ_CONTAINER], [test "x$enable_mpi_seq_container" = "xyes"])
105 ])