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