summaryrefslogtreecommitdiff
blob: 0fdad94cb9b93d55fb334e08cc080d562a50d006 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 configure.ac | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index c3364aa..2a734fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,6 +82,9 @@ AC_PROG_F77
 dnl ----------------------------------------------------------------
 dnl Disable default flag for compilation
 dnl ----------------------------------------------------------------
+CPPFLAGS_gentoo="${CPPFLAGS}"
+CFLAGS_gentoo="${CFLAGS}"
+CXXFLAGS_gentoo="${CXXFLAGS}"
 CPPFLAGS=""
 CFLAGS=""
 CXXFLAGS=""
@@ -428,6 +431,13 @@ AS_CASE([$enable_mode],
     AM_CXXFLAGS="$AM_CXXFLAGS -O3 -DNDEBUG"
     clean_default_flags=yes
     AM_CONDITIONAL([KAAPI_USE_DEBUG], [test "$enable_mode" = truc ])
+  ], [gentoo], [dnl
+    AC_MSG_NOTICE([Using gentoo compile mode])
+    AM_CPPFLAGS="$AM_CPPFLAGS ${CPPFLAGS_gentoo}"
+    AM_CFLAGS="$AM_CFLAGS -DNDEBUG ${CFLAGS_gentoo}"
+    AM_CXXFLAGS="$AM_CXXFLAGS -DNDEBUG ${CXXFLAGS_gentoo}"
+    clean_default_flags=yes
+    AM_CONDITIONAL([KAAPI_USE_DEBUG], [test "$enable_mode" = gentoo ])
   ], [dnl
     AC_MSG_ERROR([Unknown compilation mode '$enable_mode'. Aborting.])
   ])