dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 1 | |
| 2 | #----------------------------------------------------------------------- |
| 3 | # Supports the following non-standard switches. |
| 4 | # |
| 5 | # --enable-threadsafe |
| 6 | # --enable-readline |
| 7 | # --enable-dynamic-extensions |
| 8 | # |
| 9 | |
| 10 | AC_PREREQ(2.61) |
| 11 | AC_INIT(sqlite, 3.7.5, http://www.sqlite.org) |
| 12 | AC_CONFIG_SRCDIR([sqlite3.c]) |
| 13 | |
| 14 | # Use automake. |
| 15 | AM_INIT_AUTOMAKE([foreign]) |
| 16 | |
| 17 | AC_SYS_LARGEFILE |
| 18 | |
| 19 | # Check for required programs. |
| 20 | AC_PROG_CC |
| 21 | AC_PROG_RANLIB |
| 22 | AC_PROG_LIBTOOL |
| 23 | AC_PROG_MKDIR_P |
| 24 | |
| 25 | # Check for library functions that SQLite can optionally use. |
| 26 | AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r]) |
| 27 | AC_FUNC_STRERROR_R |
| 28 | |
| 29 | AC_CONFIG_FILES([Makefile sqlite3.pc]) |
| 30 | AC_SUBST(BUILD_CFLAGS) |
| 31 | |
| 32 | #----------------------------------------------------------------------- |
| 33 | # --enable-readline |
| 34 | # |
| 35 | AC_ARG_ENABLE(readline, [AS_HELP_STRING( |
| 36 | [--enable-readline], |
| 37 | [use readline in shell tool (yes, no) [default=yes]])], |
| 38 | [], [enable_readline=yes]) |
| 39 | if test x"$enable_readline" != xno ; then |
| 40 | sLIBS=$LIBS |
| 41 | LIBS="" |
| 42 | AC_SEARCH_LIBS(tgetent, curses ncurses ncursesw, [], []) |
| 43 | AC_SEARCH_LIBS(readline, readline, [], [enable_readline=no]) |
| 44 | AC_CHECK_FUNCS(readline, [], []) |
| 45 | READLINE_LIBS=$LIBS |
| 46 | LIBS=$sLIBS |
| 47 | fi |
| 48 | AC_SUBST(READLINE_LIBS) |
| 49 | #----------------------------------------------------------------------- |
| 50 | |
| 51 | #----------------------------------------------------------------------- |
| 52 | # --enable-threadsafe |
| 53 | # |
| 54 | AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( |
| 55 | [--enable-threadsafe], [build a thread-safe library [default=yes]])], |
| 56 | [], [enable_threadsafe=yes]) |
| 57 | THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0 |
| 58 | if test x"$enable_threadsafe" != "xno"; then |
| 59 | THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1" |
| 60 | AC_SEARCH_LIBS(pthread_create, pthread) |
| 61 | fi |
| 62 | AC_SUBST(THREADSAFE_FLAGS) |
| 63 | #----------------------------------------------------------------------- |
| 64 | |
| 65 | #----------------------------------------------------------------------- |
| 66 | # --enable-dynamic-extensions |
| 67 | # |
| 68 | AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING( |
| 69 | [--enable-dynamic-extensions], [support loadable extensions [default=yes]])], |
| 70 | [], [enable_dynamic_extensions=yes]) |
| 71 | if test x"$enable_dynamic_extensions" != "xno"; then |
| 72 | AC_SEARCH_LIBS(dlopen, dl) |
| 73 | else |
| 74 | DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 |
| 75 | fi |
| 76 | AC_MSG_CHECKING([for whether to support dynamic extensions]) |
| 77 | AC_MSG_RESULT($enable_dynamic_extensions) |
| 78 | AC_SUBST(DYNAMIC_EXTENSION_FLAGS) |
| 79 | #----------------------------------------------------------------------- |
| 80 | |
| 81 | AC_CHECK_FUNCS(posix_fallocate) |
| 82 | |
| 83 | #----------------------------------------------------------------------- |
| 84 | # UPDATE: Maybe it's better if users just set CFLAGS before invoking |
| 85 | # configure. This option doesn't really add much... |
| 86 | # |
| 87 | # --enable-tempstore |
| 88 | # |
| 89 | # AC_ARG_ENABLE(tempstore, [AS_HELP_STRING( |
| 90 | # [--enable-tempstore], |
| 91 | # [in-memory temporary tables (never, no, yes, always) [default=no]])], |
| 92 | # [], [enable_tempstore=no]) |
| 93 | # AC_MSG_CHECKING([for whether or not to store temp tables in-memory]) |
| 94 | # case "$enable_tempstore" in |
| 95 | # never ) TEMP_STORE=0 ;; |
| 96 | # no ) TEMP_STORE=1 ;; |
| 97 | # always ) TEMP_STORE=3 ;; |
| 98 | # yes ) TEMP_STORE=3 ;; |
| 99 | # * ) |
| 100 | # TEMP_STORE=1 |
| 101 | # enable_tempstore=yes |
| 102 | # ;; |
| 103 | # esac |
| 104 | # AC_MSG_RESULT($enable_tempstore) |
| 105 | # AC_SUBST(TEMP_STORE) |
| 106 | #----------------------------------------------------------------------- |
| 107 | |
| 108 | AC_OUTPUT |