flac: Fix debug builds
authorTed Hess <[email protected]>
Wed, 27 Apr 2016 21:13:41 +0000 (17:13 -0400)
committerTed Hess <[email protected]>
Wed, 27 Apr 2016 21:13:41 +0000 (17:13 -0400)
Signed-off-by: Ted Hess <[email protected]>
libs/flac/Makefile
libs/flac/patches/005-gcc_debug_options.patch [new file with mode: 0644]

index 0454f98f7fecd40416b6a47c2f9ea05c8c9e90c4..01d7d646e3e06b8f272d688d9ae12dd1a373325e 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=flac
 PKG_VERSION:=1.3.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://downloads.xiph.org/releases/flac/
@@ -43,8 +43,8 @@ CONFIGURE_ARGS += \
        --disable-xmms-plugin \
        --disable-ogg \
        --disable-oggtest \
-       --disable-debug \
-       --enable-static \
+       $(if $(CONFIG_DEBUG),--enable-debug) \
+       --enable-static
 
 TARGET_CFLAGS += $(FPIC)
 
diff --git a/libs/flac/patches/005-gcc_debug_options.patch b/libs/flac/patches/005-gcc_debug_options.patch
new file mode 100644 (file)
index 0000000..80ffff1
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -348,11 +348,11 @@ fi
+ if test "x$debug" = xtrue; then
+       CPPFLAGS="-DDEBUG $CPPFLAGS"
+-      CFLAGS=$(echo "$CFLAGS" | sed 's/-g//')
+-      CFLAGS="-g $CFLAGS"
++      CFLAGS=$(echo "$CFLAGS" | sed 's/-g[0-9]*//')
++      CFLAGS="-g3 $CFLAGS"
+ else
+       CPPFLAGS="-DNDEBUG $CPPFLAGS"
+-      CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//;s/-g//')
++      CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//;s/-g[0-9]*//')
+       CFLAGS="-O3 -funroll-loops $CFLAGS"
+ fi