Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 310119 - app-text/libpaper-1.1.23_p2 fails to compile on OS X
Summary: app-text/libpaper-1.1.23_p2 fails to compile on OS X
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Mac OSX (show other bugs)
Hardware: All OS X
: High normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-18 18:36 UTC by Stuart Shelton
Modified: 2010-03-20 11:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2010-03-18 18:36:13 UTC
Fails with:

/opt/gentoo/bin/bash ../libtool --tag=CC   --mode=compile x86_64-apple-darwin10-gcc -DHAVE_CONFIG_H -I. -I..  -D_REENTRANT   -O2 -fno-math-errno -march=core2 -msse4.1 -mfpmath=sse -pipe -MT libpaper_la-paper.lo -MD -MP -MF .deps/libpaper_la-paper.Tpo -c -o libpaper_la-paper.lo `test -f 'paper.c' || echo './'`paper.c
libtool: compile:  x86_64-apple-darwin10-gcc -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -O2 -fno-math-errno -march=core2 -msse4.1 -mfpmath=sse -pipe -MT libpaper_la-paper.lo -MD -MP -MF .deps/libpaper_la-paper.Tpo -c paper.c  -fno-common -DPIC -o .libs/libpaper_la-paper.o
paper.c:17:20: error: malloc.h: No such file or directory
make[3]: *** [libpaper_la-paper.lo] Error 1

On OS X, '#include <malloc.h>' needs to be '#include <malloc/malloc.h>':

--- lib/paper.c.dist
+++ lib/paper.c
@@ -14,7 +14,7 @@
 #include <sys/stat.h>
 
 #include <stdio.h>
-#include <malloc.h>
+#include <malloc/malloc.h>
 #include <string.h>
 #include <ctype.h>
 

... I'm not sure off-hand what symbols can be checked to see if the library is being built on OS X, though.
Comment 1 Fabian Groffen gentoo-dev 2010-03-18 18:38:10 UTC
include stdlib.h instead, that's what you're supposed to include when you need malloc, and is portable, while malloc/malloc.h isn't.
Comment 2 Fabian Groffen gentoo-dev 2010-03-20 11:29:52 UTC
BSD probably needs the same fix.  The patch is simple, and can be found here:
http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/app-text/libpaper/files/libpaper-1.1.23_p2-darwin-malloc.patch