for some reason the current configure script tries to implement its own cross-compiling logic which ends up being pretty fragile ... the attached patch punts pretty much all of it in favor of the standard method that just about every other autoconf-based project uses
there is one more small change required that i didnt include because it'll conflict with the previous readline patch i sent out: # Figure out what C libraries are required to compile programs # that use "fdatasync()" function. # -CC=$TARGET_CC -LIBS=$TARGET_LIBS AC_SEARCH_LIBS(fdatasync, [rt]) -TARGET_LIBS="$LIBS" -mike
pgpxwZX1CkC87.pgp
Description: PGP signature
Index: configure.ac
===================================================================
RCS file: /sqlite/sqlite/configure.ac,v
retrieving revision 1.26
diff -u -p -r1.26 configure.ac
--- configure.ac 3 Jun 2006 18:02:18 -0000 1.26
+++ configure.ac 16 Feb 2007 23:53:20 -0000
@@ -45,18 +45,6 @@
# The filename extension for executables on the build
# platform. "" for Unix and ".exe" for Windows.
#
-# TARGET_CC
-#
-# The name of a command that runs on the build platform
-# and converts C source files into *.o files for the
-# target platform. In other words, the cross-compiler.
-#
-# TARGET_CFLAGS
-#
-# Switches that the target compiler needs to turn C source files
-# into *.o files. Do not include TARGET_TCL_INC in this list.
-# Makefiles might add additional switches such as "-I.".
-#
# TCL_*
#
# Lots of values are read in from the tclConfig.sh script,
@@ -76,18 +64,6 @@
# files for the readline library. If the compiler is able
# to find <readline.h> on its own, then this can be blank.
#
-# TARGET_LINK
-#
-# The name of the linker that combines *.o files generated
-# by TARGET_CC into executables for the target platform.
-#
-# TARGET_LIBS
-#
-# Additional libraries or other switch that the target linker needs
-# to build an executable on the target. Do not include
-# on this list any libraries in TARGET_TCL_LIBS and
-# TARGET_READLINE_LIBS, etc.
-#
# TARGET_EXEEXT
#
# The filename extension for executables on the
@@ -184,96 +160,19 @@ fi
# Locate a compiler for the build machine. This compiler should
# generate command-line programs that run on the build machine.
#
-default_build_cflags="-g"
-if test "$config_BUILD_CC" = ""; then
- AC_PROG_CC
- if test "$cross_compiling" = "yes"; then
- AC_MSG_ERROR([unable to find a compiler for building build tools])
- fi
- BUILD_CC=$CC
- default_build_cflags=$CFLAGS
-else
- BUILD_CC=$config_BUILD_CC
- AC_MSG_CHECKING([host compiler])
- CC=$BUILD_CC
- AC_MSG_RESULT($BUILD_CC)
-fi
-AC_MSG_CHECKING([switches for the host compiler])
-if test "$config_BUILD_CFLAGS" != ""; then
- CFLAGS=$config_BUILD_CFLAGS
- BUILD_CFLAGS=$config_BUILD_CFLAGS
-else
- BUILD_CFLAGS=$default_build_cflags
-fi
-AC_MSG_RESULT($BUILD_CFLAGS)
-if test "$config_BUILD_LIBS" != ""; then
- BUILD_LIBS=$config_BUILD_LIBS
+if test x"$cross_compiling" = xno; then
+ BUILD_CC=$CC
+ BUILD_CFLAGS=$CFLAGS
+else
+ if test "${BUILD_CC+set}" != set; then
+ AC_CHECK_PROGS(BUILD_CC, gcc cc cl)
+ fi
+ if test "${BUILD_CFLAGS+set}" != set; then
+ BUILD_CFLAGS="-g"
+ fi
fi
AC_SUBST(BUILD_CC)
AC_SUBST(BUILD_CFLAGS)
-AC_SUBST(BUILD_LIBS)
-
-##########
-# Locate a compiler that converts C code into *.o files that run on
-# the target machine.
-#
-AC_MSG_CHECKING([target compiler])
-if test "$config_TARGET_CC" != ""; then
- TARGET_CC=$config_TARGET_CC
-else
- TARGET_CC=$BUILD_CC
-fi
-AC_MSG_RESULT($TARGET_CC)
-AC_MSG_CHECKING([switches on the target compiler])
-if test "$config_TARGET_CFLAGS" != ""; then
- TARGET_CFLAGS=$config_TARGET_CFLAGS
-else
- TARGET_CFLAGS=$BUILD_CFLAGS
-fi
-AC_MSG_RESULT($TARGET_CFLAGS)
-AC_MSG_CHECKING([target linker])
-if test "$config_TARGET_LINK" = ""; then
- TARGET_LINK=$TARGET_CC
-else
- TARGET_LINK=$config_TARGET_LINK
-fi
-AC_MSG_RESULT($TARGET_LINK)
-AC_MSG_CHECKING([switches on the target compiler])
-if test "$config_TARGET_TFLAGS" != ""; then
- TARGET_TFLAGS=$config_TARGET_TFLAGS
-else
- TARGET_TFLAGS=$BUILD_CFLAGS
-fi
-if test "$config_TARGET_RANLIB" != ""; then
- TARGET_RANLIB=$config_TARGET_RANLIB
-else
- AC_PROG_RANLIB
- TARGET_RANLIB=$RANLIB
-fi
-if test "$config_TARGET_AR" != ""; then
- TARGET_AR=$config_TARGET_AR
-else
- TARGET_AR='ar cr'
-fi
-AC_MSG_RESULT($TARGET_TFLAGS)
-AC_SUBST(TARGET_CC)
-AC_SUBST(TARGET_CFLAGS)
-AC_SUBST(TARGET_LINK)
-AC_SUBST(TARGET_LFLAGS)
-AC_SUBST(TARGET_RANLIB)
-AC_SUBST(TARGET_AR)
-
-# Set the $cross variable if we are cross-compiling. Make
-# it 0 if we are not.
-#
-AC_MSG_CHECKING([if host and target compilers are the same])
-if test "$BUILD_CC" = "$TARGET_CC"; then
- cross=0
- AC_MSG_RESULT(yes)
-else
- cross=1
- AC_MSG_RESULT(no)
-fi
##########
# Do we want to support multithreaded use of sqlite
@@ -401,7 +300,7 @@ if test "$CYGWIN" = "yes"; then
else
BUILD_EXEEXT=$EXEEXT
fi
-if test "$cross" = "0"; then
+if test x"$cross_compiling" = xno; then
TARGET_EXEEXT=$BUILD_EXEEXT
else
TARGET_EXEEXT=$config_TARGET_EXEEXT
@@ -438,15 +337,6 @@ AC_SUBST(OS_OS2)
AC_SUBST(TARGET_EXEEXT)
##########
-# Extract generic linker options from the environment.
-#
-if test "$config_TARGET_LIBS" != ""; then
- TARGET_LIBS=$config_TARGET_LIBS
-else
- TARGET_LIBS=""
-fi
-
-##########
# Figure out all the parameters needed to compile against Tcl.
#
# This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG
@@ -676,11 +574,6 @@ AC_CHECK_FUNC(usleep, [TARGET_CFLAGS="$T
AC_CHECK_FUNC(fdatasync, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_FDATASYNC=1"])
#########
-# Put out accumulated miscellaneous LIBRARIES
-#
-AC_SUBST(TARGET_LIBS)
-
-#########
# Generate the output files.
#
AC_OUTPUT([
Index: Makefile.in
===================================================================
RCS file: /sqlite/sqlite/Makefile.in,v
retrieving revision 1.162
diff -u -p -r1.162 Makefile.in
--- Makefile.in 8 Jan 2007 13:40:36 -0000 1.162
+++ Makefile.in 16 Feb 2007 23:53:21 -0000
@@ -26,7 +26,7 @@ BCC = @BUILD_CC@ @BUILD_CFLAGS@
# will run on the target platform. (BCC and TCC are usually the
# same unless your are cross-compiling.)
#
-TCC = @TARGET_CC@ @TARGET_CFLAGS@ -I. -I${TOP}/src
+TCC = @CC@ @CFLAGS@ -I. -I${TOP}/src
# Define -DNDEBUG to compile without debugging (i.e., for production usage)
# Omitting the define will cause extra debugging code to be inserted and
@@ -63,7 +63,7 @@ [EMAIL PROTECTED]@
TCC += [EMAIL PROTECTED]@
# The fdatasync library
-TLIBS = @TARGET_LIBS@
+TLIBS = @LIBS@
# Flags controlling use of the in memory btree implementation
#
@@ -107,7 +107,7 @@ LIBTOOL = ./libtool
ALLOWRELEASE = @ALLOWRELEASE@
# libtool compile/link/install
-LTCOMPILE = $(LIBTOOL) --mode=compile $(TCC)
+LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC)
LTLINK = $(LIBTOOL) --mode=link $(TCC)
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------

