Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build on OpenBSD #98

Open
hboetes opened this issue Jun 19, 2020 · 0 comments
Open

fix build on OpenBSD #98

hboetes opened this issue Jun 19, 2020 · 0 comments

Comments

@hboetes
Copy link

hboetes commented Jun 19, 2020

I just tried building glyrc on OpenBSD and ran into not having execinfo.h, which is nice for backtraces but not required. In fact the code that requires it is already enclosed in an ifdef.

#ifdef __linux__                                                                                                                                                              
/* Backtrace*/                                                                                                                                                                
#include <execinfo.h>                                                                                                                                                         
#endif                                                                                                                                                                        

So applying this diff fixed the build for me. Now I'm not claiming this patch should be applied to the main source. It should be rewritten so that missing backtrace is not a problem.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f9bf068..c1e0d35 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,29 +94,6 @@ PKG_CHECK_MODULES(SQLITE3 sqlite3 REQUIRED)
 INCLUDE_DIRECTORIES(${GLIBPKG_INCLUDE_DIRS})
 
 
-# --------------------------
-# Check for backtrace
-# --------------------------
-
-INCLUDE(CheckIncludeFile)
-CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO)
-IF(NOT HAVE_EXECINFO)
-  MESSAGE(FATAL_ERROR "execinfo.h could not be found on the system")
-ENDIF(NOT HAVE_EXECINFO)
-
-INCLUDE(CheckSymbolExists)
-CHECK_SYMBOL_EXISTS("backtrace" "execinfo.h" HAVE_BACKTRACE)
-IF(NOT HAVE_BACKTRACE)
-  SET(CMAKE_REQUIRED_FLAGS "-lexecinfo")
-  CHECK_SYMBOL_EXISTS("backtrace" "execinfo.h" HAVE_LIBEXECINFO)
-  IF(HAVE_LIBEXECINFO)
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lexecinfo")
-  ELSE(HAVE_LIBEXECINFO)
-    MESSAGE(FATAL_ERROR "Could not link to libexecinfo")
-  ENDIF(HAVE_LIBEXECINFO)
-ENDIF(NOT HAVE_BACKTRACE)
-
-
 # --------------------------
 # set directories
 # --------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant