speex does not build in platforms where malloc.h is a trap, like FreeBSD. Currently, in speex 1.1.12, only one file does include it, having included stdlib.h previously. A straightforward fix is to kill just the line including malloc.h in libspeex/kiss_fft.h, which should have zero impact on other platforms. Steps to reproduce: 1. emerge speex in any BSD-like C library, in which malloc.h is a trap. Actual results: emerge failed to compile with an #error popping up from <malloc.h>: i686-gentoo-freebsd6.0-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -I.. -I/usr/include -march=athlon-xp -O -pipe -O3 -msse -MT fftwrap.lo -MD -MP -MF .deps/fftwrap.Tpo -c fftwrap.c -fPIC -DPIC -o .libs/fftwrap.o In file included from kiss_fft.h:8, from kiss_fftr.h:4, from fftwrap.c:134: /usr/include/malloc.h:3:2: #error "<malloc.h> has been replaced by <stdlib.h>" gmake[2]: *** [fftwrap.lo] Error 1 Expected results: emerge compiling without problems the package. Build & Platform: speex 1.1.12 using gcc 3.4.6-r1 on Gentoo/FreeBSD emerge info: Gentoo Base System version 20060420 Portage 2.1_pre10-r4 (default-bsd/fbsd/6.1/x86, gcc-, freebsd-lib-6.0-r3, 6.0-RELEASE i386) ================================================================= System uname: 6.0-RELEASE i386 i386 dev-lang/python: 2.4.3-r1 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.16.1-r2 sys-devel/libtool: 1.5.22 virtual/os-headers: 6.0-r3 ACCEPT_KEYWORDS="x86-fbsd ~x86-fbsd" AUTOCLEAN="yes" CBUILD="i686-gentoo-freebsd6.0" CFLAGS="-march=athlon-xp -O -pipe" CHOST="i686-gentoo-freebsd6.0" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon-xp -O -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig collision-protect distlocks metadata-transfer sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage/portage-alt-overlay" SYNC="rsync://192.168.2.1/gentoo-portage" USE="x86-fbsd 3dnow X bash-completion cscope cups dri ffmpeg flac gdbm gif jpeg kde mailwrapper mmx mp3 ncurses ogg oss pam perl png python readline ruby speex sse sse2 ssl tcpd theora truetype usb vorbis xcomposite xine xml xv zeroconf zlib elibc_FreeBSD input_devices_keyboard input_devices_mouse input_devices_joystick kernel_FreeBSD userland_BSD video_cards_nvidia video_cards_nv" Unset: ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 86481 [details, diff] Kill #include <malloc.h> in libspeex/kiss_fft.h
Created attachment 86482 [details, diff] Modify speex 1.1.12 ebuild to patch the sources with previous patch
Thanks for the patch, added now and keyworded.