[sane-devel] configure broken for gcc 4.0

Julien BLACHE jb at jblache.org
Sun Jul 31 19:01:28 UTC 2005


Hi,

The configure script is broken for gcc 4.0, and will incorrectly
report that gcc is unable to produce PIC shared libraries, or use the
-o option, among other things.

The problem is that CPPFLAGS is defined before the libtool checks are
performed, and that CPPFLAGS contains references to Makefile variables
which are then passed as is to gcc.

---- 8< snip ----
configure:13304: checking if i486-linux-gnu-gcc PIC flag -fPIC works 
configure:13322: i486-linux-gnu-gcc -c -g -O2 -W -Wall -Wcast-align -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prot\
otypes -pedantic -ansi  -DPATH_SANE_CONFIG_DIR=$(configdir)       -DPATH_SANE_DATA_DIR=$(datadir)         -DPATH_SANE_LOCK_DIR=$(localstatedir)           -DV_MAJOR=1 -\
DV_MINOR=0 -I/usr/include/gphoto2   -fPIC -DPIC conftest.c >&5 
<command line>:1:22: warning: '$' in identifier or number 
configure:13326: $? = 0 
configure:13337: result: no 
---- 8< snip ----

The fix would be to either undefine CPPFLAGS when libtool runs its
checks, or run the libtool checks before setting CPPFLAGS.

I went for the quick solution and modified CPPFLAGS before the libtool
checks (which might not be the best solution).

---- 8< snip ----
dnl ***********************************************************************
dnl initialize libtool
dnl ***********************************************************************
brokenCPPFLAGS="$CPPFLAGS"
CPPFLAGS=""

AC_LIBTOOL_WIN32_DLL
AC_DISABLE_STATIC
AC_PROG_LIBTOOL

CPPFLAGS="$brokenCPPFLAGS"
---- 8< snip ----


Until this is fixed, sane-backends is broken on each and every system
using gcc 4.0 and a non-i386 CPU (which do not tolerate shared
libraries built without -fPIC).

JB.

-- 
Julien BLACHE                                   <http://www.jblache.org> 
<jb at jblache.org>                                  GPG KeyID 0xF5D65169



More information about the sane-devel mailing list