Bug 15026

Summary: compilation on osX fail in weird way
Product: Telepathy Reporter: Michael Scherer <misc>
Component: tp-glibAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Mac OS X (All)   
URL: http://monkey.collabora.co.uk/tp-glib-smcv-15026
Whiteboard:
i915 platform: i915 features:
Attachments: add the missing makefile dependancy

Description Michael Scherer 2008-03-15 06:19:53 UTC
When I tried to compile telepathy-glib on osx ( 10.5, leopard ), I faced weird errors like this :

/bin/sh ../libtool --tag=CC   --mode=link gcc -std=gnu99 -DG_LOG_DOMAIN=\"tp-glib\" -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wdeclaration-after-statement -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -I/opt/local/include/dbus-1.0 -I/opt/local/lib/dbus-1.0/include -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I.. -I.. -g -O2 -version-info "8":"0":"8"  -export-symbols-regex '^tp' -Wl,-O1 -o libtelepathy-glib.la -rpath /usr/local/lib  libtelepathy-glib-internal.la 
mkdir .libs
libtool: link: cannot find the library `libtelepathy-glib-internal.la' or unhandled argument `libtelepathy-glib-internal.la'

It seems that having HAVE_LD_VERSION_SCRIPT set to no lead to a code path not usually used, where a dependancy is missing in the makefile.
Here is a patch to correct the problem.

And in order to compile, I need to pass --disable-linker-optimisations ,it would be nice to autodetect this on osx, or enhance linker.m4 to do it.
Comment 1 Michael Scherer 2008-03-15 06:36:27 UTC
Created attachment 15141 [details] [review]
add the missing makefile dependancy
Comment 2 Simon McVittie 2008-04-01 11:57:52 UTC
Please try with the patch from http://monkey.collabora.co.uk/tp-glib-smcv-15026/diff (you can also pull from http://monkey.collabora.co.uk/tp-glib-smcv-15026 as a Darcs branch) after it next refreshes (in approximately 5 minutes).
Comment 3 Simon McVittie 2008-04-02 11:42:20 UTC
By setting CC to a shell script that rejects -Wl,-O1 and -Wl,--version-script and execs gcc for anything else, I can confirm that the version of that branch with two Darcs patches does not work, but the updated version I've just pushed with three Darcs patches (you'll need to wait around 5 minutes from the time of this comment to get it from the /diff URL) does work.

My pseudo-Mac C compiler, for future reference:

#!/bin/sh
case "$*" in
  *Wl,--version-script*)
    echo "-Wl,--version-script not supported here"
    exit 42
    ;;
  *Wl,-O1*)
    echo "-Wl,-O1 not supported here"
    exit 42
    ;;
esac
exec /usr/bin/gcc "$@"
Comment 4 Simon McVittie 2008-04-02 14:15:59 UTC
Fixed in Darcs, along with a bunch of other issues on Mac OS. Michael: thanks for your help on IRC!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.