ports/81610: [PATCH] devel/ode: add option to support trimesh

Jonathan Hanna jhanna at pangolin-systems.com
Sun May 29 01:00:14 UTC 2005


>Number:         81610
>Category:       ports
>Synopsis:       [PATCH] devel/ode: add option to support trimesh
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 29 01:00:13 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan Hanna
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
>Description:

The ode distribution includes an "OPCODE" library that is required
to support triangle mesh objects. It is not currently enabled in
the port.
This patch:
 - adds an option (on by default) to use OPCODE, enabling trimesh
 - changes the header include order so as not to pick up installed
   includes before local ones
 - suppresses the unneeded use of values.h
 - works around an inlining limitation in g++

>How-To-Repeat:
>Fix:

diff -urPN --exclude=CVS ode.orig/Makefile ode/Makefile
--- ode.orig/Makefile	Fri Jul 23 01:44:18 2004
+++ ode/Makefile	Mon May 23 20:55:28 2005
@@ -21,6 +21,8 @@
 USE_GMAKE=	yes
 USE_REINPLACE=	yes
 
+OPTIONS=	OPCODE "Enable code required by TriList (trimesh) class" on
+
 .include <bsd.port.pre.mk>
 
 .if ${ARCH} == "amd64"
@@ -42,6 +44,15 @@
 		s|-fno-rtti||; \
 		s|-ffast-math|${CXXFLAGS} -I${X11BASE}/include|' \
 		${WRKSRC}/config/makefile.unix-gcc
+.if !defined(WITHOUT_OPCODE)
+	@${REINPLACE_CMD} -e \
+		's/^#OPCODE_DIRECTORY/OPCODE_DIRECTORY/' \
+		${WRKSRC}/config/user-settings
+.endif
+
+do-configure:
+	cd ${WRKSRC} ; ${GMAKE} configure
+	@${REINPLACE_CMD} -e '/include.*values.h/d' ${WRKSRC}/include/ode/config.h
 
 do-install:
 	@${INSTALL_DATA} ${WRKSRC}/lib/libode.a ${PREFIX}/lib
diff -urPN --exclude=CVS ode.orig/files/patch-Makefile ode/files/patch-Makefile
--- ode.orig/files/patch-Makefile	Sat Jun 26 11:36:17 2004
+++ ode/files/patch-Makefile	Mon May 23 21:00:04 2005
@@ -5,11 +5,11 @@
  
  %$(OBJ): %.c
 -	$(CC) $(C_FLAGS) $(C_INC)$(INCPATH) $(DEFINES) $(C_OPT)1 $(C_OUT)$@ $<
-+	$(CC) $(C_FLAGS) $(C_INC)$(INCPATH) $(DEFINES) $(C_OUT)$@ $<
++	$(CC) $(C_INC)$(INCPATH) $(C_FLAGS) $(DEFINES) $(C_OUT)$@ $<
  
  %$(OBJ): %.cpp
 -	$(CC) $(C_FLAGS) $(C_INC)$(INCPATH) $(INC_OPCODE) $(DEFINES) $(C_OPT)$(OPT) $(C_OUT)$@ $<
-+	$(CC) $(C_FLAGS) $(C_INC)$(INCPATH) $(INC_OPCODE) $(DEFINES) $(C_OUT)$@ $<
++	$(CC) $(C_INC)$(INCPATH) $(C_FLAGS) $(INC_OPCODE) $(DEFINES) $(C_OUT)$@ $<
  
  %.exe: %$(OBJ)
 -	$(CC) $(C_EXEOUT)$@ $< $(ODE_LIB) $(DRAWSTUFF_LIB) $(RESOURCE_FILE) $(LINK_OPENGL) $(LINK_MATH)
diff -urPN --exclude=CVS ode.orig/files/patch-OPC_TreeCollider.h ode/files/patch-OPC_TreeCollider.h
--- ode.orig/files/patch-OPC_TreeCollider.h	Wed Dec 31 16:00:00 1969
+++ ode/files/patch-OPC_TreeCollider.h	Mon May 23 20:17:42 2005
@@ -0,0 +1,30 @@
+--- OPCODE/OPC_TreeCollider.h.orig	Mon May 23 20:11:48 2005
++++ OPCODE/OPC_TreeCollider.h	Mon May 23 20:16:16 2005
+@@ -28,6 +28,13 @@
+ 	//! even entering the recursive collision code.
+ 	struct OPCODE_API BVTCache : Pair
+ 	{
++		inline_		void	ResetCountDown()
++							{
++#ifdef __MESHMERIZER_H__		// Collision hulls only supported within ICE !
++								CountDown		= 50;
++#endif // __MESHMERIZER_H__
++							}
++
+ 		//! Constructor
+ 		inline_				BVTCache()
+ 							{
+@@ -46,13 +53,6 @@
+ 								SepVector.pid	= 0;
+ 								SepVector.qid	= 0;
+ 								SepVector.SV	= Point(1.0f, 0.0f, 0.0f);
+-#endif // __MESHMERIZER_H__
+-							}
+-
+-		inline_		void	ResetCountDown()
+-							{
+-#ifdef __MESHMERIZER_H__		// Collision hulls only supported within ICE !
+-								CountDown		= 50;
+ #endif // __MESHMERIZER_H__
+ 							}
+ 
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list