summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authormartin <martin@pkgsrc.org>2014-06-20 07:27:50 +0000
committermartin <martin@pkgsrc.org>2014-06-20 07:27:50 +0000
commitba16a8b4b6b2667d15148772e3c9c073f2e489b4 (patch)
tree7a903d1ed7f7821d17d21589bc61fc4a0b7b2974 /www
parentac8ecfca01cf8f3fe730c139f1e3088efe40a97f (diff)
downloadpkgsrc-ba16a8b4b6b2667d15148772e3c9c073f2e489b4.tar.gz
Add compiler depenend magic to keep the version compiled with option "debug"
usable with modern gcc. Since the full "debug" version will behave differently to the standard version (as it enables all the mozilla internal consistency checks, and also drops compiler optimization), it is not very usefull when trying to debug crashes that could be compiler bugs, or mozilla low level bugs - so provide a new option "debug-info" that creates a debuggable, but fully optimized version. The result is best run from the pkgobj dir via the work/build/dist/bin/run-mozilla script with options "-g ./firefox". No changes to the default pkg generated.
Diffstat (limited to 'www')
-rw-r--r--www/firefox/options.mk23
1 files changed, 18 insertions, 5 deletions
diff --git a/www/firefox/options.mk b/www/firefox/options.mk
index 2711736306b..5780dd856a5 100644
--- a/www/firefox/options.mk
+++ b/www/firefox/options.mk
@@ -1,8 +1,8 @@
-# $NetBSD: options.mk,v 1.22 2014/05/05 00:53:34 ryoon Exp $
+# $NetBSD: options.mk,v 1.23 2014/06/20 07:27:50 martin Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.firefox
PKG_SUPPORTED_OPTIONS= official-mozilla-branding
-PKG_SUPPORTED_OPTIONS+= alsa debug mozilla-jemalloc gnome pulseaudio webrtc
+PKG_SUPPORTED_OPTIONS+= alsa debug debug-info mozilla-jemalloc gnome pulseaudio webrtc
PLIST_VARS+= gnome jemalloc debug
.if ${OPSYS} == "Linux"
@@ -45,14 +45,27 @@ CONFIGURE_ARGS+= --enable-jemalloc
CONFIGURE_ARGS+= --disable-jemalloc
.endif
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mgcc) && ${CC_VERSION:S/gcc-//:S/.//g} >= 480
+# Modern gcc does not run any "tracking" passes when compiling with -O0,
+# which makes the generated debug info mostly useless. So explicitly
+# request them.
+O0TRACKING=-fvar-tracking-assignments -fvar-tracking
+.endif
+
.if !empty(PKG_OPTIONS:Mdebug)
-CONFIGURE_ARGS+= --enable-debug="-g -O0" --enable-debug-symbols --disable-optimize
+CONFIGURE_ARGS+= --enable-debug="-g -O0 ${O0TRACKING}" --enable-debug-symbols --disable-optimize
CONFIGURE_ARGS+= --disable-install-strip
PLIST.debug= yes
.else
-CONFIGURE_ARGS+= --disable-debug --disable-debug-symbols
+.if !empty(PKG_OPTIONS:Mdebug-info)
+CONFIGURE_ARGS+= --enable-debug-symbols
+.else
+CONFIGURE_ARGS+= --disable-debug-symbols
+.endif
+CONFIGURE_ARGS+= --disable-debug
+CONFIGURE_ARGS+= --enable-optimize=-O2
CONFIGURE_ARGS+= --enable-install-strip
-CONFIGURE_ARGS+= --enable-optimize=-O2
.endif
.if !empty(PKG_OPTIONS:Mpulseaudio)