Changeset: 5b7cdfef9424 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5b7cdfef9424
Modified Files:
        MonetDB.spec
        buildtools/ChangeLog.Apr2019
        configure.ag
        debian/rules
Branch: Apr2019
Log Message:

Remove restrictions on combinations of --{en,dis}able-{assert,debug,optimize}.


diffs (222 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -971,10 +971,12 @@ fi
     CFLAGS="${CFLAGS:-%optflags -Wno-format-truncation}"
 %endif
 export CFLAGS
+# do not use --enable-optimize or --disable-optimize: we don't want
+# any changes to optimization flags
 %{configure} \
        --enable-assert=no \
        --enable-console=yes \
-       --enable-debug=no \
+       --enable-debug=yes \
        --enable-developer=no \
        --enable-embedded=no \
        --enable-embedded-r=no \
@@ -987,7 +989,6 @@ export CFLAGS
        --enable-monetdb5=yes \
        --enable-netcdf=no \
        --enable-odbc=yes \
-       --enable-optimize=no \
        
--enable-py2integration=%{?with_py2integration:yes}%{!?with_py2integration:no} \
        
--enable-py3integration=%{?with_py3integration:yes}%{!?with_py3integration:no} \
        
--enable-rintegration=%{?with_rintegration:yes}%{!?with_rintegration:no} \
diff --git a/buildtools/ChangeLog.Apr2019 b/buildtools/ChangeLog.Apr2019
--- a/buildtools/ChangeLog.Apr2019
+++ b/buildtools/ChangeLog.Apr2019
@@ -1,3 +1,12 @@
 # ChangeLog file for buildtools
 # This file is updated with Maddlog
 
+* Fri Jul 12 2019 Sjoerd Mullender <sjo...@acm.org>
+- Removed restriction on using combinations of --enable-assert,
+  --enable-debug,  and --enable-optimize.  --enable-debug adds a -g (or
+  -even -g3) option, --enable-debug=gdb adds a -ggdb3 flag (for GCC);
+  --enable-optimize adds a bunch of optimization flags; --disable-debug
+  (or --enable-debug=no) removes any -g flags; --disable-optimize
+  removes any -O flags; --enable-optimize=auto leaves the optimization
+  flags untouched.
+
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -146,7 +146,7 @@ AS_IF([test -f "$srcdir"/vertoo.data],
        dft_strict=no
        dft_assert=no
        dft_debug=no
-       dft_optimize=no
+       dft_optimize=auto
        dft_developer=no])
 
 AC_ARG_ENABLE([developer],
@@ -820,66 +820,35 @@ AC_ARG_WITH([translatepath],
        [AS_VAR_IF([cross_compiling], [yes],
                [AC_MSG_WARN([Cross compiling, but no --with-translatepath 
option given])])])
 
-# check whether no (explictly chosen) mutual exclusive combinations
-# were made, compatability matrix:
-#                deb  ass  opt
-#  debug          \    C    X
-#  assert         C    \    C
-#  optimize       X    C    \
-
-# find conflicts
-AS_CASE([x$enable_debug.$enable_optimize],
-       [xyes.yes],
-               [AC_MSG_ERROR([combining --enable-optimize and --enable-debug 
is not possible])],
-       # handle defaults after user requests
-       [xyes.*], [
-               enable_debug=yes
-               AS_VAR_IF([enable_optimize], [no], [],
-                       [why_not_optimize="(as debug is enabled)"])
-               enable_optimize=no
-               ],
-       [x*.*no], [
-               enable_debug=`AS_ECHO(["$enable_debug"]) | sed 's:^def_::'`
-               enable_optimize=no
-               ],
-       [x*.*yes], [
-               # enable-optimize overrules other defaults
-               enable_optimize=yes
-               AS_VAR_IF([enable_debug], [no], [],
-                       [why_not_debug="(as optimize is enabled)"])
-               enable_debug=no
-               ],
-       [x*],
-               [AC_MSG_WARN([unhandled configuration 
$enable_debug.$enable_optimize, please file a bug on bugs.monetdb.org])])
-# make defaults real for flags which don't conflict with anything
-enable_assert=`AS_ECHO(["$enable_assert"]) | sed 's:^def_::'`
-
 AC_MSG_CHECKING([for --enable-debug])
-AS_VAR_IF([enable_debug], [yes], [
-       origCFLAGS=$CFLAGS
-       # remove "-Ox" as some compilers don't like "-g -Ox" combinations
-       CFLAGS=" $CFLAGS "
-       CFLAGS=`AS_ECHO(["$CFLAGS"]) | sed -e 's| -O[[0-9]] | |g' -e 's| -g | 
|g' -e 's|^ ||' -e 's| $||'`
-       # add "-g or -g3"
-       AS_CASE([$CC_ver],
-               [gcc-*], [CFLAGS="$CFLAGS -g3"],
-               [CFLAGS="$CFLAGS -g"])
-       AS_CASE([$GCC-$host_os],
-               [yes-aix*], [CFLAGS="$CFLAGS -gxcoff"])
-       changedCFLAGS=
-       for flag in $origCFLAGS ; do
-               AS_CASE([" $CFLAGS "],
-                       [*" $flag "*], [],
-                       [changedCFLAGS="$changedCFLAGS, removed $flag"])
-       done
-       for flag in $CFLAGS ; do
-               AS_CASE([" $origCFLAGS "],
-                       [*" $flag "*], [],
-                       [changedCFLAGS="$changedCFLAGS, added $flag"])
-       done
-       changedCFLAGS=`AS_ECHO(["$changedCFLAGS"]) | sed -e 's|^, ||'`
-       AC_MSG_RESULT([$enable_debug: $changedCFLAGS])],
-       [AC_MSG_RESULT([no])])
+AS_CASE([$enable_debug],
+       [yes|gdb], [
+               origCFLAGS=$CFLAGS
+               # add -g or -g3 (or even -ggdb3)
+               AS_CASE([$CC_ver],
+                       [gcc-*], [AS_VAR_IF([enable_debug], [gdb],
+                               [CFLAGS="$CFLAGS -ggdb3"],
+                               [CFLAGS="$CFLAGS -g3"])],
+                       [CFLAGS="$CFLAGS -g"])
+               AS_CASE([$GCC-$host_os],
+                       [yes-aix*], [CFLAGS="$CFLAGS -gxcoff"])
+               changedCFLAGS=
+               for flag in $origCFLAGS ; do
+                       AS_CASE([" $CFLAGS "],
+                               [*" $flag "*], [],
+                               [changedCFLAGS="$changedCFLAGS, removed $flag"])
+               done
+               for flag in $CFLAGS ; do
+                       AS_CASE([" $origCFLAGS "],
+                               [*" $flag "*], [],
+                               [changedCFLAGS="$changedCFLAGS, added $flag"])
+               done
+               changedCFLAGS=`AS_ECHO(["$changedCFLAGS"]) | sed -e 's|^, ||'`
+               AC_MSG_RESULT([$enable_debug: $changedCFLAGS])],
+       [
+               # disable debug: remove -g
+               CFLAGS=`AS_ECHO([" $CFLAGS "]) | sed -e 's| -g[[^ ]]* | |g' -e 
's|^ ||' -e 's| $||'`
+               AC_MSG_RESULT([no])])
 
 AC_MSG_CHECKING([for --enable-assert])
 AS_VAR_IF([enable_assert], [no], [
@@ -889,12 +858,10 @@ AS_VAR_IF([enable_assert], [no], [
 
 
 AC_MSG_CHECKING([for --enable-optimize])
-AS_VAR_IF([enable_optimize], [yes], [
+AS_CASE([$enable_optimize], [yes], [
        origCFLAGS="$CFLAGS"
-       # remove "-g" as some compilers don't like "-g -Ox" combinations
        # remove "-O2" as we add "-Ox" and some compilers don't like "-Oy -Ox" 
combinations
-       CFLAGS=" $CFLAGS "
-       CFLAGS=`AS_ECHO(["$CFLAGS"]) | sed -e 's| -g | |g' -e 's| -O2 | |g' -e 
's|^ ||' -e 's| $||'`
+       CFLAGS=`AS_ECHO([" $CFLAGS "]) | sed -e 's| -O2 | |g' -e 's|^ ||' -e 
's| $||'`
        # Optimization flags
        AS_CASE([$GCC-$CC_ver],
                [yes-clang-*],
@@ -1035,16 +1002,26 @@ AS_VAR_IF([enable_optimize], [yes], [
                        [changedCFLAGS="$changedCFLAGS, added $flag"])
        done
        changedCFLAGS=`AS_ECHO(["$changedCFLAGS"]) | sed -e 's|^, ||'`
-       AC_MSG_RESULT([yes: $changedCFLAGS])
-
-       # The default configure invocation when doing an rpmbuild also uses 
this.
-       # In fact, rpmbuild uses -Wp,-D_FORTIFY_SOURCE=2 (cf. 
/usr/lib/rpm/redhat/macros),
-       # but clang 3.3 complains about "argument unused during compilation";
-       # hence, we resort to plain "-D_FORTIFY_SOURCE=2", which appears to 
work fine
-       # also with `make rpm`. Well, worst case is that we miss a check that 
during
-       # "normal" build, that is then caught by '-Wp,-D_FORTIFY_SOURCE=2' 
during `make rpm`.
-       MCHECK_ADD_FLAG([-D_FORTIFY_SOURCE=2])],
-       [AC_MSG_RESULT([no])])
+       AC_MSG_RESULT([yes: $changedCFLAGS])],
+       [no], [
+       origCFLAGS="$CFLAGS"
+       # remove "-O2" as we add "-Ox" and some compilers don't like "-Oy -Ox" 
combinations
+       CFLAGS=`AS_ECHO([" $CFLAGS "]) | sed -e 's| -O2 | |g' -e 's|^ ||' -e 
's| $||'`
+       changedCFLAGS=
+       for flag in $origCFLAGS ; do
+               AS_CASE([" $CFLAGS "],
+                       [*" $flag "*], [],
+                       [changedCFLAGS="$changedCFLAGS, removed $flag"])
+       done
+       for flag in $CFLAGS ; do
+               AS_CASE([" $origCFLAGS "],
+                       [*" $flag "*], [],
+                       [changedCFLAGS="$changedCFLAGS, added $flag"])
+       done
+       changedCFLAGS=`AS_ECHO(["$changedCFLAGS"]) | sed -e 's|^, ||'`
+       AC_MSG_RESULT([no: $changedCFLAGS])
+       ],
+       [AC_MSG_RESULT([auto])])
 
 AC_PATH_PROG([BASH], [bash], [/usr/bin/bash], [$PATH])
 AC_CHECK_PROG([RM], [rm], [rm -f])
diff --git a/debian/rules b/debian/rules
--- a/debian/rules
+++ b/debian/rules
@@ -15,7 +15,7 @@ override_dh_auto_configure:
        dh_auto_configure -- \
        --enable-assert=no \
        --enable-console=yes \
-       --enable-debug=no \
+       --enable-debug=yes \
        --enable-developer=no \
        --enable-embedded=no \
        --enable-embedded-r=no \
@@ -56,8 +56,7 @@ override_dh_auto_configure:
        --with-snappy=no \
        --with-unixodbc=yes \
        --with-uuid=yes \
-       --with-valgrind=no \
-       X_CFLAGS=-g
+       --with-valgrind=no
 
 # currently the test suite fails
 override_dh_auto_test:
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to