/ Artifact Content
Login

Artifact 5f6cf281ae675685335ce7f43f8c2d59d3ac8ba4174a57b8e83097c5e10dcf4e:


     1  
     2  #-----------------------------------------------------------------------
     3  # Supports the following non-standard switches.
     4  #
     5  #   --enable-threadsafe
     6  #   --enable-readline
     7  #   --enable-editline
     8  #   --enable-static-shell
     9  #   --enable-dynamic-extensions
    10  #
    11  
    12  AC_PREREQ(2.61)
    13  AC_INIT(sqlite, --SQLITE-VERSION--, http://www.sqlite.org)
    14  AC_CONFIG_SRCDIR([sqlite3.c])
    15  AC_CONFIG_AUX_DIR([.])
    16  
    17  # Use automake.
    18  AM_INIT_AUTOMAKE([foreign])
    19  
    20  AC_SYS_LARGEFILE
    21  
    22  # Check for required programs.
    23  AC_PROG_CC
    24  AC_PROG_LIBTOOL
    25  AC_PROG_MKDIR_P
    26  
    27  # Check for library functions that SQLite can optionally use.
    28  AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r])
    29  AC_FUNC_STRERROR_R
    30  
    31  AC_CONFIG_FILES([Makefile sqlite3.pc])
    32  AC_SUBST(BUILD_CFLAGS)
    33  
    34  #-------------------------------------------------------------------------
    35  # Two options to enable readline compatible libraries: 
    36  #
    37  #   --enable-editline
    38  #   --enable-readline
    39  #
    40  # Both are enabled by default. If, after command line processing both are
    41  # still enabled, the script searches for editline first and automatically
    42  # disables readline if it is found. So, to use readline explicitly, the
    43  # user must pass "--disable-editline". To disable command line editing
    44  # support altogether, "--disable-editline --disable-readline".
    45  #
    46  # When searching for either library, check for headers before libraries 
    47  # as some distros supply packages that contain libraries but not header
    48  # files, which come as a separate development package.
    49  #
    50  AC_ARG_ENABLE(editline, [AS_HELP_STRING([--enable-editline],[use BSD libedit])])
    51  AC_ARG_ENABLE(readline, [AS_HELP_STRING([--enable-readline],[use readline])])
    52  
    53  AS_IF([ test x"$enable_editline" != xno ],[
    54    AC_CHECK_HEADERS([editline/readline.h],[
    55      sLIBS=$LIBS
    56      LIBS=""
    57      AC_SEARCH_LIBS([readline],[edit],[
    58        AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline)
    59        READLINE_LIBS="$LIBS -ltinfo"
    60        enable_readline=no
    61      ],[],[-ltinfo])
    62      AS_UNSET(ac_cv_search_readline)
    63      LIBS=$sLIBS
    64    ])
    65  ])
    66  
    67  AS_IF([ test x"$enable_readline" != xno ],[
    68    AC_CHECK_HEADERS([readline/readline.h],[
    69      sLIBS=$LIBS
    70      LIBS=""
    71      AC_SEARCH_LIBS(tgetent, termcap curses ncurses ncursesw, [], [])
    72      AC_SEARCH_LIBS(readline,[readline edit], [
    73        AC_DEFINE([HAVE_READLINE],1,Define to use readline or wrapper)
    74        READLINE_LIBS=$LIBS
    75      ])
    76      LIBS=$sLIBS
    77    ])
    78  ])
    79  
    80  AC_SUBST(READLINE_LIBS)
    81  #-----------------------------------------------------------------------
    82  
    83  #-----------------------------------------------------------------------
    84  #   --enable-threadsafe
    85  #
    86  AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING(
    87    [--enable-threadsafe], [build a thread-safe library [default=yes]])], 
    88    [], [enable_threadsafe=yes])
    89  THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0
    90  if test x"$enable_threadsafe" != "xno"; then
    91    THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
    92    AC_SEARCH_LIBS(pthread_create, pthread)
    93    AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
    94  fi
    95  AC_SUBST(THREADSAFE_FLAGS)
    96  #-----------------------------------------------------------------------
    97  
    98  #-----------------------------------------------------------------------
    99  #   --enable-dynamic-extensions
   100  #
   101  AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING(
   102    [--enable-dynamic-extensions], [support loadable extensions [default=yes]])], 
   103    [], [enable_dynamic_extensions=yes])
   104  if test x"$enable_dynamic_extensions" != "xno"; then
   105    AC_SEARCH_LIBS(dlopen, dl)
   106  else
   107    DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1
   108  fi
   109  AC_MSG_CHECKING([for whether to support dynamic extensions])
   110  AC_MSG_RESULT($enable_dynamic_extensions)
   111  AC_SUBST(DYNAMIC_EXTENSION_FLAGS)
   112  #-----------------------------------------------------------------------
   113  
   114  #-----------------------------------------------------------------------
   115  #   --enable-fts5
   116  #
   117  AC_ARG_ENABLE(fts5, [AS_HELP_STRING(
   118    [--enable-fts5], [include fts5 support [default=yes]])], 
   119    [], [enable_fts5=yes])
   120  if test x"$enable_fts5" = "xyes"; then
121 AC_SEARCH_LIBS(log, m)
122 FTS5_FLAGS=-DSQLITE_ENABLE_FTS5 123 fi 124 AC_SUBST(FTS5_FLAGS) 125 #----------------------------------------------------------------------- 126 127 #----------------------------------------------------------------------- 128 # --enable-json1 129 # 130 AC_ARG_ENABLE(json1, [AS_HELP_STRING( 131 [--enable-json1], [include json1 support [default=yes]])], 132 [], [enable_json1=yes]) 133 if test x"$enable_json1" = "xyes"; then 134 JSON1_FLAGS=-DSQLITE_ENABLE_JSON1 135 fi 136 AC_SUBST(JSON1_FLAGS) 137 #----------------------------------------------------------------------- 138 139 #----------------------------------------------------------------------- 140 # --enable-session 141 # 142 AC_ARG_ENABLE(session, [AS_HELP_STRING( 143 [--enable-session], [enable the session extension [default=no]])], 144 [], [enable_session=no]) 145 if test x"$enable_session" = "xyes"; then 146 SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" 147 fi 148 AC_SUBST(SESSION_FLAGS) 149 #----------------------------------------------------------------------- 150 151 #----------------------------------------------------------------------- 152 # --enable-debug 153 # 154 AC_ARG_ENABLE(debug, [AS_HELP_STRING( 155 [--enable-debug], [build with debugging features enabled [default=no]])], 156 [], [enable_session=no]) 157 if test x"$enable_debug" = "xyes"; then 158 DEBUG_FLAGS="-DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" 159 fi 160 AC_SUBST(DEBUG_FLAGS) 161 #----------------------------------------------------------------------- 162 163 #----------------------------------------------------------------------- 164 # --enable-static-shell 165 # 166 AC_ARG_ENABLE(static-shell, [AS_HELP_STRING( 167 [--enable-static-shell], 168 [statically link libsqlite3 into shell tool [default=yes]])], 169 [], [enable_static_shell=yes]) 170 if test x"$enable_static_shell" = "xyes"; then 171 EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT 172 else 173 EXTRA_SHELL_OBJ=libsqlite3.la 174 fi 175 AC_SUBST(EXTRA_SHELL_OBJ) 176 #----------------------------------------------------------------------- 177 178 AC_CHECK_FUNCS(posix_fallocate) 179 AC_CHECK_HEADERS(zlib.h,[ 180 AC_SEARCH_LIBS(deflate,z,[ZLIB_FLAGS="-DSQLITE_HAVE_ZLIB"]) 181 ]) 182 AC_SUBST(ZLIB_FLAGS) 183 184 AC_SEARCH_LIBS(system,,,[SHELL_CFLAGS="-DSQLITE_NOHAVE_SYSTEM"]) 185 AC_SUBST(SHELL_CFLAGS) 186 187 #----------------------------------------------------------------------- 188 # UPDATE: Maybe it's better if users just set CFLAGS before invoking 189 # configure. This option doesn't really add much... 190 # 191 # --enable-tempstore 192 # 193 # AC_ARG_ENABLE(tempstore, [AS_HELP_STRING( 194 # [--enable-tempstore], 195 # [in-memory temporary tables (never, no, yes, always) [default=no]])], 196 # [], [enable_tempstore=no]) 197 # AC_MSG_CHECKING([for whether or not to store temp tables in-memory]) 198 # case "$enable_tempstore" in 199 # never ) TEMP_STORE=0 ;; 200 # no ) TEMP_STORE=1 ;; 201 # always ) TEMP_STORE=3 ;; 202 # yes ) TEMP_STORE=3 ;; 203 # * ) 204 # TEMP_STORE=1 205 # enable_tempstore=yes 206 # ;; 207 # esac 208 # AC_MSG_RESULT($enable_tempstore) 209 # AC_SUBST(TEMP_STORE) 210 #----------------------------------------------------------------------- 211 212 AC_OUTPUT