[Midnightbsd-cvs] mports [20190] trunk/graphics/OpenEXR: fix build with gcc

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Tue Sep 8 21:55:46 EDT 2015


Revision: 20190
          http://svnweb.midnightbsd.org/mports/?rev=20190
Author:   laffer1
Date:     2015-09-08 21:55:46 -0400 (Tue, 08 Sep 2015)
Log Message:
-----------
fix build with gcc

Modified Paths:
--------------
    trunk/graphics/OpenEXR/Makefile
    trunk/graphics/OpenEXR/files/patch-IlmImf__ImfSystemSpecific.cpp

Modified: trunk/graphics/OpenEXR/Makefile
===================================================================
--- trunk/graphics/OpenEXR/Makefile	2015-09-09 01:50:30 UTC (rev 20189)
+++ trunk/graphics/OpenEXR/Makefile	2015-09-09 01:55:46 UTC (rev 20190)
@@ -2,6 +2,7 @@
 
 PORTNAME=	OpenEXR
 PORTVERSION=	2.2.0
+PORTREVISION=	2
 CATEGORIES=	graphics devel
 MASTER_SITES=	SAVANNAH/openexr/:dist \
 		FREEBSD_LOCAL/mandree/:test
@@ -26,7 +27,7 @@
 CPPFLAGS+=	-I. -I../IlmImf
 
 # must be linked with -l{thr|pthread} explicitly
-LDFLAGS+=	${PTHREAD_LIBS}
+LDFLAGS+=	-lpthread
 
 PORTDOCS=	*
 PORTEXAMPLES=	*
@@ -47,13 +48,6 @@
 
 .include <bsd.port.pre.mk>
 
-# If default compiler is GCC, upgrade it because
-# g++ 4.2 is too old to auto-upgrade 0xffffffffffffffffl to
-# a long long integer constant - and has likely more issues.
-.if ${COMPILER_TYPE} == gcc
-USE_GCC=	yes
-.endif
-
 MAJORVER=	2_2
 VER=		22
 

Modified: trunk/graphics/OpenEXR/files/patch-IlmImf__ImfSystemSpecific.cpp
===================================================================
--- trunk/graphics/OpenEXR/files/patch-IlmImf__ImfSystemSpecific.cpp	2015-09-09 01:50:30 UTC (rev 20189)
+++ trunk/graphics/OpenEXR/files/patch-IlmImf__ImfSystemSpecific.cpp	2015-09-09 01:55:46 UTC (rev 20190)
@@ -1,25 +1,29 @@
---- IlmImf/ImfSystemSpecific.cpp.orig	2014-08-10 04:23:57 UTC
-+++ IlmImf/ImfSystemSpecific.cpp
-@@ -35,6 +35,9 @@
- #include "ImfSystemSpecific.h"
- #include "ImfNamespace.h"
- #include "OpenEXRConfig.h"
-+#if defined(IMF_HAVE_SSE2) &&  defined(__GNUC__)
-+#include <cpuid.h>
-+#endif
- 
- OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
- 
-@@ -44,11 +47,7 @@ namespace {
+--- IlmImf/ImfSystemSpecific.cpp.orig	2014-08-10 08:23:57.000000000 +0400
++++ IlmImf/ImfSystemSpecific.cpp	2015-04-09 00:08:50.100958000 +0300
+@@ -44,11 +44,23 @@
      // Helper functions for gcc + SSE enabled
      void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
      {
--        __asm__ __volatile__ (
++#if __i386__
+         __asm__ __volatile__ (
 -            "cpuid"
 -            : /* Output  */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) 
 -            : /* Input   */ "a"(n)
--            : /* Clobber */);
-+	__cpuid(n, eax, ebx, ecx, edx);
++            "xchgl %%ebx,%k1\n"
++            "cpuid\n"
++            "xchgl %%ebx,%k1" \
++            : /* Output  */ "=a"(eax), "=&r"(ebx), "=c"(ecx), "=d"(edx)
++            : /* Input   */ "0"(n)
+             : /* Clobber */);
++#else
++        __asm__ __volatile__ (
++            "xchgq %%rbx,%q1\n"
++            "cpuid\n"
++            "xchgq %%rbx,%q1" \
++            : /* Output  */ "=a"(eax), "=&r"(ebx), "=c"(ecx), "=d"(edx)
++            : /* Input   */ "0"(n)
++            : /* Clobber */);
++#endif
      }
  
  #else // IMF_HAVE_SSE2 && __GNUC__



More information about the Midnightbsd-cvs mailing list