1 dnl Copyright (C) 2006-2011 CEA/DEN, EDF R&D
3 dnl This library is free software; you can redistribute it and/or
4 dnl modify it under the terms of the GNU Lesser General Public
5 dnl License as published by the Free Software Foundation; either
6 dnl version 2.1 of the License.
8 dnl This library is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 dnl Lesser General Public License for more details.
13 dnl You should have received a copy of the GNU Lesser General Public
14 dnl License along with this library; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
21 dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
22 dnl version $Id: production.m4,v 1.2.20.1 2008-12-05 14:11:38 abd Exp $
23 dnl author Patrick GOLDBRONN
25 # AC_ENABLE_PRODUCTION
26 AC_DEFUN(AC_ENABLE_PRODUCTION, [dnl
27 define([AC_ENABLE_PRODUCTION_DEFAULT], ifelse($1, no, no, yes))dnl
28 AC_ARG_ENABLE(production,
29 changequote(<<, >>)dnl
30 << --enable-production[=PKGS] build without debug information [default=>>AC_ENABLE_PRODUCTION_DEFAULT],
34 yes) enable_production=yes ;;
35 no) enable_production=no ;;
38 # Look at the argument we got. We use all the common list separators.
39 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
40 for pkg in $enableval; do
41 if test "X$pkg" = "X$p"; then
48 enable_production=AC_ENABLE_PRODUCTION_DEFAULT)dnl
49 if test "X$enable_production" = "Xyes"; then
52 CXXFLAGS="$CXXFLAGS -O3 "
60 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
61 AC_DEFUN(AC_DISABLE_PRODUCTION, [AC_ENABLE_PRODUCTION(no)])
64 AC_DEFUN(AC_ENABLE_DEBUG, [dnl
65 define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
67 changequote(<<, >>)dnl
68 << --enable-debug[=PKGS] build without debug information [default=>>AC_ENABLE_DEBUG_DEFAULT],
72 yes) enable_debug=yes ;;
73 no) enable_debug=no ;;
76 # Look at the argument we got. We use all the common list separators.
77 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
78 for pkg in $enableval; do
79 if test "X$pkg" = "X$p"; then
86 enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
88 if test "X$enable_debug" = "Xyes"; then
91 CXXFLAGS="$CXXFLAGS -g -D_DEBUG_ "
99 # AC_DISABLE_DEBUG - set the default flag to --disable-debug
100 AC_DEFUN(AC_DISABLE_DEBUG, [AC_ENABLE_DEBUG(no)])