1 dnl Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 dnl This library is free software; you can redistribute it and/or
5 dnl modify it under the terms of the GNU Lesser General Public
6 dnl License as published by the Free Software Foundation; either
7 dnl version 2.1 of the License.
9 dnl This library is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 dnl Lesser General Public License for more details.
14 dnl You should have received a copy of the GNU Lesser General Public
15 dnl License along with this library; if not, write to the Free Software
16 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 dnl See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
23 dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
25 dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
28 dnl author Patrick GOLDBRONN
31 # AC_ENABLE_PRODUCTION
32 AC_DEFUN([AC_ENABLE_PRODUCTION], [dnl
33 define([AC_ENABLE_PRODUCTION_DEFAULT], ifelse($1, no, no, yes))dnl
34 AC_ARG_ENABLE(production,
35 changequote(<<, >>)dnl
36 << --enable-production[=PKGS] build without debug information [default=>>AC_ENABLE_PRODUCTION_DEFAULT],
40 yes) enable_production=yes ;;
41 no) enable_production=no ;;
44 # Look at the argument we got. We use all the common list separators.
45 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
46 for pkg in $enableval; do
47 if test "X$pkg" = "X$p"; then
54 enable_production=AC_ENABLE_PRODUCTION_DEFAULT)dnl
56 AC_CXX_OPTION(-Wno-deprecated,CXXFLAGS)
57 AC_CXX_OPTION(-Wparentheses,CXXFLAGS)
58 AC_CXX_OPTION(-Wreturn-type,CXXFLAGS)
59 AC_CXX_OPTION(-Wmissing-declarations,CXXFLAGS)
60 AC_CXX_OPTION(-fmessage-length=0,CXXFLAGS)
61 AC_CXX_OPTION(-Wunused,CXXFLAGS)
63 if test "X$enable_production" = "Xyes"; then
65 AC_CXX_OPTION(-Wuninitialized,CXXFLAGS)
66 CXXFLAGS="$CXXFLAGS -O "
70 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
71 AC_DEFUN([AC_DISABLE_PRODUCTION], [AC_ENABLE_PRODUCTION(no)])
74 AC_DEFUN([AC_ENABLE_DEBUG], [dnl
75 define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
77 changequote(<<, >>)dnl
78 << --enable-debug[=PKGS] build without debug information [default=>>AC_ENABLE_DEBUG_DEFAULT],
82 yes) enable_debug=yes ;;
83 no) enable_debug=no ;;
86 # Look at the argument we got. We use all the common list separators.
87 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
88 for pkg in $enableval; do
89 if test "X$pkg" = "X$p"; then
96 enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
98 if test "X$enable_debug" = "Xyes"; then
99 CFLAGS="$CFLAGS -g -D_DEBUG_ "
100 CXXFLAGS="$CXXFLAGS -g -D_DEBUG_ "
104 # AC_DISABLE_DEBUG - set the default flag to --disable-debug
105 AC_DEFUN([AC_DISABLE_DEBUG], [AC_ENABLE_DEBUG(no)])