<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>(a) There's already a configure.mtune option. You should use that ("configure.mtune native") instead of appending to all the flags options.</div><div><br></div><div>(b) Don't you have to disable binary archives if you set "-mtune=native"?<br><br><div>vq</div>Sent from my iPhone</div><div><br>On Jan 23, 2014, at 3:07 PM, <a href="mailto:sean@macports.org">sean@macports.org</a> wrote:<br><br></div><blockquote type="cite"><div>

<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>[116291] trunk/dports/_resources/port1.0/group/debug-1.0.tcl</title>




<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/116291">116291</a></dd>
<dt>Author</dt> <dd><a href="mailto:sean@macports.org">sean@macports.org</a></dd>
<dt>Date</dt> <dd>2014-01-23 12:07:41 -0800 (Thu, 23 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>debug-1.0: add port group for unifying having a debug variant</pre>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdports_resourcesport10groupdebug10tcl">trunk/dports/_resources/port1.0/group/debug-1.0.tcl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdports_resourcesport10groupdebug10tcl"></a>
<div class="addfile"><h4>Added: trunk/dports/_resources/port1.0/group/debug-1.0.tcl (0 =&gt; 116291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/_resources/port1.0/group/debug-1.0.tcl                                (rev 0)
+++ trunk/dports/_resources/port1.0/group/debug-1.0.tcl        2014-01-23 20:07:41 UTC (rev 116291)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+#
+# Copyright (c) 2012 The MacPorts Project
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of The MacPorts Project nor the names of its
+#    contributors may be used to endorse or promote products derived from
+#    this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#
+# This PortGroup sets up default variants for projects that want m
+#
+# Usage:
+#
+#   PortGroup               debug 1.0
+
+configure.cflags-append    -mtune=native
+configure.cxxflags-append  -mtune=native
+configure.fflags-append    -mtune=native
+configure.f90flags-append  -mtune=native
+configure.fcflags-append   -mtune=native
+configure.cppflags-append  -mtune=native
+
+ui_debug "adding the default debug variant"
+variant debug description {Enable debug flags and symbols} {
+    configure.cflags-delete     -O1 -O2 -O3 -mtune=native -DNDEBUG -DNDEBUG=1
+    configure.cxxflags-delete   -O1 -O2 -O3 -mtune=native -DNDEBUG -DNDEBUG=1
+    configure.cppflags-delete   -O1 -O2 -O3 -mtune=native -DNDEBUG -DNDEBUG=1
+    configure.fflags-delete     -O1 -O2 -O3 -mtune=native -DNDEBUG -DNDEBUG=1
+    configure.f90flags-delete   -O1 -O2 -O3 -mtune=native -DNDEBUG -DNDEBUG=1
+    configure.fcflags-delete    -O1 -O2 -O3 -mtune=native -DNDEBUG -DNDEBUG=1
+
+    # certain options break the way cmake configures, so test for cmake variable
+    if {[info exists cmake_share_module_dir]} {
+        configure.args-delete   -DCMAKE_BUILD_TYPE=Release
+        configure.args-append   -DCMAKE_BUILD_TYPE=debugFull
+    } else {
+        configure.args-delete   --disable-debug
+        configure.args-append   --enable-debug
+    }
+
+    configure.cflags-append     -g -O0
+    configure.cxxflags-append   -g -O0
+    configure.fflags-append     -g -O0
+    configure.f90flags-append   -g -O0
+    configure.fcflags-append    -g -O0
+}
+
+post-destroot {
+  if {[variant_isset debug]} {
+      ui_debug "Generating the .dSYM bundles because of +debug: find ${destroot}${prefix} -type f '(' -name '*.dylib' -or -name '*.so' ')' -exec dsymutil {} +"
+      system -W ${destroot}${prefix} "find . -type f '(' -name '*.dylib' -or -name '*.so' ')' -exec dsymutil {} +"
+  }
+}
</ins></span></pre>
</div>
</div>


</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>macports-changes mailing list</span><br><span><a href="mailto:macports-changes@lists.macosforge.org">macports-changes@lists.macosforge.org</a></span><br><span><a href="https://lists.macosforge.org/mailman/listinfo/macports-changes">https://lists.macosforge.org/mailman/listinfo/macports-changes</a></span><br></div></blockquote></body></html>