# # # patch "m4/sqlite.m4" # from [6ee5373ed7c982b10ef8918bbda9da38c5ed4ad1] # to [bcd8e50df9bfa103226129f5ee0f517826809bae] # ============================================================ --- m4/sqlite.m4 6ee5373ed7c982b10ef8918bbda9da38c5ed4ad1 +++ m4/sqlite.m4 bcd8e50df9bfa103226129f5ee0f517826809bae @@ -1,12 +1,21 @@ -# checks only done because the bundled sqlite needs them. +dnl checks only done because the bundled sqlite needs them. AC_DEFUN([MTN_SQLITE_DEPENDENCIES], -[AC_SEARCH_LIBS([fdatasync], [rt], AC_DEFINE(HAVE_FDATASYNC)) -AH_TEMPLATE([HAVE_FDATASYNC], [For SQLite; use fdatasync if available]) -AC_SEARCH_LIBS([usleep], [rt], AC_DEFINE(HAVE_USLEEP)) -AH_TEMPLATE([HAVE_USLEEP], [For SQLite; use usleep if available]) +[SQLITE_CPPFLAGS= -# Now let the user specify whether he wants large file support or not in -# sqlite. +# sqlite does not read our config.h so we have to shove all this on the +# command line. + +AC_SEARCH_LIBS([fdatasync], [rt], + [SQLITE_CPPFLAGS="$SQLITE_CPPFLAGS -DHAVE_FDATASYNC=1"]) + +AC_SEARCH_LIBS([usleep], [rt], + [SQLITE_CPPFLAGS="$SQLITE_CPPFLAGS -DHAVE_USLEEP=1"]) + +AC_CHECK_FUNC([pread], + [AC_CHECK_FUNC([pwrite], + [SQLITE_CPPFLAGS="$SQLITE_CPPFLAGS -DUSE_PREAD=1"])]) + +# Let the user specify whether he wants large file support or not in sqlite. AC_ARG_ENABLE([large-file], AS_HELP_STRING( [--disable-large-file], @@ -17,5 +26,6 @@ fi if test "x$enable_large_file" = "xno"; then SQLITE_CPPFLAGS="$SQLITE_CPPFLAGS -DSQLITE_DISABLE_LFS" fi + AC_SUBST(SQLITE_CPPFLAGS) ])