pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

openclonk: Work around silliness involving link-time optimization



Module Name:	pkgsrc-wip
Committed By:	Charlotte Koch <cfkoch%edgebsd.org@localhost>
Pushed By:	cfkoch
Date:		Wed Feb 12 22:36:12 2020 -0800
Changeset:	7ab5b5c0d4fe2f6229b10438e74d4c9c670b4f9b

Modified Files:
	openclonk/Makefile
	openclonk/distinfo
Added Files:
	openclonk/patches/patch-CMakeLists.txt

Log Message:
openclonk: Work around silliness involving link-time optimization

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=7ab5b5c0d4fe2f6229b10438e74d4c9c670b4f9b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 openclonk/Makefile                     |  7 ++++--
 openclonk/distinfo                     |  1 +
 openclonk/patches/patch-CMakeLists.txt | 46 ++++++++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+), 2 deletions(-)

diffs:
diff --git a/openclonk/Makefile b/openclonk/Makefile
index 3b8938a3a4..0d25fbb913 100644
--- a/openclonk/Makefile
+++ b/openclonk/Makefile
@@ -19,6 +19,9 @@ USE_LANGUAGES=	c c++
 USE_TOOLS+=	pkg-config
 GCC_REQD+=	4.9
 
+#CMAKE_ARGS+=	-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=FALSE
+MAKE_FLAGS+=	VERBOSE=1
+
 .include "../../audio/SDL2_mixer/buildlink3.mk"
 .include "../../audio/freealut/buildlink3.mk"
 .include "../../audio/libvorbis/buildlink3.mk"
@@ -30,8 +33,8 @@ GCC_REQD+=	4.9
 .include "../../graphics/freetype2/buildlink3.mk"
 .include "../../graphics/glew/buildlink3.mk"
 .include "../../graphics/png/buildlink3.mk"
-.include "../../mk/jpeg.buildlink3.mk"
-.include "../../mk/bsd.pkg.mk"
 .include "../../multimedia/libogg/buildlink3.mk"
 .include "../../x11/gtk3/buildlink3.mk"
 .include "../../x11/gtksourceview3/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/openclonk/distinfo b/openclonk/distinfo
index 769ad27333..ca4d48a0cd 100644
--- a/openclonk/distinfo
+++ b/openclonk/distinfo
@@ -4,3 +4,4 @@ SHA1 (openclonk-8.1-src.tar.bz2) = cad119b97ae4f1da772ef180c3c67741b812e466
 RMD160 (openclonk-8.1-src.tar.bz2) = 65ae54147aa12d50972cf3bf9ef454338063e6d6
 SHA512 (openclonk-8.1-src.tar.bz2) = b52a2fba0906cc80fffe2ce308bb4631d4e2d4ada6b8442856deb5e729d37d5c473c3c1a50765eb0bd978d9e3c874d83e0d60f67f44d9535a3ac432029849f6c
 Size (openclonk-8.1-src.tar.bz2) = 120149164 bytes
+SHA1 (patch-CMakeLists.txt) = f0d0eac3227c0bf3ff11cb85203ba471de8d9344
diff --git a/openclonk/patches/patch-CMakeLists.txt b/openclonk/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..a4e2ec6cd7
--- /dev/null
+++ b/openclonk/patches/patch-CMakeLists.txt
@@ -0,0 +1,46 @@
+$NetBSD$
+
+Don't attempt to deal with link-time optimization manually; CMake is smart
+enough to figure it out on its own.
+
+--- CMakeLists.txt.orig	2020-02-12 22:30:26.516115047 -0800
++++ CMakeLists.txt	2020-02-12 22:30:36.341115137 -0800
+@@ -91,38 +91,6 @@
+ 	endforeach()
+ endfunction()
+ 
+-CHECK_CXX_COMPILER_FLAG("-flto" USE_GCC_STYLE_LTCG)
+-if(USE_GCC_STYLE_LTCG)
+-	set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -flto")
+-	set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -flto")
+-	add_linker_flags(optimized MODULES exe shared FLAGS -flto)
+-
+-	# Use GCC's ar and ranlib wrappers if necessary, because the plain ones 
+-	# don't understand lto objects without an explicit plugin parameter
+-	if(CMAKE_C_COMPILER MATCHES "gcc$")
+-		set(LTCG_NEEDS_AR_WRAPPER 1)
+-		set(LTCG_AR_WRAPPER_PREFIX "${CMAKE_C_COMPILER}")
+-	elseif(CMAKE_C_COMPILER MATCHES "cc$")
+-		set(LTCG_NEEDS_AR_WRAPPER 1)
+-		set(LTCG_AR_WRAPPER_PREFIX "gcc")
+-	else()
+-		set(LTCG_NEEDS_AR_WRAPPER 0)
+-	endif()
+-
+-	if(LTCG_NEEDS_AR_WRAPPER)
+-		find_program(AR_WRAPPER "${LTCG_AR_WRAPPER_PREFIX}-ar")
+-		if (AR_WRAPPER)
+-			message("Using ${AR_WRAPPER} instead of ${CMAKE_AR} to support lto objects.")
+-			set(CMAKE_AR "${AR_WRAPPER}" CACHE FILEPATH "Path to an ar that supports lto objects." FORCE)
+-		endif()
+-		find_program(RANLIB_WRAPPER "${LTCG_AR_WRAPPER_PREFIX}-ranlib")
+-		if (RANLIB_WRAPPER)
+-			message("Using ${RANLIB_WRAPPER} instead of ${CMAKE_RANLIB} to support lto objects.")
+-			set(CMAKE_RANLIB "${RANLIB_WRAPPER}" CACHE FILEPATH "Path to a ranlib that supports lto objects." FORCE)
+-		endif()
+-	endif()
+-endif()
+-
+ if(MSVC)
+ 	if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ 		# Set up some additional flags only if we're using the MS compiler,


Home | Main Index | Thread Index | Old Index