1 dnl Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
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
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, or (at your option) any later version.
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.
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
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
25 dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
27 dnl author Patrick GOLDBRONN
28 dnl AC_ENABLE_PRODUCTION
29 dnl This macro enables production build : optimized + no debugging information (-g)
30 dnl default = not enabled
32 AC_DEFUN([AC_ENABLE_PRODUCTION],
33 [define([AC_ENABLE_PRODUCTION_DEFAULT], ifelse($1, no, no, yes))dnl
34 AC_ARG_ENABLE([production],
35 [AC_HELP_STRING([--enable-production],
36 [compile in optimized mode @<:@default=]AC_ENABLE_PRODUCTION_DEFAULT[@:>@])],
38 enable_production=$enableval
40 [enable_production=]AC_ENABLE_PRODUCTION_DEFAULT)
42 AC_CXX_OPTION(-Wparentheses,CXXFLAGS)
43 AC_CXX_OPTION(-Wreturn-type,CXXFLAGS)
44 AC_CXX_OPTION(-fmessage-length=0,CXXFLAGS)
45 AC_CXX_OPTION(-Wunused,CXXFLAGS)
46 AC_CXX_OPTION(-pipe,CXXFLAGS)
48 if test "X$enable_production" = "Xyes"; then
50 AC_CXX_OPTION(-Wuninitialized,CXXFLAGS)
51 CXXFLAGS="$CXXFLAGS -O "
54 CXXFLAGS="$CXXFLAGS -g"
58 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
59 AC_DEFUN([AC_DISABLE_PRODUCTION], [AC_ENABLE_PRODUCTION(no)])
63 dnl This macro enables debugging build : debug + trace
64 dnl default = not enabled
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[@:>@])],
72 enable_debug=$enableval
74 [enable_debug=]AC_ENABLE_DEBUG_DEFAULT)
76 if test "X$enable_debug" = "Xyes"; then
77 CFLAGS="$CFLAGS -g -D_DEBUG_ "
78 CXXFLAGS="$CXXFLAGS -g -D_DEBUG_ "
82 # AC_DISABLE_DEBUG - set the default flag to --disable-debug
83 AC_DEFUN([AC_DISABLE_DEBUG], [AC_ENABLE_DEBUG(no)])
85 dnl AC_ENABLE_MPI_SEQ_CONTAINER
87 dnl This macro enables mpi into the sequential container
88 dnl default = not enabled
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[@:>@])],
96 enable_mpi_seq_container=$enableval
98 [enable_mpi_seq_container=]AC_ENABLE_MPI_SEQ_CONTAINER_DEFAULT)
100 if test "X$enable_mpi_seq_container" = "Xyes"; then
101 CFLAGS="$CFLAGS -D_MPI_SEQ_CONTAINER_ "
102 CXXFLAGS="$CXXFLAGS -D_MPI_SEQ_CONTAINER_ "
104 AM_CONDITIONAL([WITH_MPI_SEQ_CONTAINER], [test "x$enable_mpi_seq_container" = "xyes"])