Salome HOME
Ajout des tests Plateforme pour daComposant
[modules/adao.git] / adm_local / production.m4
1 dnl  Copyright (C) 2006-2008  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.
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 dnl define macros :
20 dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
21 dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
22 dnl version $Id: production.m4,v 1.2.20.1 2008-12-05 14:11:38 abd Exp $
23 dnl author Patrick GOLDBRONN
24 dnl
25 # AC_ENABLE_PRODUCTION
26 AC_DEFUN(AC_ENABLE_PRODUCTION, [dnl
27 define([AC_ENABLE_PRODUCTION_DEFAULT], ifelse($1, no, no, yes))dnl
28 AC_ARG_ENABLE(production,
29 changequote(<<, >>)dnl
30 <<  --enable-production[=PKGS]  build without debug information [default=>>AC_ENABLE_PRODUCTION_DEFAULT],
31 changequote([, ])dnl
32 [p=${PACKAGE-default}
33 case "$enableval" in
34 yes) enable_production=yes ;;
35 no) enable_production=no ;;
36 *)
37   enable_production=no
38   # Look at the argument we got.  We use all the common list separators.
39   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
40   for pkg in $enableval; do
41     if test "X$pkg" = "X$p"; then
42       enable_production=yes
43     fi
44   done
45   IFS="$ac_save_ifs"
46   ;;
47 esac],
48 enable_production=AC_ENABLE_PRODUCTION_DEFAULT)dnl
49 if test "X$enable_production" = "Xyes"; then
50   FFLAGS="$FFLAGS -O3 "
51   CFLAGS="$CFLAGS -O3 "
52   CXXFLAGS="$CXXFLAGS -O3 "
53 else
54   FFLAGS="$FFLAGS"
55   CFLAGS="$CFLAGS"
56   CXXFLAGS="$CXXFLAGS"
57 fi
58 ])
59
60 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
61 AC_DEFUN(AC_DISABLE_PRODUCTION, [AC_ENABLE_PRODUCTION(no)])
62
63 # AC_ENABLE_DEBUG
64 AC_DEFUN(AC_ENABLE_DEBUG, [dnl
65 define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
66 AC_ARG_ENABLE(debug,
67 changequote(<<, >>)dnl
68 <<  --enable-debug[=PKGS]  build without debug information [default=>>AC_ENABLE_DEBUG_DEFAULT],
69 changequote([, ])dnl
70 [p=${PACKAGE-default}
71 case "$enableval" in
72 yes) enable_debug=yes ;;
73 no) enable_debug=no ;;
74 *)
75   enable_debug=no
76   # Look at the argument we got.  We use all the common list separators.
77   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
78   for pkg in $enableval; do
79     if test "X$pkg" = "X$p"; then
80       enable_debug=yes
81     fi
82   done
83   IFS="$ac_save_ifs"
84   ;;
85 esac],
86 enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
87
88 if test "X$enable_debug" = "Xyes"; then
89   FFLAGS="$FFLAGS -g "
90   CFLAGS="$CFLAGS -g "
91   CXXFLAGS="$CXXFLAGS -g -D_DEBUG_ "
92 else
93   FFLAGS="$FFLAGS"
94   CFLAGS="$CFLAGS"
95   CXXFLAGS="$CXXFLAGS"
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)])
101