/ Check-in [f69ed286]
Login

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

Overview
Comment:Rework the autoconf script to better deal with utime() and dlopen().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f69ed286ffb3f62f5cb5c1f7df55fa4d2468b472
User & Date: drh 2011-06-20 18:00:17
Context
2011-06-20
18:27
Fix compiler warnings in lemon by removing some of the code added by Ryan Gordon in [1e8b842039cc0]. check-in: 76b18b2b user: drh tags: trunk
18:00
Rework the autoconf script to better deal with utime() and dlopen(). check-in: f69ed286 user: drh tags: trunk
17:41
Update a couple test scripts to account for more floating point display variation in Windows-based versions of TCL. check-in: a4a8402b user: shaneh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to config.h.in.

    70     70   #undef HAVE_UINTPTR_T
    71     71   
    72     72   /* Define to 1 if you have the <unistd.h> header file. */
    73     73   #undef HAVE_UNISTD_H
    74     74   
    75     75   /* Define to 1 if you have the `usleep' function. */
    76     76   #undef HAVE_USLEEP
           77  +
           78  +/* Define to 1 if you have the utime() library function. */
           79  +#undef HAVE_UTIME
    77     80   
    78     81   /* Define to the sub-directory in which libtool stores uninstalled libraries.
    79     82      */
    80     83   #undef LT_OBJDIR
    81     84   
    82     85   /* Define to the address where bug reports for this package should be sent. */
    83     86   #undef PACKAGE_BUGREPORT

Changes to configure.

 12141  12141   # Figure out whether or not we have these functions
 12142  12142   #
 12143  12143   
 12144  12144   
 12145  12145   
 12146  12146   
 12147  12147   
 12148         -for ac_func in usleep fdatasync localtime_r gmtime_r localtime_s
        12148  +
        12149  +for ac_func in usleep fdatasync localtime_r gmtime_r localtime_s utime
 12149  12150   do
 12150  12151   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 12151  12152   { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
 12152  12153   $as_echo_n "checking for $ac_func... " >&6; }
 12153  12154   if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
 12154  12155     $as_echo_n "(cached) " >&6
 12155  12156   else
................................................................................
 13436  13437     enableval=$enable_load_extension; use_loadextension=$enableval
 13437  13438   else
 13438  13439     use_loadextension=no
 13439  13440   fi
 13440  13441   
 13441  13442   if test "${use_loadextension}" = "yes" ; then
 13442  13443     OPT_FEATURE_FLAGS=""
        13444  +  { $as_echo "$as_me:$LINENO: checking for library containing dlopen" >&5
        13445  +$as_echo_n "checking for library containing dlopen... " >&6; }
        13446  +if test "${ac_cv_search_dlopen+set}" = set; then
        13447  +  $as_echo_n "(cached) " >&6
        13448  +else
        13449  +  ac_func_search_save_LIBS=$LIBS
        13450  +cat >conftest.$ac_ext <<_ACEOF
        13451  +/* confdefs.h.  */
        13452  +_ACEOF
        13453  +cat confdefs.h >>conftest.$ac_ext
        13454  +cat >>conftest.$ac_ext <<_ACEOF
        13455  +/* end confdefs.h.  */
        13456  +
        13457  +/* Override any GCC internal prototype to avoid an error.
        13458  +   Use char because int might match the return type of a GCC
        13459  +   builtin and then its argument prototype would still apply.  */
        13460  +#ifdef __cplusplus
        13461  +extern "C"
        13462  +#endif
        13463  +char dlopen ();
        13464  +int
        13465  +main ()
        13466  +{
        13467  +return dlopen ();
        13468  +  ;
        13469  +  return 0;
        13470  +}
        13471  +_ACEOF
        13472  +for ac_lib in '' dl; do
        13473  +  if test -z "$ac_lib"; then
        13474  +    ac_res="none required"
        13475  +  else
        13476  +    ac_res=-l$ac_lib
        13477  +    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
        13478  +  fi
        13479  +  rm -f conftest.$ac_objext conftest$ac_exeext
        13480  +if { (ac_try="$ac_link"
        13481  +case "(($ac_try" in
        13482  +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
        13483  +  *) ac_try_echo=$ac_try;;
        13484  +esac
        13485  +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
        13486  +$as_echo "$ac_try_echo") >&5
        13487  +  (eval "$ac_link") 2>conftest.er1
        13488  +  ac_status=$?
        13489  +  grep -v '^ *+' conftest.er1 >conftest.err
        13490  +  rm -f conftest.er1
        13491  +  cat conftest.err >&5
        13492  +  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
        13493  +  (exit $ac_status); } && {
        13494  +	 test -z "$ac_c_werror_flag" ||
        13495  +	 test ! -s conftest.err
        13496  +       } && test -s conftest$ac_exeext && {
        13497  +	 test "$cross_compiling" = yes ||
        13498  +	 $as_test_x conftest$ac_exeext
        13499  +       }; then
        13500  +  ac_cv_search_dlopen=$ac_res
        13501  +else
        13502  +  $as_echo "$as_me: failed program was:" >&5
        13503  +sed 's/^/| /' conftest.$ac_ext >&5
        13504  +
        13505  +
        13506  +fi
        13507  +
        13508  +rm -rf conftest.dSYM
        13509  +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
        13510  +      conftest$ac_exeext
        13511  +  if test "${ac_cv_search_dlopen+set}" = set; then
        13512  +  break
        13513  +fi
        13514  +done
        13515  +if test "${ac_cv_search_dlopen+set}" = set; then
        13516  +  :
        13517  +else
        13518  +  ac_cv_search_dlopen=no
        13519  +fi
        13520  +rm conftest.$ac_ext
        13521  +LIBS=$ac_func_search_save_LIBS
        13522  +fi
        13523  +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_dlopen" >&5
        13524  +$as_echo "$ac_cv_search_dlopen" >&6; }
        13525  +ac_res=$ac_cv_search_dlopen
        13526  +if test "$ac_res" != no; then
        13527  +  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
        13528  +
        13529  +fi
        13530  +
 13443  13531   else
 13444  13532     OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
 13445  13533   fi
 13446  13534   
 13447  13535   #########
 13448  13536   # attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) parameter
 13449  13537   for option in $CFLAGS $CPPFLAGS

Changes to configure.ac.

   123    123   #########
   124    124   # Check for needed/wanted headers
   125    125   AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h])
   126    126   
   127    127   #########
   128    128   # Figure out whether or not we have these functions
   129    129   #
   130         -AC_CHECK_FUNCS([usleep fdatasync localtime_r gmtime_r localtime_s])
          130  +AC_CHECK_FUNCS([usleep fdatasync localtime_r gmtime_r localtime_s utime])
   131    131   
   132    132   #########
   133    133   # By default, we use the amalgamation (this may be changed below...)
   134    134   #
   135    135   USE_AMALGAMATION=1
   136    136   
   137    137   #########
................................................................................
   615    615   #########
   616    616   # See whether we should allow loadable extensions
   617    617   AC_ARG_ENABLE(load-extension, AC_HELP_STRING([--enable-load-extension],
   618    618         [Enable loading of external extensions]),
   619    619         [use_loadextension=$enableval],[use_loadextension=no])
   620    620   if test "${use_loadextension}" = "yes" ; then
   621    621     OPT_FEATURE_FLAGS=""
          622  +  AC_SEARCH_LIBS(dlopen, dl)
   622    623   else
   623    624     OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
   624    625   fi
   625    626   
   626    627   #########
   627    628   # attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) parameter
   628    629   for option in $CFLAGS $CPPFLAGS

Changes to src/os_unix.c.

   134    134   # endif
   135    135   #endif /* SQLITE_ENABLE_LOCKING_STYLE */
   136    136   
   137    137   #if defined(__APPLE__) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
   138    138   # include <sys/mount.h>
   139    139   #endif
   140    140   
          141  +#ifdef HAVE_UTIME
          142  +# include <utime.h>
          143  +#endif
          144  +
   141    145   /*
   142    146   ** Allowed values of unixFile.fsFlags
   143    147   */
   144    148   #define SQLITE_FSFLAGS_IS_MSDOS     0x1
   145    149   
   146    150   /*
   147    151   ** If we are to be thread-safe, include the pthreads header and define
................................................................................
  1935   1939   
  1936   1940   
  1937   1941     /* If we have any lock, then the lock file already exists.  All we have
  1938   1942     ** to do is adjust our internal record of the lock level.
  1939   1943     */
  1940   1944     if( pFile->eFileLock > NO_LOCK ){
  1941   1945       pFile->eFileLock = eFileLock;
  1942         -#if !OS_VXWORKS
  1943   1946       /* Always update the timestamp on the old file */
         1947  +#ifdef HAVE_UTIME
         1948  +    utime(zLockFile, NULL);
         1949  +#else
  1944   1950       utimes(zLockFile, NULL);
  1945   1951   #endif
  1946   1952       return SQLITE_OK;
  1947   1953     }
  1948   1954     
  1949   1955     /* grab an exclusive lock */
  1950   1956     fd = robust_open(zLockFile,O_RDONLY|O_CREAT|O_EXCL,0600);