Salome HOME
Updated copyright comment
[modules/yacs.git] / src / wrappergen / src / HXX2SALOME_GENERIC_CLASS_NAME_SRC / adm_local / unix / config_files / production.m4
1 dnl Copyright (C) 2006-2024  CEA, EDF
2 dnl
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.
7 dnl
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.
12 dnl
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
16 dnl
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 dnl
19
20 dnl define macros :
21 dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
22 dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
23 dnl version $Id$
24 dnl author Patrick GOLDBRONN
25 dnl
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],
32 changequote([, ])dnl
33 [p=${PACKAGE-default}
34 case "$enableval" in
35 yes) enable_production=yes ;;
36 no) enable_production=no ;;
37 *)
38   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
43       enable_production=yes
44     fi
45   done
46   IFS="$ac_save_ifs"
47   ;;
48 esac],
49 enable_production=AC_ENABLE_PRODUCTION_DEFAULT)dnl
50
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)
57
58 if test "X$enable_production" = "Xyes"; then
59   CFLAGS="$CFLAGS -O"
60   AC_CXX_OPTION(-Wuninitialized,CXXFLAGS)
61   CXXFLAGS="$CXXFLAGS -O "
62 fi
63 ])
64
65 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
66 AC_DEFUN([AC_DISABLE_PRODUCTION], [AC_ENABLE_PRODUCTION(no)])
67
68 # AC_ENABLE_DEBUG
69 AC_DEFUN([AC_ENABLE_DEBUG], [dnl
70 define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
71 AC_ARG_ENABLE(debug,
72 changequote(<<, >>)dnl
73 <<  --enable-debug[=PKGS]  build without debug information [default=>>AC_ENABLE_DEBUG_DEFAULT],
74 changequote([, ])dnl
75 [p=${PACKAGE-default}
76 case "$enableval" in
77 yes) enable_debug=yes ;;
78 no) enable_debug=no ;;
79 *)
80   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
85       enable_debug=yes
86     fi
87   done
88   IFS="$ac_save_ifs"
89   ;;
90 esac],
91 enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
92
93 if test "X$enable_debug" = "Xyes"; then
94   CFLAGS="$CFLAGS -g -D_DEBUG_ "
95   CXXFLAGS="$CXXFLAGS -g -D_DEBUG_ "
96 fi
97 ])
98
99 # AC_DISABLE_DEBUG - set the default flag to --disable-debug
100 AC_DEFUN([AC_DISABLE_DEBUG], [AC_ENABLE_DEBUG(no)])