tech-pkg archive

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

libclucene fails to compile under NetBSD current with gcc 10 [with fix]



Under  NetBSD 9.99.83 (GENERIC) on amd64 the compile of libclucene 2.3.3.4 
flops out due to the gcc version being 10.x.x  
The patch patch-src_shared_cmake_MacroCheckGccVisibility.cmake only caters for 
gcc versions up to 9.x.x and the configure breaks at:

-- Performing Test _CL_HAVE_GCCVISIBILITYPATCH
-- Performing Test _CL_HAVE_GCCVISIBILITYPATCH - Success
CMake Error at src/shared/cmake/MacroEnsureVersion.cmake:27 (MATH):
  MATH cannot parse the expression: "gcc (nb1 2021041110*10000 + gcc (nb1
  202104113*100 + gcc (nb1 202104110": syntax error, unexpected exp_NUMBER,
  expecting exp_CLOSEPARENT or exp_OR (20).
Call Stack (most recent call first):
  src/shared/cmake/MacroCheckGccVisibility.cmake:35 (macro_ensure_version)
  src/shared/CMakeLists.txt:230 (MACRO_CHECK_GCC_VISIBILITY)


Simple fix is to patch the patch to allow 10 as a prefix as the diff below, 
but it probably needs a better solution to allow for gcc 11 etc.

--- patch-src_shared_cmake_MacroCheckGccVisibility.cmake.orig   2021-06-10 
19:14:27.617319459 +0000
+++ patch-src_shared_cmake_MacroCheckGccVisibility.cmake        2021-06-10 
19:14:49.735712948 +0000
@@ -9,7 +9,7 @@
     exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE 
_gcc_version_info)
  
 -   string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version 
"${_gcc_version_info}")
-+   string (REGEX MATCH "[3456789]\\.[0-9]\\.[0-9]" _gcc_version 
"${_gcc_version_info}")
++   string (REGEX MATCH "[3456789]|10\\.[0-9]\\.[0-9]" _gcc_version 
"${_gcc_version_info}")
     if (NOT _gcc_version)
     
        # clang reports: clang version 1.1 (trunk 95754)

Dave


Home | Main Index | Thread Index | Old Index