Apache OpenOffice (AOO) Bugzilla – Issue 20975
malloc.h on FreeBSD has been replaced by stdlib.h
Last modified: 2003-12-20 22:11:25 UTC
Hi, 1.1.0 compilation of FreeBSD 5.1: Making: ../../unxfbsd.pro/slo/typelib.obj /home/pavel//BuildDir/ccache /usr/bin/g++ -w -c -I. -I. -I../inc -I../../inc -I ../../unx/inc -I../../unxfbsd.pro/inc -I. -I/usr/home/pavel/BuildDir/ooo_1.1.0_s rc/solver/645/unxfbsd.pro/inc/stl -I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solve r/645/unxfbsd.pro/inc/external -I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solver/6 45/unxfbsd.pro/inc -I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solenv/unxfbsd/inc - I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solenv/inc -I/usr/home/pavel/BuildDir/oo o_1.1.0_src/res -I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solver/645/unxfbsd.pro/ inc/stl -I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solenv/inc/Xp31 -I/usr/local/jd k1.3.1/include -I/usr/local/jdk1.3.1/include/freebsd -I/usr/local/jdk1.3.1/inclu de/bsd -I/usr/local/jdk1.3.1/include/native_threads/include -I/usr/X11R6/include -I. -I../../res -I. -I/usr/X11R6/include -O -O -DCPPU_LEAK_STATIC_DATA -p ipe -fno-for-scope -fpermissive -fno-rtti -fexceptions -fPIC -DFREEBSD -DUNX - DVCL -DGCC -DC300 -DINTEL -DCVER=C300 -D_USE_NAMESPACE -D_USE_NAMESPACE=1 -DX86 -DNEW_SOLAR -DSTLPORT_VERSION=450 -DOSVERSION= -D_THREAD_SAFE -D_REENTRANT -D__D MAKE -DUNIX -DCPPU_ENV=gcc3 -DSUPD=645 -DBUILD=8693 -DPRODUCT -DNDEBUG -DPRODUCT _FULL -DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DEXCEPTIONS_ON -DCUI -DSOLAR_JAVA -DSRX645 -DSHAREDLIB -D_DLL_ -DMULTITHREAD -w -o ../../unxfbsd.pro/slo/typelib.o /usr /home/pavel/BuildDir/ooo_1.1.0_src/cppu/source/typelib/typelib.cxx In file included from /usr/home/pavel/BuildDir/ooo_1.1.0_src/cppu/source/typelib /typelib.cxx:72: /usr/include/malloc.h:3:2: #error "<malloc.h> has been replaced by <stdlib.h>" dmake: Error code 1, while making '../../unxfbsd.pro/slo/typelib.obj'
the same applies to stoc/source/corereflection/criface.cxx
This is generic problem thus probably should be in porting.
Reasing the owner to porting too.
ports on FreeBSD solve it by running throuhg all sources and replacing malloc.h for stdlib.h -> nonsense, because stdlib.h is almost certainly included before. Thus I propose the attached patch. I'd like to hear from FreeBSD folks, if it is OK. I didn't finished the build yet, thus only those two files are covered by this patch.
Created attachment 10188 [details] Do not include malloc.h on FreeBSD
The build finished, the complete patch attached.
Created attachment 10274 [details] FInal patch for inclusion
Approved for inclusion in 1.1.1.
Fixed in cws_srx645_ooo111fix1.
comment for this issue: In the ports framework, we do: @${ECHO_MSG} "===> Find old malloc.h defines and fix them in ${PKGNAME} source" @${FIND} ${WRKSRC}/.. | ${EGREP} "\.(cxx|h|c)$$" | ${XARGS} \ ${PERL} -pi -e "s|<malloc.h>|<stdlib.h>|g"
Maho, this is of course non-sense as I wrote in the comment above you comment. Please read it again.
pointy hat to: myself thanks, pavel
Verified, closing.