/ Check-in [9817b433]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:punt custom handling of cross-compile logic and move towards the standard autotool way of things (CVS 3647)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9817b433da36c78513ca278ae28e8ca8ce1cf00b
User & Date: vapier 2007-02-17 14:31:55
Context
2007-02-17
14:46
regenerate (CVS 3648) check-in: 20ac0f36 user: vapier tags: trunk
14:31
punt custom handling of cross-compile logic and move towards the standard autotool way of things (CVS 3647) check-in: 9817b433 user: vapier tags: trunk
14:28
make the readline checks more flexible and handle cross-compiling logic (CVS 3646) check-in: 4626c84b user: vapier tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to configure.ac.

    41     41   #        command-line programs.
    42     42   #
    43     43   #    BUILD_EXEEXT
    44     44   #
    45     45   #        The filename extension for executables on the build
    46     46   #        platform.  "" for Unix and ".exe" for Windows.
    47     47   #
    48         -#    TARGET_CC
    49         -#
    50         -#        The name of a command that runs on the build platform
    51         -#        and converts C source files into *.o files for the
    52         -#        target platform.  In other words, the cross-compiler.
    53         -#
    54         -#    TARGET_CFLAGS
    55         -#
    56         -#        Switches that the target compiler needs to turn C source files
    57         -#        into *.o files.  Do not include TARGET_TCL_INC in this list.
    58         -#        Makefiles might add additional switches such as "-I.".
    59         -#
    60     48   #    TCL_*
    61     49   #
    62     50   #        Lots of values are read in from the tclConfig.sh script,
    63     51   #        if that script is available.  This values are used for
    64     52   #        constructing and installing the TCL extension.
    65     53   #
    66     54   #    TARGET_READLINE_LIBS
................................................................................
    72     60   #
    73     61   #    TARGET_READLINE_INC
    74     62   #
    75     63   #        This variables define the directory that contain header
    76     64   #        files for the readline library.  If the compiler is able 
    77     65   #        to find <readline.h> on its own, then this can be blank.
    78     66   #
    79         -#    TARGET_LINK
    80         -#
    81         -#        The name of the linker that combines *.o files generated
    82         -#        by TARGET_CC into executables for the target platform.
    83         -#
    84         -#    TARGET_LIBS
    85         -#
    86         -#        Additional libraries or other switch that the target linker needs
    87         -#        to build an executable on the target.  Do not include
    88         -#        on this list any libraries in TARGET_TCL_LIBS and
    89         -#        TARGET_READLINE_LIBS, etc.
    90         -#
    91     67   #    TARGET_EXEEXT
    92     68   #
    93     69   #        The filename extension for executables on the
    94     70   #        target platform.  "" for Unix and ".exe" for windows.
    95     71   #
    96     72   # The generated configure script will make an attempt to guess
    97     73   # at all of the above parameters.  You can override any of
................................................................................
   112     88   # the corresponding code.
   113     89   #
   114     90   AC_INIT(src/sqlite.h.in)
   115     91   
   116     92   dnl Put the RCS revision string after AC_INIT so that it will also
   117     93   dnl show in in configure.
   118     94   # The following RCS revision string applies to configure.in
   119         -# $Revision: 1.27 $
           95  +# $Revision: 1.28 $
   120     96   
   121     97   #########
   122     98   # Programs needed
   123     99   #
   124    100   AC_PROG_LIBTOOL
   125    101   AC_PROG_INSTALL
   126    102   AC_PROG_AWK
................................................................................
   180    156     . $hints
   181    157   fi
   182    158   
   183    159   #########
   184    160   # Locate a compiler for the build machine.  This compiler should
   185    161   # generate command-line programs that run on the build machine.
   186    162   #
   187         -default_build_cflags="-g"
   188         -if test "$config_BUILD_CC" = ""; then
   189         -  AC_PROG_CC
   190         -  if test "$cross_compiling" = "yes"; then
   191         -    AC_MSG_ERROR([unable to find a compiler for building build tools])
   192         -  fi
   193         -  BUILD_CC=$CC
   194         -  default_build_cflags=$CFLAGS
          163  +if test x"$cross_compiling" = xno; then
          164  +	BUILD_CC=$CC
          165  +	BUILD_CFLAGS=$CFLAGS
   195    166   else
   196         -  BUILD_CC=$config_BUILD_CC
   197         -  AC_MSG_CHECKING([host compiler])
   198         -  CC=$BUILD_CC
   199         -  AC_MSG_RESULT($BUILD_CC)
   200         -fi
   201         -AC_MSG_CHECKING([switches for the host compiler])
   202         -if test "$config_BUILD_CFLAGS" != ""; then
   203         -  CFLAGS=$config_BUILD_CFLAGS
   204         -  BUILD_CFLAGS=$config_BUILD_CFLAGS
   205         -else
   206         -  BUILD_CFLAGS=$default_build_cflags
   207         -fi
   208         -AC_MSG_RESULT($BUILD_CFLAGS)
   209         -if test "$config_BUILD_LIBS" != ""; then
   210         -  BUILD_LIBS=$config_BUILD_LIBS
          167  +	if test "${BUILD_CC+set}" != set; then
          168  +		AC_CHECK_PROGS(BUILD_CC, gcc cc cl)
          169  +	fi
          170  +	if test "${BUILD_CFLAGS+set}" != set; then
          171  +		BUILD_CFLAGS="-g"
          172  +	fi
   211    173   fi
   212    174   AC_SUBST(BUILD_CC)
   213    175   AC_SUBST(BUILD_CFLAGS)
   214         -AC_SUBST(BUILD_LIBS)
   215         -
   216         -##########
   217         -# Locate a compiler that converts C code into *.o files that run on
   218         -# the target machine.
   219         -#
   220         -AC_MSG_CHECKING([target compiler])
   221         -if test "$config_TARGET_CC" != ""; then
   222         -  TARGET_CC=$config_TARGET_CC
   223         -else
   224         -  TARGET_CC=$BUILD_CC
   225         -fi
   226         -AC_MSG_RESULT($TARGET_CC)
   227         -AC_MSG_CHECKING([switches on the target compiler])
   228         -if test "$config_TARGET_CFLAGS" != ""; then
   229         -  TARGET_CFLAGS=$config_TARGET_CFLAGS
   230         -else
   231         -  TARGET_CFLAGS=$BUILD_CFLAGS
   232         -fi
   233         -AC_MSG_RESULT($TARGET_CFLAGS)
   234         -AC_MSG_CHECKING([target linker])
   235         -if test "$config_TARGET_LINK" = ""; then
   236         -  TARGET_LINK=$TARGET_CC
   237         -else
   238         -  TARGET_LINK=$config_TARGET_LINK
   239         -fi
   240         -AC_MSG_RESULT($TARGET_LINK)
   241         -AC_MSG_CHECKING([switches on the target compiler])
   242         -if test "$config_TARGET_TFLAGS" != ""; then
   243         -  TARGET_TFLAGS=$config_TARGET_TFLAGS
   244         -else
   245         -  TARGET_TFLAGS=$BUILD_CFLAGS
   246         -fi
   247         -if test "$config_TARGET_RANLIB" != ""; then
   248         -  TARGET_RANLIB=$config_TARGET_RANLIB
   249         -else
   250         -  AC_PROG_RANLIB
   251         -  TARGET_RANLIB=$RANLIB
   252         -fi
   253         -if test "$config_TARGET_AR" != ""; then
   254         -  TARGET_AR=$config_TARGET_AR
   255         -else
   256         -  TARGET_AR='ar cr'
   257         -fi
   258         -AC_MSG_RESULT($TARGET_TFLAGS)
   259         -AC_SUBST(TARGET_CC)
   260         -AC_SUBST(TARGET_CFLAGS)
   261         -AC_SUBST(TARGET_LINK)
   262         -AC_SUBST(TARGET_LFLAGS)
   263         -AC_SUBST(TARGET_RANLIB)
   264         -AC_SUBST(TARGET_AR)
   265         -
   266         -# Set the $cross variable if we are cross-compiling.  Make
   267         -# it 0 if we are not.
   268         -#
   269         -AC_MSG_CHECKING([if host and target compilers are the same])
   270         -if test "$BUILD_CC" = "$TARGET_CC"; then
   271         -  cross=0
   272         -  AC_MSG_RESULT(yes)
   273         -else
   274         -  cross=1
   275         -  AC_MSG_RESULT(no)
   276         -fi
   277    176   
   278    177   ##########
   279    178   # Do we want to support multithreaded use of sqlite
   280    179   #
   281    180   AC_ARG_ENABLE(threadsafe, 
   282    181   AC_HELP_STRING([--enable-threadsafe],[Support threadsafe operation]),,enable_threadsafe=no)
   283    182   AC_MSG_CHECKING([whether to support threadsafe operation])
................................................................................
   397    296     AC_CYGWIN
   398    297   fi
   399    298   if test "$CYGWIN" = "yes"; then
   400    299     BUILD_EXEEXT=.exe
   401    300   else
   402    301     BUILD_EXEEXT=$EXEEXT
   403    302   fi
   404         -if test "$cross" = "0"; then
          303  +if test x"$cross_compiling" = xno; then
   405    304     TARGET_EXEEXT=$BUILD_EXEEXT
   406    305   else
   407    306     TARGET_EXEEXT=$config_TARGET_EXEEXT
   408    307   fi
   409    308   if test "$TARGET_EXEEXT" = ".exe"; then
   410    309     if test $OS2_SHELL ; then
   411    310       OS_UNIX=0
................................................................................
   433    332   
   434    333   AC_SUBST(BUILD_EXEEXT)
   435    334   AC_SUBST(OS_UNIX)
   436    335   AC_SUBST(OS_WIN)
   437    336   AC_SUBST(OS_OS2)
   438    337   AC_SUBST(TARGET_EXEEXT)
   439    338   
   440         -##########
   441         -# Extract generic linker options from the environment.
   442         -#
   443         -if test "$config_TARGET_LIBS" != ""; then
   444         -  TARGET_LIBS=$config_TARGET_LIBS
   445         -else
   446         -  TARGET_LIBS=""
   447         -fi
   448         -
   449    339   ##########
   450    340   # Figure out all the parameters needed to compile against Tcl.
   451    341   #
   452    342   # This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG
   453    343   # macros in the in the tcl.m4 file of the standard TCL distribution.
   454    344   # Those macros could not be used directly since we have to make some
   455    345   # minor changes to accomodate systems that do not have TCL installed.
................................................................................
   682    572   
   683    573   #--------------------------------------------------------------------
   684    574   # Redefine fdatasync as fsync on systems that lack fdatasync
   685    575   #--------------------------------------------------------------------
   686    576   
   687    577   AC_CHECK_FUNC(fdatasync, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_FDATASYNC=1"])
   688    578   
   689         -#########
   690         -# Put out accumulated miscellaneous LIBRARIES
   691         -#
   692         -AC_SUBST(TARGET_LIBS)
   693         -
   694    579   #########
   695    580   # Generate the output files.
   696    581   #
   697    582   AC_OUTPUT([
   698    583   Makefile
   699    584   sqlite3.pc
   700    585   ])