1 dnl Copyright (C) 2009-2023 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, or (at your option) any later version.
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
21 dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
22 dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
24 dnl author Patrick GOLDBRONN
26 # AC_ENABLE_PRODUCTION
27 AC_DEFUN(AC_ENABLE_PRODUCTION, [dnl
28 define([AC_ENABLE_PRODUCTION_DEFAULT], ifelse($1, no, no, yes))dnl
29 AC_ARG_ENABLE(production,
30 changequote(<<, >>)dnl
31 << --enable-production[=PKGS] build without debug information [default=>>AC_ENABLE_PRODUCTION_DEFAULT],
35 yes) enable_production=yes ;;
36 no) enable_production=no ;;
39 # Look at the argument we got. We use all the common list separators.
40 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
41 for pkg in $enableval; do
42 if test "X$pkg" = "X$p"; then
49 enable_production=AC_ENABLE_PRODUCTION_DEFAULT)dnl
50 if test "X$enable_production" = "Xyes"; then
53 CXXFLAGS="$CXXFLAGS -O3 "
61 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
62 AC_DEFUN(AC_DISABLE_PRODUCTION, [AC_ENABLE_PRODUCTION(no)])
65 AC_DEFUN(AC_ENABLE_DEBUG, [dnl
66 define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
68 changequote(<<, >>)dnl
69 << --enable-debug[=PKGS] build without debug information [default=>>AC_ENABLE_DEBUG_DEFAULT],
73 yes) enable_debug=yes ;;
74 no) enable_debug=no ;;
77 # Look at the argument we got. We use all the common list separators.
78 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
79 for pkg in $enableval; do
80 if test "X$pkg" = "X$p"; then
87 enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
89 if test "X$enable_debug" = "Xyes"; then
92 CXXFLAGS="$CXXFLAGS -g -D_DEBUG_ "
100 # AC_DISABLE_DEBUG - set the default flag to --disable-debug
101 AC_DEFUN(AC_DISABLE_DEBUG, [AC_ENABLE_DEBUG(no)])