1 dnl Copyright (C) 2007-2008 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.
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
23 dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
24 dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
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
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[@:>@])],
37 enable_production=$enableval
39 [enable_production=]AC_ENABLE_PRODUCTION_DEFAULT)
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)
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)])