On 3/30/12 6:44 PM, Alexander Hansen wrote:
> On 3/30/12 5:52 PM, Stefan Bruda wrote:
>> Hello,
>>
>> I am attempting to build metacity on 10.7 (just a random package
>> toward bundle-gnome).  Using fink the configuration goes fine and then
>> make fails as follows (/opt/sw is my fink prefix):
>>
>>      make
>>      make  all-recursive
>>      Making all in src
>>
>>      [ ... ]
>>
>>      gcc -DHAVE_CONFIG_H -I. -I.. -I./include 
>> -DMETACITY_LIBEXECDIR=\"/opt/sw/lib/metacity\" -DHOST_ALIAS=\"\" 
>> -DMETACITY_LOCALEDIR=\"/opt/sw/share/locale\" 
>> -DMETACITY_PKGDATADIR=\"/opt/sw/share/metacity\" 
>> -DMETACITY_DATADIR=\"/opt/sw/share\" -DG_LOG_DOMAIN=\"metacity\" 
>> -DSN_API_NOT_YET_FROZEN=1 -I/opt/sw/include/glib-2.0 
>> -I/opt/sw/lib/glib-2.0/include -I/opt/sw/include 
>> -I/opt/sw/include/gtk-2.0 -I/opt/sw/lib/gtk-2.0/include 
>> -I/opt/sw/include/atk-1.0 -I/opt/sw/include/cairo 
>> -I/opt/sw/include/pango-1.0 -I/opt/sw/include/freetype2 
>> -I/opt/sw/include/gconf/2 -I/opt/sw/include/startup-notification-1.0 
>> -I/opt/sw/include/libgtop-2.0 -I/usr/X11R6/include -I/usr/X11/include 
>> -D_REENTRANT  -I/opt/sw/lib/fontconfig2/include -I/opt/sw/include  
>> -Os -Wall -Wchar-subscripts -Wmissing-declarations 
>> -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align 
>> -Wsign-compare -Wall -Werror -ansi -MT bell.o -MD -MP -MF 
>> .deps/bell.Tpo -c -o bell.o `test -f 'core/bell.c' || echo 
>> './'`core/bell.c
>>      core/async-getprop.c:218:8: error: cast from 'XPointer' (aka 
>> 'char *') to 'AgPerDisplayData *'
>>            (aka 'struct _AgPerDisplayData *') increases required 
>> alignment from 1 to 8 [-Werror,-Wcast-align]
>>        dd = (AgPerDisplayData*) data;
>>             ^~~~~~~~~~~~~~~~~~~ ~~~~
>>      core/async-getprop.c:277:11: error: cast from 'char *' to 
>> 'xGetPropertyReply *' increases required alignment from
>>            1 to 4 [-Werror,-Wcast-align]
>>        reply = (xGetPropertyReply *)
>>                ^~~~~~~~~~~~~~~~~~~~~
>>      core/async-getprop.c:385:24: error: cast from 'char *' to 'long 
>> *' increases required alignment from 1 to 8
>>            [-Werror,-Wcast-align]
>>                            *(long*) lptr = *(CARD32*) netdata;
>>                             ^~~~~~~ ~~~~
>>      core/async-getprop.c:385:40: error: cast from 'char *' to 
>> 'CARD32 *' (aka 'unsigned int *') increases required
>>            alignment from 1 to 4 [-Werror,-Wcast-align]
>>                            *(long*) lptr = *(CARD32*) netdata;
>>                                             ^~~~~~~~~ ~~~~~~~
>>      core/async-getprop.c:539:3: error: cast from 'char *' to 
>> 'xGetPropertyReq *' increases required alignment from 1
>>            to 4 [-Werror,-Wcast-align]
>>        GetReq (GetProperty, req);
>>        ^~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Fair enough, except that I want to do in-place fixes and so I go by
>> hand into the src directory and issue the same as above.  To my
>> amazement, the compilation simply succeeds:
>>
>> <  godel-v:~>  cd 
>> /opt/sw/src/fink.build/metacity-2.28.1-2/metacity-2.28.1/src
>> <  godel-v:metacity-2.28.1/src>  gcc -DHAVE_CONFIG_H -I. -I.. 
>> -I./include -DMETACITY_LIBEXECDIR=\"/opt/sw/lib/metacity\" 
>> -DHOST_ALIAS=\"\" -DMETACITY_LOCALEDIR=\"/opt/sw/share/locale\" 
>> -DMETACITY_PKGDATADIR=\"/opt/sw/share/metacity\" 
>> -DMETACITY_DATADIR=\"/opt/sw/share\" -DG_LOG_DOMAIN=\"metacity\" 
>> -DSN_API_NOT_YET_FROZEN=1 -I/opt/sw/include/glib-2.0 
>> -I/opt/sw/lib/glib-2.0/include -I/opt/sw/include 
>> -I/opt/sw/include/gtk-2.0 -I/opt/sw/lib/gtk-2.0/include 
>> -I/opt/sw/include/atk-1.0 -I/opt/sw/include/cairo 
>> -I/opt/sw/include/pango-1.0 -I/opt/sw/include/freetype2 
>> -I/opt/sw/include/gconf/2 -I/opt/sw/include/startup-notification-1.0 
>> -I/opt/sw/include/libgtop-2.0 -I/usr/X11R6/include -I/usr/X11/include 
>> -D_REENTRANT  -I/opt/sw/lib/fontconfig2/include -I/opt/sw/include  
>> -Os -Wall -Wchar-subscripts -Wmissing-declarations 
>> -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align 
>> -Wsign-compare -Wall -Werror -ansi -MT bell.o -MD -MP -MF 
>> .deps/bell.Tpo -c -o bell.o `test -f 'core/bell.c' || echo 
>> './'`core/bell.c
>>
>> In fact I can just type make in the root of the distribution
>> (/opt/sw/src/fink.build/metacity-2.28.1-2/metacity-2.28.1/src)
>> completes fine.
>>
>> I am sure I am missing something, but what would be the difference
>> between the fink environment and the shell?  Advice is appreciated.
>>
>> Many thanks in advance,
>> Stefan
>>
> You're changing the compilers.
>
> In the Fink build environment on 10.7, the default setup is to have 
> clang as the "cc", "gcc", ... compiler, and clang++ as the "c++", 
> "g++", ... compiler.
>
> When you're not using the Fink environment, the defaults depend on 
> your Xcode version.  In 4.1, "cc" and "gcc" In 4.2, "cc" and "gcc" 
> point to llvm-gcc, and "c++" and "g++" point to llvm-g++.  On 4.3.x 
> they're mixed:
>
> Alexanders-MacBook-Pro:fink hansen$ cc --version
> Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 
> 3.1svn)
> Target: x86_64-apple-darwin11.3.0
> Thread model: posix
> Alexanders-MacBook-Pro:fink hansen$ gcc --version
> i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. 
> build 5658) (LLVM build 2336.9.00)
> Copyright (C) 2007 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There 
> is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
> PURPOSE.
>
> Alexanders-MacBook-Pro:fink hansen$ c++ --version
> Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 
> 3.1svn)
> Target: x86_64-apple-darwin11.3.0
> Thread model: posix
> Alexanders-MacBook-Pro:fink hansen$ g++ --version
> i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. 
> build 5658) (LLVM build 2336.9.00)
> Copyright (C) 2007 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There 
> is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
> PURPOSE.
>
Slight correction: In Xcode 4.1, cc and gcc point to a non-llvm gcc, and 
g++ and c++ point to a non-llvm g++.  llvm is the default only in Xcode 
4.2.x.  Regardless of the Xcode version, however, Fink doesn't use the 
default compiler on 10.7.

And I forgot to add that when you're trying in-place fixes you might 
want to use the settings from

http://www.finkproject.org/faq/usage-general.php?phpLang=en#compile-myself

to emulate what the Fink build environment uses.

-- 
Alexander Hansen, Ph.D.
Fink User Liaison
http://finkakh.wordpress.com/2012/02/21/got-job/


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to