[LLVMdev] Makefile dependencies and configure test fix

Shantonu Sen ssen at apple.com
Tue Feb 5 10:10:51 PST 2008


Some low-priority fixes to the build system.... These can probably  
wait after 2.2

1) The current configure script checks for gcc 3.x or later by parsing  
"gcc --version" output and trying to tokenize it to find the major  
compiler version. This is pretty fragile and interacts poorly with  
compilers produced by vendors (like Apple) that modify this string to  
output target triple (including potentially i686 and darwin9), FSF GCC  
version, Apple local version. There's lots of numbers there, and the  
sed expression doesn't find any of the right ones. This patch turns  
the check into a compile-time check for __GNUC__ version. Since  
autoconf already does this to determine if you're using GCC or not, it  
should be pretty safe.

Believe it or not, I dusted off a copy of gcc 2.95.2 for Mac OS X for  
PowerPC and ran it under Rosetta to verify this fix:

[ssen at virgon]$ gcc-2.95.2 -v
Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
Apple Computer, Inc. version gcc-926, based on gcc version 2.95.2  
19991024 (release)
[ssen at virgon]$ ./configure CC=gcc-2.95.2 CXX=g++-2.95.2
...
checking for llvm-gcc... no
checking for llvm-g++... no
checking tool compatibility... configure: error: gcc 3.x required, but  
you have a lower version

2) Makefile.rules is missing some dependencies for shared library  
targets, which means if you change core libraries and do a rebuild,  
things like tools/lto don't get relinked against the new libraries.  
Test case is to have a pre-built tree and do "touch lib/System/Unix/ 
Program.inc && make" and make sure you see "Linking Debug Loadable  
Module LLVMlto.dylib".

3) There appears to be a typo for for llvm_cv_no_link_all_option for  
Darwin, but this never seems to be used anyway. Probably worth fixing  
in case a new standalone project uses the LLVM makefiles.

I regenerated the configure script with the required versions of  
autotools on Mac OS X on Intel.


Shantonu Sen
ssen at apple.com

Sent from my Mac Pro

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080205/f60f23b5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-makefile-and-configure.patch
Type: application/octet-stream
Size: 3937 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080205/f60f23b5/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080205/f60f23b5/attachment-0001.html>


More information about the llvm-dev mailing list