From 45df06e7f27a2c7ffbebb4f9bd4eeae858cd6114 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Jul 29 2015 23:43:45 +0000 Subject: respect CFLAGS and CXXFLAGS (and hence fix build) --- diff --git a/0001-respect-CFLAGS-and-CXXFLAGS.patch b/0001-respect-CFLAGS-and-CXXFLAGS.patch new file mode 100644 index 0000000..7dbb3a5 --- /dev/null +++ b/0001-respect-CFLAGS-and-CXXFLAGS.patch @@ -0,0 +1,45 @@ +From 6d00140f640ead5211462401442b012a4d261fe1 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Wed, 29 Jul 2015 16:32:06 -0700 +Subject: [PATCH] respect CFLAGS and CXXFLAGS + +Setting CMAKE_C_FLAGS and CMAKE_CXX_FLAGS without including +their existing contents causes any provided CFLAGS and/or +CXXFLAGS to be ignored. + +These should be respected, if set (distributions commonly have +defaults they expect to be used). The $default_flags_ tweak is +just to avoid duplication - distros will typically set CXXFLAGS +to include all the same stuff as CFLAGS, so if you include +CFLAGS in CMAKE_C_FLAGS then include CMAKE_C_FLAGS in CMAKE_ +CXX_FLAGS, you'll wind up with lots of flags repeated. +--- + cmake/SetDefaultGccFlags.cmake | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/cmake/SetDefaultGccFlags.cmake b/cmake/SetDefaultGccFlags.cmake +index eb69e6c..66755ef 100644 +--- a/cmake/SetDefaultGccFlags.cmake ++++ b/cmake/SetDefaultGccFlags.cmake +@@ -50,14 +50,15 @@ MACRO(ST_SET_DEFAULT_GCC_FLAGS) + ENDIF() + + IF(NOT COMPILER_FLAGS_OVERRIDDEN) ++ SET(default_flags_ "-Wall -Wno-unused -ffast-math ${no_inline_dllexport_cflags_}") + # Flags common for all build configurations. + SET( +- CMAKE_C_FLAGS +- "-Wall -Wno-unused -ffast-math ${no_inline_dllexport_cflags_}" ++ CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${default_flags_}" + CACHE STRING "Common C flags for all build configurations." FORCE + ) + SET( +- CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${stdlibs_shared_static_}" ++ CMAKE_CXX_FLAGS ++ "${CMAKE_CXX_FLAGS} ${default_flags_} ${stdlibs_shared_static_}" + CACHE STRING "Common C++ flags for all build configurations." FORCE + ) + +-- +2.4.6 + diff --git a/scantailor.spec b/scantailor.spec index d8d3d83..d69134c 100644 --- a/scantailor.spec +++ b/scantailor.spec @@ -8,6 +8,8 @@ License: GPLv3+ or LGPLv2.1 URL: http://scantailor.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Source1: %{name}.desktop +# Don't override CFLAGS and CXXFLAGS: https://github.com/scantailor/scantailor/pull/160 +Patch0: 0001-respect-CFLAGS-and-CXXFLAGS.patch BuildRequires: cmake BuildRequires: boost-devel @@ -33,6 +35,7 @@ project. %prep %setup -q +%patch0 -p1 %build %cmake . -DEXTRA_LIBS=Xrender -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="/usr" @@ -71,7 +74,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/icons/hicolor/scalable/apps/scantailor.svg %changelog -* Wed Jul 29 2015 Fedora Release Engineering - 0.9.11.1-13 +* Wed Jul 29 2015 Adam Williamson - 0.9.11.1-13 +- respect CFLAGS and CXXFLAGS (and hence fix build) + +* Wed Jul 29 2015 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159 * Wed Jul 22 2015 David Tardon - 0.9.11.1-12