1 dnl Copyright (C) 2006-2012 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
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
51 AC_CXX_OPTION(-Wno-deprecated,CXXFLAGS)
52 AC_CXX_OPTION(-Wparentheses,CXXFLAGS)
53 AC_CXX_OPTION(-Wreturn-type,CXXFLAGS)
54 AC_CXX_OPTION(-fmessage-length=0,CXXFLAGS)
55 AC_CXX_OPTION(-Wunused,CXXFLAGS)
56 AC_CXX_OPTION(-pipe,CXXFLAGS)
58 if test "X$enable_production" = "Xyes"; then
60 AC_CXX_OPTION(-Wuninitialized,CXXFLAGS)
61 CXXFLAGS="$CXXFLAGS -O "
65 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
66 AC_DEFUN([AC_DISABLE_PRODUCTION], [AC_ENABLE_PRODUCTION(no)])
69 AC_DEFUN([AC_ENABLE_DEBUG], [dnl
70 define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
72 changequote(<<, >>)dnl
73 << --enable-debug[=PKGS] build without debug information [default=>>AC_ENABLE_DEBUG_DEFAULT],
77 yes) enable_debug=yes ;;
78 no) enable_debug=no ;;
81 # Look at the argument we got. We use all the common list separators.
82 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
83 for pkg in $enableval; do
84 if test "X$pkg" = "X$p"; then
91 enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
93 if test "X$enable_debug" = "Xyes"; then
94 CFLAGS="$CFLAGS -g -D_DEBUG_ "
95 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)])