Salome HOME
d5fa2a3304467ecf16e91b127d83b746e144f242
[modules/yacs.git] / adm / unix / config_files / production.m4
1 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 dnl 
4 dnl  This library is free software; you can redistribute it and/or 
5 dnl  modify it under the terms of the GNU Lesser General Public 
6 dnl  License as published by the Free Software Foundation; either 
7 dnl  version 2.1 of the License. 
8 dnl 
9 dnl  This library is distributed in the hope that it will be useful, 
10 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 dnl  Lesser General Public License for more details. 
13 dnl 
14 dnl  You should have received a copy of the GNU Lesser General Public 
15 dnl  License along with this library; if not, write to the Free Software 
16 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 dnl 
18 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
19 dnl
20 dnl
21 dnl
22 dnl define macros :
23 dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
24 dnl and 
25 dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
26 dnl
27 dnl version $Id$
28 dnl author Patrick GOLDBRONN
29 dnl
30  
31 # AC_ENABLE_PRODUCTION
32 AC_DEFUN(AC_ENABLE_PRODUCTION, [dnl
33 define([AC_ENABLE_PRODUCTION_DEFAULT], ifelse($1, no, no, yes))dnl
34 AC_ARG_ENABLE(production,
35 changequote(<<, >>)dnl
36 <<  --enable-production[=PKGS]  build without debug information [default=>>AC_ENABLE_PRODUCTION_DEFAULT],
37 changequote([, ])dnl
38 [p=${PACKAGE-default}
39 case "$enableval" in
40 yes) enable_production=yes ;;
41 no) enable_production=no ;;
42 *)
43   enable_production=no
44   # Look at the argument we got.  We use all the common list separators.
45   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
46   for pkg in $enableval; do
47     if test "X$pkg" = "X$p"; then
48       enable_production=yes
49     fi
50   done
51   IFS="$ac_save_ifs"
52   ;;
53 esac],
54 enable_production=AC_ENABLE_PRODUCTION_DEFAULT)dnl
55 if test "X$enable_production" = "Xyes"; then
56   FFLAGS="$FFLAGS -O3 "
57   CFLAGS="$CFLAGS -O3 "
58   CXXFLAGS="$CXXFLAGS -O3 "
59 else
60   FFLAGS="$FFLAGS"
61   CFLAGS="$CFLAGS"
62   CXXFLAGS="$CXXFLAGS"
63 fi
64 ])
65
66 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
67 AC_DEFUN(AC_DISABLE_PRODUCTION, [AC_ENABLE_PRODUCTION(no)])
68
69 # AC_ENABLE_DEBUG
70 AC_DEFUN(AC_ENABLE_DEBUG, [dnl
71 define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
72 AC_ARG_ENABLE(debug,
73 changequote(<<, >>)dnl
74 <<  --enable-debug[=PKGS]  build without debug information [default=>>AC_ENABLE_DEBUG_DEFAULT],
75 changequote([, ])dnl
76 [p=${PACKAGE-default}
77 case "$enableval" in
78 yes) enable_debug=yes ;;
79 no) enable_debug=no ;;
80 *)
81   enable_debug=no
82   # Look at the argument we got.  We use all the common list separators.
83   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
84   for pkg in $enableval; do
85     if test "X$pkg" = "X$p"; then
86       enable_debug=yes
87     fi
88   done
89   IFS="$ac_save_ifs"
90   ;;
91 esac],
92 enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
93
94 if test "X$enable_debug" = "Xyes"; then
95   FFLAGS="$FFLAGS -g "
96   CFLAGS="$CFLAGS -g "
97   CXXFLAGS="$CXXFLAGS -g "
98 else
99   FFLAGS="$FFLAGS"
100   CFLAGS="$CFLAGS"
101   CXXFLAGS="$CXXFLAGS"
102 fi
103 ])
104
105 # AC_DISABLE_DEBUG - set the default flag to --disable-debug
106 AC_DEFUN(AC_DISABLE_DEBUG, [AC_ENABLE_DEBUG(no)])
107