1 dnl Copyright (C) 2007-2014 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, or (at your option) any later version.
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
24 dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
25 dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
27 dnl author Patrick GOLDBRONN
29 # AC_ENABLE_PRODUCTION
30 AC_DEFUN([AC_ENABLE_PRODUCTION], [dnl
31 define([AC_ENABLE_PRODUCTION_DEFAULT], ifelse($1, no, no, yes))dnl
32 AC_ARG_ENABLE(production,
33 changequote(<<, >>)dnl
34 << --enable-production[=PKGS] build without debug information [default=>>AC_ENABLE_PRODUCTION_DEFAULT],
38 yes) enable_production=yes ;;
39 no) enable_production=no ;;
42 # Look at the argument we got. We use all the common list separators.
43 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
44 for pkg in $enableval; do
45 if test "X$pkg" = "X$p"; then
52 enable_production=AC_ENABLE_PRODUCTION_DEFAULT)dnl
54 AC_CXX_OPTION(-Wparentheses,CXXFLAGS)
55 AC_CXX_OPTION(-Wreturn-type,CXXFLAGS)
56 AC_CXX_OPTION(-fmessage-length=0,CXXFLAGS)
57 AC_CXX_OPTION(-Wunused,CXXFLAGS)
58 AC_CXX_OPTION(-pipe,CXXFLAGS)
60 if test "X$enable_production" = "Xyes"; then
62 AC_CXX_OPTION(-Wuninitialized,CXXFLAGS)
63 CXXFLAGS="$CXXFLAGS -O "
67 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
68 AC_DEFUN([AC_DISABLE_PRODUCTION], [AC_ENABLE_PRODUCTION(no)])
71 AC_DEFUN([AC_ENABLE_DEBUG], [dnl
72 define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
74 changequote(<<, >>)dnl
75 << --enable-debug[=PKGS] build without debug information [default=>>AC_ENABLE_DEBUG_DEFAULT],
79 yes) enable_debug=yes ;;
80 no) enable_debug=no ;;
83 # Look at the argument we got. We use all the common list separators.
84 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
85 for pkg in $enableval; do
86 if test "X$pkg" = "X$p"; then
93 enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
95 if test "X$enable_debug" = "Xyes"; then
96 CFLAGS="$CFLAGS -g -D_DEBUG_ "
97 CXXFLAGS="$CXXFLAGS -g -D_DEBUG_ "
101 # AC_DISABLE_DEBUG - set the default flag to --disable-debug
102 AC_DEFUN([AC_DISABLE_DEBUG], [AC_ENABLE_DEBUG(no)])