Author Topic: [fixed] 3.7.1: FreeBSD linking error: CMAKE libdl.so (patch)  (Read 2274 times)

m0ellemeister

  • Guest
Hi,

when i was trying to build MG 3.7.1 on FreeBSD I ran into an odd error. libdl.so was not found. I've learned that on FreeBSD the functionality of libdl is offered by libc. So linking against libdl.so is Linux specific. CMake knows if it should link against libdl.so or not by using the variable: ${CMAKE_DL_LIBS} Please have a look on my patch and test it. I had no time to try it myself on Linux (MacOSX nor Windoze). I guess it should work on all platforms.

Btw. MegaGlest 3.7.1 is in the FreeBSD ports tree available. See: http://www.freshports.org/search.php?query=megaglest

Code: [Select]
--- ./source/shared_lib/CMakeLists.txt.orig   2012-11-25 00:19:10.000000000 +0000
+++ ./source/shared_lib/CMakeLists.txt   2012-11-25 00:12:01.000000000 +0000
@@ -124,7 +124,7 @@
         FIND_PACKAGE(LUA REQUIRED)
         INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR})
         IF(UNIX)
-           SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${LUA_LIBRARIES} "libdl.so")
+           SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS})
         ENDIF()
 #        ENDIF()
« Last Edit: 3 December 2012, 02:43:37 by tomreyn »

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Patch for CMAKE libdl.so (linking error on FreeBSD)
« Reply #1 on: 30 November 2012, 23:40:44 »
Applied in svn

m0ellemeister

  • Guest
Re: Patch for CMAKE libdl.so (linking error on FreeBSD)
« Reply #2 on: 2 December 2012, 13:46:08 »
Many thx!

 

anything