summaryrefslogtreecommitdiff
path: root/sci-libs/qd/files/0006-configure.ac-remove-enable-debug-flag.patch
blob: 151ec930e5aad616a5f26cd7de65be2ad8a729f7 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
From 6aac051631b20f5cde990fb3eda8dae85ff29666 Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Wed, 4 Aug 2021 19:01:17 -0400
Subject: [PATCH 06/12] configure.ac: remove --enable-debug flag.

The --enable-debug flag only does two things at the moment:

  1. It adds "-O" (as opposed to "-O2") to your CXXFLAGS and FCFLAGS.
  2. It adds "-g" to your CXXFLAGS and FCFLAGS.

When using gcc and gfortran, this is a convenient way to enable those
debugging flags. However, those options are not guaranteed to be
supported by other compilers. In the interest of simplicity and
portability, this commit simply removes the flag.

It would of course be possible to compile two test programs with
CXXFLAGS="-g -O" and FCFLAGS="-g -O" to determine whether or not those
flags are supported. That would solve half of the problem, but would
be a no-op (that is, it would not enable any debugging features) on
systems where the flags are not supported. That problem is more
difficult to solve, and hints that it's best to leave specific
compiler flags out of the build system whenever possible.
---
 configure.ac | 30 ++----------------------------
 1 file changed, 2 insertions(+), 28 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1e91cd1..108e58a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,16 +62,6 @@ fi
 AC_MSG_RESULT($enable_sloppy_div)
 
 
-# --enable-debug
-AC_ARG_ENABLE([debug], AS_HELP_STRING(--enable-debug, [enable debugging code. [[default=no]]]))
-AC_MSG_CHECKING([if debugging code is to be enabled])
-if test "$enable_debug" = "yes"; then
-  AC_DEFINE([QD_DEBUG], [1], [Define to 1 to enable debugging code.])
-else
-  enable_debug="no"
-fi
-AC_MSG_RESULT($enable_debug)
-
 # --enable-warnings
 AC_ARG_ENABLE([warnings], AS_HELP_STRING(--enable-warnings, [enable compiler warnings. [[default=no]]]))
 AC_MSG_CHECKING([if compiler warnings is to be enabled])
@@ -84,11 +74,7 @@ AC_MSG_RESULT($enable_warnings)
 # Checks for programs.
 AC_LANG(C++)
 if test "$CXXFLAGS" = ""; then
-  if test "$enable_debug" = "yes"; then
-    CXXFLAGS="-O"
-  else
-    CXXFLAGS="-O2"
-  fi
+  CXXFLAGS="-O2"
 fi
 
 # Set up compiler search list.  DUe to possible case insensitive filesystems, 
@@ -144,10 +130,6 @@ if test "$enable_warnings" = "yes"; then
   fi
 fi
 
-if test "$enable_debug" = "yes"; then
-  CXXFLAGS="$CXXFLAGS -g"
-fi
-
 # --enable-fma
 AC_ARG_ENABLE([fma], AS_HELP_STRING(--enable-fma, [use fused multiply-add/subtract (auto,gnu,ia64,c99,ibm,compiler).  Use this option with care.  [[default=auto]]]))
 if test "x$enable_fma" = "x"; then
@@ -242,11 +224,7 @@ AC_DEFINE([QD_HAVE_STD], [1], [Define to 1 if your compiler have the C++ standar
 
 # Check for fortran-90 compiler
 if test "$FCFLAGS" = ""; then
-  if test "$enable_debug" = "yes"; then
-    FCFLAGS="-O"
-  else
-    FCFLAGS="-O2"
-  fi
+  FCFLAGS="-O2"
 fi
 AC_ARG_ENABLE([fortran], AS_HELP_STRING(--enable-fortran, [build Fortran 77/90 interfaces [[default=auto]]]))
 if test "$enable_fortran" != "no"; then
@@ -296,14 +274,10 @@ if test "$enable_fortran" != "no"; then
   fi
   AC_SUBST(REQ_FCFLAGS)
   FCFLAGS="$FCFLAGS $REQ_FCFLAGS"
-  if test "$enable_debug" = "yes"; then
-    FCFLAGS="$FCFLAGS -g"
-  fi
   AC_LANG_POP(Fortran)
 fi
 AM_CONDITIONAL(UPCASE_MODULE, [test "$module_case" = "uppercase"])
 AM_CONDITIONAL(HAVE_FORTRAN, [test "$enable_fortran" = "yes"])
-AM_CONDITIONAL(QD_DEBUG, [test "$enable_debug" = "yes"])
 
 AC_SUBST(F77, $FC)
 AC_SUBST(FFLAGS, $FCFLAGS)
-- 
2.31.1