Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jan 2016 05:30:59 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r406284 - in branches/2016Q1/graphics/lensfun: . files
Message-ID:  <201601170530.u0H5UxTN059024@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Sun Jan 17 05:30:59 2016
New Revision: 406284
URL: https://svnweb.freebsd.org/changeset/ports/406284

Log:
  MFH: r406040 by danfe
  
  - Limit -msse/-msse2 to files that actually use intrinsics
  - Limit SSE/SSE2 optimizations to x86 CPUs (exposed as SIMD option)
  
  PR:	205006
  Approved by:	ports-secteam (feld)

Added:
  branches/2016Q1/graphics/lensfun/files/patch-libs_lensfun_CMakeLists.txt
     - copied unchanged from r406040, head/graphics/lensfun/files/patch-libs_lensfun_CMakeLists.txt
Modified:
  branches/2016Q1/graphics/lensfun/Makefile
  branches/2016Q1/graphics/lensfun/files/patch-CMakeLists.txt
Directory Properties:
  branches/2016Q1/   (props changed)

Modified: branches/2016Q1/graphics/lensfun/Makefile
==============================================================================
--- branches/2016Q1/graphics/lensfun/Makefile	Sat Jan 16 23:32:40 2016	(r406283)
+++ branches/2016Q1/graphics/lensfun/Makefile	Sun Jan 17 05:30:59 2016	(r406284)
@@ -3,7 +3,7 @@
 
 PORTNAME=	lensfun
 PORTVERSION=	0.3.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	graphics
 MASTER_SITES=	SF/${PORTNAME}/${PORTVERSION}
 
@@ -19,13 +19,10 @@ USE_GNOME=	glib20
 USE_LDCONFIG=	yes
 CMAKE_ARGS=	-DBUILD_AUXFUN:BOOL=ON -DINSTALL_HELPER_SCRIPTS:BOOL=OFF
 
-.if ! ${MACHINE_CPU:Msse} == "sse"
-CMAKE_ARGS+=	-DBUILD_FOR_SSE:BOOL=OFF
-.endif
-
-.if ! ${MACHINE_CPU:Msse2} == "sse2"
-CMAKE_ARGS+=	-DBUILD_FOR_SSE2:BOOL=OFF
-.endif
+OPTIONS_DEFINE=	SIMD
+OPTIONS_DEFAULT=	SIMD
+
+SIMD_CMAKE_OFF=	-DBUILD_FOR_SSE:BOOL=OFF -DBUILD_FOR_SSE2:BOOL=OFF
 
 post-patch:
 	@${REINPLACE_CMD} -e '/pkgconfig/s,$${LIBDIR},libdata,' \

Modified: branches/2016Q1/graphics/lensfun/files/patch-CMakeLists.txt
==============================================================================
--- branches/2016Q1/graphics/lensfun/files/patch-CMakeLists.txt	Sat Jan 16 23:32:40 2016	(r406283)
+++ branches/2016Q1/graphics/lensfun/files/patch-CMakeLists.txt	Sun Jan 17 05:30:59 2016	(r406284)
@@ -1,24 +1,46 @@
 --- CMakeLists.txt.orig	2014-09-30 17:37:34 UTC
 +++ CMakeLists.txt
-@@ -46,15 +46,11 @@ ENDIF()
+@@ -28,12 +28,18 @@ IF(NOT HAVE_REGEX_H)
+   INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libs/regex)
+ ENDIF()
+ 
++IF(CMAKE_SYSTEM_PROCESSOR MATCHES "[XxIi][0-9]?86|[Aa][Mm][Dd]64")
++  SET(X86_ON ON)
++else()
++  SET(X86_ON OFF)
++ENDIF()
++
+ # options controlling the build process
+ OPTION(BUILD_STATIC "Build static library" OFF)
+ OPTION(BUILD_TESTS "Build test programs" OFF)
+ OPTION(BUILD_AUXFUN "Build auxfun library (requires libpng)" OFF)
+-OPTION(BUILD_FOR_SSE "Build with support for SSE" ON)
+-OPTION(BUILD_FOR_SSE2 "Build with support for SSE2" ON)
++OPTION(BUILD_FOR_SSE "Build with support for SSE" ${X86_ON})
++OPTION(BUILD_FOR_SSE2 "Build with support for SSE2" ${X86_ON})
+ OPTION(BUILD_DOC "Build documentation with doxygen" OFF)
+ OPTION(INSTALL_HELPER_SCRIPTS "Install various helper scripts" ON)
+ 
+@@ -46,14 +52,14 @@ ENDIF()
  
  IF(BUILD_FOR_SSE)
    SET(VECTORIZATION_SSE 1)
 -  IF(CMAKE_COMPILER_IS_GNUCXX)
 -    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
--  ENDIF()
-+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
++  IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
++    SET(VECTORIZATION_SSE_FLAGS "-msse")
+   ENDIF()
  ENDIF()
  IF(BUILD_FOR_SSE2)
    SET(VECTORIZATION_SSE2 1)
 -  IF(CMAKE_COMPILER_IS_GNUCXX)
 -    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
--  ENDIF()
-+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
++  IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
++    SET(VECTORIZATION_SSE2_FLAGS "-msse2")
+   ENDIF()
  ENDIF()
  
- IF(WIN32)
-@@ -68,6 +64,7 @@ ENDIF()
+@@ -68,6 +74,7 @@ ENDIF()
  # find dependencies
  FIND_PACKAGE(GLIB2 REQUIRED)
  INCLUDE_DIRECTORIES(${GLIB2_INCLUDE_DIRS})

Copied: branches/2016Q1/graphics/lensfun/files/patch-libs_lensfun_CMakeLists.txt (from r406040, head/graphics/lensfun/files/patch-libs_lensfun_CMakeLists.txt)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2016Q1/graphics/lensfun/files/patch-libs_lensfun_CMakeLists.txt	Sun Jan 17 05:30:59 2016	(r406284, copy of r406040, head/graphics/lensfun/files/patch-libs_lensfun_CMakeLists.txt)
@@ -0,0 +1,14 @@
+--- libs/lensfun/CMakeLists.txt.orig	2014-09-30 17:37:34 UTC
++++ libs/lensfun/CMakeLists.txt
+@@ -9,6 +9,11 @@ IF(WIN32)
+   LIST(APPEND LENSFUN_SRC windows/auxfun.cpp)
+ ENDIF()
+ 
++SET_SOURCE_FILES_PROPERTIES(mod-color-sse.cpp mod-coord-sse.cpp
++  PROPERTIES COMPILE_FLAGS "${VECTORIZATION_SSE_FLAGS}")
++SET_SOURCE_FILES_PROPERTIES(mod-color-sse2.cpp
++  PROPERTIES COMPILE_FLAGS "${VECTORIZATION_SSE2_FLAGS}")
++
+ IF(BUILD_STATIC)
+   ADD_LIBRARY(lensfun STATIC ${LENSFUN_SRC})
+ ELSE()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601170530.u0H5UxTN059024>