[Zlib-devel] CHOST option

Török Edwin edwintorok at gmail.com
Sun May 2 17:19:01 EDT 2010


On 05/02/2010 11:26 PM, Enrico Weigelt wrote:
> * Török Edwin <edwintorok at gmail.com> schrieb:
> 
> Hi,
> 
>> I've successfully used clang as a drop-in replacement for gcc by
>> specifying CC=clang.
>> In fact it works for zlib too, if I edit the makefile and add -fPIC.
> 
> hmm, I've reworked the toolchain detection and generalized certain
> things a bit ... it treats clang as gcc ...
> 
> http://repo.or.cz/w/oss-qm-packages.git/shortlog/refs/heads/METUX.zlib.toolchain

Thanks, CC=clang, and CC=gcc work.
However the default ./configure gives me this:
Using CC: cc
Using AR: ar
Using RANLIB: ranlib
Using NM: nm
Target executable suffix:
Target shared lib suffix: .so
===
=== WARNING: no GCC detected - crosscompiling might fail ===
===

$ cc --version
cc (Debian 4.4.4-1) 4.4.4
Copyright (C) 2009 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.


$ ls -l /usr/bin/cc
lrwxrwxrwx 1 root root 20 Mar 11  2009 /usr/bin/cc -> /etc/alternatives/cc
$ ls -l /etc/alternatives/cc
lrwxrwxrwx 1 root root 12 May  7  2009 /etc/alternatives/cc -> /usr/bin/gcc

I think you should try 'gcc' first, and then fallback to 'cc' when CC is
not specified. (Or detect gcc itself some other way, 'cc' IS gcc here)
For example 'cc -v' outputs gcc:
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.4-1'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --enable-multiarch --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4
--program-suffix=-4.4 --enable-nls --enable-clocale=gnu
--enable-libstdcxx-debug --enable-objc-gc --with-arch-32=i486
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.4 (Debian 4.4.4-1)


Best regards,
--Edwin



More information about the Zlib-devel mailing list