Salome HOME
- Ajout production.m4
authorAndré <andre.ribes@edf.fr>
Wed, 21 Apr 2010 12:57:41 +0000 (14:57 +0200)
committerAndré <andre.ribes@edf.fr>
Wed, 21 Apr 2010 12:57:41 +0000 (14:57 +0200)
adm_local/production.m4 [new file with mode: 0644]
configure.ac

diff --git a/adm_local/production.m4 b/adm_local/production.m4
new file mode 100644 (file)
index 0000000..8e827fc
--- /dev/null
@@ -0,0 +1,101 @@
+dnl  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
+dnl define macros :
+dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
+dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
+dnl version $Id: production.m4,v 1.2.20.1 2008-12-05 14:11:38 abd Exp $
+dnl author Patrick GOLDBRONN
+dnl
+# AC_ENABLE_PRODUCTION
+AC_DEFUN(AC_ENABLE_PRODUCTION, [dnl
+define([AC_ENABLE_PRODUCTION_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(production,
+changequote(<<, >>)dnl
+<<  --enable-production[=PKGS]  build without debug information [default=>>AC_ENABLE_PRODUCTION_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_production=yes ;;
+no) enable_production=no ;;
+*)
+  enable_production=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_production=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_production=AC_ENABLE_PRODUCTION_DEFAULT)dnl
+if test "X$enable_production" = "Xyes"; then
+  FFLAGS="$FFLAGS -O3 "
+  CFLAGS="$CFLAGS -O3 "
+  CXXFLAGS="$CXXFLAGS -O3 "
+else
+  FFLAGS="$FFLAGS"
+  CFLAGS="$CFLAGS"
+  CXXFLAGS="$CXXFLAGS"
+fi
+])
+
+# AC_DISABLE_PRODUCTION - set the default flag to --disable-production
+AC_DEFUN(AC_DISABLE_PRODUCTION, [AC_ENABLE_PRODUCTION(no)])
+
+# AC_ENABLE_DEBUG
+AC_DEFUN(AC_ENABLE_DEBUG, [dnl
+define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(debug,
+changequote(<<, >>)dnl
+<<  --enable-debug[=PKGS]  build without debug information [default=>>AC_ENABLE_DEBUG_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_debug=yes ;;
+no) enable_debug=no ;;
+*)
+  enable_debug=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_debug=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
+
+if test "X$enable_debug" = "Xyes"; then
+  FFLAGS="$FFLAGS -g "
+  CFLAGS="$CFLAGS -g "
+  CXXFLAGS="$CXXFLAGS -g -D_DEBUG_ "
+else
+  FFLAGS="$FFLAGS"
+  CFLAGS="$CFLAGS"
+  CXXFLAGS="$CXXFLAGS"
+fi
+])
+
+# AC_DISABLE_DEBUG - set the default flag to --disable-debug
+AC_DEFUN(AC_DISABLE_DEBUG, [AC_ENABLE_DEBUG(no)])
+
index e506bf041d7b6d381ff8286f9b31543df8665574..090f102c713d35ba4f49bb9bc5a756e7fbc26712 100644 (file)
@@ -10,6 +10,8 @@ if test "x$Kernel_ok" = "xno"; then
   AC_MSG_ERROR([You must define a correct KERNEL_ROOT_DIR or use the --with-kernel= configure option !])
 fi
 
+AC_ENABLE_DEBUG(yes)
+AC_DISABLE_PRODUCTION
 AC_PROG_LIBTOOL
 AC_PROG_CC
 AC_PROG_CXX