Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#1938 closed defect (fixed)

[PATCH] Fix build failure with boost 1.53

Reported by: Vincent Cheng Owned by: leper
Priority: Should Have Milestone: Alpha 14
Component: Build & Packages Keywords: patch
Cc: vincentc1208@… Patch:

Description

0 A.D. currently fails to build on Debian/Ubuntu with boost 1.53 (also filed as Debian bug #709570). Please consider applying the following patch to fix this.

--- a/build/premake/extern_libs4.lua
+++ b/build/premake/extern_libs4.lua
@@ -242,7 +242,7 @@
 				-- The following are not strictly link dependencies on all systems, but
 				-- are included for compatibility with different versions of Boost
 				android_names = { "boost_filesystem-gcc-mt", "boost_system-gcc-mt" },
-				unix_names = { "boost_filesystem-mt", "boost_system-mt" },
+				unix_names = { "boost_filesystem", "boost_system" },
 				bsd_names = { "boost_filesystem", "boost_system" },
 			})
 		end,
@@ -251,7 +251,7 @@
 		link_settings = function()
 			add_default_links({
 				android_names = { "boost_signals-gcc-mt" },
-				unix_names = { "boost_signals-mt" },
+				unix_names = { "boost_signals" },
 				bsd_names = { "boost_signals" },
 			})
 		end,

Attachments (2)

possible-fix-for-boost-with-and-without-mt.patch (1.0 KB ) - added by Markus 11 years ago.
use (working!) findlib to decide if -mt library exists and should be used
update-premake-findlib.patch (2.7 KB ) - added by Markus 11 years ago.
update os.findlib (slightly modified premake head)

Download all attachments as: .zip

Change History (11)

comment:1 by Markus, 11 years ago

Keywords: review patch added
Milestone: BacklogAlpha 14
Summary: Fix build failure with boost 1.53[PATCH] Fix build failure with boost 1.53

comment:2 by historic_bruno, 11 years ago

IMO this will have to be patched on a per-distro basis, it's already listed as a known problem in build instructions for Slackware. Unfortunately fixing it for you will break it for others. (A situation where it would be nice to have a more robust build system like CMake, but that's a lot of work)

comment:3 by Markus, 11 years ago

Things like this should be handled by the build system, so I think we should fix this ;)

I think its not related to the boost version, so we need to check if the -mt library exists and then decide to which we try to link.

premake has a function os.findlib that I tried. It kind of worked but leper noted that the function included in the currently used premake has some features missing. It will try to lookup /etc/ld.so.conf for possible locations, but will not honour "include". At least OpenBSD does not even have this file but a binary equivalent. (Needs to call ldconfig to get a useable output.)

So we would need to insert our own findlib (use stable head... or at least that function).

by Markus, 11 years ago

use (working!) findlib to decide if -mt library exists and should be used

comment:4 by Markus, 11 years ago

("premake4 embed" is needed for the changes to take effect!)

in reply to:  3 comment:5 by historic_bruno, 11 years ago

Replying to Markus:

premake has a function os.findlib that I tried.

Nice! I didn't know that existed, maybe it would come in handy for some of our other libs.

It may be time to consider upgrading Premake. As it stands, we haven't introduced too many differences from the original 4.3 import in r9828. It wouldn't be the most fun task in the world, but we could go through and verify each change is still needed or has been fixed upstream, then upgrade to premake-stable. It takes A LOT of testing, each OS and compiler we support with and without PCH, and the tests must still compile and work. Off hand, the only other thing I know we would gain is VS2012 support which was added recently.

Last edited 11 years ago by historic_bruno (previous) (diff)

comment:6 by leper, 11 years ago

os.findlib works after a small change on OpenBSD too (in parse_ld_so_conf() add

local file = io.open("/etc/ld.so.conf")
if file == nil then
  return dict
end

before the io.lines() call and replace the parameter/filename in that call with file. Also your patch misses the addition of os._is64bit().

I agree that upgrading premake to premake-stable (or what will hopefully become 4.4 in the future) wouldn't be the worst decision to be made.

Also see #1518 related to upgrading/differences from 4.3.

by Markus, 11 years ago

update os.findlib (slightly modified premake head)

comment:7 by leper, 11 years ago

Owner: set to leper
Resolution: fixed
Status: newclosed

In 13512:

Use os.findlib to find boost. Patch by Markus. Fixes #1938. Refs #1518.

comment:8 by leper, 11 years ago

Keywords: review removed

Thanks for the patch.

comment:9 by ben, 11 years ago

In 13514:

Fixes OS X build failing to find Boost libs, refs #1938

Note: See TracTickets for help on using tickets.