--- /dev/null
+Remove hardcoded CFLAGS, fix broken example generation.
+
+--- SDIF-3.11.4-src/configure.ac
++++ SDIF-3.11.4-src/configure.ac
+@@ -518,15 +518,15 @@
+ [--enable-debug support additional library/programs with debug enabled],
+ [echo FEATURE enable-debug... $enableval;
+ if test "$enableval" = "yes"; then
+- SELLIB=libsdif-debug.la; CFLAGS="$EXTERNAL_CFLAGS -g2 -Wall";
++ SELLIB=libsdif-debug.la;
+ PROGLIST="querysdif-debug\$(EXEEXT) sdifextract-debug\$(EXEEXT) sdiftotext-debug\$(EXEEXT) tosdif-debug\$(EXEEXT)";
+
+ else
+- SELLIB=libsdif.la; CFLAGS="$EXTERNAL_CFLAGS -O3";
++ SELLIB=libsdif.la;
+ PROGLIST="querysdif\$(EXEEXT) sdifextract\$(EXEEXT) sdiftotext\$(EXEEXT) tosdif\$(EXEEXT)";
+ fi ],
+ [
+-SELLIB=libsdif.la; CFLAGS="$EXTERNAL_CFLAGS -O3";
++SELLIB=libsdif.la;
+ PROGLIST="querysdif\$(EXEEXT) sdifextract\$(EXEEXT) sdiftotext\$(EXEEXT) tosdif\$(EXEEXT)";
+ ])
+
+@@ -538,7 +538,7 @@
+ [--enable-profile generate additional library/programs with profiling output enabled],
+ [echo FEATURE enable-profile... $enableval;
+ if test "$enableval" = "yes"; then
+- SELLIB=libsdif-profile.la; CFLAGS="$CFLAGS -g -pg -fprofile-arcs";
++ SELLIB=libsdif-profile.la;
+ PROGLIST="querysdif-profile\$(EXEEXT) sdifextract-profile\$(EXEEXT) sdiftotext-profile\$(EXEEXT) tosdif-profile\$(EXEEXT)";
+ dnl else use the one selected above
+ fi ],
+--- SDIF-3.11.4-src/examples/Makefile.am
++++ SDIF-3.11.4-src/examples/Makefile.am
+@@ -18,18 +18,14 @@
+ # trying to add source code to dist, not working yet
+ #
+
+-INCLUDES = -I../include -I$(top_srcdir)/include -I$(top_srcdir)/sdif
+-CFLAGS = @CFLAGS@ '-DVERSION="$(VERSION)"'
++AM_CPPFLAGS = -I../include -I$(top_srcdir)/include -I$(top_srcdir)/sdif
++AM_CFLAGS = '-DVERSION="$(VERSION)"' @PTHREAD_CFLAGS@
+
+-libsdif = $(top_srcdir)/sdif/.libs/libsdif.a
++bin_PROGRAMS = list-types list-nvt
+
+-# this is for automake
+-EXTRA_DIST = list-types.c list-nvt.c
++list_types_SOURCES = list-types.c
++list_types_LDADD = $(top_srcdir)/sdif/.libs/libsdif.a @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
+
+-all: list-types list-nvt
++list_nvt_SOURCES = list-nvt.c
++list_nvt_LDADD = $(top_srcdir)/sdif/.libs/libsdif.a @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
+
+-list-types: list-types.c $(libsdif)
+- gcc -I../include -g -o $@ $^
+-
+-list-nvt: list-nvt.c $(libsdif)
+- gcc $(LDFLAGS) -I../include -g -o $@ $^
--- /dev/null
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools eutils
+
+DESCRIPTION="Sound Description Interchange Format Library for audio and wave processing"
+HOMEPAGE="http://sourceforge.net/projects/sdif/"
+SRC_URI="http://sourceforge.net/projects/sdif/files/sdif/SDIF-${PV}/SDIF-${PV}-src.zip"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE="debug ftruncate threads"
+
+PATCHES=(
+ "${FILESDIR}/${P}-fix-buildsystem.patch"
+)
+S="${WORKDIR}/SDIF-${PV}-src"
+
+src_prepare() {
+ mv configure.{in,ac} || die
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable debug) \
+ $(use_enable ftruncate) \
+ $(use_enable threads pthreads)
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+}