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.
6 # RCS: @(#) $Id: configure.in,v 1.46 2006/01/23 19:18:55 hobbs Exp $
8 #-----------------------------------------------------------------------
9 # Sample configure.in for Tcl Extensions. The only places you should
10 # need to modify this file are marked by the string __CHANGE__
11 #-----------------------------------------------------------------------
13 #-----------------------------------------------------------------------
15 # Set your package name and version numbers here.
17 # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
18 # set as provided. These will also be added as -D defs in your Makefile
19 # so you can encode the package version directly into the source files.
20 #-----------------------------------------------------------------------
22 AC_INIT([mysqltcl], [3.052])
24 #--------------------------------------------------------------------
25 # Call TEA_INIT as the first TEA_ macro to set up initial vars.
26 # This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
27 # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
28 #--------------------------------------------------------------------
32 AC_CONFIG_AUX_DIR(tclconfig)
34 #--------------------------------------------------------------------
35 # Load the tclConfig.sh file
36 #--------------------------------------------------------------------
41 #--------------------------------------------------------------------
42 # Load the tkConfig.sh file if necessary (Tk extension)
43 #--------------------------------------------------------------------
48 #-----------------------------------------------------------------------
49 # Handle the --prefix=... option by defaulting to what Tcl gave.
50 # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
51 #-----------------------------------------------------------------------
55 #-----------------------------------------------------------------------
56 # Standard compiler checks.
57 # This sets up CC by using the CC env var, or looks for gcc otherwise.
58 # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
59 # the basic setup necessary to compile executables.
60 #-----------------------------------------------------------------------
64 #-----------------------------------------------------------------------
66 # Specify the C source files to compile in TEA_ADD_SOURCES,
67 # public headers that need to be installed in TEA_ADD_HEADERS,
68 # stub library C source files to compile in TEA_ADD_STUB_SOURCES,
69 # and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
70 # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
71 # and PKG_TCL_SOURCES.
72 #-----------------------------------------------------------------------
74 TEA_ADD_SOURCES([mysqltcl.c])
79 TEA_ADD_STUB_SOURCES([])
80 TEA_ADD_TCL_SOURCES([])
82 #--------------------------------------------------------------------
84 # A few miscellaneous platform-specific items:
86 # Define a special symbol for Windows (BUILD_sample in this case) so
87 # that we create the export library with the dll.
89 # Windows creates a few extra files that need to be cleaned up.
90 # You can add more files to clean if your extension creates any extra
93 # TEA_ADD_* any platform specific compiler/build info here.
94 #--------------------------------------------------------------------
96 if test "${TEA_PLATFORM}" = "windows" ; then
97 AC_DEFINE(BUILD_sample, 1, [Build windows export dll])
98 CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch"
99 #TEA_ADD_SOURCES([win/winFile.c])
100 #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
102 CLEANFILES="pkgIndex.tcl"
103 #TEA_ADD_SOURCES([unix/unixFile.c])
104 #TEA_ADD_LIBS([-lsuperfly])
108 #--------------------------------------------------------------------
110 # Choose which headers you need. Extension authors should try very
111 # hard to only rely on the Tcl public header files. Internal headers
112 # contain private data structures and are subject to change without
114 # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
115 #--------------------------------------------------------------------
117 TEA_PUBLIC_TCL_HEADERS
118 #TEA_PRIVATE_TCL_HEADERS
120 #TEA_PUBLIC_TK_HEADERS
121 #TEA_PRIVATE_TK_HEADERS
124 #--------------------------------------------------------------------
125 # Check whether --enable-threads or --disable-threads was given.
126 # This auto-enables if Tcl was compiled threaded.
127 #--------------------------------------------------------------------
131 #--------------------------------------------------------------------
132 # The statement below defines a collection of symbols related to
133 # building as a shared library instead of a static library.
134 #--------------------------------------------------------------------
138 #--------------------------------------------------------------------
139 # This macro figures out what flags to use with the compiler/linker
140 # when building shared/static debug/optimized objects. This information
141 # can be taken from the tclConfig.sh file, but this figures it all out.
142 #--------------------------------------------------------------------
146 #--------------------------------------------------------------------
147 # Set the default compiler switches based on the --enable-symbols option.
148 #--------------------------------------------------------------------
152 #--------------------------------------------------------------------
153 # Everyone should be linking against the Tcl stub library. If you
154 # can't for some reason, remove this definition. If you aren't using
155 # stubs, you also need to modify the SHLIB_LD_LIBS setting below to
156 # link against the non-stubbed Tcl library. Add Tk too if necessary.
157 #--------------------------------------------------------------------
159 AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
160 #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
162 #--------------------------------------------------------------------
163 # This macro generates a line to use when building a library. It
164 # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
165 # and TEA_LOAD_TCLCONFIG macros above.
166 #--------------------------------------------------------------------
171 AC_ARG_WITH(mysql-include,[ --with-mysql-include=DIR Mysql includes are in DIR],
172 MYSQL_INC_DIR=$withval, MYSQL_INC_DIR="/usr/include/mysql")
173 AC_ARG_WITH(mysql-lib,[ --with-mysql-lib=DIR Mysql libraries are in DIR],
174 MYSQL_LIB_DIR=$withval, MYSQL_LIB_DIR="/usr/lib/mysql")
175 MYSQL_INCLUDES="-I$MYSQL_INC_DIR"
178 AC_ARG_ENABLE(mysqlstatic, [ --enable-mysqlstatic link static with libmysqlclient.a], [tcl_ok=$enableval], [tcl_ok=$1])
180 if test "$tcl_ok" = "yes"; then
181 LIBS="${LIBS} ${MYSQL_LIB_DIR}/libmysqlclient.a -lz -lcrypt -lnsl -lm"
183 if test ! -f $MSQL_LIB_DIR/libmysqlclient${SHLIB_SUFFIX} -a -f /usr/lib/libmysqlclient${SHLIB_SUFFIX}; then
184 MYSQL_LIB_DIR=/usr/lib
186 MYSQL_LIBS="-L$MYSQL_LIB_DIR -lmysqlclient"
187 if test ! "$MYSQL_LIB_DIR" = ""; then
188 LIBMYSQL="libmysqclient${SHLIB_SUFFIX}"
194 AC_SUBST(MYSQL_INCLUDES)
196 AC_SUBST(MYSQL_LIB_DIR)
197 AC_MSG_CHECKING([for mysql header])
198 if test ! -f ${MYSQL_INC_DIR}/mysql.h ; then
199 AC_MSG_ERROR(Cannot find mysql.h in $MYSQL_INC_DIR use -with-mysql-include=?)
202 AC_MSG_CHECKING([for libmysqlclient lib])
203 if test "$tcl_ok" = "yes"; then
204 if test ! -f ${MYSQL_LIB_DIR}/libmysqlclient.a ; then
205 AC_MSG_ERROR(Cannot find libmysqlclient.a in $MYSQL_LIB_DIR use --with-mysql-lib=?)
208 if test ! -f ${MYSQL_LIB_DIR}/libmysqlclient${SHLIB_SUFFIX} ; then
209 AC_MSG_ERROR(Cannot find libmysqlclient${SHLIB_SUFFIX} in $MYSQL_LIB_DIR use --with-mysql-lib=?)
214 #--------------------------------------------------------------------
215 # Determine the name of the tclsh and/or wish executables in the
216 # Tcl and Tk build directories or the location they were installed
217 # into. These paths are used to support running test cases only,
218 # the Makefile should not be making use of these paths to generate
219 # a pkgIndex.tcl file or anything else at extension build time.
220 #--------------------------------------------------------------------
225 #--------------------------------------------------------------------
226 # Finally, substitute all of the various values into the Makefile.
227 # You may alternatively have a special pkgIndex.tcl.in or other files
228 # which require substituting th AC variables in. Include these here.
229 #--------------------------------------------------------------------
231 AC_OUTPUT([Makefile pkgIndex.tcl])