Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -43,22 +43,10 @@ # BUILD_EXEEXT # # 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, # if that script is available. This values are used for # constructing and installing the TCL extension. @@ -74,22 +62,10 @@ # # This variables define the directory that contain header # files for the readline library. If the compiler is able # to find 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 # target platform. "" for Unix and ".exe" for windows. # @@ -114,11 +90,11 @@ AC_INIT(src/sqlite.h.in) dnl Put the RCS revision string after AC_INIT so that it will also dnl show in in configure. # The following RCS revision string applies to configure.in -# $Revision: 1.27 $ +# $Revision: 1.28 $ ######### # Programs needed # AC_PROG_LIBTOOL @@ -182,100 +158,23 @@ ######### # 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 # AC_ARG_ENABLE(threadsafe, @@ -399,11 +298,11 @@ if test "$CYGWIN" = "yes"; then BUILD_EXEEXT=.exe 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 fi if test "$TARGET_EXEEXT" = ".exe"; then @@ -435,19 +334,10 @@ AC_SUBST(OS_UNIX) AC_SUBST(OS_WIN) 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 # macros in the in the tcl.m4 file of the standard TCL distribution. @@ -684,17 +574,12 @@ # Redefine fdatasync as fsync on systems that lack fdatasync #-------------------------------------------------------------------- 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([ Makefile sqlite3.pc ])