summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/a52dec/module.defs5
-rw-r--r--contrib/ffmpeg/module.defs10
-rw-r--r--contrib/fontconfig/module.defs15
-rw-r--r--contrib/libbluray/module.defs12
-rw-r--r--contrib/libdvdnav/module.defs14
-rw-r--r--contrib/libdvdread/module.defs12
-rw-r--r--make/include/contrib.defs17
7 files changed, 51 insertions, 34 deletions
diff --git a/contrib/a52dec/module.defs b/contrib/a52dec/module.defs
index 4354366b7..5f53fa0cf 100644
--- a/contrib/a52dec/module.defs
+++ b/contrib/a52dec/module.defs
@@ -5,9 +5,4 @@ A52DEC.FETCH.url = http://download.handbrake.fr/handbrake/contrib/a52dec-0.7.4.t
A52DEC.EXTRACT.tarbase = a52dec
A52DEC.INSTALL.strip = liba52.a
-# a52dec overrides whatever optimization flags you try to set :(
-ifeq (max,$(GCC.g))
- A52DEC.CONFIGURE.env.CFLAGS = CFLAGS="-g"
-endif
-
A52DEC.CONFIGURE.bootstrap = rm -fr aclocal.m4 autom4te.cache; autoreconf -fiv;
diff --git a/contrib/ffmpeg/module.defs b/contrib/ffmpeg/module.defs
index eb66a4607..90cbd5c75 100644
--- a/contrib/ffmpeg/module.defs
+++ b/contrib/ffmpeg/module.defs
@@ -48,15 +48,21 @@ else
FFMPEG.CONFIGURE.extra += --enable-pthreads
endif
-ifneq (max,$(GCC.g))
+ifneq (max,$(FFMPEG.GCC.g))
FFMPEG.CONFIGURE.extra += --disable-debug
else
FFMPEG.CONFIGURE.extra += --enable-debug
endif
-ifeq (none,$(GCC.O))
+ifeq (none,$(FFMPEG.GCC.O))
+#
+# gcc on darwin i386 fails to find enough registers when
+# optimizations are disabled
+#
+ifneq (darwin-i386,$(BUILD.system)-$(BUILD.machine))
FFMPEG.CONFIGURE.extra += --disable-optimizations
endif
+endif
#
# MPC8 Doesn't compile on SPARC
diff --git a/contrib/fontconfig/module.defs b/contrib/fontconfig/module.defs
index 5d96593e8..78e819422 100644
--- a/contrib/fontconfig/module.defs
+++ b/contrib/fontconfig/module.defs
@@ -49,8 +49,19 @@ FONTCONFIG.CONFIGURE.env.CC = CC="$(FONTCONFIG.GCC.gcc) $(FONTCONFIG.cc_ar
# The following lines override the original lines in /make/include/contrib.defs,
# but have '*archs' removed (and '$(1)' presubstituted for 'FONTCONFIG').
#
-FONTCONFIG.CONFIGURE.env.CFLAGS = CFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra)"
-FONTCONFIG.CONFIGURE.env.CXXFLAGS = CXXFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra)"
+ifeq (max,$(FONTCONFIG.GCC.g))
+ ifeq (none,$(FONTCONFIG.GCC.O))
+ FONTCONFIG.CONFIGURE.env.CFLAGS = CFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra .g .O)"
+ FONTCONFIG.CONFIGURE.env.CXXFLAGS = CXXFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra .g .O)"
+ else
+ FONTCONFIG.CONFIGURE.env.CFLAGS = CFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra .g)"
+ FONTCONFIG.CONFIGURE.env.CXXFLAGS = CXXFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra .g)"
+ endif
+else
+ FONTCONFIG.CONFIGURE.env.CFLAGS = CFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra)"
+ FONTCONFIG.CONFIGURE.env.CXXFLAGS = CXXFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra)"
+endif
+
FONTCONFIG.CONFIGURE.env.CPPFLAGS = CPPFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra)"
FONTCONFIG.CONFIGURE.env.LDFLAGS = LDFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver)"
diff --git a/contrib/libbluray/module.defs b/contrib/libbluray/module.defs
index 123eb4cdf..d3371d089 100644
--- a/contrib/libbluray/module.defs
+++ b/contrib/libbluray/module.defs
@@ -5,4 +5,14 @@ LIBBLURAY.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libbluray-0
LIBBLURAY.CONFIGURE.bootstrap = rm -fr aclocal.m4 autom4te.cache; ./bootstrap;
-LIBBLURAY.CONFIGURE.extra += --disable-optimizations --enable-debug --disable-examples
+ifneq (max,$(LIBBLURAY.GCC.g))
+ LIBBLURAY.CONFIGURE.extra += --disable-debug
+else
+ LIBBLURAY.CONFIGURE.extra += --enable-debug
+endif
+
+ifeq (none,$(LIBBLURAY.GCC.O))
+ LIBBLURAY.CONFIGURE.extra += --disable-optimizations
+endif
+
+LIBBLURAY.CONFIGURE.extra += --disable-examples
diff --git a/contrib/libdvdnav/module.defs b/contrib/libdvdnav/module.defs
index 98c26b6b5..6f596d409 100644
--- a/contrib/libdvdnav/module.defs
+++ b/contrib/libdvdnav/module.defs
@@ -4,17 +4,11 @@ $(eval $(call import.CONTRIB.defs,LIBDVDNAV))
LIBDVDNAV.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libdvdnav-svn1168.tar.gz
LIBDVDNAV.EXTRACT.tarbase = libdvdnav
-ifneq (max,$(GCC.g))
-ifeq (none,$(GCC.O))
- LIBDVDNAV.CONFIGURE.env.CFLAGS = CFLAGS="-DNDEBUG -O0"
+ifneq (max,$(LIBDVDNAV.GCC.g))
+ifeq (none,$(LIBDVDNAV.GCC.O))
+ LIBDVDNAV.CONFIGURE.env.CFLAGS = CFLAGS="$(call fn.ARGS,LIBDVDNAV.GCC,*sysroot *minver ?extra .O) -DNDEBUG"
else
- LIBDVDNAV.CONFIGURE.env.CFLAGS = CFLAGS="-DNDEBUG"
-endif
-else
-ifeq (none,$(GCC.O))
- LIBDVDNAV.CONFIGURE.env.CFLAGS = CFLAGS="-g -O0"
-else
- LIBDVDNAV.CONFIGURE.env.CFLAGS = CFLAGS="-g"
+ LIBDVDNAV.CONFIGURE.env.CFLAGS = CFLAGS="$(call fn.ARGS,LIBDVDNAV.GCC,*sysroot *minver ?extra) -DNDEBUG"
endif
endif
diff --git a/contrib/libdvdread/module.defs b/contrib/libdvdread/module.defs
index bbf7e1dc9..acd6717c7 100644
--- a/contrib/libdvdread/module.defs
+++ b/contrib/libdvdread/module.defs
@@ -4,17 +4,5 @@ $(eval $(call import.CONTRIB.defs,LIBDVDREAD))
LIBDVDREAD.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libdvdread-svn1168.tar.gz
LIBDVDREAD.EXTRACT.tarbase = libdvdread
-ifeq (max,$(GCC.g))
-ifeq (none,$(GCC.O))
- LIBDVDREAD.CONFIGURE.env.CFLAGS = CFLAGS="-g -O0"
-else
- LIBDVDREAD.CONFIGURE.env.CFLAGS = CFLAGS="-g"
-endif
-else
-ifeq (none,$(GCC.O))
- LIBDVDREAD.CONFIGURE.env.CFLAGS = CFLAGS="-O0"
-endif
-endif
-
LIBDVDREAD.CONFIGURE.extra = --enable-local-dlfcn
LIBDVDREAD.CONFIGURE.bootstrap = rm -fr aclocal.m4 autom4te.cache; autoreconf -fiv;
diff --git a/make/include/contrib.defs b/make/include/contrib.defs
index 0e158cd67..003152b85 100644
--- a/make/include/contrib.defs
+++ b/make/include/contrib.defs
@@ -83,9 +83,22 @@ define import.CONTRIB.defs
$(1).CONFIGURE.args = !sete @dir !bootstrap !env !exe @host @prefix !deps !shared !static !extra
$(1).CONFIGURE.env.CC = CC=$$($(1).GCC.gcc)
- $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra)"
$(1).CONFIGURE.env.CXX = CXX=$$($(1).GCC.gxx)
- $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra)"
+ ##
+ ## Only add debug and optimization flags to contribs when
+ ## debug=max or optimizations=none. Otherwise, use the contribs defaults
+ ifeq (max,$$($(1).GCC.g))
+ ifeq (none,$$($(1).GCC.O))
+ $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g .O)"
+ $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g .O)"
+ else
+ $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g)"
+ $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g)"
+ endif
+ else
+ $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra)"
+ $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra)"
+ endif
$(1).CONFIGURE.env.CPPFLAGS = CPPFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra)"
$(1).CONFIGURE.env.LDFLAGS = LDFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver)"
$(1).CONFIGURE.env.PKG_CONFIG_PATH = PKG_CONFIG_PATH="$$(call fn.ABSOLUTE,$$(CONTRIB.build/))lib/pkgconfig"