Salome HOME
760f2d3b6a6d2433c5b59ddd591ec622b765e7f8
[modules/yacs.git] / src / wrappergen / bin / Cpp_Template__SRC / adm / unix / config_files / production.m4
1 dnl Copyright (C) 2006-2020  CEA/DEN, EDF R&D
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 if test "X$enable_production" = "Xyes"; then
51   FFLAGS="$FFLAGS -O3 "
52   CFLAGS="$CFLAGS -O3 "
53   CXXFLAGS="$CXXFLAGS -O3 "
54 fi
55 ])
56
57 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
58 AC_DEFUN(AC_DISABLE_PRODUCTION, [AC_ENABLE_PRODUCTION(no)])
59
60 # AC_ENABLE_DEBUG
61 AC_DEFUN(AC_ENABLE_DEBUG, [dnl
62 define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
63 AC_ARG_ENABLE(debug,
64 changequote(<<, >>)dnl
65 <<  --enable-debug[=PKGS]  build without debug information [default=>>AC_ENABLE_DEBUG_DEFAULT],
66 changequote([, ])dnl
67 [p=${PACKAGE-default}
68 case "$enableval" in
69 yes) enable_debug=yes ;;
70 no) enable_debug=no ;;
71 *)
72   enable_debug=no
73   # Look at the argument we got.  We use all the common list separators.
74   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
75   for pkg in $enableval; do
76     if test "X$pkg" = "X$p"; then
77       enable_debug=yes
78     fi
79   done
80   IFS="$ac_save_ifs"
81   ;;
82 esac],
83 enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
84
85 if test "X$enable_debug" = "Xyes"; then
86   FFLAGS="$FFLAGS -g -D_DEBUG_ "
87   CFLAGS="$CFLAGS -g -D_DEBUG_ "
88   CXXFLAGS="$CXXFLAGS -g -D_DEBUG_ "
89 fi
90 ])
91
92 # AC_DISABLE_DEBUG - set the default flag to --disable-debug
93 AC_DEFUN(AC_DISABLE_DEBUG, [AC_ENABLE_DEBUG(no)])
94