autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gcc works on the command line, not with autoconf


From: Stephane Bortzmeyer
Subject: gcc works on the command line, not with autoconf
Date: Wed, 27 Oct 2004 12:13:44 +0200
User-agent: Mutt/1.5.6+20040818i

Summary
*******

gcc 3 works fine on my Sparc / NetBSD when I use it from the command
line. It fails when running from a configure script.

Gory details
************

preston:pkgsrc/net/quagga % uname -a
NetBSD preston 1.6.2 NetBSD 1.6.2 (GENERIC) #3: Mon Feb  9 18:37:36 CET 2004    
 
address@hidden:/usr/users/he/build-1-6/obj.sparc64/sys/arch/sparc64/compile/GENERIC
 sparc64

preston:pkgsrc/net/quagga %  /usr/pkg/gcc3/bin/gcc --version
gcc (GCC) 3.3.4
Copyright (C) 2003 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.

I created a config.site:

preston:pkgsrc/net/quagga % more /usr/pkg/etc/config.site      
# config.site for configure. See (autoconf) Site Defaults     
#

# Give Autoconf 2.x generated configure scripts a shared default
# cache file for feature test results, architecture-specific.
if test "$cache_file" = /dev/null; then
  if test "$prefix" = NONE; then
    prefix=$ac_default_prefix
  fi
  cache_file="$prefix/var/tmp/config.cache"
  if ! test -d `dirname $cache_file`; then
     mkdirhier `dirname $cache_file`
  fi
  # A cache file is only valid for one C compiler.
  # We have strange autoconf problems with gcc3
  CC=/usr/pkg/gcc3/bin/gcc
  LD=/usr/pkg/gcc3/bin/gcc
  CPP=/usr/pkg/gcc3/bin/cpp
  CXX=/usr/pkg/gcc3/bin/c++
  CPLUSPLUS=$CXX
  #CC=gcc
fi

# Use the packages
CPPFLAGS=-I/usr/pkg/include
LDFLAGS=-L/usr/pkg/lib

# Otherwise, libtool tries to use it even for pure-C programs!
F77=false

# Use GNUTLS
with_gnutls=yes

Now, configure scripts use gcc3 as wanted. From the command line, gcc3
is OK:

preston:~/tmp % cat conftest.c
int
 main ()
 {
  ;
 return 0;
}
preston:~/tmp %  /usr/pkg/gcc3/bin/gcc   conftest.c
preston:~/tmp %

But from configure (I test with Quagga but it is the same problem with
every configure file):

preston:pkgsrc/net/quagga % sudo make
...
=> Checksum OK for quagga-0.96.3.tar.gz.
===> Extracting for quagga-0.96.3nb2
...
checking build system type... sparc64-unknown-netbsd1.6.2
checking host system type... sparc64--netbsd
checking for sparc64--netbsd-gcc... /usr/pkg/gcc3/bin/gcc
checking for C compiler default output file name... configure: error: C compiler
+cannot create executables
See `config.log' for more details.
*** Error code 77

Stop.
make: stopped in /usr/pkgsrc/net/quagga
*** Error code 1

config.log has:

configure:2211: checking for C compiler default output file name
configure:2214: /usr/pkg/gcc3/bin/gcc -O -ffixed-g4 -I/usr/pkg/include 
-L/usr/pkg/lib conftest.c  -Wl,-R/usr/pkg/lib >&5
/usr/bin/ld: cannot find -lgcc_eh
collect2: ld returned 1 exit status
configure:2217: $? = 1
configure: failed program was:

Funny, the same command line works:

preston:~/tmp % /usr/pkg/gcc3/bin/gcc -O -ffixed-g4 -I/usr/pkg/include 
-L/usr/pkg/lib conftest.c  -Wl,-R/usr/pkg/lib
preston:~/tmp % 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]