configure.in 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. #!/bin/bash -norc
  2. dnl This file is an input file used by the GNU "autoconf" program to
  3. dnl generate the file "configure", which is run during Tcl installation
  4. dnl to configure the system for the local environment.
  5. #
  6. # RCS: @(#) $Id: configure.in,v 1.43 2005/07/26 19:17:05 mdejong Exp $
  7. #-----------------------------------------------------------------------
  8. # Sample configure.in for Tcl Extensions. The only places you should
  9. # need to modify this file are marked by the string __CHANGE__
  10. #-----------------------------------------------------------------------
  11. #-----------------------------------------------------------------------
  12. # __CHANGE__
  13. # Set your package name and version numbers here.
  14. #
  15. # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
  16. # set as provided. These will also be added as -D defs in your Makefile
  17. # so you can encode the package version directly into the source files.
  18. #-----------------------------------------------------------------------
  19. AC_INIT([sqlite], [3.7.4])
  20. #--------------------------------------------------------------------
  21. # Call TEA_INIT as the first TEA_ macro to set up initial vars.
  22. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
  23. # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
  24. #--------------------------------------------------------------------
  25. TEA_INIT([3.9])
  26. AC_CONFIG_AUX_DIR(tclconfig)
  27. #--------------------------------------------------------------------
  28. # Load the tclConfig.sh file
  29. #--------------------------------------------------------------------
  30. TEA_PATH_TCLCONFIG
  31. TEA_LOAD_TCLCONFIG
  32. #--------------------------------------------------------------------
  33. # Load the tkConfig.sh file if necessary (Tk extension)
  34. #--------------------------------------------------------------------
  35. #TEA_PATH_TKCONFIG
  36. #TEA_LOAD_TKCONFIG
  37. #-----------------------------------------------------------------------
  38. # Handle the --prefix=... option by defaulting to what Tcl gave.
  39. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
  40. #-----------------------------------------------------------------------
  41. TEA_PREFIX
  42. #-----------------------------------------------------------------------
  43. # Standard compiler checks.
  44. # This sets up CC by using the CC env var, or looks for gcc otherwise.
  45. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
  46. # the basic setup necessary to compile executables.
  47. #-----------------------------------------------------------------------
  48. TEA_SETUP_COMPILER
  49. #-----------------------------------------------------------------------
  50. # __CHANGE__
  51. # Specify the C source files to compile in TEA_ADD_SOURCES,
  52. # public headers that need to be installed in TEA_ADD_HEADERS,
  53. # stub library C source files to compile in TEA_ADD_STUB_SOURCES,
  54. # and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
  55. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
  56. # and PKG_TCL_SOURCES.
  57. #-----------------------------------------------------------------------
  58. TEA_ADD_SOURCES([tclsqlite3.c])
  59. TEA_ADD_HEADERS([])
  60. TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${srcdir}/generic`\"])
  61. TEA_ADD_LIBS([])
  62. TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS3=1])
  63. TEA_ADD_CFLAGS([-DSQLITE_3_SUFFIX_ONLY=1])
  64. TEA_ADD_CFLAGS([-DSQLITE_ENABLE_RTREE=1])
  65. TEA_ADD_CFLAGS([-DSQLITE_OMIT_DEPRECATED=1])
  66. TEA_ADD_STUB_SOURCES([])
  67. TEA_ADD_TCL_SOURCES([])
  68. #--------------------------------------------------------------------
  69. # The --with-system-sqlite causes the TCL bindings to SQLite to use
  70. # the system shared library for SQLite rather than statically linking
  71. # against its own private copy. This is dangerous and leads to
  72. # undersirable dependences and is not recommended.
  73. # Patchs from rmax.
  74. #--------------------------------------------------------------------
  75. AC_ARG_WITH([system-sqlite],
  76. [AC_HELP_STRING([--with-system-sqlite],
  77. [use a system-supplied libsqlite3 instead of the bundled one])],
  78. [], [with_system_sqlite=no])
  79. if test x$with_system_sqlite != xno; then
  80. AC_CHECK_HEADER([sqlite3.h],
  81. [AC_CHECK_LIB([sqlite3],[sqlite3_initialize],
  82. [AC_DEFINE(USE_SYSTEM_SQLITE)
  83. LIBS="$LIBS -lsqlite3"])])
  84. fi
  85. #--------------------------------------------------------------------
  86. # __CHANGE__
  87. # Choose which headers you need. Extension authors should try very
  88. # hard to only rely on the Tcl public header files. Internal headers
  89. # contain private data structures and are subject to change without
  90. # notice.
  91. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
  92. #--------------------------------------------------------------------
  93. TEA_PUBLIC_TCL_HEADERS
  94. #TEA_PRIVATE_TCL_HEADERS
  95. #TEA_PUBLIC_TK_HEADERS
  96. #TEA_PRIVATE_TK_HEADERS
  97. #TEA_PATH_X
  98. #--------------------------------------------------------------------
  99. # Check whether --enable-threads or --disable-threads was given.
  100. # This auto-enables if Tcl was compiled threaded.
  101. #--------------------------------------------------------------------
  102. TEA_ENABLE_THREADS
  103. if test "${TCL_THREADS}" = "1" ; then
  104. AC_DEFINE(SQLITE_THREADSAFE, 1, [Trigger sqlite threadsafe build])
  105. # Not automatically added by Tcl because its assumed Tcl links to them,
  106. # but it may not if it isn't really a threaded build.
  107. TEA_ADD_LIBS([$THREADS_LIBS])
  108. else
  109. AC_DEFINE(SQLITE_THREADSAFE, 0, [Trigger sqlite non-threadsafe build])
  110. fi
  111. #--------------------------------------------------------------------
  112. # The statement below defines a collection of symbols related to
  113. # building as a shared library instead of a static library.
  114. #--------------------------------------------------------------------
  115. TEA_ENABLE_SHARED
  116. #--------------------------------------------------------------------
  117. # This macro figures out what flags to use with the compiler/linker
  118. # when building shared/static debug/optimized objects. This information
  119. # can be taken from the tclConfig.sh file, but this figures it all out.
  120. #--------------------------------------------------------------------
  121. TEA_CONFIG_CFLAGS
  122. #--------------------------------------------------------------------
  123. # Set the default compiler switches based on the --enable-symbols option.
  124. #--------------------------------------------------------------------
  125. TEA_ENABLE_SYMBOLS
  126. #--------------------------------------------------------------------
  127. # Everyone should be linking against the Tcl stub library. If you
  128. # can't for some reason, remove this definition. If you aren't using
  129. # stubs, you also need to modify the SHLIB_LD_LIBS setting below to
  130. # link against the non-stubbed Tcl library. Add Tk too if necessary.
  131. #--------------------------------------------------------------------
  132. AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
  133. #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
  134. #--------------------------------------------------------------------
  135. # Redefine fdatasync as fsync on systems that lack fdatasync
  136. #--------------------------------------------------------------------
  137. AC_CHECK_FUNC(fdatasync, , AC_DEFINE(fdatasync, fsync))
  138. AC_FUNC_STRERROR_R
  139. #--------------------------------------------------------------------
  140. # This macro generates a line to use when building a library. It
  141. # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
  142. # and TEA_LOAD_TCLCONFIG macros above.
  143. #--------------------------------------------------------------------
  144. TEA_MAKE_LIB
  145. #--------------------------------------------------------------------
  146. # Determine the name of the tclsh and/or wish executables in the
  147. # Tcl and Tk build directories or the location they were installed
  148. # into. These paths are used to support running test cases only,
  149. # the Makefile should not be making use of these paths to generate
  150. # a pkgIndex.tcl file or anything else at extension build time.
  151. #--------------------------------------------------------------------
  152. TEA_PROG_TCLSH
  153. #TEA_PROG_WISH
  154. #--------------------------------------------------------------------
  155. # Finally, substitute all of the various values into the Makefile.
  156. # You may alternatively have a special pkgIndex.tcl.in or other files
  157. # which require substituting th AC variables in. Include these here.
  158. #--------------------------------------------------------------------
  159. AC_OUTPUT([Makefile pkgIndex.tcl])