1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00

- Unbreak on system < 7.x by using malloc(3)

- Remove optimized cflags until other scons based ports play nice with them

PR:		ports/104542
Submitted by:	David Yeske <dyeske at yahoo.com> (maintainer)
Approved by:	portmgr (erwin)
This commit is contained in:
Rong-En Fan 2006-10-21 10:12:31 +00:00
parent 38a3d0cc77
commit a496109e19
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=175467
4 changed files with 40 additions and 30 deletions

View File

@ -20,20 +20,10 @@ USE_LDCONFIG= yes
WRKSRC= ${WRKDIR}/${PORTNAME}
.if defined(WITH_OPTIMIZED_CFLAGS)
CFLAGS+= -O3 -ffast-math
.endif
pre-everything::
.if !defined(WITH_OPTIMIZED_CFLAGS)
@${ECHO_MSG} "You can enable additional compilation optimizations"
@${ECHO_MSG} "by defining WITH_OPTIMIZED_CFLAGS"
.endif
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 700014
BROKEN= depends on posix_memalign(3)
.if ${OSVERSION} < 500000
BROKEN= Does not compile on 4.x
.endif
pre-patch:

View File

@ -1,24 +1,39 @@
--- src/yafraycore/y_alloc.h.orig Thu Jul 13 12:35:02 2006
+++ src/yafraycore/y_alloc.h Tue Sep 19 03:33:32 2006
+++ src/yafraycore/y_alloc.h Tue Oct 17 14:55:47 2006
@@ -5,7 +5,7 @@
#include<config.h>
#endif
-#ifdef __APPLE__
+#ifdef __FreeBSD__
+#if defined(__APPLE__) || defined (__FreeBSD__)
#include <stdlib.h>
#else
#include <malloc.h>
@@ -26,6 +26,12 @@
@@ -13,6 +13,10 @@
#include <vector>
#include <algorithm>
+#if defined(__FreeBSD__)
+#include <sys/param.h>
+#endif
+
__BEGIN_YAFRAY
typedef unsigned int u_int32;
@@ -26,6 +30,16 @@
// however, malloc is supposed to return at least SSE2 compatible alignment, which has to be enough.
// alternative would be valloc, but i have no good info on its effects.
return malloc(size);
+#elif defined(__FreeBSD__)
+#if (__FreeBSD_version < 700014)
+ return malloc(size);
+#else
+ void *ret;
+ if (posix_memalign(&ret, bound, size) != 0)
+ return (NULL);
+ else
+ return (ret);
+#endif
#else
return memalign(bound, size);
#endif

View File

@ -20,20 +20,10 @@ USE_LDCONFIG= yes
WRKSRC= ${WRKDIR}/${PORTNAME}
.if defined(WITH_OPTIMIZED_CFLAGS)
CFLAGS+= -O3 -ffast-math
.endif
pre-everything::
.if !defined(WITH_OPTIMIZED_CFLAGS)
@${ECHO_MSG} "You can enable additional compilation optimizations"
@${ECHO_MSG} "by defining WITH_OPTIMIZED_CFLAGS"
.endif
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 700014
BROKEN= depends on posix_memalign(3)
.if ${OSVERSION} < 500000
BROKEN= Does not compile on 4.x
.endif
pre-patch:

View File

@ -1,24 +1,39 @@
--- src/yafraycore/y_alloc.h.orig Thu Jul 13 12:35:02 2006
+++ src/yafraycore/y_alloc.h Tue Sep 19 03:33:32 2006
+++ src/yafraycore/y_alloc.h Tue Oct 17 14:55:47 2006
@@ -5,7 +5,7 @@
#include<config.h>
#endif
-#ifdef __APPLE__
+#ifdef __FreeBSD__
+#if defined(__APPLE__) || defined (__FreeBSD__)
#include <stdlib.h>
#else
#include <malloc.h>
@@ -26,6 +26,12 @@
@@ -13,6 +13,10 @@
#include <vector>
#include <algorithm>
+#if defined(__FreeBSD__)
+#include <sys/param.h>
+#endif
+
__BEGIN_YAFRAY
typedef unsigned int u_int32;
@@ -26,6 +30,16 @@
// however, malloc is supposed to return at least SSE2 compatible alignment, which has to be enough.
// alternative would be valloc, but i have no good info on its effects.
return malloc(size);
+#elif defined(__FreeBSD__)
+#if (__FreeBSD_version < 700014)
+ return malloc(size);
+#else
+ void *ret;
+ if (posix_memalign(&ret, bound, size) != 0)
+ return (NULL);
+ else
+ return (ret);
+#endif
#else
return memalign(bound, size);
#endif